|
@ -389,7 +389,14 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService<BusSale |
|
|
List<BusSalesOrderVehicle> busSalesOrderVehicles = busSalesOrderVehicleService.selByLoanContractSid(record.getSalesOrderSid()); |
|
|
List<BusSalesOrderVehicle> busSalesOrderVehicles = busSalesOrderVehicleService.selByLoanContractSid(record.getSalesOrderSid()); |
|
|
busSalesOrderVehicles.removeAll(Collections.singleton(null)); |
|
|
busSalesOrderVehicles.removeAll(Collections.singleton(null)); |
|
|
if (!busSalesOrderVehicles.isEmpty()) { |
|
|
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()) { |
|
|
if (!stringVinNos.isEmpty()) { |
|
|
record.setVinNo(String.join(",", stringVinNos)); |
|
|
record.setVinNo(String.join(",", stringVinNos)); |
|
|
} |
|
|
} |
|
@ -406,7 +413,7 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService<BusSale |
|
|
//车辆数
|
|
|
//车辆数
|
|
|
BigDecimal vehCount = new BigDecimal(schedule.getVehCount()); |
|
|
BigDecimal vehCount = new BigDecimal(schedule.getVehCount()); |
|
|
if (StringUtils.isNotBlank(schedule.getIsDifferent())) { |
|
|
if (StringUtils.isNotBlank(schedule.getIsDifferent())) { |
|
|
if (schedule.getIsDifferent().equals("是")) { |
|
|
if (schedule.getIsDifferent().equals("1")) { |
|
|
//判断是否有一台车不同月还金额
|
|
|
//判断是否有一台车不同月还金额
|
|
|
//主产品期数
|
|
|
//主产品期数
|
|
|
BigDecimal mainPeriod = new BigDecimal(schedule.getMainPeriod()); |
|
|
BigDecimal mainPeriod = new BigDecimal(schedule.getMainPeriod()); |
|
@ -437,6 +444,36 @@ public class BusSalesOrderLoancontractService extends MybatisBaseService<BusSale |
|
|
record.setMainAmount(mainAmount.toString()); |
|
|
record.setMainAmount(mainAmount.toString()); |
|
|
record.setAmountAll(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 { |
|
|
} else { |
|
|
//主产品期数
|
|
|
//主产品期数
|
|
|