瀏覽代碼

feat(密码):密码加密

liutao 8 月之前
父節點
當前提交
1674148229

+ 36 - 10
src/main/java/com/sunxung/factoring/service/supplier/impl/SupplierApprovalFirstServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.sunxung.factoring.component.util.CollectionUtil;
 import com.sunxung.factoring.component.util.ConstantConversionUtil;
 import com.sunxung.factoring.component.util.ConstantUtil;
+import com.sunxung.factoring.component.util.StringUtil;
 import com.sunxung.factoring.dict.impl.FileModuleDict;
 import com.sunxung.factoring.entity.ResponseJson;
 import com.sunxung.factoring.entity.credit.CreditDetail;
@@ -308,8 +309,13 @@ public class SupplierApprovalFirstServiceImpl extends ServiceImpl<SupplierApprov
                     if(creditInfo != null){
                         List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                         if(CollectionUtil.isNotEmpty(creditDetails)){
-                            List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                            creditInvestigationInfoHistory.setCreditDetailFiles(creditDetailFiles);
+                            CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                            if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                                List<FileStorage> list = new ArrayList<>();
+                                FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                                list.add(creditDetailFiles);
+                                creditInvestigationInfoHistory.setCreditDetailFiles(list);
+                            }
                         }
                     }
                     List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
@@ -339,8 +345,13 @@ public class SupplierApprovalFirstServiceImpl extends ServiceImpl<SupplierApprov
                         if(creditInfo != null){
                             List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                             if(CollectionUtil.isNotEmpty(creditDetails)){
-                                List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                                creditInvestigationInfoHistory.setCreditDetailFiles(creditDetailFiles);
+                                CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                                if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                                    List<FileStorage> list = new ArrayList<>();
+                                    FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                                    list.add(creditDetailFiles);
+                                    creditInvestigationInfoHistory.setCreditDetailFiles(list);
+                                }
                             }
                         }
                         creditSituation.setCreditInvestigationInfoHistory(creditInvestigationInfoHistory);
@@ -362,8 +373,13 @@ public class SupplierApprovalFirstServiceImpl extends ServiceImpl<SupplierApprov
         if(creditInfo != null){
             List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
             if(CollectionUtil.isNotEmpty(creditDetails)){
-                List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                corporateGoodwill.setCreditDetailFiles(creditDetailFiles);
+                CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                    List<FileStorage> list = new ArrayList<>();
+                    FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                    list.add(creditDetailFiles);
+                    corporateGoodwill.setCreditDetailFiles(list);
+                }
             }
         }
         enterprise.setCorporateGoodwill(corporateGoodwill);
@@ -742,8 +758,13 @@ public class SupplierApprovalFirstServiceImpl extends ServiceImpl<SupplierApprov
                     if(creditInfo != null){
                         List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                         if(CollectionUtil.isNotEmpty(creditDetails)){
-                            List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                            creditInvestigationInfoHistory.setCreditDetailFiles(creditDetailFiles);
+                            CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                            if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                                List<FileStorage> list = new ArrayList<>();
+                                FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                                list.add(creditDetailFiles);
+                                creditInvestigationInfoHistory.setCreditDetailFiles(list);
+                            }
                         }
                     }
                     List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
@@ -761,8 +782,13 @@ public class SupplierApprovalFirstServiceImpl extends ServiceImpl<SupplierApprov
         if(creditInfo != null){
             List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
             if(CollectionUtil.isNotEmpty(creditDetails)){
-                List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                corporateGoodwill.setCreditDetailFiles(creditDetailFiles);
+                CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                    List<FileStorage> list = new ArrayList<>();
+                    FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                    list.add(creditDetailFiles);
+                    corporateGoodwill.setCreditDetailFiles(list);
+                }
             }
         }
         enterprise.setCorporateGoodwill(corporateGoodwill);

+ 28 - 8
src/main/java/com/sunxung/factoring/service/supplier/impl/SupplierInfoServiceImpl.java

@@ -483,8 +483,13 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
             if(creditInfo != null){
                 List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                 if(CollectionUtil.isNotEmpty(creditDetails)){
-                    List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                    corporateGoodwill.setCreditDetailFiles(creditDetailFiles);
+                    CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                    if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                        List<FileStorage> list = new ArrayList<>();
+                        FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                        list.add(creditDetailFiles);
+                        corporateGoodwill.setCreditDetailFiles(list);
+                    }
                 }
             }
             //视频尽调的企业信誉
@@ -506,8 +511,13 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
                 if(creditInfo1 != null){
                     List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo1.getId());
                     if(CollectionUtil.isNotEmpty(creditDetails)){
-                        List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                        creditInvestigationInfoHistory.setCreditDetailFiles(creditDetailFiles);
+                        CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                        if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                            List<FileStorage> list = new ArrayList<>();
+                            FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                            list.add(creditDetailFiles);
+                            creditInvestigationInfoHistory.setCreditDetailFiles(list);
+                        }
                     }
                 }
                 List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
@@ -666,8 +676,13 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
                 if(creditInfo != null){
                     List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                     if(CollectionUtil.isNotEmpty(creditDetails)){
-                        List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                        creditInvestigationInfoHistory.setCreditDetailFiles(creditDetailFiles);
+                        CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                        if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                            List<FileStorage> list = new ArrayList<>();
+                            FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                            list.add(creditDetailFiles);
+                            creditInvestigationInfoHistory.setCreditDetailFiles(list);
+                        }
                     }
                 }
                 List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
@@ -683,8 +698,13 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
             if(creditInfo != null){
                 List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                 if(CollectionUtil.isNotEmpty(creditDetails)){
-                    List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                    corporateGoodwill.setCreditDetailFiles(creditDetailFiles);
+                    CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                    if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())) {
+                        List<FileStorage> list = new ArrayList<>();
+                        FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                        list.add(creditDetailFiles);
+                        corporateGoodwill.setCreditDetailFiles(list);
+                    }
                 }
             }
             AttachmentDto attachmentDto = AttachmentDto.builder()

+ 15 - 4
src/main/java/com/sunxung/factoring/service/supplier/impl/VideoDueDiligenceServiceImpl.java

@@ -8,6 +8,7 @@ import com.sunxung.factoring.component.enums.ProjectAndEnterpriseStatusEnums;
 import com.sunxung.factoring.component.enums.SupplierStatusEnums;
 import com.sunxung.factoring.component.util.CollectionUtil;
 import com.sunxung.factoring.component.util.ConstantUtil;
+import com.sunxung.factoring.component.util.StringUtil;
 import com.sunxung.factoring.dict.impl.FileModuleDict;
 import com.sunxung.factoring.entity.ResponseJson;
 import com.sunxung.factoring.entity.credit.CreditDetail;
@@ -273,8 +274,13 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
             if (creditInfo != null) {
                 List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
                 if (CollectionUtil.isNotEmpty(creditDetails)) {
-                    List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                    creditInvestigationInfoHistory.setCreditDetailFiles(creditDetailFiles);
+                    CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                    if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                        List<FileStorage> fileList = new ArrayList<>();
+                        FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                        fileList.add(creditDetailFiles);
+                        creditInvestigationInfoHistory.setCreditDetailFiles(fileList);
+                    }
                 }
             }
             List<FileStorageDO> cardFiles = fileService.findByBusinessId(creditInvestigationInfoHistory.getId(), FileModuleDict.ChildEnum.ENTERPRISE_IDCARD_FILES_HISTORY.getCode());
@@ -300,8 +306,13 @@ public class VideoDueDiligenceServiceImpl extends ServiceImpl<VideoDueDiligenceM
         if (creditInfo != null) {
             List<CreditDetail> creditDetails = creditDetailService.getByCreditId(creditInfo.getId());
             if (CollectionUtil.isNotEmpty(creditDetails)) {
-                List<FileStorage> creditDetailFiles = creditDetails.stream().map(r -> fileStorageService.get(Long.valueOf(r.getCreditAddress()))).collect(Collectors.toList());
-                corporateGoodwill.setCreditDetailFiles(creditDetailFiles);
+                CreditDetail creditDetail = creditDetails.get(creditDetails.size() - 1);
+                if(StringUtil.isNotEmpty(creditDetail.getCreditAddress())){
+                    List<FileStorage> fileList = new ArrayList<>();
+                    FileStorage creditDetailFiles = fileStorageService.get(Long.valueOf(creditDetail.getCreditAddress()));
+                    fileList.add(creditDetailFiles);
+                    corporateGoodwill.setCreditDetailFiles(fileList);
+                }
             }
         }
         corporateGoodwill.setQuestion("有无其他融资渠道?融资缺口有多少?");