zhangherong
2025-07-12 06d7422f44d0c3103dd00e360e9a4362817b3e59
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
@@ -8,6 +8,7 @@
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import liquibase.pro.packaged.E;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.flowable.engine.TaskService;
@@ -367,13 +368,18 @@
                        }
                    } else {
                        //安全装置检查结果填报
                        if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
                            for (EamTechnicalStatusEvaluationOrderDetail detail : 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(request.getTableDetailList());
                        }
                        orderDetailService.updateBatchById(collect);
                        values.put("NextAssignee", userApprovalList);
                        entity.setSafetyCheckCompleted(CommonConstant.STATUS_1);
                    }
@@ -394,13 +400,18 @@
                        }
                    } else {
                        //设备精度检查结果填报
                        if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
                            for (EamTechnicalStatusEvaluationOrderDetail detail : 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(request.getTableDetailList());
                        }
                        orderDetailService.updateBatchById(collect);
                        values.put("NextAssignee", userApprovalList);
                        entity.setPrecisionCheckCompleted(CommonConstant.STATUS_1);
                    }
@@ -422,13 +433,20 @@
                        }
                    } else {
                        //其他检查结果填报
                        if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
                            for (EamTechnicalStatusEvaluationOrderDetail detail : 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(request.getTableDetailList());
                        }
                        orderDetailService.updateBatchById(collect);
                        values.put("NextAssignee", userApprovalList);
                        entity.setPrecisionCheckCompleted(CommonConstant.STATUS_1);
                        values.put("NextAssignee", userApprovalList);
                        entity.setOtherCheckCompleted(CommonConstant.STATUS_1);
                    }
@@ -553,6 +571,30 @@
        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();//接下来审批的节点