| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | 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.setOtherCheckCompleted(CommonConstant.STATUS_1); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateEvaluationStatus(String orderId, String evaluationStatus) { |
| | | UpdateWrapper<EamTechnicalStatusEvaluationOrder> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.eq("order_id", orderId); |
| | | updateWrapper.set("evaluation_status", evaluationStatus); |
| | | updateWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0); |
| | | updateWrapper.eq("evaluation_status", TechnicalStatusEvaluationOrderStatusEnum.WAIT_EVALUATION.name()); |
| | | int update = this.getBaseMapper().update(null, updateWrapper); |
| | | return update > 0; |
| | | } |
| | | |
| | | 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();//接下来审批的节点 |
| | | business.getValues();//前端传进来的参数 |