增加检测第一步与最后一步需要上传图片

This commit is contained in:
许允枞 2024-11-07 18:03:42 +08:00
parent b2682976d5
commit b6c5d5515b
5 changed files with 65 additions and 12 deletions

View File

@ -154,4 +154,15 @@ public class InspectionInfoController extends BaseController {
public CommonResult getWeorkNodesById(Integer inspectionId) {
return success(inspectionInfoService.getWeorkNodesById(inspectionId));
}
/**
* 判断是否需要上传图片
* @param inspectionId
* @param workNodeId
* @return
*/
@GetMapping("orImages")
public CommonResult orImages(Integer inspectionId, String workNodeId){
return success(inspectionWorkNodeService.orImages(inspectionId,workNodeId));
}
}

View File

@ -33,4 +33,6 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
* @return
*/
List<InspectionWorkNode> getWeorkNodesById(Integer inspectionId);
boolean orImages(Integer inspectionId, String workNodeId);
}

View File

@ -117,6 +117,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
private PermissionService permissionService;
@Autowired
private RoleService roleService;
@Autowired
private IInspectionWorkNodeService inspectionWorkNodeService;
@Override
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
@ -1479,6 +1481,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.setGoodsImage(goods.getImage());
LambdaQueryWrapper<InspectionStepInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(InspectionStepInfo::getInspectionInfoId,inspectionInfoId).orderByAsc(InspectionStepInfo::getStepNum);
queryWrapper.orderBy(true, false, InspectionStepInfo::getId);
List<InspectionStepInfo> list = stepInfoService.list(queryWrapper);
if (CollectionUtil.isNotEmpty(list)){
res.setStepInfos(list);
@ -1731,7 +1734,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
AdminUserDO buyUser = userService.getUser(inspectionInfo.getUserId());
PartnerWorker worker = partnerWorkerService.getById(inspectionInfo.getWorkId());
ShopMallPartners partner = this.getById(orderInfo.getPartnerId());
AdminUserDO workerUser = userService.getUser(worker.getUserId());
AdminUserDO workerUser = userService.getUser(inspectionInfo.getWorkId());
String inspection_work_order = configService.selectConfigByKey("inspection_work_order");
String payType = "未知";
if (StringUtils.isNotEmpty(orderInfo.getPayType())){

View File

@ -239,7 +239,6 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
stepInfo.setTitle("检测开始");
stepInfo.setContent("检测开始");
stepInfo.setCreateTime(new Date());
stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
boolean save = inspectionStepInfoService.save(stepInfo);

View File

@ -45,6 +45,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
/**
* 员工接单
*
* @param inspectionId
* @param workNodeId
*/
@ -90,8 +91,11 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测");
inspectionStepInfo.setContent(project.getProjectName() + "项目开始检测");
if (ObjectUtil.isNotNull(project)) {
inspectionStepInfo.setTitle(project.getProjectName() + "项目开始检测");
}else {
inspectionStepInfo.setTitle("项目检测开始");
}
inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(workerUser.getId())));
inspectionStepService.save(inspectionStepInfo);
@ -141,9 +145,18 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
//根据projectId查询项目名称
DlInspectionProject project = inspectionProjectService.getOne(new LambdaQueryWrapper<DlInspectionProject>()
.eq(DlInspectionProject::getId, workNode.getProjectId()));
String stepTitle = project.getProjectName() + "项目检测完成";
inspectionStepInfo.setTitle(stepTitle);
inspectionStepInfo.setContent(stepTitle);
String stepTitle = "";
if(ObjectUtil.isNotNull(project)) {
inspectionStepInfo.setTitle(project.getProjectName() + "项目检测完成");
}else {
inspectionStepInfo.setTitle("项目检测完成");
}
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) {
inspectionStepInfo.setContent(inspectionWorkNode.getRemark());
}
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) {
inspectionStepInfo.setImages(inspectionWorkNode.getDealImages());
}
inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
inspectionStepService.save(inspectionStepInfo);
@ -162,7 +175,6 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
inspectionStepInfo = new InspectionStepInfo();
inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(workNode.getInspectionInfoId())));
inspectionStepInfo.setTitle(stepTitle);
inspectionStepInfo.setContent(stepTitle);
inspectionStepInfo.setCreateTime(DateUtil.date());
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
inspectionStepService.save(inspectionStepInfo);
@ -190,6 +202,21 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
return baseMapper.getWeorkNodesById(inspectionId);
}
@Override
public boolean orImages(Integer inspectionId, String workNodeId) {
/*获取当前节点*/
InspectionWorkNode workNode = getById(workNodeId);
if (workNode.getOrderNum() == 1) {
return true;
}
/*获取所有流程*/
List<InspectionWorkNode> workNodes = getWeorkNodesById(inspectionId);
if (!hasNextNode(workNodes, workNode)) {
return true;
}
return false;
}
/**
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
*
@ -211,9 +238,10 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
/**
* 退办理
*
* @param inspectionWorkNode
*/
public void returnInspectionInfo(InspectionWorkNode inspectionWorkNode){
public void returnInspectionInfo(InspectionWorkNode inspectionWorkNode) {
// 获取当前登录人
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//通过工单id获取工单
@ -227,7 +255,12 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
stepInfo.setTitle("退办理");
stepInfo.setContent("退办理");
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) {
stepInfo.setContent(inspectionWorkNode.getRemark());
}
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) {
stepInfo.setImages(inspectionWorkNode.getDealImages());
}
stepInfo.setCreateTime(DateUtil.date());
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
inspectionStepService.save(stepInfo);
@ -235,7 +268,6 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
stepInfo.setTitle("检测结束");
stepInfo.setContent("检测结束");
stepInfo.setCreateTime(DateUtil.date());
stepInfo.setCreator(Integer.parseInt(loginUser.getId().toString()));
inspectionStepService.save(stepInfo);
@ -248,6 +280,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
/**
* 重审
*
* @param inspectionWorkNode
*/
public void retrial(InspectionWorkNode inspectionWorkNode) {
@ -272,7 +305,12 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
InspectionStepInfo stepInfo = new InspectionStepInfo();
stepInfo.setInspectionInfoId(Integer.parseInt(inspectionWorkNode.getInspectionInfoId().toString()));
stepInfo.setTitle("重审");
stepInfo.setContent("重审");
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getRemark())) {
stepInfo.setContent(inspectionWorkNode.getRemark());
}
if (ObjectUtil.isNotEmpty(inspectionWorkNode.getDealImages())) {
stepInfo.setImages(inspectionWorkNode.getDealImages());
}
inspectionStepService.save(stepInfo);
}
}