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/EamSecondMaintenanceOrderServiceImpl.java |   59 +++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 49 insertions(+), 10 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
index 75ab1fa..e59f21d 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
@@ -259,13 +259,16 @@
                 throw new JeecgBootException("涓嶆槸鎿嶄綔宸ワ紝鏃犳硶棰嗗彇姝ゅ伐鍗曪紒");
             }
         }
+        List<String> usernames = new ArrayList<>();
         if (sysUser != null) {
-            entity.setOperator(sysUser.getUsername());
-        }
-        if (BusinessCodeConst.PCR0001.equals(sysUser.getPost())) {
-            entity.setOperator(sysUser.getUsername());
-        }else if (BusinessCodeConst.PCR0002.equals(sysUser.getPost())) {
-            entity.setRepairman(sysUser.getUsername());
+            if (BusinessCodeConst.PCR0001.equals(sysUser.getPost())) {
+                entity.setOperator(sysUser.getUsername());
+                usernames.add(entity.getOperator());
+            }
+            if (BusinessCodeConst.PCR0002.equals(sysUser.getPost())) {
+                entity.setRepairman(sysUser.getUsername());
+                usernames.add(entity.getRepairman());
+            }
         }
         entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.UNDER_MAINTENANCE.name());
         entity.setActualStartTime(new Date());
@@ -283,8 +286,6 @@
             variables.put("comment", entity.getRemark());
         }
         variables.put("proofreading", true);
-        List<String> usernames = new ArrayList<>();
-        usernames.add(entity.getOperator());
         if (sysUser != null) {
             if (BusinessCodeConst.PCR0001.equals(sysUser.getPost())) {
                 variables.put("operator_task", usernames);
@@ -371,14 +372,48 @@
                 }
                 if (BusinessCodeConst.PCR0001.equals(user.getPost())) {
                     entity.setOperator(user.getUsername());
+                    values.put("organization", "浜屼繚鎿嶄綔宸ユ墽琛岀粨鏉�");
+                    values.put("comment", "浜屼繚鎿嶄綔宸ユ墽琛岀粨鏉�");
                     //澶勭悊瀵瑰簲璇︽儏
+                    if (CollectionUtils.isNotEmpty(request.getOperatorDetailList())){
+                        //鍒犻櫎鍘熸湁鏁版嵁
+                        List<EamSecondMaintenanceOrderDetail> addList = new ArrayList<>();
+                        //鍏堝垹闄ゅ師鏈�
+                        LambdaQueryWrapper<EamSecondMaintenanceOrderDetail> queryWrapper = new LambdaQueryWrapper<>();
+                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getOrderId, entity.getId());
+                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getItemCategory,EamMaintenanceStandardDetailCategory.OPERATOR_MAINTENANCE.name());
+                        secondMaintenanceOrderDetailService.remove(queryWrapper);
+                        request.getOperatorDetailList().forEach(tableDetail -> {
+                            EamSecondMaintenanceOrderDetail eamMaintenanceStandardDetail=new EamSecondMaintenanceOrderDetail();
+                            BeanUtils.copyProperties(tableDetail, eamMaintenanceStandardDetail);
+                            eamMaintenanceStandardDetail.setOrderId(entity.getId());
+                            addList.add(eamMaintenanceStandardDetail);
+                        });
+                        secondMaintenanceOrderDetailService.saveBatch(addList);
+                    }
                 }else if (BusinessCodeConst.PCR0002.equals(user.getPost())) {
                     entity.setRepairman(user.getUsername());
+                    values.put("organization", "浜屼繚缁翠慨宸ユ墽琛岀粨鏉�");
+                    values.put("comment", "浜屼繚缁翠慨宸ユ墽琛岀粨鏉�");
                     //澶勭悊瀵瑰簲璇︽儏
+                    if (CollectionUtils.isNotEmpty(request.getRepairmanDetailList())){
+                        //鍒犻櫎鍘熸湁鏁版嵁
+                        List<EamSecondMaintenanceOrderDetail> addList = new ArrayList<>();
+                        //鍏堝垹闄ゅ師鏈�
+                        LambdaQueryWrapper<EamSecondMaintenanceOrderDetail> queryWrapper = new LambdaQueryWrapper<>();
+                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getOrderId, entity.getId());
+                        queryWrapper.eq(EamSecondMaintenanceOrderDetail::getItemCategory,EamMaintenanceStandardDetailCategory.REPAIRER_MAINTENANCE.name());
+                        secondMaintenanceOrderDetailService.remove(queryWrapper);
+                        request.getRepairmanDetailList().forEach(tableDetail -> {
+                            EamSecondMaintenanceOrderDetail eamMaintenanceStandardDetail=new EamSecondMaintenanceOrderDetail();
+                            BeanUtils.copyProperties(tableDetail, eamMaintenanceStandardDetail);
+                            eamMaintenanceStandardDetail.setOrderId(entity.getId());
+                            addList.add(eamMaintenanceStandardDetail);
+                        });
+                        secondMaintenanceOrderDetailService.saveBatch(addList);
+                    }
                 }
                 values.put("dataId", entity.getId());
-                values.put("organization", "涓変繚鎵ц缁撴潫");
-                values.put("comment", "涓変繚鎵ц缁撴潫");
                 break;
             case WAIT_ADMIN_CONFIRM:
                 //绠$悊鍛樼‘璁�
@@ -391,9 +426,11 @@
                     values.put("dataId", entity.getId());
                     values.put("organization",request.getComment());
                     values.put("comment", request.getComment());
+                    values.put("manageUserResult",request.getManageUserResult());
                     entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.WAIT_INSPECTOR_CONFIRM.name());
                     entity.setManageUser(user.getUsername());
                     entity.setProblemDescription(request.getProblemDescription());
+                    entity.setManageUserResult(request.getManageUserResult());
                     entity.setDealDescription(request.getComment());
                     entity.setConfirmTime(new Date());
                 }
@@ -403,8 +440,10 @@
                 values.put("dataId", entity.getId());
                 values.put("organization",request.getComment());
                 values.put("comment", request.getComment());
+                values.put("inspectorResult",request.getInspectorResult());
                 entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.COMPLETE.name());
                 entity.setInspector(user.getUsername());
+                entity.setInspectorResult(request.getInspectorResult());
                 entity.setInspectConfirmComment(request.getInspectConfirmComment());
                 entity.setInspectConfirmTime(new Date());
                 break;

--
Gitblit v1.9.3