zhangherong
8 天以前 cb404c4bfcb239fa7cf69b0937541f304db5c356
art: 技术状态鉴定工单-流程问题修改
已修改1个文件
171 ■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java 171 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
@@ -353,100 +353,93 @@
                }
                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;
@@ -586,19 +579,19 @@
        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;