Browse Source

Merge remote-tracking branch 'origin/master'

master
yunuo970428 12 months ago
parent
commit
d9ef345584
  1. 41
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderloancontract/BusSalesOrderLoancontractService.java
  2. 6
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentschedule/LoanRepaymentScheduleMapper.xml

41
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorderloancontract/BusSalesOrderLoancontractService.java

@ -389,7 +389,14 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService<BusSale
List<BusSalesOrderVehicle> busSalesOrderVehicles = busSalesOrderVehicleService.selByLoanContractSid(record.getSalesOrderSid());
busSalesOrderVehicles.removeAll(Collections.singleton(null));
if (!busSalesOrderVehicles.isEmpty()) {
List<String> stringVinNos = busSalesOrderVehicles.stream().map(c -> c.getLinkNo()).collect(Collectors.toList());
List<String> stringVinNos = new ArrayList<>();
for (BusSalesOrderVehicle v : busSalesOrderVehicles) {
if (v.getLinkNo().length() > 8) {
stringVinNos.add(v.getLinkNo().substring(v.getLinkNo().length() - 8));
} else {
stringVinNos.add(v.getLinkNo());
}
}
if (!stringVinNos.isEmpty()) {
record.setVinNo(String.join(",", stringVinNos));
}
@ -406,7 +413,7 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService<BusSale
//车辆数
BigDecimal vehCount = new BigDecimal(schedule.getVehCount());
if (StringUtils.isNotBlank(schedule.getIsDifferent())) {
if (schedule.getIsDifferent().equals("")) {
if (schedule.getIsDifferent().equals("1")) {
//判断是否有一台车不同月还金额
//主产品期数
BigDecimal mainPeriod = new BigDecimal(schedule.getMainPeriod());
@ -437,6 +444,36 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService<BusSale
record.setMainAmount(mainAmount.toString());
record.setAmountAll(mainAmount.toString());
}
} else if (schedule.getIsDifferent().equals("0")) {
//主产品期数
BigDecimal mainPeriod = new BigDecimal(schedule.getMainPeriod());
//主产品首期月还
BigDecimal mainFirstRepay = schedule.getMainFirstRepay().multiply(vehCount);
//主产品期间月还
BigDecimal mainMidRepay = mainPeriod.subtract(new BigDecimal("2")).multiply(schedule.getMainMidRepay()).multiply(vehCount);
//主产品末期月还
BigDecimal mainLastRepay = schedule.getMainLastRepay().multiply(vehCount);
mainAmount = mainFirstRepay.add(mainMidRepay).add(mainLastRepay);
if (schedule.getIsOtherPolicy().equals("1")) {
//有其他融
//其他融期数
BigDecimal otherPeriod = new BigDecimal(schedule.getOtherPeriod());
//其他融首期月还
BigDecimal otherFirstRepay = schedule.getOtherFirstRepay().multiply(vehCount);
//其他融期间月还
BigDecimal otherMidRepay = otherPeriod.subtract(new BigDecimal("2")).multiply(schedule.getOtherMidRepay()).multiply(vehCount);
//其他融末期月还
BigDecimal otherLastRepay = schedule.getOtherLastRepay().multiply(vehCount);
otherAmount = otherFirstRepay.add(otherMidRepay).add(otherLastRepay);
amountAll = mainAmount.add(otherAmount);
record.setMainAmount(mainAmount.toString());
record.setOtherAmount(otherAmount.toString());
record.setAmountAll(amountAll.toString());
} else if (schedule.getIsOtherPolicy().equals("0")) {
//没有其他融
record.setMainAmount(mainAmount.toString());
record.setAmountAll(mainAmount.toString());
}
}
} else {
//主产品期数

6
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymentschedule/LoanRepaymentScheduleMapper.xml

@ -106,7 +106,7 @@
SELECT
@row_number := @row_number + 1 AS rankNo,
p.loanContractSid,
p.createTime,
l.repaymentCreateTime as createTime,
p.customer,
p.staffName,
p.borrowerName,
@ -129,7 +129,9 @@
p.dept,
p.useOrgName
FROM
loan_repayment_plan_details AS p,(
loan_repayment_plan_details AS p
LEFT JOIN anrui_buscenter.bus_sales_order_loancontract as l ON p.loanContractSid = l.sid
,(
SELECT
@row_number := 0
) AS t

Loading…
Cancel
Save