Przeglądaj źródła

融资申请优化

liuj 8 miesięcy temu
rodzic
commit
8ea8457a15

+ 32 - 6
src/main/java/com/sunxung/factoring/entity/financing/review/ReviewQuotaDisburseHis.java

@@ -19,6 +19,16 @@ public class ReviewQuotaDisburseHis extends BaseEntity {
      */
     private Long reviewQuotaDisburseId;
 
+    /**
+     * 审批结论
+     */
+    private String approvalConclusion;
+
+    /**
+     * 审批意见
+     */
+    private String approvalComments;
+
     /**
      * 业务编号
      */
@@ -70,13 +80,13 @@ public class ReviewQuotaDisburseHis extends BaseEntity {
      * 有无相关还款责任人:0无、1有
      **/
     @TableField("is_resp_repay")
-    private boolean respRepay;
+    private Boolean respRepay;
 
     /**
      * 有无抵质押:0无、1有
      **/
     @TableField("is_mortgage_info")
-    private boolean mortgageInfo;
+    private Boolean mortgageInfo;
 
     /**
      * 预期Irr(字符串)
@@ -196,19 +206,19 @@ public class ReviewQuotaDisburseHis extends BaseEntity {
         this.quotaDisburseBatch = quotaDisburseBatch;
     }
 
-    public boolean isRespRepay() {
+    public Boolean getRespRepay() {
         return respRepay;
     }
 
-    public void setRespRepay(boolean respRepay) {
+    public void setRespRepay(Boolean respRepay) {
         this.respRepay = respRepay;
     }
 
-    public boolean isMortgageInfo() {
+    public Boolean getMortgageInfo() {
         return mortgageInfo;
     }
 
-    public void setMortgageInfo(boolean mortgageInfo) {
+    public void setMortgageInfo(Boolean mortgageInfo) {
         this.mortgageInfo = mortgageInfo;
     }
 
@@ -299,4 +309,20 @@ public class ReviewQuotaDisburseHis extends BaseEntity {
     public void setReviewBasicContractHisList(List<ReviewBasicContractHis> reviewBasicContractHisList) {
         this.reviewBasicContractHisList = reviewBasicContractHisList;
     }
+
+    public String getApprovalConclusion() {
+        return approvalConclusion;
+    }
+
+    public void setApprovalConclusion(String approvalConclusion) {
+        this.approvalConclusion = approvalConclusion;
+    }
+
+    public String getApprovalComments() {
+        return approvalComments;
+    }
+
+    public void setApprovalComments(String approvalComments) {
+        this.approvalComments = approvalComments;
+    }
 }

+ 1 - 1
src/main/java/com/sunxung/factoring/service/financing/apply/impl/FinancingApplyServiceImpl.java

@@ -322,7 +322,7 @@ public class FinancingApplyServiceImpl implements FinancingApplyService {
 
         ReviewQuotaDisburse reviewQuotaDisburse = reviewQuotaDisburseService.getOne(new QueryWrapper<ReviewQuotaDisburse>()
                 .eq("c_financing_basic_info_id", financingBasicInfo.getId())
-                .eq("approval_conclusion", ConstantConversionUtil.APPROVAL_RESULT_PASS));
+                .orderByDesc("id").last("LIMIT 1"));
 
         if (reviewQuotaDisburse == null) {
             reviewQuotaDisburse = new ReviewQuotaDisburse();

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

@@ -440,8 +440,6 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
             //无相关还款责任人
             quotaDisburseReport.setRespRepay(0);
         }
-        //保证信息
-        reviewQuotaDisburse.getMortgageInfo()
     }
 
     /**

+ 247 - 232
src/main/java/com/sunxung/factoring/service/financing/review/impl/ReviewQuotaDisburseServiceImpl.java

@@ -238,7 +238,9 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
     public void editReviewQuotaDisburse(ReviewQuotaDisburse quotaDisburse) throws Exception {
         if (null != quotaDisburse) {
             // 验证额度支用数据的合法性
-            checkQuotaDisburseLegality(quotaDisburse);
+            if (ConstantConversionUtil.APPROVAL_RESULT_PASS.equals(quotaDisburse.getApprovalConclusion())) {
+                checkQuotaDisburseLegality(quotaDisburse);
+            }
             //IRR处理
             if (quotaDisburse.getPlanIrrStr() != null) {
                 Number number = PercentageUtil.convertDouble(quotaDisburse.getPlanIrrStr());
@@ -262,6 +264,9 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
                         financingBasicInfo.setFinancingAmount(quotaDisburse.getReviewFinancingInfo().getFinancingAmount());
                     }
                     financingBasicInfoService.updateById(financingBasicInfo);
+                }else if (ConstantConversionUtil.APPROVAL_RESULT_BACK.equals(quotaDisburse.getApprovalConclusion())){
+                    financingBasicInfo.setCurrentStage("");
+                    financingBasicInfoService.updateById(financingBasicInfo);
                 }
 
                 Map<String, Object> procVariables = new HashMap<>();
@@ -298,232 +303,236 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
         //保存主表历史信息
         ReviewQuotaDisburseHis reviewQuotaDisburseHis = new ReviewQuotaDisburseHis();
         BeanUtils.copyProperties(quotaDisburse, reviewQuotaDisburseHis, "id");
+        reviewQuotaDisburseHis.setReviewQuotaDisburseId(quotaDisburse.getId());
         reviewQuotaDisburseHisService.save(reviewQuotaDisburseHis);
         // 融资信息
-        ReviewFinancingInfo financingInfo = reviewFinancingInfoService.getOne(new QueryWrapper<ReviewFinancingInfo>().eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (financingInfo != null) {
-            ReviewFinancingInfoHis reviewFinancingInfoHis = new ReviewFinancingInfoHis();
-            BeanUtils.copyProperties(financingInfo, reviewFinancingInfoHis, "id");
-            reviewFinancingInfoHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-            reviewFinancingInfoHisService.save(reviewFinancingInfoHis);
-        }
-        // 填充收支计划信息
-        List<ReviewIncomeExpenditurePlan> list = reviewIncomeExpenditurePlanService.list(new QueryWrapper<ReviewIncomeExpenditurePlan>().eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (list != null && list.size() > 0) {
-            for (ReviewIncomeExpenditurePlan reviewIncomeExpenditurePlan : list) {
-                ReviewIncomeExpenditurePlanHis reviewIncomeExpenditurePlanHis = new ReviewIncomeExpenditurePlanHis();
-                BeanUtils.copyProperties(reviewIncomeExpenditurePlan, reviewIncomeExpenditurePlanHis, "id");
-                reviewIncomeExpenditurePlanHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-                reviewIncomeExpenditurePlanHisService.save(reviewIncomeExpenditurePlanHis);
+        if (ConstantConversionUtil.APPROVAL_RESULT_PASS.equals(quotaDisburse.getApprovalConclusion())) {
+            ReviewFinancingInfo financingInfo = reviewFinancingInfoService.getOne(new QueryWrapper<ReviewFinancingInfo>().eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (financingInfo != null) {
+                ReviewFinancingInfoHis reviewFinancingInfoHis = new ReviewFinancingInfoHis();
+                BeanUtils.copyProperties(financingInfo, reviewFinancingInfoHis, "id");
+                reviewFinancingInfoHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                reviewFinancingInfoHisService.save(reviewFinancingInfoHis);
             }
-        }
-        // 填充主合同信息
-        ReviewMasterContract masterContract = reviewMasterContractService.getOne(new QueryWrapper<ReviewMasterContract>()
-                .eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (null != masterContract) {
-            ReviewMasterContractHis reviewMasterContractHis = new ReviewMasterContractHis();
-            BeanUtils.copyProperties(masterContract, reviewMasterContractHis, "id");
-            reviewMasterContractHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-            reviewMasterContractHisService.save(reviewMasterContractHis);
-            List<ReviewMasterContractDebtor> reviewMasterContractDebtorList = reviewMasterContractDebtorService.list(new QueryWrapper<ReviewMasterContractDebtor>().eq("review_master_contract_id", masterContract.getId()));
-            if (null != reviewMasterContractDebtorList && reviewMasterContractDebtorList.size() > 0) {
-                for (ReviewMasterContractDebtor reviewMasterContractDebtor : reviewMasterContractDebtorList) {
-                    ReviewMasterContractDebtorHis debtorHis = new ReviewMasterContractDebtorHis();
-                    BeanUtils.copyProperties(reviewMasterContractDebtor, debtorHis, "id");
-                    debtorHis.setReviewMasterContractHisId(reviewMasterContractHis.getId());
-                    reviewMasterContractDebtorHisService.save(debtorHis);
+            // 填充收支计划信息
+            List<ReviewIncomeExpenditurePlan> list = reviewIncomeExpenditurePlanService.list(new QueryWrapper<ReviewIncomeExpenditurePlan>().eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (list != null && list.size() > 0) {
+                for (ReviewIncomeExpenditurePlan reviewIncomeExpenditurePlan : list) {
+                    ReviewIncomeExpenditurePlanHis reviewIncomeExpenditurePlanHis = new ReviewIncomeExpenditurePlanHis();
+                    BeanUtils.copyProperties(reviewIncomeExpenditurePlan, reviewIncomeExpenditurePlanHis, "id");
+                    reviewIncomeExpenditurePlanHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                    reviewIncomeExpenditurePlanHisService.save(reviewIncomeExpenditurePlanHis);
+                }
+            }
+            // 填充主合同信息
+            ReviewMasterContract masterContract = reviewMasterContractService.getOne(new QueryWrapper<ReviewMasterContract>()
+                    .eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (null != masterContract) {
+                ReviewMasterContractHis reviewMasterContractHis = new ReviewMasterContractHis();
+                BeanUtils.copyProperties(masterContract, reviewMasterContractHis, "id");
+                reviewMasterContractHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                reviewMasterContractHisService.save(reviewMasterContractHis);
+                List<ReviewMasterContractDebtor> reviewMasterContractDebtorList = reviewMasterContractDebtorService.list(new QueryWrapper<ReviewMasterContractDebtor>().eq("review_master_contract_id", masterContract.getId()));
+                if (null != reviewMasterContractDebtorList && reviewMasterContractDebtorList.size() > 0) {
+                    for (ReviewMasterContractDebtor reviewMasterContractDebtor : reviewMasterContractDebtorList) {
+                        ReviewMasterContractDebtorHis debtorHis = new ReviewMasterContractDebtorHis();
+                        BeanUtils.copyProperties(reviewMasterContractDebtor, debtorHis, "id");
+                        debtorHis.setReviewMasterContractHisId(reviewMasterContractHis.getId());
+                        reviewMasterContractDebtorHisService.save(debtorHis);
+                    }
                 }
             }
-        }
 
-        // 填充应收转让信息
-        ReviewTransferReceivable transferReceivable = reviewTransferReceivableService.getOne(new QueryWrapper<ReviewTransferReceivable>()
-                .eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (null != transferReceivable) {
-            ReviewTransferReceivableHis transferReceivableHis = new ReviewTransferReceivableHis();
-            BeanUtils.copyProperties(transferReceivable, transferReceivableHis, "id");
-            transferReceivableHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-            reviewTransferReceivableHisService.save(transferReceivableHis);
-        }
+            // 填充应收转让信息
+            ReviewTransferReceivable transferReceivable = reviewTransferReceivableService.getOne(new QueryWrapper<ReviewTransferReceivable>()
+                    .eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (null != transferReceivable) {
+                ReviewTransferReceivableHis transferReceivableHis = new ReviewTransferReceivableHis();
+                BeanUtils.copyProperties(transferReceivable, transferReceivableHis, "id");
+                transferReceivableHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                reviewTransferReceivableHisService.save(transferReceivableHis);
+            }
+
+            // 填充基础交易合同信息
+            List<ReviewBasicContract> reviewBasicContracts = reviewBasicContractService.list(new QueryWrapper<ReviewBasicContract>()
+                    .eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (null != reviewBasicContracts && reviewBasicContracts.size() > 0) {
+                for (ReviewBasicContract reviewBasicContract : reviewBasicContracts) {
+                    ReviewBasicContractHis reviewBasicContractHis = new ReviewBasicContractHis();
+                    BeanUtils.copyProperties(reviewBasicContract, reviewBasicContractHis, "id");
+                    reviewBasicContractHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                    reviewBasicContractHisService.save(reviewBasicContractHis);
 
-        // 填充基础交易合同信息
-        List<ReviewBasicContract> reviewBasicContracts = reviewBasicContractService.list(new QueryWrapper<ReviewBasicContract>()
-                .eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (null != reviewBasicContracts && reviewBasicContracts.size() > 0) {
-            for (ReviewBasicContract reviewBasicContract : reviewBasicContracts) {
-                ReviewBasicContractHis reviewBasicContractHis = new ReviewBasicContractHis();
-                BeanUtils.copyProperties(reviewBasicContract, reviewBasicContractHis, "id");
-                reviewBasicContractHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-                reviewBasicContractHisService.save(reviewBasicContractHis);
-
-                List<ReviewBasicContractChangeContent> reviewBasicContractChangeContentList = reviewBasicContractChangeContentService.list(new QueryWrapper<ReviewBasicContractChangeContent>()
-                        .eq("review_basic_contract_id", reviewBasicContract.getId()));
-                if (reviewBasicContractChangeContentList != null && reviewBasicContractChangeContentList.size() > 0) {
-                    for (ReviewBasicContractChangeContent reviewBasicContractChangeContent : reviewBasicContractChangeContentList) {
-                        ReviewBasicContractChangeContentHis contractChangeContentHis = new ReviewBasicContractChangeContentHis();
-                        BeanUtils.copyProperties(reviewBasicContractChangeContent, contractChangeContentHis, "id");
-                        contractChangeContentHis.setReviewBasicContractHisId(reviewBasicContractHis.getId());
-                        reviewBasicContractChangeContentHisService.save(contractChangeContentHis);
+                    List<ReviewBasicContractChangeContent> reviewBasicContractChangeContentList = reviewBasicContractChangeContentService.list(new QueryWrapper<ReviewBasicContractChangeContent>()
+                            .eq("review_basic_contract_id", reviewBasicContract.getId()));
+                    if (reviewBasicContractChangeContentList != null && reviewBasicContractChangeContentList.size() > 0) {
+                        for (ReviewBasicContractChangeContent reviewBasicContractChangeContent : reviewBasicContractChangeContentList) {
+                            ReviewBasicContractChangeContentHis contractChangeContentHis = new ReviewBasicContractChangeContentHis();
+                            BeanUtils.copyProperties(reviewBasicContractChangeContent, contractChangeContentHis, "id");
+                            contractChangeContentHis.setReviewBasicContractHisId(reviewBasicContractHis.getId());
+                            reviewBasicContractChangeContentHisService.save(contractChangeContentHis);
+                        }
                     }
                 }
             }
-        }
 //        // 填充授信信息
 //        ReviewCreditInfo creditInfo = reviewCreditInfoService.getReviewCreditInfoForView(entityId);
 //        if (null != creditInfo) {
 //            creditInfo.setReviewQuotaDisburse(quotaDisburse);
 //            reviewCreditInfoService.addReviewCreditInfoHistory(creditInfo);
 //        }
-        // 2021.7.18新增 填充相关还款责任人信息
-        List<ReviewRltRepay> reviewRltRepayList = reviewRltRepayService.list(new QueryWrapper<ReviewRltRepay>().eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (null != reviewRltRepayList && reviewRltRepayList.size() > 0) {
-            for (ReviewRltRepay reviewRltRepay : reviewRltRepayList) {
-                ReviewRltRepayHis reviewRltRepayHis = new ReviewRltRepayHis();
-                BeanUtils.copyProperties(reviewRltRepay, reviewRltRepayHis, "id");
-                reviewRltRepayHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-                reviewRltRepayHisService.save(reviewRltRepayHis);
-                //保存附件
-                List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewRltRepay.getId())
-                        .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.GUARANTEEINFO_FILE).list();
-                if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
-                    reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
-                        ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
-                        reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
-                        reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
-                        reviewGuaranteeFileHis.setGuaranteeId(reviewRltRepayHis.getId());
-                        reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
-                    });
-                }
-                // 新增房产信息
-                List<ReviewRltRepayEstate> reviewRltRepayEstates = reviewRltRepayEstateService.lambdaQuery().eq(ReviewRltRepayEstate::getReviewRltRepayId, reviewRltRepay.getId()).list();
-                if (CollectionUtil.isNotEmpty(reviewRltRepayEstates)) {
-                    reviewRltRepayEstates.forEach(reviewRltRepayEstate -> {
-                        ReviewRltRepayEstateHistory reviewRltRepayEstateHistory = new ReviewRltRepayEstateHistory();
-                        BeanUtils.copyProperties(reviewRltRepayEstate, reviewRltRepayEstateHistory, "id");
-                        reviewRltRepayEstateHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
-                        reviewRltRepayEstateHistoryService.save(reviewRltRepayEstateHistory);
-                    });
-                }
-                // 新增土地信息
-                List<ReviewRltRepayLand> reviewRltRepayLands = reviewRltRepayLandService.lambdaQuery().eq(ReviewRltRepayLand::getReviewRltRepayId, reviewRltRepay.getId()).list();
-                if (CollectionUtil.isNotEmpty(reviewRltRepayLands)) {
-                    reviewRltRepayLands.forEach(reviewRltRepayLand -> {
-                        ReviewRltRepayLandHistory reviewRltRepayLandHistory = new ReviewRltRepayLandHistory();
-                        BeanUtils.copyProperties(reviewRltRepayLand, reviewRltRepayLandHistory, "id");
-                        reviewRltRepayLandHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
-                        reviewRltRepayLandHistoryService.save(reviewRltRepayLandHistory);
-                    });
-                }
-                // 新增车辆信息
-                List<ReviewRltRepayVehicle> reviewRltRepayVehicles = reviewRltRepayVehicleService.lambdaQuery().eq(ReviewRltRepayVehicle::getReviewRltRepayId, reviewRltRepay.getId()).list();
-                if (CollectionUtil.isNotEmpty(reviewRltRepayVehicles)) {
-                    reviewRltRepayVehicles.forEach(reviewRltRepayVehicle -> {
-                        ReviewRltRepayVehicleHistory reviewRltRepayVehicleHistory = new ReviewRltRepayVehicleHistory();
-                        BeanUtils.copyProperties(reviewRltRepayVehicle, reviewRltRepayVehicleHistory, "id");
-                        reviewRltRepayVehicleHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
-                        reviewRltRepayVehicleHistoryService.save(reviewRltRepayVehicleHistory);
-                    });
-                }
-                // 新增股权资产信息
-                List<ReviewRltRepayEquityAssets> reviewRltRepayEquityAssets = reviewRltRepayEquityAssetsService.lambdaQuery().eq(ReviewRltRepayEquityAssets::getReviewRltRepayId, reviewRltRepay.getId()).list();
-                if (CollectionUtil.isNotEmpty(reviewRltRepayEquityAssets)) {
-                    reviewRltRepayEquityAssets.forEach(reviewRltRepayEquityAsset -> {
-                        ReviewRltRepayEquityAssetsHistory reviewRltRepayEquityAssetsHistory = new ReviewRltRepayEquityAssetsHistory();
-                        BeanUtils.copyProperties(reviewRltRepayEquityAsset, reviewRltRepayEquityAssetsHistory, "id");
-                        reviewRltRepayEquityAssetsHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
-                        reviewRltRepayEquityAssetsHistoryService.save(reviewRltRepayEquityAssetsHistory);
-                    });
-                }
-                // 新增其他资产信息
-                List<ReviewRltRepayOtherAssets> reviewRltRepayOtherAssets = reviewRltRepayOtherAssetsService.lambdaQuery().eq(ReviewRltRepayOtherAssets::getReviewRltRepayId, reviewRltRepay.getId()).list();
-                if (CollectionUtil.isNotEmpty(reviewRltRepayOtherAssets)) {
-                    reviewRltRepayOtherAssets.forEach(reviewRltRepayOtherAsset -> {
-                        ReviewRltRepayOtherAssetsHistory reviewRltRepayOtherAssetsHistory = new ReviewRltRepayOtherAssetsHistory();
-                        BeanUtils.copyProperties(reviewRltRepayOtherAsset, reviewRltRepayOtherAssetsHistory, "id");
-                        reviewRltRepayOtherAssetsHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
-                        reviewRltRepayOtherAssetsHistoryService.save(reviewRltRepayOtherAssetsHistory);
-                    });
+            // 2021.7.18新增 填充相关还款责任人信息
+            List<ReviewRltRepay> reviewRltRepayList = reviewRltRepayService.list(new QueryWrapper<ReviewRltRepay>().eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (null != reviewRltRepayList && reviewRltRepayList.size() > 0) {
+                for (ReviewRltRepay reviewRltRepay : reviewRltRepayList) {
+                    ReviewRltRepayHis reviewRltRepayHis = new ReviewRltRepayHis();
+                    BeanUtils.copyProperties(reviewRltRepay, reviewRltRepayHis, "id");
+                    reviewRltRepayHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                    reviewRltRepayHisService.save(reviewRltRepayHis);
+                    //保存附件
+                    List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewRltRepay.getId())
+                            .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.GUARANTEEINFO_FILE).list();
+                    if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
+                        reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
+                            ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
+                            reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
+                            reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
+                            reviewGuaranteeFileHis.setGuaranteeId(reviewRltRepayHis.getId());
+                            reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
+                        });
+                    }
+                    // 新增房产信息
+                    List<ReviewRltRepayEstate> reviewRltRepayEstates = reviewRltRepayEstateService.lambdaQuery().eq(ReviewRltRepayEstate::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                    if (CollectionUtil.isNotEmpty(reviewRltRepayEstates)) {
+                        reviewRltRepayEstates.forEach(reviewRltRepayEstate -> {
+                            ReviewRltRepayEstateHistory reviewRltRepayEstateHistory = new ReviewRltRepayEstateHistory();
+                            BeanUtils.copyProperties(reviewRltRepayEstate, reviewRltRepayEstateHistory, "id");
+                            reviewRltRepayEstateHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
+                            reviewRltRepayEstateHistoryService.save(reviewRltRepayEstateHistory);
+                        });
+                    }
+                    // 新增土地信息
+                    List<ReviewRltRepayLand> reviewRltRepayLands = reviewRltRepayLandService.lambdaQuery().eq(ReviewRltRepayLand::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                    if (CollectionUtil.isNotEmpty(reviewRltRepayLands)) {
+                        reviewRltRepayLands.forEach(reviewRltRepayLand -> {
+                            ReviewRltRepayLandHistory reviewRltRepayLandHistory = new ReviewRltRepayLandHistory();
+                            BeanUtils.copyProperties(reviewRltRepayLand, reviewRltRepayLandHistory, "id");
+                            reviewRltRepayLandHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
+                            reviewRltRepayLandHistoryService.save(reviewRltRepayLandHistory);
+                        });
+                    }
+                    // 新增车辆信息
+                    List<ReviewRltRepayVehicle> reviewRltRepayVehicles = reviewRltRepayVehicleService.lambdaQuery().eq(ReviewRltRepayVehicle::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                    if (CollectionUtil.isNotEmpty(reviewRltRepayVehicles)) {
+                        reviewRltRepayVehicles.forEach(reviewRltRepayVehicle -> {
+                            ReviewRltRepayVehicleHistory reviewRltRepayVehicleHistory = new ReviewRltRepayVehicleHistory();
+                            BeanUtils.copyProperties(reviewRltRepayVehicle, reviewRltRepayVehicleHistory, "id");
+                            reviewRltRepayVehicleHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
+                            reviewRltRepayVehicleHistoryService.save(reviewRltRepayVehicleHistory);
+                        });
+                    }
+                    // 新增股权资产信息
+                    List<ReviewRltRepayEquityAssets> reviewRltRepayEquityAssets = reviewRltRepayEquityAssetsService.lambdaQuery().eq(ReviewRltRepayEquityAssets::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                    if (CollectionUtil.isNotEmpty(reviewRltRepayEquityAssets)) {
+                        reviewRltRepayEquityAssets.forEach(reviewRltRepayEquityAsset -> {
+                            ReviewRltRepayEquityAssetsHistory reviewRltRepayEquityAssetsHistory = new ReviewRltRepayEquityAssetsHistory();
+                            BeanUtils.copyProperties(reviewRltRepayEquityAsset, reviewRltRepayEquityAssetsHistory, "id");
+                            reviewRltRepayEquityAssetsHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
+                            reviewRltRepayEquityAssetsHistoryService.save(reviewRltRepayEquityAssetsHistory);
+                        });
+                    }
+                    // 新增其他资产信息
+                    List<ReviewRltRepayOtherAssets> reviewRltRepayOtherAssets = reviewRltRepayOtherAssetsService.lambdaQuery().eq(ReviewRltRepayOtherAssets::getReviewRltRepayId, reviewRltRepay.getId()).list();
+                    if (CollectionUtil.isNotEmpty(reviewRltRepayOtherAssets)) {
+                        reviewRltRepayOtherAssets.forEach(reviewRltRepayOtherAsset -> {
+                            ReviewRltRepayOtherAssetsHistory reviewRltRepayOtherAssetsHistory = new ReviewRltRepayOtherAssetsHistory();
+                            BeanUtils.copyProperties(reviewRltRepayOtherAsset, reviewRltRepayOtherAssetsHistory, "id");
+                            reviewRltRepayOtherAssetsHistory.setReviewRltRepayId(reviewRltRepayHis.getId());
+                            reviewRltRepayOtherAssetsHistoryService.save(reviewRltRepayOtherAssetsHistory);
+                        });
+                    }
                 }
             }
-        }
-        //新增 填充抵质押信息
-        List<ReviewQuotaMortgageRel> quotaMortgageRelList = reviewQuotaMortgageRelService.list(new QueryWrapper<ReviewQuotaMortgageRel>().eq("review_quota_disburse_id", quotaDisburse.getId()));
-        if (quotaMortgageRelList != null && !quotaMortgageRelList.isEmpty()) {
-            for (ReviewQuotaMortgageRel quotaMortgageRel : quotaMortgageRelList) {
-                ReviewMortgageBasicInfo mortgageBasicInfo = reviewMortgageBasicInfoService.getById(quotaMortgageRel.getReviewMortgageBasicId());
-                Long mortgageBasicInfoId = mortgageBasicInfo.getId();
-                if (mortgageBasicInfo != null && mortgageBasicInfo.getId() != null) {
-                    ReviewMortgageBasicInfoHis reviewMortgageBasicInfoHis = new ReviewMortgageBasicInfoHis();
-                    BeanUtils.copyProperties(mortgageBasicInfo, reviewMortgageBasicInfoHis, "id");
-                    reviewMortgageBasicInfoHisService.save(reviewMortgageBasicInfoHis);
-
-                    ReviewQuotaMortgageRelHis reviewQuotaMortgageRelHis = new ReviewQuotaMortgageRelHis();
-                    reviewQuotaMortgageRelHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
-                    reviewQuotaMortgageRelHis.setReviewMortgageBasicHisId(reviewMortgageBasicInfoHis.getId());
-                    reviewQuotaMortgageRelHisService.save(reviewQuotaMortgageRelHis);
-
-                    //获取抵押物信息
-                    List<ReviewMortgageCollateralInfo> collateralInfoList = reviewMortgageCollateralInfoService.list(new QueryWrapper<ReviewMortgageCollateralInfo>()
-                            .eq("review_mortgage_basic_id", mortgageBasicInfoId));
-                    if (collateralInfoList != null && collateralInfoList.size() > 0) {
-                        for (ReviewMortgageCollateralInfo reviewMortgageCollateralInfo : collateralInfoList) {
-                            ReviewMortgageCollateralInfoHis reviewMortgageCollateralInfoHis = new ReviewMortgageCollateralInfoHis();
-                            BeanUtils.copyProperties(reviewMortgageCollateralInfo, reviewMortgageCollateralInfoHis, "id");
-                            reviewMortgageCollateralInfoHis.setReviewMortgageBasicHisId(reviewMortgageBasicInfoHis.getId());
-                            reviewMortgageCollateralInfoHisService.save(reviewMortgageCollateralInfoHis);
-                            //保存附件
-                            List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewMortgageCollateralInfo.getId())
-                                    .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.CHATTELMORTGAGE_FILE).list();
-                            if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
-                                reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
-                                    ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
-                                    reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
-                                    reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
-                                    reviewGuaranteeFileHis.setGuaranteeId(reviewMortgageCollateralInfoHis.getId());
-                                    reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
-                                });
+            //新增 填充抵质押信息
+            List<ReviewQuotaMortgageRel> quotaMortgageRelList = reviewQuotaMortgageRelService.list(new QueryWrapper<ReviewQuotaMortgageRel>().eq("review_quota_disburse_id", quotaDisburse.getId()));
+            if (quotaMortgageRelList != null && !quotaMortgageRelList.isEmpty()) {
+                for (ReviewQuotaMortgageRel quotaMortgageRel : quotaMortgageRelList) {
+                    ReviewMortgageBasicInfo mortgageBasicInfo = reviewMortgageBasicInfoService.getById(quotaMortgageRel.getReviewMortgageBasicId());
+                    Long mortgageBasicInfoId = mortgageBasicInfo.getId();
+                    if (mortgageBasicInfo != null && mortgageBasicInfo.getId() != null) {
+                        ReviewMortgageBasicInfoHis reviewMortgageBasicInfoHis = new ReviewMortgageBasicInfoHis();
+                        BeanUtils.copyProperties(mortgageBasicInfo, reviewMortgageBasicInfoHis, "id");
+                        reviewMortgageBasicInfoHisService.save(reviewMortgageBasicInfoHis);
+
+                        ReviewQuotaMortgageRelHis reviewQuotaMortgageRelHis = new ReviewQuotaMortgageRelHis();
+                        reviewQuotaMortgageRelHis.setReviewQuotaDisburseHisId(reviewQuotaDisburseHis.getId());
+                        reviewQuotaMortgageRelHis.setReviewMortgageBasicHisId(reviewMortgageBasicInfoHis.getId());
+                        reviewQuotaMortgageRelHisService.save(reviewQuotaMortgageRelHis);
+
+                        //获取抵押物信息
+                        List<ReviewMortgageCollateralInfo> collateralInfoList = reviewMortgageCollateralInfoService.list(new QueryWrapper<ReviewMortgageCollateralInfo>()
+                                .eq("review_mortgage_basic_id", mortgageBasicInfoId));
+                        if (collateralInfoList != null && collateralInfoList.size() > 0) {
+                            for (ReviewMortgageCollateralInfo reviewMortgageCollateralInfo : collateralInfoList) {
+                                ReviewMortgageCollateralInfoHis reviewMortgageCollateralInfoHis = new ReviewMortgageCollateralInfoHis();
+                                BeanUtils.copyProperties(reviewMortgageCollateralInfo, reviewMortgageCollateralInfoHis, "id");
+                                reviewMortgageCollateralInfoHis.setReviewMortgageBasicHisId(reviewMortgageBasicInfoHis.getId());
+                                reviewMortgageCollateralInfoHisService.save(reviewMortgageCollateralInfoHis);
+                                //保存附件
+                                List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewMortgageCollateralInfo.getId())
+                                        .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.CHATTELMORTGAGE_FILE).list();
+                                if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
+                                    reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
+                                        ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
+                                        reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
+                                        reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
+                                        reviewGuaranteeFileHis.setGuaranteeId(reviewMortgageCollateralInfoHis.getId());
+                                        reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
+                                    });
+                                }
                             }
                         }
-                    }
-                    //获取质押物信息
-                    List<ReviewMortgagePledgeInfo> pledgeInfoList = reviewMortgagePledgeInfoService.list(new QueryWrapper<ReviewMortgagePledgeInfo>()
-                            .eq("review_mortgage_basic_id", mortgageBasicInfoId));
-                    if (pledgeInfoList != null && pledgeInfoList.size() > 0) {
-                        for (ReviewMortgagePledgeInfo reviewMortgagePledgeInfo : pledgeInfoList) {
-                            ReviewMortgagePledgeInfoHis reviewMortgagePledgeInfoHis = new ReviewMortgagePledgeInfoHis();
-                            BeanUtils.copyProperties(reviewMortgagePledgeInfo, reviewMortgagePledgeInfoHis, "id");
-                            reviewMortgagePledgeInfoHis.setReviewMortgageBasicHisId(reviewMortgageBasicInfoHis.getId());
-                            reviewMortgagePledgeInfoHisService.save(reviewMortgagePledgeInfoHis);
-                            //保存附件
-                            List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewMortgagePledgeInfo.getId())
-                                    .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.PLEDGEINFORMATION_FILE).list();
-                            if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
-                                reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
-                                    ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
-                                    reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
-                                    reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
-                                    reviewGuaranteeFileHis.setGuaranteeId(reviewMortgagePledgeInfoHis.getId());
-                                    reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
-                                });
+                        //获取质押物信息
+                        List<ReviewMortgagePledgeInfo> pledgeInfoList = reviewMortgagePledgeInfoService.list(new QueryWrapper<ReviewMortgagePledgeInfo>()
+                                .eq("review_mortgage_basic_id", mortgageBasicInfoId));
+                        if (pledgeInfoList != null && pledgeInfoList.size() > 0) {
+                            for (ReviewMortgagePledgeInfo reviewMortgagePledgeInfo : pledgeInfoList) {
+                                ReviewMortgagePledgeInfoHis reviewMortgagePledgeInfoHis = new ReviewMortgagePledgeInfoHis();
+                                BeanUtils.copyProperties(reviewMortgagePledgeInfo, reviewMortgagePledgeInfoHis, "id");
+                                reviewMortgagePledgeInfoHis.setReviewMortgageBasicHisId(reviewMortgageBasicInfoHis.getId());
+                                reviewMortgagePledgeInfoHisService.save(reviewMortgagePledgeInfoHis);
+                                //保存附件
+                                List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, reviewMortgagePledgeInfo.getId())
+                                        .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.PLEDGEINFORMATION_FILE).list();
+                                if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
+                                    reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
+                                        ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
+                                        reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
+                                        reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
+                                        reviewGuaranteeFileHis.setGuaranteeId(reviewMortgagePledgeInfoHis.getId());
+                                        reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
+                                    });
+                                }
                             }
                         }
                     }
-                }
-                // 填充附件信息
-                List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, mortgageBasicInfoId)
-                        .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.MORTGAGEINFORMATION_FILE).list();
-                if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
-                    reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
-                        ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
-                        reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
-                        reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
-                        reviewGuaranteeFileHis.setGuaranteeId(mortgageBasicInfo.getId());
-                        reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
-                    });
+                    // 填充附件信息
+                    List<ReviewGuaranteeFile> reviewGuaranteeFiles = reviewGuaranteeSecondFileService.lambdaQuery().eq(ReviewGuaranteeFile::getGuaranteeId, mortgageBasicInfoId)
+                            .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.MORTGAGEINFORMATION_FILE).list();
+                    if (CollectionUtil.isNotEmpty(reviewGuaranteeFiles)) {
+                        reviewGuaranteeFiles.forEach(reviewGuaranteeSecondFile -> {
+                            ReviewGuaranteeFileHis reviewGuaranteeFileHis = new ReviewGuaranteeFileHis();
+                            reviewGuaranteeFileHis.setFileId(reviewGuaranteeSecondFile.getFileId());
+                            reviewGuaranteeFileHis.setGuaranteeFileType(reviewGuaranteeSecondFile.getGuaranteeFileType());
+                            reviewGuaranteeFileHis.setGuaranteeId(mortgageBasicInfo.getId());
+                            reviewGuaranteeSecondFileHistoryService.save(reviewGuaranteeFileHis);
+                        });
+                    }
                 }
             }
         }
-        return quotaDisburse.getId();
+
+        return reviewQuotaDisburseHis.getId();
     }
 
     /**
@@ -735,7 +744,8 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
      */
     public ReviewQuotaDisburse add(ReviewQuotaDisburse reviewQuotaDisburse) throws IOException {
 
-        if (reviewQuotaDisburse.isVisible()) {
+        if (reviewQuotaDisburse.isVisible()
+                && ConstantConversionUtil.APPROVAL_RESULT_PASS.equals(reviewQuotaDisburse.getApprovalConclusion())) {
             ValidatorUtil.validator(ValidatorEntity.ValidatorType.ADD, reviewQuotaDisburse);
             int batch = quotaDisburseMapper.getMaxBatchByBusinessNo(reviewQuotaDisburse.getBusinessNumber());
             reviewQuotaDisburse.setQuotaDisburseBatch(batch + 1);
@@ -743,20 +753,22 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
             ValidatorUtil.validator(ValidatorEntity.ValidatorType.TEMP, reviewQuotaDisburse);
         }
         quotaDisburseMapper.insert(reviewQuotaDisburse);
-        // 新增融资信息
-        addFinancingInfo(reviewQuotaDisburse);
-        // 新增收支计划信息
-        addIncomeExpenditurePlan(reviewQuotaDisburse);
-        // 新增主合同信息
-        addMasterContract(reviewQuotaDisburse);
-        // 新增基础交易合同信息
-        addBasicContract(reviewQuotaDisburse);
-        // 新增应收账款转让信息
-        addReviewTransferReceivable(reviewQuotaDisburse);
-        // 新增相关还款责任人
-        addReviewRltRepay(reviewQuotaDisburse);
-        // 新增抵质押信息
-        addMortgageInfo(reviewQuotaDisburse);
+        if (ConstantConversionUtil.APPROVAL_RESULT_PASS.equals(reviewQuotaDisburse.getApprovalConclusion())) {
+            // 新增融资信息
+            addFinancingInfo(reviewQuotaDisburse);
+            // 新增收支计划信息
+            addIncomeExpenditurePlan(reviewQuotaDisburse);
+            // 新增主合同信息
+            addMasterContract(reviewQuotaDisburse);
+            // 新增基础交易合同信息
+            addBasicContract(reviewQuotaDisburse);
+            // 新增应收账款转让信息
+            addReviewTransferReceivable(reviewQuotaDisburse);
+            // 新增相关还款责任人
+            addReviewRltRepay(reviewQuotaDisburse);
+            // 新增抵质押信息
+            addMortgageInfo(reviewQuotaDisburse);
+        }
         return reviewQuotaDisburse;
     }
 
@@ -766,7 +778,8 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
      */
     @Transactional(rollbackFor = Exception.class)
     public ReviewQuotaDisburse update(ReviewQuotaDisburse reviewQuotaDisburse) throws IOException {
-        if (reviewQuotaDisburse.isVisible()) {
+        if (reviewQuotaDisburse.isVisible()
+                && ConstantConversionUtil.APPROVAL_RESULT_PASS.equals(reviewQuotaDisburse.getApprovalConclusion())) {
             ReviewQuotaDisburse hisQuotaDisburse = quotaDisburseMapper.selectById(reviewQuotaDisburse.getId());
             if (null == hisQuotaDisburse || StringUtil.isEmpty(hisQuotaDisburse.getBusinessNumber())) {
                 throw new BusinessException(CodeUtil.FAIL, "修改额度支用时,业务编号不能为空");
@@ -802,21 +815,23 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
         addReviewTransferReceivable(reviewQuotaDisburse);
         //修改相关还款责任人信息
         List<ReviewRltRepay> oldRltRepas = reviewRltRepayService.list(new QueryWrapper<ReviewRltRepay>().eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
-        oldRltRepas.forEach(reviewRltRepay -> {
-            // 删除房产信息
-            reviewRltRepayEstateService.lambdaUpdate().eq(ReviewRltRepayEstate::getReviewRltRepayId, reviewRltRepay.getId()).remove();
-            // 删除土地信息
-            reviewRltRepayLandService.lambdaUpdate().eq(ReviewRltRepayLand::getReviewRltRepayId, reviewRltRepay.getId()).remove();
-            // 删除车辆信息
-            reviewRltRepayVehicleService.lambdaUpdate().eq(ReviewRltRepayVehicle::getReviewRltRepayId, reviewRltRepay.getId()).remove();
-            // 删除股权资产信息
-            reviewRltRepayEquityAssetsService.lambdaUpdate().eq(ReviewRltRepayEquityAssets::getReviewRltRepayId, reviewRltRepay.getId()).remove();
-            // 删除其他资产信息
-            reviewRltRepayOtherAssetsService.lambdaUpdate().eq(ReviewRltRepayOtherAssets::getReviewRltRepayId, reviewRltRepay.getId()).remove();
-            // 删除附件
-            reviewGuaranteeSecondFileService.lambdaUpdate().eq(ReviewGuaranteeFile::getGuaranteeId, reviewRltRepay.getId())
-                    .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.MORTGAGEINFORMATION_FILE).remove();
-        });
+        if (CollectionUtil.isNotEmpty(oldRltRepas)) {
+            oldRltRepas.forEach(reviewRltRepay -> {
+                // 删除房产信息
+                reviewRltRepayEstateService.lambdaUpdate().eq(ReviewRltRepayEstate::getReviewRltRepayId, reviewRltRepay.getId()).remove();
+                // 删除土地信息
+                reviewRltRepayLandService.lambdaUpdate().eq(ReviewRltRepayLand::getReviewRltRepayId, reviewRltRepay.getId()).remove();
+                // 删除车辆信息
+                reviewRltRepayVehicleService.lambdaUpdate().eq(ReviewRltRepayVehicle::getReviewRltRepayId, reviewRltRepay.getId()).remove();
+                // 删除股权资产信息
+                reviewRltRepayEquityAssetsService.lambdaUpdate().eq(ReviewRltRepayEquityAssets::getReviewRltRepayId, reviewRltRepay.getId()).remove();
+                // 删除其他资产信息
+                reviewRltRepayOtherAssetsService.lambdaUpdate().eq(ReviewRltRepayOtherAssets::getReviewRltRepayId, reviewRltRepay.getId()).remove();
+                // 删除附件
+                reviewGuaranteeSecondFileService.lambdaUpdate().eq(ReviewGuaranteeFile::getGuaranteeId, reviewRltRepay.getId())
+                        .eq(ReviewGuaranteeFile::getGuaranteeFileType, ConstantConversionUtil.MORTGAGEINFORMATION_FILE).remove();
+            });
+        }
         reviewRltRepayService.remove(new QueryWrapper<ReviewRltRepay>().eq("review_quota_disburse_id", reviewQuotaDisburse.getId()));
         addReviewRltRepay(reviewQuotaDisburse);
         //修改抵质押信息

+ 1 - 1
src/main/resources/application-dev.yml

@@ -133,7 +133,7 @@ sop:
   getBusinessByKeyWordUrl: http://192.168.3.6:8868/api/trade/findBusinessName
   getFlushUrl: http://192.168.3.6:8868/sys/customer/flushByTrade/url
   getEnterpriseInfoUrl: http://192.168.3.6:8868/sys/customer/getEnterpriseInfoByTrade
-  synchronizeDownloadFile: http://localhost:8868/synchronize/factoringContractTemplate/fileStorage/downloadFile
+  synchronizeDownloadFile: http://192.168.3.6:8868/synchronize/factoringContractTemplate/fileStorage/downloadFile
   synchronizeInformation: http://192.168.3.6:8868/sys/customer/synchronize/information
   getBusinessNoByTrade: http://192.168.3.6:8868/api/trade/quotaDisburseReport/getBusinessNoByTrade
 

+ 1 - 0
src/main/resources/application-prod.yml

@@ -134,6 +134,7 @@ sop:
   getBusinessByKeyWordUrl: http://222.90.211.174:18868/api/trade/findBusinessName
   getFlushUrl: http://222.90.211.174:18868/sys/customer/flushByTrade/url
   getEnterpriseInfoUrl: http://222.90.211.174:18868/sys/customer/getEnterpriseInfoByTrade
+  synchronizeDownloadFile: http://222.90.211.174:8868/synchronize/factoringContractTemplate/fileStorage/downloadFile
   synchronizeInformation: http://222.90.211.174:18868/sys/customer/synchronize/information
   getBusinessNoByTrade: http://222.90.211.174:18868/api/trade/quotaDisburseReport/getBusinessNoByTrade
 

+ 4 - 2
src/main/resources/data/update/v1.0/liujia.sql

@@ -6,7 +6,7 @@ CREATE TABLE `review_quota_disburse` (
         `approval_conclusion` varchar(50) DEFAULT '' COMMENT '通过pass/否决veto',
         `approval_comments` varchar(3000) DEFAULT '' COMMENT '审批意见',
         `business_number` varchar(50) DEFAULT NULL COMMENT '业务编号',
-        `quota_disburse_batch` int(11) DEFAULT '0' COMMENT '额度支用批次',
+        `quota_disburse_batch` int(11) DEFAULT NULL COMMENT '额度支用批次',
         `business_credit_balance` decimal(17,2) DEFAULT '0.00' COMMENT '业务综合授信余额',
         `supplier_credit_balance` decimal(17,2) DEFAULT '0.00' COMMENT '供应商授信余额',
         `start_date` datetime DEFAULT NULL COMMENT '应收账款起始日',
@@ -30,8 +30,10 @@ DROP TABLE IF EXISTS `review_quota_disburse_his`;
 CREATE TABLE `review_quota_disburse_his` (
         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
         `review_quota_disburse_id` bigint(20) unsigned DEFAULT '0' COMMENT '额度支用信息Id',
+        `approval_conclusion` varchar(50) DEFAULT '' COMMENT '通过pass/否决veto',
+        `approval_comments` varchar(3000) DEFAULT '' COMMENT '审批意见',
         `business_number` varchar(50) DEFAULT NULL COMMENT '业务编号',
-        `quota_disburse_batch` int(11) DEFAULT '0' COMMENT '额度支用批次',
+        `quota_disburse_batch` int(11) DEFAULT NULL COMMENT '额度支用批次',
         `business_credit_balance` decimal(17,2) DEFAULT '0.00' COMMENT '业务综合授信余额',
         `supplier_credit_balance` decimal(17,2) DEFAULT '0.00' COMMENT '供应商授信余额',
         `start_date` datetime DEFAULT NULL COMMENT '应收账款起始日',

+ 1 - 1
src/main/resources/mapper/financing/apply/CFinancingBasicInfoMapper.xml

@@ -30,7 +30,7 @@
     </resultMap>
 
     <select id="getListInfo" parameterType="java.lang.Long" resultMap="CFinancingBasicInfoResult">
-        SELECT
+        SELECT DISTINCT
             t1.id,
             t1.business_number,
             t3.contract_no contract_number,