liuj преди 6 месеца
родител
ревизия
b5623d26a9

+ 26 - 0
src/main/java/com/sunxung/factoring/entity/financing/sop/ReviewMasterContractApi.java

@@ -8,6 +8,16 @@ import org.hibernate.validator.constraints.NotBlank;
  */
 public class ReviewMasterContractApi {
 
+    /**
+     * 合同编号
+     */
+    private String contractNo;
+
+    /**
+     * 池保理融资确认书编号
+     **/
+    private String poolFactoringFinancingConfirmNo;
+
     /**
      * 保理商联系人
      */
@@ -432,4 +442,20 @@ public class ReviewMasterContractApi {
     public void setOtherFeeCollectionMethod(String otherFeeCollectionMethod) {
         this.otherFeeCollectionMethod = otherFeeCollectionMethod;
     }
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public String getPoolFactoringFinancingConfirmNo() {
+        return poolFactoringFinancingConfirmNo;
+    }
+
+    public void setPoolFactoringFinancingConfirmNo(String poolFactoringFinancingConfirmNo) {
+        this.poolFactoringFinancingConfirmNo = poolFactoringFinancingConfirmNo;
+    }
 }

+ 13 - 17
src/main/java/com/sunxung/factoring/service/financing/review/impl/ReviewQuotaDisburseServiceImpl.java

@@ -176,7 +176,13 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
         List<ReviewIncomeExpenditurePlan> planList = new ArrayList<>();
         preOrAfterInterest(reviewFinancingInfo, planList, dict);
 
-        planList.sort(Comparator.comparing(ReviewIncomeExpenditurePlan::getIncomeExpenditureDate));
+        if (CollectionUtil.isNotEmpty(planList)) {
+            planList.sort(Comparator.comparing(ReviewIncomeExpenditurePlan::getIncomeExpenditureDate));
+            int i = 0;
+            for (ReviewIncomeExpenditurePlan plan : planList) {
+                plan.setRecordNo(++i);
+            }
+        }
         return planList;
     }
 
@@ -1155,19 +1161,7 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
             }
             if (StringUtil.isNotEmpty(masterContractNo)) {
                 // 设置三方协议编号
-                String quotaBatchStr;
-                // 判断是新池还是已有池
-                ReviewQuotaDisburse oldQuotaDisburse = quotaDisburseMapper.selectOne(new QueryWrapper<ReviewQuotaDisburse>()
-                        .eq("business_number", quotaDisburse.getBusinessNumber())
-                        .ne("id", quotaDisburse.getId())
-                        .last("limit 1"));
-                if (null == oldQuotaDisburse) {
-                    //新池
-                    quotaBatchStr = "01";
-                } else {
-                    quotaBatchStr = String.valueOf(quotaDisburse.getQuotaDisburseBatch());
-                }
-                contractNo = masterContractNo + "-" + quotaBatchStr + "-" + mark + seq;
+                contractNo = masterContractNo + "-" + mark + seq;
             }
         }
         return contractNo;
@@ -1307,15 +1301,17 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
                 if (StringUtils.isBlank(masterContract.getContractNo())) {
                     //生成新的保理合同编号
                     contractNo = serialNumberGenerator.nextValue(ConstantUtil.REVIEW_MASTER_CONTRACT_DOMESTIC_CODE);
+                    masterContract.setContractNo(contractNo);
                 }
                 if (StringUtils.isBlank(masterContract.getPoolFactoringFinancingConfirmNo())) {
                     int batch = quotaDisburse.getQuotaDisburseBatch();
                     String batchStr = StringUtil.formatNumber(batch);
                     poolFactoringFinancingConfirmNo = contractNo + "-" + batchStr + "-" + 2;
+                    masterContract.setPoolFactoringFinancingConfirmNo(poolFactoringFinancingConfirmNo);
                 }
             }
-            masterContract.setPoolFactoringFinancingConfirmNo(poolFactoringFinancingConfirmNo);
-            masterContract.setContractNo(contractNo);
+
+
             reviewMasterContractService.addMasterContract(masterContract, quotaDisburse.isVisible());
         }
     }
@@ -1690,7 +1686,7 @@ public class ReviewQuotaDisburseServiceImpl extends ServiceImpl<ReviewQuotaDisbu
             plan.setIncomeExpenditureType(IncomeExpenditureTypeDict.ChildEnum.PRINCIPAL.getCode());
             plan.setFinalCashFlow(reviewFinancingInfo.getFinancingAmount().negate());
             //收款主体默认为债权人
-            plan.setReceivingSubject(ConstantUtil.CREDITOR);
+//            plan.setReceivingSubject(ConstantUtil.CREDITOR);
             planList.add(plan);
         }
 

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

@@ -2,3 +2,5 @@
 ALTER TABLE `trading_platform` ADD COLUMN `legal_person` varchar(100) DEFAULT NULL COMMENT '法定代表人';
 -- 电子签信息表新增出证文件字段
 ALTER TABLE `contract_electronic_info` ADD COLUMN `report_file_id` bigint(20) DEFAULT NULL COMMENT '出证电子签文件';
+-- 额度支用融资信息表新增资方Id字段
+ALTER TABLE `review_financing_info` ADD COLUMN `refinancing_management_id` bigint(20) DEFAULT '0' COMMENT '资方ID';