From 60e43e1bc0785a7151fd050b20b04f2047df2727 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期六, 12 七月 2025 10:18:14 +0800
Subject: [PATCH] 点检添加周报校验

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java |  369 +++++++++++++++++++++++++++-------------------------
 1 files changed, 191 insertions(+), 178 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
index 6121b18..0b352c9 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
@@ -3,17 +3,16 @@
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.flowable.engine.TaskService;
 import org.flowable.task.api.Task;
-import org.jeecg.common.api.vo.FileUploadResult;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.constant.DataBaseConstant;
@@ -38,8 +37,11 @@
 import org.jeecg.modules.flowable.apithird.service.FlowCommonService;
 import org.jeecg.modules.flowable.service.IFlowDefinitionService;
 import org.jeecg.modules.flowable.service.IFlowTaskService;
+import org.jeecg.modules.system.entity.BaseFactory;
+import org.jeecg.modules.system.entity.BaseFactoryUser;
+import org.jeecg.modules.system.service.IBaseFactoryService;
+import org.jeecg.modules.system.service.IBaseFactoryUserService;
 import org.jeecg.modules.system.service.ISysUserService;
-import org.jeecg.modules.system.vo.UserSelector;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -79,8 +81,11 @@
     private IEamReportRepairService eamReportRepairService;
     @Autowired
     private IEamEquipmentExtendService eamEquipmentExtendService;
-    @Autowired
-    private IEamPrecisionCheckDetailService precisionCheckDetailService;
+
+    @Resource
+    private IBaseFactoryUserService baseFactoryUserService;
+    @Resource
+    private IBaseFactoryService baseFactoryService;
 
     @Override
     public IPage<EamThirdMaintenanceOrder> queryPageList(Page<EamThirdMaintenanceOrder> page, EamThirdMaintenanceQuery query) {
@@ -95,8 +100,16 @@
             List<String> equipArr = Arrays.asList(sysUser.getEquipmentIds().split(","));
             queryWrapper.in("e.equipment_code", equipArr);
         } else {
-            //娌℃湁閫夋嫨璁惧锛屾牴鎹溅闂磋繃婊よ澶�
-            queryWrapper.exists("select 1 from mdc_user_production t where t.user_id={0} and t.pro_id=e.org_id ", sysUser.getId());
+            //娌℃湁閫夋嫨璁惧锛屾牴鎹腑蹇冭繃婊よ澶�
+            List<BaseFactoryUser> baseFactoryUserList = baseFactoryUserService.
+                    list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId, sysUser.getId()));
+            if (!CollectionUtils.isEmpty(baseFactoryUserList)) {
+                Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet());
+                Set<String> factoryCode = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet());
+                queryWrapper.in("e.factory_org_code", factoryCode);
+            }else {
+                return page;
+            }
         }
         //鏌ヨ鏉′欢杩囨护
         if (query != null) {
@@ -162,38 +175,38 @@
             thirdMaintenanceOrderDetailService.saveBatch(request.getTableDetailList());
         }
         //澶勭悊绮惧害鍙傛暟
-        if (CollectionUtil.isNotEmpty(request.getPrecisionDetailList())) {
-            request.getPrecisionDetailList().forEach(tableDetail -> {
-                tableDetail.setId(null);
-                tableDetail.setOrderId(order.getId());
-            });
-            precisionCheckDetailService.saveBatch(request.getPrecisionDetailList());
-        }
+//        if (CollectionUtil.isNotEmpty(request.getPrecisionDetailList())) {
+//            request.getPrecisionDetailList().forEach(tableDetail -> {
+//                tableDetail.setId(null);
+//                tableDetail.setOrderId(order.getId());
+//            });
+//            precisionCheckDetailService.saveBatch(request.getPrecisionDetailList());
+//        }
         //鍒ゆ柇鏄惁瀛樺湪淇濆吇浜� 濡傛灉瀛樺湪鍒欏惎鍔ㄦ祦绋�
-        if (StringUtils.isNotBlank(order.getOperator())) {
-            //鍚姩娴佺▼
-            flowCommonService.initActBusiness("宸ュ崟鍙�:" + order.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(),
-                    order.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null);
-            Map<String, Object> variables = new HashMap<>();
-            variables.put("dataId", order.getId());
-            if (StrUtil.isEmpty(order.getRemark())) {
-                variables.put("organization", "鏂板涓変繚宸ュ崟榛樿鍚姩娴佺▼");
-                variables.put("comment", "鏂板涓変繚宸ュ崟榛樿鍚姩娴佺▼");
-            } else {
-                variables.put("organization", order.getRemark());
-                variables.put("comment", order.getRemark());
-            }
-            variables.put("proofreading", true);
-            //骞惰浠诲姟浼氱
-            variables.put("maintenance_execution", Collections.singletonList(request.getOperator()));
-            variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
-            Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables);
-            if (result != null) {
-                //鏇存柊璁惧淇濆吇鐘舵��
-                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_THIRD_MAINTENANCE.name());
-                return result.isSuccess();
-            }
-        }
+//        if (StringUtils.isNotBlank(order.getOperator())) {
+//            //鍚姩娴佺▼
+//            flowCommonService.initActBusiness("宸ュ崟鍙�:" + order.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(),
+//                    order.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null);
+//            Map<String, Object> variables = new HashMap<>();
+//            variables.put("dataId", order.getId());
+//            if (StrUtil.isEmpty(order.getRemark())) {
+//                variables.put("organization", "鏂板涓変繚宸ュ崟榛樿鍚姩娴佺▼");
+//                variables.put("comment", "鏂板涓変繚宸ュ崟榛樿鍚姩娴佺▼");
+//            } else {
+//                variables.put("organization", order.getRemark());
+//                variables.put("comment", order.getRemark());
+//            }
+//            variables.put("proofreading", true);
+//            //骞惰浠诲姟浼氱
+//            variables.put("maintenance_execution", Collections.singletonList(request.getOperator()));
+////            variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
+//            Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables);
+//            if (result != null) {
+//                //鏇存柊璁惧淇濆吇鐘舵��
+//                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_THIRD_MAINTENANCE.name());
+//                return result.isSuccess();
+//            }
+//        }
 
         return true;
     }
@@ -257,7 +270,7 @@
             variables.put("proofreading", true);
             //骞惰浠诲姟浼氱
             variables.put("maintenance_execution", Collections.singletonList(request.getOperator()));
-            variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
+//            variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
             Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables);
             if (result != null) {
                 //鏇存柊璁惧淇濆吇鐘舵��
@@ -283,9 +296,9 @@
         if (equipment == null) {
             throw new JeecgBootException("璁惧涓嶅瓨鍦紝娣诲姞澶辫触锛�");
         }
-        if (StringUtils.isBlank(equipment.getEquipmentManager())) {
-            throw new JeecgBootException("璁惧鏈垎閰嶈澶囩鐞嗗憳锛屾棤娉曡繘鍏ヤ笅绾у鎵癸紒");
-        }
+//        if (StringUtils.isBlank(equipment.getEquipmentManager())) {
+//            throw new JeecgBootException("璁惧鏈垎閰嶈澶囩鐞嗗憳锛屾棤娉曡繘鍏ヤ笅绾у鎵癸紒");
+//        }
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         if (sysUser == null || !BusinessCodeConst.PCR0001.equals(sysUser.getPost())) {
             throw new JeecgBootException("涓嶆槸鎿嶄綔宸ワ紝鏃犳硶棰嗗彇姝ゅ伐鍗曪紒");
@@ -299,8 +312,8 @@
         flowCommonService.initActBusiness("宸ュ崟鍙�:" + entity.getOrderNum() + ";璁惧缂栧彿: " + equipment.getEquipmentCode() + ";瀹夎浣嶇疆" + equipment.getInstallationPosition(),
                 entity.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null);
         Map<String, Object> variables = new HashMap<>();
-        boolean equipmentPrecisionFlag = precisionCheckDetailService.hasPrecisionCheckDetail(entity.getId());
-        variables.put("equipmentPrecisionFlag", equipmentPrecisionFlag);
+//        boolean equipmentPrecisionFlag = precisionCheckDetailService.hasPrecisionCheckDetail(entity.getId());
+//        variables.put("equipmentPrecisionFlag", equipmentPrecisionFlag);
         variables.put("dataId", entity.getId());
         if (StrUtil.isEmpty(entity.getRemark())) {
             variables.put("organization", "鏂板涓変繚宸ュ崟榛樿鍚姩娴佺▼");
@@ -312,7 +325,7 @@
         variables.put("proofreading", true);
         //骞惰浠诲姟浼氱
         variables.put("maintenance_execution", Collections.singletonList(sysUser.getUsername()));
-        variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
+//        variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
         Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables);
         if (result != null) {
             //鏇存柊璁惧淇濆吇鐘舵��
@@ -330,138 +343,138 @@
         if (entity == null) {
             throw new JeecgBootException("瀹℃壒鐨勬暟鎹凡鍒犻櫎锛岃鍒锋柊閲嶈瘯锛�");
         }
-        // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛
-        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-        if (user == null || StrUtil.isBlank(user.getId())) {
-            throw new JeecgBootException("鏈幏鍙栧埌鐧诲綍鐢ㄦ埛锛岃閲嶆柊鐧诲綍鍚庡啀璇曪紒");
-        }
-        request.setAssignee(user.getUsername());
-        // 鑾峰彇娴佺▼涓氬姟璁板綍
-        FlowMyBusiness flowMyBusiness = flowMyBusinessService.getFlowMyBusiness(request.getInstanceId(), request.getTaskId());
-        if (flowMyBusiness == null) {
-            throw new JeecgBootException("娴佺▼瀹炰緥涓嶅瓨鍦紝璇峰埛鏂板悗閲嶈瘯锛�");
-        }
-
-        boolean userAuthorized = isUserAuthorized(flowMyBusiness, user);
-        if (!userAuthorized) {
-            throw new JeecgBootException("鐢ㄦ埛鏃犳潈鎿嶄綔姝や换鍔★紝璇峰埛鏂板悗閲嶈瘯锛�");
-        }
-        // 璁ら浠诲姟
-        if (!claimTask(flowMyBusiness.getTaskId(), user)) {
-            throw new JeecgBootException("浠诲姟涓嶅瓨鍦ㄣ�佸凡瀹屾垚鎴栧凡琚粬浜鸿棰嗭紒");
-        }
-
-        EamEquipment equipment = eamEquipmentService.getById(entity.getEquipmentId());
-        if (equipment == null) {
-            throw new JeecgBootException("璁惧涓嶅瓨鍦紝璇锋鏌ワ紒");
-        }
-
-        ThirdMaintenanceStatusEnum status = ThirdMaintenanceStatusEnum.getInstance(entity.getMaintenanceStatus());
-        if (status == null) {
-            return null;
-        }
-        //娴佺▼鍙橀噺
-        Map<String, Object> values = new HashMap<>();
-        List<String> userApprovalList;
-        List<UserSelector> userSelectors;
-        switch (status) {
-            case UNDER_MAINTENANCE:
-                boolean parallelCompletion = flowTaskService.checkParallelCompletion(flowMyBusiness.getTaskId());
-                //鎵ц瀹屾垚
-                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0006);
-                if (CollectionUtil.isEmpty(userSelectors)) {
-                    throw new JeecgBootException("璁惧鏈垎閰嶇粰杞﹂棿鐝粍闀匡紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�");
-                }
-                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
-                values.put("dataId", entity.getId());
-                values.put("organization", "涓変繚鎵ц缁撴潫");
-                values.put("comment", "涓変繚鎵ц缁撴潫");
-                if (parallelCompletion) {
-                    values.put("NextAssignee", userApprovalList);
-                }
-                request.setComment("涓変繚鎵ц缁撴潫");
-                //璁剧疆entity
-                if (parallelCompletion) {
-                    entity.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_CONFIRM.name());
-                    entity.setActualEndTime(new Date());
-                }
-                if ("maintenance_execution".equals(flowMyBusiness.getTaskNameId())) {
-                    //鎵ц淇濆吇
-                    //澶勭悊闄勪欢
-                    if (CollectionUtil.isNotEmpty(request.getImageFilesResult())) {
-                        List<FileUploadResult> fileUploadResultList = request.getImageFilesResult();
-                        ObjectMapper mapper = new ObjectMapper();
-                        try {
-                            String referenceFile = mapper.writeValueAsString(fileUploadResultList);
-                            entity.setImageFiles(referenceFile);
-                        } catch (JsonProcessingException e) {
-                            log.error("JSON杞崲澶辫触锛�" + e.getMessage(), e);
-                        }
-                    }
-                    //澶勭悊璇︽儏
-                    if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
-                        thirdMaintenanceOrderDetailService.updateBatchById(request.getTableDetailList());
-                    }
-                } else if ("precision_check".equals(flowMyBusiness.getTaskNameId())) {
-                    entity.setPrecisionChecker(user.getUsername());
-                    entity.setPrecisionCheckTime(new Date());
-                    //澶勭悊绮惧害妫�楠�
-                    if (CollectionUtil.isNotEmpty(request.getPrecisionDetailList())) {
-                        precisionCheckDetailService.updateBatchById(request.getPrecisionDetailList());
-                    }
-                }
-                if (parallelCompletion) {
-                    //鏇存柊璁惧淇濆吇鐘舵��
-                    eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.THIRD_MAINTENANCE_WAIT_CONFIRM.name());
-                }
-                break;
-            case WAIT_CONFIRM:
-                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003);
-                if (CollectionUtil.isEmpty(userSelectors)) {
-                    throw new JeecgBootException("璁惧鏈垎閰嶇粰杞﹂棿鐝粍闀匡紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�");
-                }
-                //鐝粍闀跨‘璁�
-                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
-                values.put("dataId", entity.getId());
-                values.put("organization", request.getConfirmComment());
-                values.put("comment", request.getConfirmComment());
-                values.put("NextAssignee", userApprovalList);
-                values.put("confirmation", request.getConfirmDealType());
-                request.setComment(request.getConfirmComment());
-                //璁剧疆entity
-                entity.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_LEADER_CONFIRM.name());
-                entity.setConfirmUser(user.getUsername());
-                entity.setConfirmComment(request.getConfirmComment());
-                entity.setConfirmTime(new Date());
-                //澶勭悊鎶ヤ慨
-                List<EamThirdMaintenanceOrderDetail> collect = request.getTableDetailList().stream().filter((detail) -> CommonConstant.DEFAULT_1.equals(detail.getReportFlag())).collect(Collectors.toList());
-                if (CollectionUtil.isNotEmpty(collect)) {
-                    eamReportRepairService.reportRepairFromThirdMaintenance(equipment.getId(), entity.getOperator(), collect);
-                }
-                break;
-            case WAIT_LEADER_CONFIRM:
-                values.put("dataId", entity.getId());
-                values.put("organization", request.getLeaderConfirmComment());
-                values.put("comment", request.getLeaderConfirmComment());
-                request.setComment(request.getLeaderConfirmComment());
-                //璁剧疆entity
-                entity.setMaintenanceStatus(ThirdMaintenanceStatusEnum.COMPLETE.name());
-                entity.setConfirmLeader(user.getUsername());
-                entity.setLeaderConfirmComment(request.getLeaderConfirmComment());
-                entity.setLeaderConfirmTime(new Date());
-                //鏇存柊璁惧淇濆吇鐘舵��
-                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.NORMAL.name());
-                break;
-        }
-        request.setValues(values);
-
-        // 瀹屾垚娴佺▼浠诲姟
-        Result result = flowTaskService.complete(request);
-        if (!result.isSuccess()) {
-            throw new JeecgBootException("瀹℃壒澶辫触锛岃鍒锋柊鏌ョ湅锛�");
-        }
-        //淇濆瓨宸ュ崟
-        eamThirdMaintenanceOrderMapper.updateById(entity);
+//        // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛
+//        LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        if (user == null || StrUtil.isBlank(user.getId())) {
+//            throw new JeecgBootException("鏈幏鍙栧埌鐧诲綍鐢ㄦ埛锛岃閲嶆柊鐧诲綍鍚庡啀璇曪紒");
+//        }
+//        request.setAssignee(user.getUsername());
+//        // 鑾峰彇娴佺▼涓氬姟璁板綍
+//        FlowMyBusiness flowMyBusiness = flowMyBusinessService.getFlowMyBusiness(request.getInstanceId(), request.getTaskId());
+//        if (flowMyBusiness == null) {
+//            throw new JeecgBootException("娴佺▼瀹炰緥涓嶅瓨鍦紝璇峰埛鏂板悗閲嶈瘯锛�");
+//        }
+//
+//        boolean userAuthorized = isUserAuthorized(flowMyBusiness, user);
+//        if (!userAuthorized) {
+//            throw new JeecgBootException("鐢ㄦ埛鏃犳潈鎿嶄綔姝や换鍔★紝璇峰埛鏂板悗閲嶈瘯锛�");
+//        }
+//        // 璁ら浠诲姟
+//        if (!claimTask(flowMyBusiness.getTaskId(), user)) {
+//            throw new JeecgBootException("浠诲姟涓嶅瓨鍦ㄣ�佸凡瀹屾垚鎴栧凡琚粬浜鸿棰嗭紒");
+//        }
+//
+//        EamEquipment equipment = eamEquipmentService.getById(entity.getEquipmentId());
+//        if (equipment == null) {
+//            throw new JeecgBootException("璁惧涓嶅瓨鍦紝璇锋鏌ワ紒");
+//        }
+//
+//        ThirdMaintenanceStatusEnum status = ThirdMaintenanceStatusEnum.getInstance(entity.getMaintenanceStatus());
+//        if (status == null) {
+//            return null;
+//        }
+//        //娴佺▼鍙橀噺
+//        Map<String, Object> values = new HashMap<>();
+//        List<String> userApprovalList;
+//        List<UserSelector> userSelectors;
+//        switch (status) {
+//            case UNDER_MAINTENANCE:
+//                boolean parallelCompletion = flowTaskService.checkParallelCompletion(flowMyBusiness.getTaskId());
+//                //鎵ц瀹屾垚
+//                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0006);
+//                if (CollectionUtil.isEmpty(userSelectors)) {
+//                    throw new JeecgBootException("璁惧鏈垎閰嶇粰杞﹂棿鐝粍闀匡紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�");
+//                }
+//                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
+//                values.put("dataId", entity.getId());
+//                values.put("organization", "涓変繚鎵ц缁撴潫");
+//                values.put("comment", "涓変繚鎵ц缁撴潫");
+//                if (parallelCompletion) {
+//                    values.put("NextAssignee", userApprovalList);
+//                }
+//                request.setComment("涓変繚鎵ц缁撴潫");
+//                //璁剧疆entity
+//                if (parallelCompletion) {
+//                    entity.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_CONFIRM.name());
+//                    entity.setActualEndTime(new Date());
+//                }
+//                if ("maintenance_execution".equals(flowMyBusiness.getTaskNameId())) {
+//                    //鎵ц淇濆吇
+//                    //澶勭悊闄勪欢
+//                    if (CollectionUtil.isNotEmpty(request.getImageFilesResult())) {
+//                        List<FileUploadResult> fileUploadResultList = request.getImageFilesResult();
+//                        ObjectMapper mapper = new ObjectMapper();
+//                        try {
+//                            String referenceFile = mapper.writeValueAsString(fileUploadResultList);
+//                            entity.setImageFiles(referenceFile);
+//                        } catch (JsonProcessingException e) {
+//                            log.error("JSON杞崲澶辫触锛�" + e.getMessage(), e);
+//                        }
+//                    }
+//                    //澶勭悊璇︽儏
+//                    if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
+//                        thirdMaintenanceOrderDetailService.updateBatchById(request.getTableDetailList());
+//                    }
+//                } else if ("precision_check".equals(flowMyBusiness.getTaskNameId())) {
+//                    entity.setPrecisionChecker(user.getUsername());
+//                    entity.setPrecisionCheckTime(new Date());
+//                    //澶勭悊绮惧害妫�楠�
+//                    if (CollectionUtil.isNotEmpty(request.getPrecisionDetailList())) {
+//                        precisionCheckDetailService.updateBatchById(request.getPrecisionDetailList());
+//                    }
+//                }
+//                if (parallelCompletion) {
+//                    //鏇存柊璁惧淇濆吇鐘舵��
+//                    eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.THIRD_MAINTENANCE_WAIT_CONFIRM.name());
+//                }
+//                break;
+//            case WAIT_CONFIRM:
+//                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(),null, BusinessCodeConst.PCR0003);
+//                if (CollectionUtil.isEmpty(userSelectors)) {
+//                    throw new JeecgBootException("璁惧鏈垎閰嶇粰杞﹂棿鐝粍闀匡紝鏃犳硶杩涘叆涓嬬骇瀹℃壒锛�");
+//                }
+//                //鐝粍闀跨‘璁�
+//                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
+//                values.put("dataId", entity.getId());
+//                values.put("organization", request.getConfirmComment());
+//                values.put("comment", request.getConfirmComment());
+//                values.put("NextAssignee", userApprovalList);
+//                values.put("confirmation", request.getConfirmDealType());
+//                request.setComment(request.getConfirmComment());
+//                //璁剧疆entity
+//                entity.setMaintenanceStatus(ThirdMaintenanceStatusEnum.WAIT_LEADER_CONFIRM.name());
+//                entity.setConfirmUser(user.getUsername());
+//                entity.setConfirmComment(request.getConfirmComment());
+//                entity.setConfirmTime(new Date());
+//                //澶勭悊鎶ヤ慨
+//                List<EamThirdMaintenanceOrderDetail> collect = request.getTableDetailList().stream().filter((detail) -> CommonConstant.DEFAULT_1.equals(detail.getReportFlag())).collect(Collectors.toList());
+//                if (CollectionUtil.isNotEmpty(collect)) {
+//                    eamReportRepairService.reportRepairFromThirdMaintenance(equipment.getId(), entity.getOperator(), collect);
+//                }
+//                break;
+//            case WAIT_LEADER_CONFIRM:
+//                values.put("dataId", entity.getId());
+//                values.put("organization", request.getLeaderConfirmComment());
+//                values.put("comment", request.getLeaderConfirmComment());
+//                request.setComment(request.getLeaderConfirmComment());
+//                //璁剧疆entity
+//                entity.setMaintenanceStatus(ThirdMaintenanceStatusEnum.COMPLETE.name());
+//                entity.setConfirmLeader(user.getUsername());
+//                entity.setLeaderConfirmComment(request.getLeaderConfirmComment());
+//                entity.setLeaderConfirmTime(new Date());
+//                //鏇存柊璁惧淇濆吇鐘舵��
+//                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.NORMAL.name());
+//                break;
+//        }
+//        request.setValues(values);
+//
+//        // 瀹屾垚娴佺▼浠诲姟
+//        Result result = flowTaskService.complete(request);
+//        if (!result.isSuccess()) {
+//            throw new JeecgBootException("瀹℃壒澶辫触锛岃鍒锋柊鏌ョ湅锛�");
+//        }
+//        //淇濆瓨宸ュ崟
+//        eamThirdMaintenanceOrderMapper.updateById(entity);
         return entity;
     }
 

--
Gitblit v1.9.3