|
|
@ -726,6 +726,7 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
|
voucher.setVoucherNo(organizationVo.getOrgCode()); |
|
|
|
} |
|
|
|
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>(); |
|
|
|
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos2 = new ArrayList<>(); |
|
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(loanOutboundApply.getDeptSid()).getData(); |
|
|
|
for (int i = 0; i < busVinSidList.size(); i++){ |
|
|
|
String busVinSid = busVinSidList.get(i); |
|
|
@ -782,6 +783,7 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
|
BigDecimal wdqMoney = BigDecimal.ZERO; |
|
|
|
//应收贷款车欠款_到期欠款_本金
|
|
|
|
BigDecimal bjMoney = BigDecimal.ZERO; |
|
|
|
BigDecimal zjzyfMoney = BigDecimal.ZERO; |
|
|
|
String lq = loanRepaymentPlanDetailsService.getYqLq(busVinSid); |
|
|
|
lqMoney = lqMoney.add(new BigDecimal(StringUtils.isBlank(lq) ? "0" : lq)); |
|
|
|
//未到期欠款
|
|
|
@ -792,10 +794,16 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
|
all = lqMoney.add(wdqMoney).add(bjMoney); |
|
|
|
//已认款
|
|
|
|
String subAll = baseMapper.selectByBusVinSid(busVinSid); |
|
|
|
if(loanSecondarySalesCost.getBankSettleCost().compareTo(BigDecimal.ZERO)>0){ |
|
|
|
all = all.add(loanSecondarySalesCost.getBankSettleCost()).subtract(new BigDecimal(subAll)); |
|
|
|
} |
|
|
|
|
|
|
|
BigDecimal bankSettleCost = loanSecondarySalesCost.getBankSettleCost(); |
|
|
|
all = all.subtract(new BigDecimal(subAll)).add(bankSettleCost); |
|
|
|
BigDecimal loanDeposit = loanSecondarySalesCost.getLoanDeposit();//贷款保证金
|
|
|
|
cssMoney = all.subtract(loanDeposit).subtract(bxbzjMoney);//车损失
|
|
|
|
String zjzyf = alrepaidAndArrVo.getWheFundOccMoney(); |
|
|
|
zjzyfMoney = zjzyfMoney.add(new BigDecimal(StringUtils.isBlank(zjzyf)?"0":zjzyf)); |
|
|
|
|
|
|
|
if(all.compareTo(BigDecimal.ZERO)>0){//贷方
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
@ -833,7 +841,7 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
|
if(cssMoney.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJf3 = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoJf3.setSummary("**扣回车辆再次销售-车损失"); |
|
|
|
voucherResultDetailDtoJf3.setSubjectNo("2182.01.01"); |
|
|
|
voucherResultDetailDtoJf3.setSubjectNo("1201.03.04.01"); |
|
|
|
//核算部门
|
|
|
|
voucherResultDetailDtoJf3.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
@ -841,12 +849,59 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
|
voucherResultDetailDtoJf3.setDebit(cssMoney.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJf3); |
|
|
|
} |
|
|
|
if(loanSecondarySalesCost.getIsRecovery() == 0){//不追偿
|
|
|
|
if(cssMoney.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoDf.setSummary("**扣回车辆再次销售-不追偿处理"); |
|
|
|
voucherResultDetailDtoDf.setSubjectNo("1201.03.04.01"); |
|
|
|
//核算部门
|
|
|
|
voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoDf.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoDf.setCredit(cssMoney.toString()); |
|
|
|
voucherResultDetailDtos2.add(voucherResultDetailDtoDf); |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoJf.setSummary("**扣回车辆再次销售-不追偿处理"); |
|
|
|
voucherResultDetailDtoDf.setSubjectNo("1911.05"); |
|
|
|
//核算部门
|
|
|
|
voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoJf.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoJf.setDebit(cssMoney.toString()); |
|
|
|
voucherResultDetailDtos2.add(voucherResultDetailDtoJf); |
|
|
|
} |
|
|
|
if(zjzyfMoney.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoDf.setSummary("**扣回车辆再次销售-不追偿减免资金占用费"); |
|
|
|
voucherResultDetailDtoDf.setSubjectNo("2191.05.00"); |
|
|
|
//核算部门
|
|
|
|
voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoDf.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoDf.setCredit(zjzyfMoney.negate().toString()); |
|
|
|
voucherResultDetailDtos2.add(voucherResultDetailDtoDf); |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); |
|
|
|
voucherResultDetailDtoJf.setSummary("**扣回车辆再次销售-不追偿减免资金占用费"); |
|
|
|
voucherResultDetailDtoDf.setSubjectNo("1201.02.02"); |
|
|
|
//核算部门
|
|
|
|
voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoJf.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoJf.setDebit(zjzyfMoney.negate().toString()); |
|
|
|
voucherResultDetailDtos2.add(voucherResultDetailDtoJf); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(!voucherResultDetailDtos.isEmpty()){ |
|
|
|
voucher.setResultDetails(voucherResultDetailDtos); |
|
|
|
finKingDeeFeign.saveVoucher(voucher); |
|
|
|
} |
|
|
|
if(!voucherResultDetailDtos2.isEmpty()){ |
|
|
|
voucher.setResultDetails(voucherResultDetailDtos2); |
|
|
|
finKingDeeFeign.saveVoucher(voucher); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//推送赎回凭证结转
|
|
|
|