From d073e531919d945344ae37b2df0737f245e345d3 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期五, 11 七月 2025 11:39:04 +0800
Subject: [PATCH] art: 工单信息转译

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamTechnicalStatusEvaluationOrderServiceImpl.java |   46 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 35 insertions(+), 11 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 43adcef..7125c4e 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
@@ -11,6 +11,7 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.flowable.engine.TaskService;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.constant.DataBaseConstant;
 import org.jeecg.common.exception.JeecgBootException;
@@ -221,6 +222,10 @@
         if (!TechnicalStatusEvaluationOrderStatusEnum.WAIT_EVALUATION.name().equals(entity.getEvaluationStatus())) {
             throw new JeecgBootException("璇ュ伐鍗曞凡杩涜杩囬鍙栵紒");
         }
+        EamTechnicalStatusEvaluationStandard standard = standardService.getById(entity.getStandardId());
+        if(standard == null) {
+            throw new JeecgBootException("璁惧淇濆吇鏍囧噯涓嶅瓨鍦紝璇锋鏌ワ紒");
+        }
         EamEquipment equipment = equipmentService.getById(entity.getEquipmentId());
         if (equipment == null) {
             throw new JeecgBootException("璁惧涓嶅瓨鍦紝娣诲姞澶辫触锛�");
@@ -231,9 +236,9 @@
         }
         List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0002);
         if (CollectionUtil.isEmpty(userSelectors)) {
-            throw new JeecgBootException("璁惧鏈垎閰嶇粰杞﹂棿鐝粍闀匡紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�");
+            throw new JeecgBootException("璁惧鏈垎閰嶇粰缁翠慨宸ワ紝鏃犳硶棰嗗彇锛�");
         }
-
+        List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
         entity.setEvaluator(sysUser.getUsername());
         entity.setEvaluationStatus(TechnicalStatusEvaluationOrderStatusEnum.UNDER_EVALUATION.name());
         entity.setActualStartTime(new Date());
@@ -252,15 +257,34 @@
             variables.put("comment", entity.getRemark());
         }
         variables.put("proofreading", true);
-        List<String> usernames = new ArrayList<>();
-        usernames.add(entity.getEquipmentCode());
-        variables.put("NextAssignee", usernames);
-//        Result result = flowDefinitionService.startProcessInstanceByKey("second_maintenance_process", variables);
-//        if (result != null) {
-//            //鏇存柊璁惧淇濆吇鐘舵��
-//            eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_SECOND_MAINTENANCE.name());
-//            return result.isSuccess();
-//        }
+        if(CommonConstant.STATUS_1.equals(standard.getHasSafetyEquipmentCheck())) {
+            variables.put("hasSafetyEquipmentCheck", CommonConstant.STATUS_1);
+            variables.put("safety_equipment_check", userApprovalList);
+            entity.setSafetyCheckCompleted(CommonConstant.STATUS_0);
+        } else {
+            variables.put("hasSafetyEquipmentCheck", CommonConstant.STATUS_0);
+            variables.put("safety_equipment_check", userApprovalList);
+        }
+        if(CommonConstant.STATUS_1.equals(standard.getHasPrecisionCheck())) {
+            variables.put("hasPrecisionCheck", CommonConstant.STATUS_1);
+            variables.put("equipment_precision_check", userApprovalList);
+            entity.setPrecisionCheckCompleted(CommonConstant.STATUS_0);
+        } else {
+            variables.put("hasPrecisionCheck", CommonConstant.STATUS_0);
+            variables.put("equipment_precision_check", userApprovalList);
+        }
+        if(CommonConstant.STATUS_1.equals(standard.getHasOtherCheck())) {
+            variables.put("hasOtherCheck", CommonConstant.STATUS_1);
+            variables.put("other_check", userApprovalList);
+            entity.setOtherCheckCompleted(CommonConstant.STATUS_0);
+        } else {
+            variables.put("hasOtherCheck ", CommonConstant.STATUS_0);
+            variables.put("other_check", userApprovalList);
+        }
+        Result<?> result = flowDefinitionService.startProcessInstanceByKey("technical_status_evaluation_process", variables);
+        if(result == null || !result.isSuccess()) {
+            throw new JeecgBootException("鍚姩娴佺▼澶辫触锛岄鍙栧け璐�");
+        }
         return true;
     }
 

--
Gitblit v1.9.3