zhangherong
2025-07-12 06d7422f44d0c3103dd00e360e9a4362817b3e59
art: 技术状态鉴定工单-审批接口优化
已修改3个文件
85 ■■■■ 文件已修改
db/ZHR/dict_zhr.sql 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
db/ZHR/dict_zhr.sql
@@ -10,11 +10,11 @@
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282588527325186', N'1943282255763828737', N'维修室主任签字中', N'REPAIR_MANAGER_SIGNING', '', 4, 1, N'admin', '2025-07-10 20:14:08.2040000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282688888631297', N'1943282255763828737', N'工艺员签字中', N'PROCESS_TECHNICIAN_SIGNING', '', 5, 1, N'admin', '2025-07-10 20:14:32.1330000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282764902002689', N'1943282255763828737', N'使用单位技术主管签字中', N'DEPART_TECHNICAL_LEADER_SIGNING', '', 6, 1, N'admin', '2025-07-10 20:14:50.2570000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282836200976386', N'1943282255763828737', N'INSPECTOR_SIGNING', N'设备检验员签字中', '', 7, 1, N'admin', '2025-07-10 20:15:07.2550000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282836200976386', N'1943282255763828737', N'设备检验员签字中', N'INSPECTOR_SIGNING', '', 7, 1, N'admin', '2025-07-10 20:15:07.2550000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282897358123009', N'1943282255763828737', N'已完成', N'COMPLETED', '', 8, 1, N'admin', '2025-07-10 20:15:21.8360000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943282982930313218', N'1943282255763828737', N'已锁定', N'LOCKED', '', 9, 1, N'admin', '2025-07-10 20:15:42.2430000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943283076018696194', N'1943282255763828737', N'变更中', N'CHANGING', '', 10, 1, N'admin', '2025-07-10 20:16:04.4340000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943283135447789569', N'1943282255763828737', N'EXPIRED', N'已过期', '', 11, 1, N'admin', '2025-07-10 20:16:18.6020000', NULL, NULL);
INSERT INTO [dbo].[sys_dict_item] ([id], [dict_id], [item_text], [item_value], [description], [sort_order], [status], [create_by], [create_time], [update_by], [update_time]) VALUES (N'1943283135447789569', N'1943282255763828737', N'已过期', N'EXPIRED', '', 11, 1, N'admin', '2025-07-10 20:16:18.6020000', NULL, NULL);
--技术状态检查项分类
delete from [dbo].[sys_dict_item] where dict_id in (select id from [dbo].[sys_dict] where dict_code='technical_status_evaluation_check_category');
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamTechnicalStatusEvaluationOrderController.java
@@ -101,6 +101,9 @@
        if (request == null) {
            return Result.error("审批的对象不能为空!");
        }
        if(CollectionUtil.isEmpty(request.getTableDetailList())) {
            return Result.error("检查明细信息为空!");
        }
        // 检查请求参数
        if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) {
            return Result.error("审批任务错误或不存在!");
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()) {
                                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);
                    }
@@ -394,13 +400,18 @@
                        }
                    } 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);
                    }
@@ -422,13 +433,20 @@
                        }
                    } 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);
                    }
@@ -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();//接下来审批的节点