|
|
@ -37,6 +37,7 @@ import com.yxt.anrui.riskcenter.api.loanfinbank.LoanFinBank; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinotherPolicy.LoanFinOtherPolicy; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.LoanFinPolicy; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfundday.LoanFundDay; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanpushfundhistory.LoanPushFundHistory; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.LoanRepaymentHistory; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetailsDto; |
|
|
@ -53,6 +54,7 @@ import com.yxt.anrui.riskcenter.biz.loanfinbank.LoanFinBankService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfinotherPolicy.LoanFinOtherPolicyService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfinpolicy.LoanFinPolicyService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfundday.LoanFundDayService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanpushfundhistory.LoanPushFundHistoryService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymenthistory.LoanRepaymentHistoryService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loansolutions.LoanSolutionsService; |
|
|
@ -155,7 +157,8 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
private LoanFundDayService loanFundDayService; |
|
|
|
@Autowired |
|
|
|
private FinUncollectedReceivablesDetailedJRFeign finUncollectedReceivablesDetailedJRFeign; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private LoanPushFundHistoryService loanPushFundHistoryService; |
|
|
|
/** |
|
|
|
* 根据销售订单SID生成还款计划表回显 |
|
|
|
* |
|
|
@ -5955,6 +5958,7 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
List<LoanRepaymentHistory> histories = new ArrayList<>();//还款记录
|
|
|
|
List<FinUncollectedReceivablesDetailedJR> jrList = new ArrayList<>();//金融应收
|
|
|
|
List<LoanFundDay> loanFundDays = new ArrayList<>();//资金占用费生成记录
|
|
|
|
List<LoanPushFundHistory> pushFundHistories = new ArrayList<>();//资金占用费计提记录
|
|
|
|
for (LoanRepaymentSchedule schedule : data) { |
|
|
|
BigDecimal Q = BigDecimal.ZERO; //累欠金额
|
|
|
|
BigDecimal T = BigDecimal.ZERO; //其中公司垫还资方金额
|
|
|
@ -6069,6 +6073,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
fundDay.setBusSid(plan.getSid()); |
|
|
|
fundDay.setIsEnable(3); |
|
|
|
loanFundDays.add(fundDay); |
|
|
|
//生成资金占用费计提记录
|
|
|
|
LoanPushFundHistory pushFundHistory = new LoanPushFundHistory(); |
|
|
|
pushFundHistory.setCreateBySid(userSid); |
|
|
|
pushFundHistory.setFund(B); |
|
|
|
pushFundHistory.setBusVinSid(plan.getBusVinSid()); |
|
|
|
pushFundHistory.setIsEnable(3); |
|
|
|
pushFundHistory.setUseOrgSid(plan.getUseOrgSid()); |
|
|
|
pushFundHistory.setUseOrgName(plan.getUseOrgName()); |
|
|
|
pushFundHistories.add(pushFundHistory); |
|
|
|
} |
|
|
|
if (pd) { |
|
|
|
planDetails.add(plan); |
|
|
@ -6195,6 +6208,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
fundDay.setFund(B1); |
|
|
|
fundDay.setBusSid(p.getSid()); |
|
|
|
loanFundDays.add(fundDay); |
|
|
|
//生成资金占用费计提记录
|
|
|
|
LoanPushFundHistory pushFundHistory = new LoanPushFundHistory(); |
|
|
|
pushFundHistory.setCreateBySid(userSid); |
|
|
|
pushFundHistory.setFund(B1); |
|
|
|
pushFundHistory.setBusVinSid(p.getBusVinSid()); |
|
|
|
pushFundHistory.setIsEnable(3); |
|
|
|
pushFundHistory.setUseOrgSid(p.getUseOrgSid()); |
|
|
|
pushFundHistory.setUseOrgName(p.getUseOrgName()); |
|
|
|
pushFundHistories.add(pushFundHistory); |
|
|
|
} |
|
|
|
Q1 = Q1.subtract(temp); |
|
|
|
} else if (Q1.compareTo(BigDecimal.ZERO) == 0) { |
|
|
@ -6314,6 +6336,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
fundDay.setFund(B1); |
|
|
|
fundDay.setBusSid(p.getSid()); |
|
|
|
loanFundDays.add(fundDay); |
|
|
|
//生成资金占用费计提记录
|
|
|
|
LoanPushFundHistory pushFundHistory = new LoanPushFundHistory(); |
|
|
|
pushFundHistory.setCreateBySid(userSid); |
|
|
|
pushFundHistory.setFund(B1); |
|
|
|
pushFundHistory.setBusVinSid(p.getBusVinSid()); |
|
|
|
pushFundHistory.setIsEnable(3); |
|
|
|
pushFundHistory.setUseOrgSid(p.getUseOrgSid()); |
|
|
|
pushFundHistory.setUseOrgName(p.getUseOrgName()); |
|
|
|
pushFundHistories.add(pushFundHistory); |
|
|
|
} |
|
|
|
Q1 = Q1.subtract(temp); |
|
|
|
} else if (Q1.compareTo(BigDecimal.ZERO) == 0) { |
|
|
@ -6402,6 +6433,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
fundDay.setFund(B); |
|
|
|
fundDay.setBusSid(plan.getSid()); |
|
|
|
loanFundDays.add(fundDay); |
|
|
|
//生成资金占用费计提记录
|
|
|
|
LoanPushFundHistory pushFundHistory = new LoanPushFundHistory(); |
|
|
|
pushFundHistory.setCreateBySid(userSid); |
|
|
|
pushFundHistory.setFund(B); |
|
|
|
pushFundHistory.setBusVinSid(plan.getBusVinSid()); |
|
|
|
pushFundHistory.setIsEnable(3); |
|
|
|
pushFundHistory.setUseOrgSid(plan.getUseOrgSid()); |
|
|
|
pushFundHistory.setUseOrgName(plan.getUseOrgName()); |
|
|
|
pushFundHistories.add(pushFundHistory); |
|
|
|
} |
|
|
|
if (pd) { |
|
|
|
planDetails.add(plan); |
|
|
@ -6546,6 +6586,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
fundDay.setFund(B1); |
|
|
|
fundDay.setBusSid(p.getSid()); |
|
|
|
loanFundDays.add(fundDay); |
|
|
|
//生成资金占用费计提记录
|
|
|
|
LoanPushFundHistory pushFundHistory = new LoanPushFundHistory(); |
|
|
|
pushFundHistory.setCreateBySid(userSid); |
|
|
|
pushFundHistory.setFund(B1); |
|
|
|
pushFundHistory.setBusVinSid(p.getBusVinSid()); |
|
|
|
pushFundHistory.setIsEnable(3); |
|
|
|
pushFundHistory.setUseOrgSid(p.getUseOrgSid()); |
|
|
|
pushFundHistory.setUseOrgName(p.getUseOrgName()); |
|
|
|
pushFundHistories.add(pushFundHistory); |
|
|
|
} |
|
|
|
Q1 = Q1.subtract(temp); |
|
|
|
} else if (Q1.compareTo(BigDecimal.ZERO) == 0) { |
|
|
@ -6665,6 +6714,15 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
fundDay.setFund(B1); |
|
|
|
fundDay.setBusSid(p.getSid()); |
|
|
|
loanFundDays.add(fundDay); |
|
|
|
//生成资金占用费计提记录
|
|
|
|
LoanPushFundHistory pushFundHistory = new LoanPushFundHistory(); |
|
|
|
pushFundHistory.setCreateBySid(userSid); |
|
|
|
pushFundHistory.setFund(B1); |
|
|
|
pushFundHistory.setBusVinSid(p.getBusVinSid()); |
|
|
|
pushFundHistory.setIsEnable(3); |
|
|
|
pushFundHistory.setUseOrgSid(p.getUseOrgSid()); |
|
|
|
pushFundHistory.setUseOrgName(p.getUseOrgName()); |
|
|
|
pushFundHistories.add(pushFundHistory); |
|
|
|
} |
|
|
|
Q1 = Q1.subtract(temp); |
|
|
|
} else if (Q1.compareTo(BigDecimal.ZERO) == 0) { |
|
|
@ -6705,6 +6763,9 @@ public class LoanRepaymentScheduleService extends MybatisBaseService<LoanRepayme |
|
|
|
if (loanFundDays.size() > 0 && !loanFundDays.isEmpty()) { |
|
|
|
loanFundDayService.saveList(loanFundDays); |
|
|
|
} |
|
|
|
if (pushFundHistories.size() > 0 && !pushFundHistories.isEmpty()) { |
|
|
|
loanPushFundHistoryService.saveList(pushFundHistories); |
|
|
|
} |
|
|
|
if (jrList.size() > 0 && !jrList.isEmpty()) { |
|
|
|
finUncollectedReceivablesDetailedJRFeign.saveList(jrList); |
|
|
|
} |
|
|
|