From 7d5d6d104b0ad994b62b53683d752b4fec61b8c1 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 15 七月 2025 21:13:29 +0800
Subject: [PATCH] art: 技术状态鉴定工单-字段转译

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java |  185 +++++++++++++++++++++++-----------------------
 1 files changed, 93 insertions(+), 92 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
index f3cf21d..3a7c6ba 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java
@@ -331,6 +331,9 @@
         List<UserSelector> userSelectors;
         switch (status) {
             case UNDER_EVALUATION:
+                if(CollectionUtil.isEmpty(request.getTableDetailList())) {
+                    throw new JeecgBootException("妫�鏌ユ槑缁嗕俊鎭负绌猴紒");
+                }
                 boolean parallelCompletion = flowTaskService.checkParallelCompletion(flowMyBusiness.getTaskId());
                 //鎵ц瀹屾垚
                 userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0008);
@@ -343,7 +346,10 @@
                 values.put("comment", "鎶�鏈姸鎬侀壌瀹氭墽琛岀粨鏉�");
                 request.setComment("鎶�鏈姸鎬侀壌瀹氭墽琛岀粨鏉�");
                 //璁剧疆entity
-                if (parallelCompletion) {
+                if (CommonConstant.STATUS_1.equals(entity.getSafetyCheckCompleted())
+                        && CommonConstant.STATUS_1.equals(entity.getPrecisionCheckCompleted())
+                        && CommonConstant.STATUS_1.equals(entity.getOtherCheckCompleted())
+                        && parallelCompletion) {
                     //澶氫釜浠诲姟閮藉凡瀹屾垚涓旂淮淇涓讳换閮藉凡瀹℃壒閫氳繃,浼氱瀹屾垚锛岃繘琛岀淮淇伐绛惧瓧
                     userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0002);
                     userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
@@ -353,100 +359,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.setOtherCheckConfirmResult(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;
@@ -486,6 +485,7 @@
                 entity.setRepairManagerSignature(user.getUsername());
                 entity.setRepairManagerSignatureTime(new Date());
                 entity.setRepairManagerComment(request.getRepairManagerComment());
+                entity.setRepairManagerSignatureResult(request.getRepairManagerSignatureResult());
                 //璁剧疆entity
                 if (BusinessCodeConst.APPROVED.equals(request.getRepairManagerSignatureResult())) {
                     values.put("NextAssignee", userApprovalList);
@@ -532,14 +532,15 @@
                 entity.setDepartTechnicalLeaderSignature(user.getUsername());
                 entity.setDepartTechnicalLeaderSignatureTime(new Date());
                 entity.setDepartTechnicalLeaderComment(request.getDepartTechnicalLeaderComment());
+                entity.setDepartTechnicalLeaderSignatureResult(request.getDepartTechnicalLeaderSignatureResult());
                 //璁剧疆entity
                 if (BusinessCodeConst.APPROVED.equals(request.getDepartTechnicalLeaderSignatureResult())) {
                     values.put("NextAssignee", userApprovalList);
-                    entity.setEvaluationStatus(TechnicalStatusEvaluationOrderStatusEnum.PROCESS_TECHNICIAN_SIGNING.name());
+                    entity.setEvaluationStatus(TechnicalStatusEvaluationOrderStatusEnum.INSPECTOR_SIGNING.name());
                 } else {
                     userApprovalList = Collections.singletonList(entity.getProcessTechnicianSignature());
                     values.put("NextAssignee", userApprovalList);
-                    entity.setEvaluationStatus(TechnicalStatusEvaluationOrderStatusEnum.INSPECTOR_SIGNING.name());
+                    entity.setEvaluationStatus(TechnicalStatusEvaluationOrderStatusEnum.PROCESS_TECHNICIAN_SIGNING.name());
                 }
                 break;
             case INSPECTOR_SIGNING:
@@ -586,19 +587,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;

--
Gitblit v1.9.3