| | |
| | | if (standard == null) { |
| | | throw new JeecgBootException("技术状态鉴定规范不存在,添加失败!"); |
| | | } |
| | | if (!TechnicalStatusEvaluationStandardEnum.ENABLE.name().equals(standard.getStandardStatus())) { |
| | | if (!TechnicalStatusEvaluationStandardStatusEnum.ENABLE.name().equals(standard.getStandardStatus())) { |
| | | throw new JeecgBootException("技术状态鉴定规范未启用,添加失败!"); |
| | | } |
| | | List<EamTechnicalStatusEvaluationStandardDetail> standardDetailList = standardDetailService.queryList(standard.getId()); |
| | |
| | | } |
| | | } else { |
| | | //安全装置检查结果填报 |
| | | if (CollectionUtil.isNotEmpty(request.getTableDetailList())) { |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : request.getTableDetailList()) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(request.getTableDetailList()); |
| | | 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 (CollectionUtil.isNotEmpty(request.getTableDetailList())) { |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : request.getTableDetailList()) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(request.getTableDetailList()); |
| | | 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 (CollectionUtil.isNotEmpty(request.getTableDetailList())) { |
| | | for (EamTechnicalStatusEvaluationOrderDetail detail : request.getTableDetailList()) { |
| | | detail.setRepairmanSignature(user.getUsername()); |
| | | detail.setRepairmanSignatureTime(new Date()); |
| | | } |
| | | orderDetailService.updateBatchById(request.getTableDetailList()); |
| | | 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.setPrecisionCheckCompleted(CommonConstant.STATUS_1); |
| | | values.put("NextAssignee", userApprovalList); |
| | | entity.setOtherCheckCompleted(CommonConstant.STATUS_1); |
| | | } |
| | |
| | | return entity; |
| | | } |
| | | |
| | | private void checkDetailResult(List<EamTechnicalStatusEvaluationOrderDetail> detailList, TechnicalStatusEvaluationCheckCategoryEnum checkCategory) { |
| | | boolean b; |
| | | switch (checkCategory) { |
| | | case SAFETY_EQUIPMENT_CHECK: |
| | | b = detailList.stream().allMatch(item -> StringUtils.isNotBlank(item.getSafetyEquipmentCheckResult())); |
| | | if(!b) { |
| | | throw new JeecgBootException("有安全装置检查结果未填写!"); |
| | | } |
| | | break; |
| | | case PRECISION_CHECK: |
| | | b = detailList.stream().allMatch(item -> item.getPrecisionCheckResult() != null); |
| | | if(!b) { |
| | | throw new JeecgBootException("有设备精度检查结果未填写!"); |
| | | } |
| | | break; |
| | | case OTHER_CHECK: |
| | | b = detailList.stream().allMatch(item -> StringUtils.isNotBlank(item.getOtherCheckResult())); |
| | | if(!b) { |
| | | throw new JeecgBootException("有其他检查结果未填写!"); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | business.getTaskNameId();//接下来审批的节点 |