|
|
@ -187,6 +187,9 @@ public class LoanTransferPaymentApplyService extends MybatisBaseService<LoanTran |
|
|
|
public ResultBean<String> saveTransferPayment(LoanTransferPaymentApplyDto dto) { |
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
String sid = ""; |
|
|
|
if (StringUtils.isBlank(dto.getPayFormKey())) { |
|
|
|
return rb.setMsg("请选择财务付款形式"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getSid())) { |
|
|
|
sid = dto.getSid(); |
|
|
|
LoanTransferPaymentApply updateEntity = fetchBySid(sid); |
|
|
@ -629,11 +632,11 @@ public class LoanTransferPaymentApplyService extends MybatisBaseService<LoanTran |
|
|
|
Set<String> setConOrNumber = new HashSet<>(); |
|
|
|
for (LoanTransferPaymentRecord applyRecord : loanTransferPaymentRecords) { |
|
|
|
LoanRepaymentHistory repaymentHistory = loanRepaymentHistoryService.fetchBySid(applyRecord.getRepaymentHistorySid()); |
|
|
|
// if (null != repaymentHistory) {
|
|
|
|
// repaymentHistory.setPaymentStateKey("003");
|
|
|
|
// repaymentHistory.setPaymentState("已转付");
|
|
|
|
// repaymentHistory.setTransferDate(new DateTime());
|
|
|
|
// loanRepaymentHistoryService.updateById(repaymentHistory);
|
|
|
|
if (null != repaymentHistory) { |
|
|
|
repaymentHistory.setPaymentStateKey("003"); |
|
|
|
repaymentHistory.setPaymentState("已转付"); |
|
|
|
repaymentHistory.setTransferDate(new DateTime()); |
|
|
|
loanRepaymentHistoryService.updateById(repaymentHistory); |
|
|
|
// //推送转付还款记录
|
|
|
|
// LoanRepaymentHistory transfer = new LoanRepaymentHistory();
|
|
|
|
// transfer.setScheduleSid(repaymentHistory.getScheduleSid());
|
|
|
@ -656,7 +659,7 @@ public class LoanTransferPaymentApplyService extends MybatisBaseService<LoanTran |
|
|
|
// String amount = String.valueOf(money);
|
|
|
|
// transfer.setActualMoney(new BigDecimal("-" + amount));
|
|
|
|
// loanRepaymentHistoryService.insert(transfer);
|
|
|
|
// }
|
|
|
|
} |
|
|
|
if (payFormKey.equals("01")) { |
|
|
|
if (StringUtils.isNotBlank(applyRecord.getBankContractNo())) { |
|
|
|
setConOrNumber.add(applyRecord.getBankContractNo()); |
|
|
@ -788,8 +791,44 @@ public class LoanTransferPaymentApplyService extends MybatisBaseService<LoanTran |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void pushPaymentVoucher(String businessSid) { |
|
|
|
List<LoanTransferPaymentRecord> records = loanTransferPaymentRecordService.selByMainSid(businessSid); |
|
|
|
public ResultBean pushPaymentRecord(String sid, String paySid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
List<LoanTransferPaymentRecord> records = loanTransferPaymentRecordService.selByMainSidAndPaySid(sid, paySid); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (LoanTransferPaymentRecord applyRecord : records) { |
|
|
|
LoanRepaymentHistory repaymentHistory = loanRepaymentHistoryService.fetchBySid(applyRecord.getRepaymentHistorySid()); |
|
|
|
if (null != repaymentHistory) { |
|
|
|
//推送转付还款记录
|
|
|
|
LoanRepaymentHistory transfer = new LoanRepaymentHistory(); |
|
|
|
transfer.setScheduleSid(repaymentHistory.getScheduleSid()); |
|
|
|
transfer.setPlanDetailSid(repaymentHistory.getPlanDetailSid()); |
|
|
|
transfer.setReturnWay("转付"); |
|
|
|
transfer.setReturnWayKey("03"); |
|
|
|
transfer.setActualDate(new Date()); |
|
|
|
transfer.setDataTime(new DateTime()); |
|
|
|
transfer.setBuckleKey("001"); |
|
|
|
transfer.setBuckle("未申请"); |
|
|
|
transfer.setUpdateState("1"); |
|
|
|
transfer.setUpdateTime(new DateTime()); |
|
|
|
BigDecimal money = new BigDecimal(0); |
|
|
|
if (null != applyRecord.getTransferPrincipal()) { |
|
|
|
money = applyRecord.getTransferPrincipal(); |
|
|
|
} |
|
|
|
if (null != applyRecord.getDefaultInterest()) { |
|
|
|
money = applyRecord.getDefaultInterest().add(money); |
|
|
|
} |
|
|
|
String amount = String.valueOf(money); |
|
|
|
transfer.setActualMoney(new BigDecimal("-" + amount)); |
|
|
|
loanRepaymentHistoryService.insert(transfer); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean pushPaymentVoucher(String sid, String paySid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
List<LoanTransferPaymentRecord> records = loanTransferPaymentRecordService.selByMainSidAndPaySid(sid, paySid); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
PaymentVoucher paymentVoucher = new PaymentVoucher(); |
|
|
|
List<PaymentVoucher.PaymentVoucherDetail> voucherDetails = new ArrayList<>(); |
|
|
@ -889,6 +928,7 @@ public class LoanTransferPaymentApplyService extends MybatisBaseService<LoanTran |
|
|
|
paymentVoucher.setVoucherDetails(voucherDetails); |
|
|
|
finKingDeeFeign.savePaymentVoucher(paymentVoucher); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1231,4 +1271,6 @@ public class LoanTransferPaymentApplyService extends MybatisBaseService<LoanTran |
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|