|
|
@ -833,15 +833,18 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void pushRiskToFin(String businessSid){ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void pushRiskToFin(String businessSid,String payTypeCode,String accountNumber,String cost){ |
|
|
|
LoanRepurchaseApply loanRepurchaseApply = fetchBySid(businessSid); |
|
|
|
LoanRepurchaseCost loanRepurchaseCost = loanRepurchaseCostService.selectByMainSid(businessSid); |
|
|
|
//查询月还明细表,遍历
|
|
|
|
List<LoanRepaymentPlanDetails> list = loanRepaymentPlanDetailsService.selectByBusVinSid2(loanRepurchaseApply.getBusVinSid()); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
if(!list.isEmpty()){ |
|
|
|
BigDecimal bankSettlePrice = loanRepurchaseCost.getBankSettlePrice(); |
|
|
|
BigDecimal bankSettlePrice = BigDecimal.ZERO; |
|
|
|
if(StringUtils.isNotBlank(cost)){ |
|
|
|
bankSettlePrice = new BigDecimal(cost); |
|
|
|
} |
|
|
|
if(bankSettlePrice != null && bankSettlePrice.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
for (int jj = 0; jj < list.size(); jj++) { |
|
|
|
LoanRepaymentPlanDetails loanRepaymentPlanDetails = list.get(jj); |
|
|
@ -858,7 +861,6 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
loanRepaymentPlanDetails.setPaymentMoney(paymentMoney); |
|
|
|
loanRepaymentPlanDetailsService.updateById(loanRepaymentPlanDetails); |
|
|
|
}else{ |
|
|
|
bankSettlePrice = BigDecimal.ZERO; |
|
|
|
BigDecimal paymentMoney = loanRepaymentPlanDetails.getPaymentMoney(); |
|
|
|
if(paymentMoney != null){ |
|
|
|
paymentMoney = paymentMoney.add(bankSettlePrice); |
|
|
@ -943,12 +945,6 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
|
} |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); |
|
|
|
String accountNumber = loanRepurchaseCost.getBankAccount(); |
|
|
|
String payTypeCode = ""; |
|
|
|
FinManufacturerBank manufacturerBank = baseMapper.selectByAccountNumAndUseSid(accountNumber,loanRepurchaseApply.getUseOrgSid()); |
|
|
|
if (null != manufacturerBank) { |
|
|
|
payTypeCode = manufacturerBank.getDueBankKey(); |
|
|
|
} |
|
|
|
|
|
|
|
all= all.add(loanRepurchaseCost.getBankSettlePrice()); |
|
|
|
if ("02".equals(payTypeCode)) { |
|
|
@ -957,10 +953,7 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
voucherResultDetailDtoDf2.setSubjectNo("1002.02.01"); |
|
|
|
} |
|
|
|
voucherResultDetailDtoDf2.setSummary(loanRepurchaseApply.getBankName() + "结清"); |
|
|
|
//核算部门
|
|
|
|
voucherResultDetailDtoDf2.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoDf2.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoDf2.setBankAccount(accountNumber); |
|
|
|
voucherResultDetailDtoDf2.setCredit(loanRepurchaseCost.getBankSettlePrice().toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf2); |
|
|
|
if(all.compareTo(BigDecimal.ZERO)>0){ |
|
|
@ -973,7 +966,7 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoJf.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoJf.setCredit(all.toString()); |
|
|
|
voucherResultDetailDtoJf.setDebit(all.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJf); |
|
|
|
} |
|
|
|
} |
|
|
@ -981,8 +974,17 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
BigDecimal bankContractLiquidated = loanRepurchaseCost.getBankContractLiquidated();//合同违约金
|
|
|
|
BigDecimal bankNominalPrice = loanRepurchaseCost.getBankNominalPrice();//名义价
|
|
|
|
BigDecimal bankOtherReceivable = loanRepurchaseCost.getBankOtherReceivable();//资方其他应收
|
|
|
|
BigDecimal all2 = bankContractLiquidated.add(bankNominalPrice).add(bankOtherReceivable); |
|
|
|
if(bankContractLiquidated.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
BigDecimal all2 = BigDecimal.ZERO; |
|
|
|
if(bankContractLiquidated != null){ |
|
|
|
all2 = all2.add(bankContractLiquidated); |
|
|
|
} |
|
|
|
if(bankNominalPrice != null){ |
|
|
|
all2 = all2.add(bankNominalPrice); |
|
|
|
} |
|
|
|
if(bankOtherReceivable != null){ |
|
|
|
all2 = all2.add(bankOtherReceivable); |
|
|
|
} |
|
|
|
if(bankContractLiquidated != null && bankContractLiquidated.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
|
if (null != dictCommonVo) { |
|
|
|
voucherResultDetailDtoDf.setSubjectNo(dictCommonVo.getDictValue()); |
|
|
@ -995,7 +997,7 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
voucherResultDetailDtoDf.setCredit(bankContractLiquidated.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
|
} |
|
|
|
if(bankNominalPrice.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
if(bankNominalPrice != null && bankNominalPrice.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
|
if (null != dictCommonVo) { |
|
|
|
voucherResultDetailDtoDf.setSubjectNo(dictCommonVo.getDictValue()); |
|
|
@ -1008,7 +1010,7 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
voucherResultDetailDtoDf.setCredit(bankNominalPrice.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
|
} |
|
|
|
if(bankOtherReceivable.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
if(bankOtherReceivable != null && bankOtherReceivable.compareTo(BigDecimal.ZERO)>0){ |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
|
if (null != dictCommonVo) { |
|
|
|
voucherResultDetailDtoDf.setSubjectNo(dictCommonVo.getDictValue()); |
|
|
@ -1049,7 +1051,7 @@ public class LoanRepurchaseApplyService extends MybatisBaseService<LoanRepurchas |
|
|
|
voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
//核算客户
|
|
|
|
voucherResultDetailDtoJf.setDimensionCustom(customerNumber); |
|
|
|
voucherResultDetailDtoJf.setCredit(all2.toString()); |
|
|
|
voucherResultDetailDtoJf.setDebit(all2.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJf); |
|
|
|
} |
|
|
|
if(!voucherResultDetailDtos.isEmpty()){ |
|
|
|