From 54bbda6f374f3b8ebafed04d49f756fd75e53a1a Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期六, 06 四月 2024 12:31:39 +0800
Subject: [PATCH] 提交一把

---
 server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java |   57 +++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
index ad8d7af..be2de67 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
@@ -172,15 +172,40 @@
                             .selectAs(SystemUser::getType,ApplyLog::getCreatorType)
                             .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator)
                             .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId)
-                            .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.THREE))
+                            .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.FOUR))
                             .eq(ApplyLog::getApplyId,unionChange.getId())
                             .orderByAsc(ApplyLog::getCreateDate)
             );
             unionChange.setApplyLogList(applyLogList);
         }
+        initFiles(unionChange);
         return unionChange;
     }
 
+    private void initFiles(UnionChange unionChange) {
+        List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda()
+                .eq(Multifile::getObjId, unionChange.getId() )
+                .in(Multifile::getObjType, Arrays.asList(new Integer[]{Constants.MultiFile.WTB_CA_TBD_PDF.getKey(),Constants.MultiFile.WTB_CA_DONE_PDF.getKey()}))
+                .eq(Multifile::getIsdeleted,Constants.ZERO));
+        if(multifiles!=null){
+            String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()
+                    +systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode();
+            for(Multifile f : multifiles){
+                if(StringUtils.isBlank(f.getFileurl())){
+                    continue;
+                }
+                f.setFileurlFull(path+f.getFileurl());
+                if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.WTB_CA_TBD_PDF.getKey())){
+                    //绛剧讲鍚庣敵璇峰崟
+                    unionChange.setApplyFile(f);
+                }
+                if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.WTB_CA_DONE_PDF.getKey())){
+                    //绛剧讲鍚庣敵璇峰崟
+                    unionChange.setPidanFile(f);
+                }
+            }
+        }
+    }
 
 
     @Override
@@ -494,6 +519,7 @@
         }
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         UnionChange unionChange = this.unionChangeDetail(smsCheckDTO.getBusinessId());
+        unionChange.setStatus(Constants.formatIntegerNum(unionChange.getStatus()));
         if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
@@ -506,7 +532,7 @@
         if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"瀵逛笉璧凤紝鍚堝苟鍗曚笟鍔″凡鍏抽棴");
         }
-        if(unionChange.getStatus().equals(Constants.UnionChangeStatus.MERGE.getKey())){
+        if(!unionChange.getStatus().equals(Constants.UnionChangeStatus.MERGE.getKey())){
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"瀵逛笉璧凤紝鍚堝苟鍗曠姸鎬佸凡娴佽浆");
         }
         Company company =  companyMapper.selectById(user.getCompanyId());
@@ -559,6 +585,8 @@
         if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
+        unionChange.setStatus(Constants.formatIntegerNum(unionChange.getStatus()));
+        unionChange.setShopId(Constants.formatIntegerNum(unionChange.getShopId()));
         if(!unionChange.getShopId().equals(user.getCompanyId())){
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"瀵逛笉璧烽潪鎮ㄧ殑鍚堝苟鍗曪紝鎮ㄦ棤娉曡繘琛屾搷浣滐紒");
         }
@@ -568,7 +596,7 @@
         if(unionChange.getStatus().equals(Constants.UnionChangeStatus.CLOSE.getKey())){
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"瀵逛笉璧凤紝鍚堝苟鍗曚笟鍔″凡鍏抽棴");
         }
-        if(unionChange.getStatus().equals(Constants.UnionChangeStatus.UPLOAD_INSURANCE_POLICY.getKey())){
+        if(!unionChange.getStatus().equals(Constants.UnionChangeStatus.UPLOAD_INSURANCE_POLICY.getKey())){
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"瀵逛笉璧凤紝鍚堝苟鍗曠姸鎬佸凡娴佽浆");
         }
 
@@ -608,15 +636,15 @@
                         ||StringUtils.isBlank(m.getFileurl())
                         ||StringUtils.isBlank(m.getName())
                 ){
-                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍔犲噺淇�/鎹㈠巶涓氬姟鎵瑰崟鏂囦欢淇℃伅缂哄け");
+                    throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鎵瑰崟鏂囦欢淇℃伅缂哄け");
                 }
-                multifile.setIsdeleted(Constants.ZERO);
-                multifile.setCreator(user.getId());
-                multifile.setCreateDate(new Date());
-                multifile.setCreateDate(new Date());
-                multifile.setObjType(Constants.MultiFile.CA_PD_PDF.getKey());
-                multifile.setType(Constants.TWO);
-                multifileMapper.insert(multifile);
+                m.setId(null);
+                m.setIsdeleted(Constants.ZERO);
+                m.setCreator(user.getId());
+                m.setCreateDate(new Date());
+                m.setObjType(Constants.MultiFile.CA_PD_PDF.getKey());
+                m.setType(Constants.TWO);
+                multifileMapper.insert(m);
             }
         }
 
@@ -628,7 +656,12 @@
                 applyChange.setEditDate(new Date());
                 applyChange.setEditor(user.getId());
                 applyChange.setStatus(Constants.ApplyChangeStatus.APPROVE.getKey());
-                List<ApplyChagneDetail> allList = applyChagneDetailJoinMapper.selectList(new QueryWrapper<ApplyChagneDetail>().lambda().eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId()));
+                List<ApplyChagneDetail> allList = applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class,
+                        new MPJLambdaWrapper<ApplyChagneDetail>().selectAll(ApplyChagneDetail.class)
+                                .selectAs(Member::getName,ApplyChagneDetail::getMemberName )
+                                .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo )
+                                .leftJoin(Member.class,Member::getId,ApplyChagneDetail::getMemberId)
+                                .eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId()));
                 this.dealApplyChangeDetail(applyChange,allList);
                 applyChange.setCode(unionChangeBXDDTO.getCode());
                 applyChange.setCheckUserId(user.getId());

--
Gitblit v1.9.3