| | |
| | | @Autowired |
| | | private IEamEquipmentService eamEquipmentService; |
| | | @Autowired |
| | | private IEamReportRepairService eamReportRepairService; |
| | | @Autowired |
| | | private IEamEquipmentExtendService eamEquipmentExtendService; |
| | | @Autowired |
| | | private IEamBaseHFCodeService hfCodeService; |
| | |
| | | throw new JeecgBootException("设备未存在检查人,无法进入下级审批!"); |
| | | }else{ |
| | | userApprovalList= userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | values.put("dataId", entity.getId()); |
| | | if (StrUtil.isEmpty(request.getDealDescription())){ |
| | | request.setDealDescription(""); |
| | | if (StrUtil.isEmpty(request.getManageUserResult())){ |
| | | request.setManageUserResult(""); |
| | | } |
| | | values.put("organization",request.getDealDescription()); |
| | | values.put("comment", request.getDealDescription()); |
| | | values.put("comment", request.getManageUserResult()); |
| | | values.put("manageUserResult",request.getManageUserResult()); |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.WAIT_INSPECTOR_CONFIRM.name()); |
| | | entity.setManageUser(user.getUsername()); |
| | | entity.setProblemDescription(request.getProblemDescription()); |
| | | entity.setManageUserResult(request.getManageUserResult()); |
| | | entity.setDealDescription(request.getDealDescription()); |
| | | entity.setConfirmTime(new Date()); |
| | | request.setComment(request.getDealDescription()); |
| | | if (request.getManageUserResult().equals("2")){ |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.REJECTED.name()); |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.UNDER_MAINTENANCE.name()); |
| | | }else { |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.WAIT_INSPECTOR_CONFIRM.name()); |
| | | entity.setConfirmTime(new Date()); |
| | | entity.setManageUser(user.getUsername()); |
| | | entity.setProblemDescription(request.getProblemDescription()); |
| | | entity.setManageUserResult(request.getManageUserResult()); |
| | | entity.setDealDescription(request.getDealDescription()); |
| | | } |
| | | } |
| | | break; |
| | | case WAIT_INSPECTOR_CONFIRM: |
| | | //检查人确认 |
| | | if (StrUtil.isEmpty(request.getDealDescription())){ |
| | | request.setDealDescription(""); |
| | | if (StrUtil.isEmpty(request.getInspectConfirmComment())){ |
| | | request.setInspectConfirmComment(""); |
| | | } |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization",request.getInspectConfirmComment()); |
| | | values.put("comment", request.getInspectConfirmComment()); |
| | | values.put("inspectorResult",request.getInspectorResult()); |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.COMPLETE.name()); |
| | | entity.setInspector(user.getUsername()); |
| | | entity.setInspectorResult(request.getInspectorResult()); |
| | | entity.setInspectConfirmComment(request.getInspectConfirmComment()); |
| | | entity.setInspectConfirmTime(new Date()); |
| | | request.setComment(request.getDealDescription()); |
| | | request.setComment(request.getInspectConfirmComment()); |
| | | if (request.getInspectorResult().equals("2")){ |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.REJECTED.name()); |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.WAIT_ADMIN_CONFIRM.name()); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("设备未存在管理员,无法进入下级审批!"); |
| | | }else{ |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | } |
| | | }else { |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.COMPLETE.name()); |
| | | entity.setInspector(user.getUsername()); |
| | | entity.setInspectorResult(request.getInspectorResult()); |
| | | entity.setInspectConfirmComment(request.getInspectConfirmComment()); |
| | | entity.setInspectConfirmTime(new Date()); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | if (!result.isSuccess()) { |
| | | throw new JeecgBootException("审批失败,请刷新查看!"); |
| | | } |
| | | if (user.getPost().equals(BusinessCodeConst.PCR0004)&&request.getManageUserResult().equals("2")){ |
| | | //管理员拒绝,会签节点修改对应关系 |
| | | List<FlowMyBusiness> list = flowMyBusinessService.list(new LambdaQueryWrapper<FlowMyBusiness>().eq(FlowMyBusiness::getProcessInstanceId, request.getInstanceId())); |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | list.forEach(item -> { |
| | | if (item.getTaskNameId().equals("maintenance_task")) { |
| | | //获取维修工岗位用户 |
| | | List<UserSelector> userSelectorList = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0002); |
| | | if (!CollectionUtils.isEmpty(userSelectorList)) { |
| | | List<String> usernameList = userSelectorList.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | item.setTodoUsers(JSON.toJSONString(usernameList)); |
| | | } |
| | | } |
| | | if (item.getTaskNameId().equals("operator_task")) { |
| | | //获取操作人岗位用户 |
| | | List<UserSelector> userSelectorList = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0001); |
| | | if (!CollectionUtils.isEmpty(userSelectorList)) { |
| | | List<String> usernameList = userSelectorList.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | item.setTodoUsers(JSON.toJSONString(usernameList)); |
| | | } |
| | | } |
| | | }); |
| | | flowMyBusinessService.updateBatchById(list); |
| | | } |
| | | } |
| | | //保存工单 |
| | | eamSecondMaintenanceOrderMapper.updateById(entity); |
| | | return entity; |