From ff087240b3dee29ce4e14ad0836e76b9fdf312cf Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 19 八月 2025 09:28:07 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/lianhelihua_sh

---
 server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
index 1b6ba87..5ddb640 100644
--- a/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
+++ b/server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
@@ -94,6 +94,7 @@
         //澶勭悊SHE浜嬩欢鐘舵��
         Constants.WorkOrderStatus  workOrderStatus = Constants.equalsInteger(workorder.getType(),Constants.ZERO)?Constants.WorkOrderStatus.close:Constants.WorkOrderStatus.waitConfirm;
         workorder.setStatus(workOrderStatus.getKey());
+        workorder.setSheDealUserQwIds(workorder.getQwnoticeMemberIds());
         workorderMapper.insert(workorder);
 
         //瀛樺偍DCA 闂璁板綍琛�
@@ -185,8 +186,11 @@
         }else{
             textCard.setTitle(Constants.equalsInteger(workorder.getType(),Constants.ONE)?"銆怐CA涓婃姤銆�":"銆愯穼缁婃粦椋庨櫓涓婃姤銆�");
             if(Constants.equalsInteger(workorder.getType(),Constants.THREE)){
-                message = message + " <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"绯荤粺") + (Constants.equalsInteger(contentType,Constants.ZERO)?"浠诲姟鍒嗛厤缁欎綘":(Constants.equalsInteger(contentType,Constants.ONE)?"瀵硅宸ュ崟杩涜浜嗗偓淇冿紝璇峰敖蹇鐞�":"浠诲姟宸插鐞�")) +"</div>";
+                message = message + " <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"绯荤粺") + (Constants.equalsInteger(contentType,Constants.ZERO)?"浠诲姟鍒嗛厤缁欎綘":(Constants.equalsInteger(contentType,Constants.ONE)?"瀵硅宸ュ崟杩涜浜嗗偓淇冿紝璇峰敖蹇鐞�":((Constants.equalsInteger(contentType,Constants.TWO)?"鎶勯�佺粰浣�":"浠诲姟宸插鐞�")))) +"</div>";//:"浠诲姟宸插鐞�")) +"</div>";
                 message = message + " <div class=\"normal\">"+  DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm") +"/"+ workorder.getLocationName() +"/"+  categoryName+"</div>";
+                if(Constants.equalsInteger(contentType,Constants.TWO)){
+                    message = message + "  <div class=\"normal\">璇存槑    "+ csInfo +"</div>";
+                }
             }else{
                 message = message + "  <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"绯荤粺") + (Constants.equalsInteger(contentType,Constants.ZERO)?"浠诲姟鍒嗛厤缁欎綘":(Constants.equalsInteger(contentType,Constants.ONE)?"瀵硅宸ュ崟杩涜浜嗗偓淇冿紝璇峰敖蹇鐞�":((Constants.equalsInteger(contentType,Constants.TWO)?"鎶勯�佺粰浣�":"宸插鐞嗕竴椤�")))) +"</div>";
                 message = message + "  <div class=\"normal\">瑙傚療涓婚  "+ categoryName +"</div>";
@@ -269,6 +273,7 @@
                     dcaWorkOrder.setEventInfo(dcaNoProblemDTO.getEventInfo());
                     dcaWorkOrder.setQwnoticeMemberIds(workorder.getQwnoticeMemberIds());
                     dcaWorkOrder.setMemberNames(workorder.getMemberNames());
+                    dcaWorkOrder.setSheDealUserQwIds(dcaWorkOrder.getQwnoticeMemberIds());
                     workorderMapper.insert(dcaWorkOrder);
                     //瀛樺偍鏃ュ織
                     this.dealLogData(dcaWorkOrder,workOrderStatus);
@@ -443,7 +448,7 @@
             if(Objects.isNull(workorder.getMemberType())
                     || Objects.isNull(workorder.getOutJiuyi())
                     || (Constants.equalsInteger(workorder.getOutJiuyi(),Constants.ZERO) && Objects.isNull(workorder.getIsYiwushi()))
-                    || (Constants.equalsInteger(workorder.getIsYiwushi(),Constants.ZERO) && Objects.isNull(workorder.getIsHurted()))
+                    || (Constants.equalsInteger(workorder.getOutJiuyi(),Constants.ZERO) && Constants.equalsInteger(workorder.getIsYiwushi(),Constants.ZERO) && Objects.isNull(workorder.getIsHurted()))
                     || Objects.isNull(workorder.getWorkRelated())
                     || (Constants.equalsInteger(workorder.getMemberType(),Constants.TWO) && StringUtils.isEmpty(workorder.getMemberNames()))
                     || (Constants.equalsInteger(workorder.getMemberType(),Constants.ONE) && StringUtils.isEmpty(workorder.getMemberQwids()))
@@ -502,10 +507,12 @@
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
 
+        workorder.setStatusName(Constants.WorkOrderStatus.getStatusName(workorder.getStatus()));
         this.dealButton(workorder,member);
         //鏌ヨ闄勪欢淇℃伅
         List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO)
-                .eq(Multifile::getObjId,workorder.getId()).orderByAsc(Multifile::getId));
+                .eq(Multifile::getObjType,Constants.multiFileType.upload)
+                .eq(Multifile::getObjId,workorder.getId().toString()).orderByAsc(Multifile::getId));
         String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()
                 +systemDictDataBiz.queryByCode(Constants.FTP,Constants.WORKORDER_FILE_PATH).getCode();
 
@@ -527,6 +534,7 @@
             if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(dcaChildList)){
                 for (Workorder dcaChild:dcaChildList) {
                     this.dealButton(dcaChild,member);
+                    dcaChild.setStatusName(Constants.WorkOrderStatus.getStatusName(dcaChild.getStatus()));
                 }
                 workorder.setManagerId(dcaChildList.stream().filter(i->Objects.nonNull(i.getManagerId())).map(i->i.getManagerId()).collect(Collectors.joining(",")));
             }
@@ -543,7 +551,7 @@
             if(org.apache.commons.lang3.StringUtils.isNotBlank(workorder.getQwnoticeMemberIds())&&
                     (Constants.equalsInteger(workorder.getStatus(),Constants.ZERO)||
                             Constants.equalsInteger(workorder.getStatus(),Constants.ONE)||Constants.equalsInteger(workorder.getStatus(),Constants.TWO))){
-                closeUserList.addAll(Arrays.asList(workorder.getQwnoticeMemberIds().split(",")));
+                closeUserList.addAll(Arrays.asList(workorder.getSheDealUserQwIds().split(",")));
             }
             if(org.apache.commons.lang3.StringUtils.isNotBlank(workorder.getManagerId())&&
                     (Constants.equalsInteger(workorder.getStatus(),Constants.ONE)||Constants.equalsInteger(workorder.getStatus(),Constants.TWO))){
@@ -560,7 +568,7 @@
             //寰呭垎閰嶇姸鎬� 澶勭悊杞氦鎸夐挳
             if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())
             ){
-                passOnUserList.addAll(Arrays.asList(workorder.getQwnoticeMemberIds().split(",")));
+                passOnUserList.addAll(Arrays.asList(workorder.getSheDealUserQwIds().split(",")));
             }
             if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())
                 || Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey())
@@ -777,7 +785,13 @@
         Utils.MP.blankToNull(pageWrap.getModel());
         pageWrap.getModel().setIsdeleted(Constants.ZERO);
         MPJLambdaWrapper<Workorder> queryWrapper = getJoinQueryMapper(pageWrap.getModel());
-        return PageData.from(workorderMapper.selectJoinPage(page,Workorder.class, queryWrapper));
+        PageData<Workorder> result = PageData.from(workorderMapper.selectJoinPage(page,Workorder.class, queryWrapper));
+        if(result!=null && result.getRecords()!=null){
+            for(Workorder w : result.getRecords()){
+                w.setStatusName(Constants.WorkOrderStatus.getStatusName(w.getStatus()));
+            }
+        }
+        return result;
     }
 
     @Override
@@ -839,7 +853,7 @@
         //鎻愪氦鍚庣殑 寰呯‘璁�/寰呭垵瀹$姸鎬� 濡傛灉鍘诲叧闂� 鍙湁宸ュ崟閲岀粦瀹氱殑SHE浜哄憳鍙互鍏抽棴
         if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())){
             //鍒ゆ柇SHE浜哄憳鍐呮槸鍚︽湁褰撳墠鐧诲綍璐﹀彿
-            if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO){
+            if(workorder.getSheDealUserQwIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
             }
             workorder.setStatus(Constants.WorkOrderStatus.sheClose.getKey());
@@ -847,12 +861,12 @@
             qwIds.remove(closeDTO.getMember().getQwId());
         }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){
             //鍒ゆ柇SHE浜哄憳鍐呮槸鍚︽湁褰撳墠鐧诲綍璐﹀彿
-            if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO &&  !workorder.getManagerId().equals(closeDTO.getMember().getQwId())){
+            if(workorder.getSheDealUserQwIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO &&  !workorder.getManagerId().equals(closeDTO.getMember().getQwId())){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
             }
             if(workorder.getManagerId().equals(closeDTO.getMember().getQwId())){
                 workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey());
-            }else if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())>Constants.ZERO){
+            }else if(workorder.getSheDealUserQwIds().indexOf(closeDTO.getMember().getQwId())>Constants.ZERO){
                 workorder.setStatus(Constants.WorkOrderStatus.sheClose.getKey());
             }else{
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
@@ -862,7 +876,7 @@
             qwIds.remove(closeDTO.getMember().getQwId());
         }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey())){
             //鍒ゆ柇SHE浜哄憳鍐呮槸鍚︽湁褰撳墠鐧诲綍璐﹀彿
-            if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO &&  !workorder.getManagerId().equals(closeDTO.getMember().getQwId())
+            if(workorder.getSheDealUserQwIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO &&  !workorder.getManagerId().equals(closeDTO.getMember().getQwId())
                     &&  !workorder.getDealerId().equals(closeDTO.getMember().getQwId()) ){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
             }
@@ -870,7 +884,7 @@
                 workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey());
             }else if(workorder.getDealerId().equals(closeDTO.getMember().getQwId())){
                 workorder.setStatus(Constants.WorkOrderStatus.close.getKey());
-            }else if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())>Constants.ZERO){
+            }else if(workorder.getSheDealUserQwIds().indexOf(closeDTO.getMember().getQwId())>Constants.ZERO){
                 workorder.setStatus(Constants.WorkOrderStatus.sheClose.getKey());
             }else{
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝褰撳墠宸ュ崟闈炴偍鐨勫伐鍗曪紝鏃犳硶杩涜澶勭悊");
@@ -947,12 +961,20 @@
             if(!Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())){
                 throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
             }
+            if(workorder.getSheDealUserQwIds().indexOf(passOnDTO.getMember().getQwId())<Constants.ZERO){
+                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝闈炲甫鎮ㄥ鐞嗙殑宸ュ崟锛屾棤娉曡繘琛岃鎿嶄綔");
+            }
             workorder.setManagerId(member.getQwId());
             workorder.setStatus(Constants.WorkOrderStatus.waitAllocation.getKey());
+            workorder.setSheDealUserQwIds(passOnDTO.getMember().getQwId());
+            
         }else{
             if(!(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())
                 || Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey()))){
                 throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"宸ュ崟鐘舵�佸凡娴佽浆");
+            }
+            if(!workorder.getManagerId().equals(passOnDTO.getMember().getQwId())){
+                throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝闈炲甫鎮ㄥ鐞嗙殑宸ュ崟锛屾棤娉曡繘琛岃鎿嶄綔");
             }
             workorder.setDealerId(member.getQwId());
             workorder.setStatus(Constants.WorkOrderStatus.waitDeal.getKey());
@@ -1064,6 +1086,7 @@
               status = 2;
               info ="鏃犳晥鍛樺伐淇℃伅锛屾棤娉曞彂閫侀偖绠�";
         }else{
+            //閭宸插彂閫侊細鎴愬姛锛歔"姹熻悕閭jp@doumee.com"]澶辫触锛歔"姹熻悕/鏃犻偖绠�","鎴村己寮�/閭null","閮檯鏂囨/閭null"]
             List<String>    successInfo = new ArrayList<>();
             List<String> errorInfo = new ArrayList<>();
             Map<String,String> contentForm = getEmailContentFormByModel(workorder);

--
Gitblit v1.9.3