| | |
| | | values.put("comment", "技术状态鉴定执行结束"); |
| | | request.setComment("技术状态鉴定执行结束"); |
| | | //设置entity |
| | | if (parallelCompletion) { |
| | | if (CommonConstant.STATUS_1.equals(entity.getSafetyCheckCompleted()) |
| | | && CommonConstant.STATUS_1.equals(entity.getPrecisionCheckCompleted()) |
| | | && CommonConstant.STATUS_1.equals(entity.getOtherCheckCompleted()) |
| | | && parallelCompletion) { |
| | | //多个任务都已完成且维修室主任都已审批通过,会签完成,进行维修工签字 |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0002); |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | |
| | | } |
| | | if ("safety_equipment_check".equals(flowMyBusiness.getTaskNameId())) { |
| | | //执行安全检查 |
| | | if (CommonConstant.STATUS_1.equals(entity.getSafetyCheckCompleted())) { |
| | | values.put("safetyEquipmentCheckFlag", request.getSafetyCheckConfirmResult()); |
| | | entity.setSafetyCheckConfirmResult(request.getSafetyCheckConfirmResult()); |
| | | entity.setSafetyCheckConfirm(user.getUsername()); |
| | | entity.setSafetyCheckConfirmTime(new Date()); |
| | | entity.setSafetyCheckConfirmComment(request.getSafetyCheckConfirmComment()); |
| | | //维修室主任审批 |
| | | if (!CommonConstant.STATUS_1.equals(request.getSafetyCheckConfirmResult())) { |
| | | //驳回 给监察人 |
| | | userApprovalList = Collections.singletonList(request.getTableDetailList().get(0).getRepairmanSignature()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setSafetyCheckCompleted(CommonConstant.STATUS_0); |
| | | } |
| | | } else { |
| | | //安全装置检查结果填报 |
| | | List<EamTechnicalStatusEvaluationOrderDetail> collect = request.getTableDetailList().stream().filter(item -> TechnicalStatusEvaluationCheckCategoryEnum.SAFETY_EQUIPMENT_CHECK.name().equals(item.getCheckCategory())).collect(Collectors.toList()); |
| | | if(CollectionUtil.isEmpty(collect)) { |
| | | throw new JeecgBootException("安全装置检查项明细为空!"); |
| | | } |
| | | //结果项检查 |
| | | checkDetailResult(request.getTableDetailList(), TechnicalStatusEvaluationCheckCategoryEnum.SAFETY_EQUIPMENT_CHECK); |
| | | //添加操作人信息 |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : collect) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(collect); |
| | | //安全装置检查结果填报 |
| | | List<EamTechnicalStatusEvaluationOrderDetail> collect = request.getTableDetailList().stream().filter(item -> TechnicalStatusEvaluationCheckCategoryEnum.SAFETY_EQUIPMENT_CHECK.name().equals(item.getCheckCategory())).collect(Collectors.toList()); |
| | | if (CollectionUtil.isEmpty(collect)) { |
| | | throw new JeecgBootException("安全装置检查项明细为空!"); |
| | | } |
| | | //结果项检查 |
| | | checkDetailResult(request.getTableDetailList(), TechnicalStatusEvaluationCheckCategoryEnum.SAFETY_EQUIPMENT_CHECK); |
| | | //添加操作人信息 |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : collect) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(collect); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setSafetyCheckCompleted(CommonConstant.STATUS_1); |
| | | } else if ("safety_equipment_check_confirm".equals(flowMyBusiness.getTaskNameId()) && CommonConstant.STATUS_1.equals(entity.getSafetyCheckCompleted())) { |
| | | values.put("safetyEquipmentCheckFlag", request.getSafetyCheckConfirmResult()); |
| | | entity.setSafetyCheckConfirmResult(request.getSafetyCheckConfirmResult()); |
| | | entity.setSafetyCheckConfirm(user.getUsername()); |
| | | entity.setSafetyCheckConfirmTime(new Date()); |
| | | entity.setSafetyCheckConfirmComment(request.getSafetyCheckConfirmComment()); |
| | | //维修室主任审批 |
| | | if (!CommonConstant.STATUS_1.equals(request.getSafetyCheckConfirmResult())) { |
| | | //驳回 给监察人 |
| | | userApprovalList = Collections.singletonList(request.getTableDetailList().get(0).getRepairmanSignature()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setSafetyCheckCompleted(CommonConstant.STATUS_1); |
| | | entity.setSafetyCheckCompleted(CommonConstant.STATUS_0); |
| | | } |
| | | } else if ("equipment_precision_check".equals(flowMyBusiness.getTaskNameId())) { |
| | | //处理精度检验 |
| | | if (CommonConstant.STATUS_1.equals(entity.getPrecisionCheckCompleted())) { |
| | | values.put("precisionCheckFlag", request.getPrecisionCheckConfirmResult()); |
| | | entity.setPrecisionCheckConfirmResult(request.getPrecisionCheckConfirmResult()); |
| | | entity.setPrecisionCheckConfirm(user.getUsername()); |
| | | entity.setPrecisionCheckConfirmTime(new Date()); |
| | | entity.setPrecisionCheckConfirmComment(request.getPrecisionCheckConfirmComment()); |
| | | //维修室主任审批 |
| | | if (!CommonConstant.STATUS_1.equals(request.getPrecisionCheckConfirmResult())) { |
| | | //驳回 给监察人 |
| | | userApprovalList = Collections.singletonList(request.getTableDetailList().get(0).getRepairmanSignature()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setPrecisionCheckCompleted(CommonConstant.STATUS_0); |
| | | } |
| | | } else { |
| | | //设备精度检查结果填报 |
| | | List<EamTechnicalStatusEvaluationOrderDetail> collect = request.getTableDetailList().stream().filter(item -> TechnicalStatusEvaluationCheckCategoryEnum.PRECISION_CHECK.name().equals(item.getCheckCategory())).collect(Collectors.toList()); |
| | | if(CollectionUtil.isEmpty(collect)) { |
| | | throw new JeecgBootException("设备精度检查项明细为空!"); |
| | | } |
| | | //结果项检查 |
| | | checkDetailResult(request.getTableDetailList(), TechnicalStatusEvaluationCheckCategoryEnum.PRECISION_CHECK); |
| | | //添加操作人信息 |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : collect) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(collect); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setPrecisionCheckCompleted(CommonConstant.STATUS_1); |
| | | //设备精度检查结果填报 |
| | | List<EamTechnicalStatusEvaluationOrderDetail> collect = request.getTableDetailList().stream().filter(item -> TechnicalStatusEvaluationCheckCategoryEnum.PRECISION_CHECK.name().equals(item.getCheckCategory())).collect(Collectors.toList()); |
| | | if (CollectionUtil.isEmpty(collect)) { |
| | | throw new JeecgBootException("设备精度检查项明细为空!"); |
| | | } |
| | | |
| | | //结果项检查 |
| | | checkDetailResult(request.getTableDetailList(), TechnicalStatusEvaluationCheckCategoryEnum.PRECISION_CHECK); |
| | | //添加操作人信息 |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : collect) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(collect); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setPrecisionCheckCompleted(CommonConstant.STATUS_1); |
| | | } else if ("equipment_precision_check_confirm".equals(flowMyBusiness.getTaskNameId()) && CommonConstant.STATUS_1.equals(entity.getPrecisionCheckCompleted())) { |
| | | values.put("precisionCheckFlag", request.getPrecisionCheckConfirmResult()); |
| | | entity.setPrecisionCheckConfirmResult(request.getPrecisionCheckConfirmResult()); |
| | | entity.setPrecisionCheckConfirm(user.getUsername()); |
| | | entity.setPrecisionCheckConfirmTime(new Date()); |
| | | entity.setPrecisionCheckConfirmComment(request.getPrecisionCheckConfirmComment()); |
| | | //维修室主任审批 |
| | | if (!CommonConstant.STATUS_1.equals(request.getPrecisionCheckConfirmResult())) { |
| | | //驳回 给监察人 |
| | | userApprovalList = Collections.singletonList(request.getTableDetailList().get(0).getRepairmanSignature()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setPrecisionCheckCompleted(CommonConstant.STATUS_0); |
| | | } |
| | | } else if ("other_check".equals(flowMyBusiness.getTaskNameId())) { |
| | | //处理其他检查 |
| | | if (CommonConstant.STATUS_1.equals(entity.getOtherCheckCompleted())) { |
| | | values.put("otherCheckFlag", request.getOtherCheckResult()); |
| | | entity.setOtherCheckResult(request.getOtherCheckConfirmResult()); |
| | | entity.setOtherCheckConfirm(user.getUsername()); |
| | | entity.setOtherCheckConfirmTime(new Date()); |
| | | entity.setOtherCheckConfirmComment(request.getOtherCheckConfirmComment()); |
| | | //维修室主任审批 |
| | | if (!CommonConstant.STATUS_1.equals(request.getOtherCheckConfirmResult())) { |
| | | //驳回 给监察人 |
| | | userApprovalList = Collections.singletonList(request.getTableDetailList().get(0).getRepairmanSignature()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setOtherCheckCompleted(CommonConstant.STATUS_0); |
| | | } |
| | | } else { |
| | | //其他检查结果填报 |
| | | List<EamTechnicalStatusEvaluationOrderDetail> collect = request.getTableDetailList().stream().filter(item -> TechnicalStatusEvaluationCheckCategoryEnum.OTHER_CHECK.name().equals(item.getCheckCategory())).collect(Collectors.toList()); |
| | | if(CollectionUtil.isEmpty(collect)) { |
| | | throw new JeecgBootException("其他检查项明细为空!"); |
| | | } |
| | | //结果项检查 |
| | | checkDetailResult(request.getTableDetailList(), TechnicalStatusEvaluationCheckCategoryEnum.OTHER_CHECK); |
| | | //添加操作人信息 |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : collect) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(collect); |
| | | //其他检查结果填报 |
| | | List<EamTechnicalStatusEvaluationOrderDetail> collect = request.getTableDetailList().stream().filter(item -> TechnicalStatusEvaluationCheckCategoryEnum.OTHER_CHECK.name().equals(item.getCheckCategory())).collect(Collectors.toList()); |
| | | if (CollectionUtil.isEmpty(collect)) { |
| | | throw new JeecgBootException("其他检查项明细为空!"); |
| | | } |
| | | //结果项检查 |
| | | checkDetailResult(request.getTableDetailList(), TechnicalStatusEvaluationCheckCategoryEnum.OTHER_CHECK); |
| | | //添加操作人信息 |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : collect) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(collect); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setOtherCheckCompleted(CommonConstant.STATUS_1); |
| | | } else if ("other_check_confirm".equals(flowMyBusiness.getTaskNameId()) && CommonConstant.STATUS_1.equals(entity.getOtherCheckCompleted())) { |
| | | values.put("otherCheckFlag", request.getOtherCheckConfirmResult()); |
| | | entity.setOtherCheckResult(request.getOtherCheckConfirmResult()); |
| | | entity.setOtherCheckConfirm(user.getUsername()); |
| | | entity.setOtherCheckConfirmTime(new Date()); |
| | | entity.setOtherCheckConfirmComment(request.getOtherCheckConfirmComment()); |
| | | //维修室主任审批 |
| | | if (!CommonConstant.STATUS_1.equals(request.getOtherCheckConfirmResult())) { |
| | | //驳回 给监察人 |
| | | userApprovalList = Collections.singletonList(request.getTableDetailList().get(0).getRepairmanSignature()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setOtherCheckCompleted(CommonConstant.STATUS_1); |
| | | entity.setOtherCheckCompleted(CommonConstant.STATUS_0); |
| | | } |
| | | } |
| | | break; |
| | |
| | | switch (checkCategory) { |
| | | case SAFETY_EQUIPMENT_CHECK: |
| | | b = detailList.stream().allMatch(item -> StringUtils.isNotBlank(item.getSafetyEquipmentCheckResult())); |
| | | if(!b) { |
| | | if (!b) { |
| | | throw new JeecgBootException("有安全装置检查结果未填写!"); |
| | | } |
| | | break; |
| | | case PRECISION_CHECK: |
| | | b = detailList.stream().allMatch(item -> item.getPrecisionCheckResult() != null); |
| | | if(!b) { |
| | | if (!b) { |
| | | throw new JeecgBootException("有设备精度检查结果未填写!"); |
| | | } |
| | | break; |
| | | case OTHER_CHECK: |
| | | b = detailList.stream().allMatch(item -> StringUtils.isNotBlank(item.getOtherCheckResult())); |
| | | if(!b) { |
| | | if (!b) { |
| | | throw new JeecgBootException("有其他检查结果未填写!"); |
| | | } |
| | | break; |