Przeglądaj źródła

付款审核优化

liuj 1 miesiąc temu
rodzic
commit
16a7e565b0

+ 28 - 28
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyServiceImpl.java

@@ -532,35 +532,35 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
         List<FileStorage> acceptanceFiles = new ArrayList<>();
         CFinancingBasicInfo financingBasicInfo = financingBasicInfoService.getById(financingBasicInfoId);
         if (financingBasicInfo != null) {
-            Map<String, Object> map = financingGoodsInfoService.getMap(new QueryWrapper<CFinancingGoodsInfo>().select("DISTINCT acceptance_basic_info_id")
+            List<CFinancingGoodsInfo> financingGoodsInfoList = financingGoodsInfoService.list(new QueryWrapper<CFinancingGoodsInfo>()
+                    .select("DISTINCT acceptance_basic_info_id AS cAcceptanceBasicInfoId")
                     .eq("c_financing_basic_info_id", financingBasicInfo.getId()));
-            List<Long> acceptanceBasicInfoIds = (List<Long>) map.get("acceptance_basic_info_id");
-            if (CollectionUtil.isNotEmpty(acceptanceBasicInfoIds)) {
-//                for (CFinancingGoodsInfo goodsInfo : financingGoodsInfoList) {
-//                    if (goodsInfo.getcAcceptanceBasicInfoId() != null) {
-//                        AcceptanceSignConfirmation acceptanceSignConfirmation = acceptanceSignConfirmationService.lambdaQuery()
-//                                .eq(AcceptanceSignConfirmation::getAcceptanceBasicInfoId, goodsInfo.getcAcceptanceBasicInfoId()).one();
-//                        if (acceptanceSignConfirmation != null) {
-//                            List<AcceptanceSignConfirmationElectronicInfo> acceptanceSignConfirmationElectronicInfos = acceptanceSignConfirmationElectronicInfoService.lambdaQuery()
-//                                    .eq(AcceptanceSignConfirmationElectronicInfo::getAcceptanceSignConfirmationId, acceptanceSignConfirmation.getId())
-//                                    .eq(AcceptanceSignConfirmationElectronicInfo::getCallBack, 1)
-//                                    .list();
-//                            if (CollectionUtil.isNotEmpty(acceptanceSignConfirmationElectronicInfos)) {
-//                                acceptanceSignConfirmationElectronicInfos.forEach(x -> {
-//                                    //获取已签署文件
-//                                    AttachmentDto attachmentDto = AttachmentDto.builder()
-//                                            .setEntityId(x.getId())
-//                                            .setChildEnum(FileModuleDict.ChildEnum.ACCEPTANCE_SIGN_CONFIRM_BACK_FILE)
-//                                            .build();
-//                                    List<FileStorage> files = sysAttachmentRefService.getFiles(attachmentDto);
-//                                    if (CollectionUtil.isNotEmpty(files)) {
-//                                        acceptanceFiles.addAll(files);
-//                                    }
-//                                });
-//                            }
-//                        }
-//                    }
-//                }
+            if (CollectionUtil.isNotEmpty(financingGoodsInfoList)) {
+                for (CFinancingGoodsInfo goodsInfo : financingGoodsInfoList) {
+                    if (goodsInfo.getcAcceptanceBasicInfoId() != null) {
+                        AcceptanceSignConfirmation acceptanceSignConfirmation = acceptanceSignConfirmationService.lambdaQuery()
+                                .eq(AcceptanceSignConfirmation::getAcceptanceBasicInfoId, goodsInfo.getcAcceptanceBasicInfoId()).one();
+                        if (acceptanceSignConfirmation != null) {
+                            List<AcceptanceSignConfirmationElectronicInfo> acceptanceSignConfirmationElectronicInfos = acceptanceSignConfirmationElectronicInfoService.lambdaQuery()
+                                    .eq(AcceptanceSignConfirmationElectronicInfo::getAcceptanceSignConfirmationId, acceptanceSignConfirmation.getId())
+                                    .eq(AcceptanceSignConfirmationElectronicInfo::getCallBack, 1)
+                                    .list();
+                            if (CollectionUtil.isNotEmpty(acceptanceSignConfirmationElectronicInfos)) {
+                                acceptanceSignConfirmationElectronicInfos.forEach(x -> {
+                                    //获取已签署文件
+                                    AttachmentDto attachmentDto = AttachmentDto.builder()
+                                            .setEntityId(x.getId())
+                                            .setChildEnum(FileModuleDict.ChildEnum.ACCEPTANCE_SIGN_CONFIRM_BACK_FILE)
+                                            .build();
+                                    List<FileStorage> files = sysAttachmentRefService.getFiles(attachmentDto);
+                                    if (CollectionUtil.isNotEmpty(files)) {
+                                        acceptanceFiles.addAll(files);
+                                    }
+                                });
+                            }
+                        }
+                    }
+                }
             }
         }
         return acceptanceFiles;