Browse Source

完善金融认款部分、划扣申请部分

master
fanzongzhe 1 year ago
parent
commit
f53d7c1586
  1. 90
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  2. 5
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanmonthlyaccrualapply/LoanMonthlyAccrualApplyService.java
  3. 13
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java

90
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java

@ -3733,44 +3733,69 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
}
LoanRepaymentPlanDetails planDetails = loanRepaymentPlanDetailsFeign.fetchDetails(planSid).getData();
if (null != planDetails) {
if (planDetails.getPaymentMoney().compareTo(BigDecimal.ZERO) == 1) {
String orderSid = planDetails.getSalesOrderSid();
ResultBean<LoanFinBank> bankResultBean = loanFinBankFeign.reAdvancesByOrderSid(orderSid);
if (bankResultBean.getData() != null) {
LoanFinBank loanFinBank = bankResultBean.getData();
if (null != loanFinBank.getReAdvances()) {
if (loanFinBank.getReAdvances() == 1) {
LoanRepaymentHistory historyEntity = new LoanRepaymentHistory();
historyEntity.setSkdBillNo(finalConfirmation.getBillNo());
historyEntity.setActualMoney(new BigDecimal(v.getSubscriptionMoney()));
historyEntity.setActualDate(new DateTime());
historyEntity.setReturnWay("间还");
historyEntity.setReturnWayKey("02");
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
Date dueDate = planDetails.getDueDate();
if (new Date().compareTo(dueDate) > 0) {
if (null != planDetails.getPaymentMoney()) {
if (planDetails.getPaymentMoney().compareTo(BigDecimal.ZERO) == 1) {
String orderSid = planDetails.getSalesOrderSid();
ResultBean<LoanFinBank> bankResultBean = loanFinBankFeign.reAdvancesByOrderSid(orderSid);
if (bankResultBean.getData() != null) {
LoanFinBank loanFinBank = bankResultBean.getData();
if (null != loanFinBank.getReAdvances()) {
if (loanFinBank.getReAdvances() == 1) {
LoanRepaymentHistory historyEntity = new LoanRepaymentHistory();
historyEntity.setSkdBillNo(finalConfirmation.getBillNo());
historyEntity.setActualMoney(new BigDecimal(v.getSubscriptionMoney()));
historyEntity.setActualDate(new DateTime());
historyEntity.setReturnWay("间还");
historyEntity.setReturnWayKey("02");
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
Date dueDate = planDetails.getDueDate();
if (new Date().compareTo(dueDate) > 0) {
historyEntity.setPrepareDate(new DateTime());
} else {
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(dueDate);
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
}
historyEntity.setPrepareDate(new DateTime());
historyEntity.setPlanDetailSid(planSid);
historyEntity.setScheduleSid(planDetails.getScheduleSid());
loanRepaymentHistoryFeign.saveHistoryByEntity(historyEntity);
} else {
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(dueDate);
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
BigDecimal paymentMoney = planDetails.getPaymentMoney();
String subscriptionMoney = v.getSubscriptionMoney();
BigDecimal subtract = paymentMoney.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentMoney(subtract);
loanRepaymentPlanDetailsFeign.updateByEntity(planDetails);
}
historyEntity.setPrepareDate(new DateTime());
historyEntity.setPlanDetailSid(planSid);
historyEntity.setScheduleSid(planDetails.getScheduleSid());
loanRepaymentHistoryFeign.saveHistoryByEntity(historyEntity);
} else {
BigDecimal paymentMoney = planDetails.getPaymentMoney();
String subscriptionMoney = v.getSubscriptionMoney();
BigDecimal subtract = paymentMoney.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentMoney(subtract);
loanRepaymentPlanDetailsFeign.updateByEntity(planDetails);
}
}
} else {
LoanRepaymentHistory historyEntity = new LoanRepaymentHistory();
historyEntity.setSkdBillNo(finalConfirmation.getBillNo());
historyEntity.setActualMoney(new BigDecimal(v.getSubscriptionMoney()));
historyEntity.setActualDate(new DateTime());
historyEntity.setReturnWay("间还");
historyEntity.setReturnWayKey("02");
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
Date dueDate = planDetails.getDueDate();
if (new Date().compareTo(dueDate) > 0) {
historyEntity.setPrepareDate(new DateTime());
} else {
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(dueDate);
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
}
historyEntity.setPrepareDate(new DateTime());
historyEntity.setPlanDetailSid(planSid);
historyEntity.setScheduleSid(planDetails.getScheduleSid());
loanRepaymentHistoryFeign.saveHistoryByEntity(historyEntity);
}
} else {
} else {
LoanRepaymentHistory historyEntity = new LoanRepaymentHistory();
historyEntity.setSkdBillNo(finalConfirmation.getBillNo());
historyEntity.setActualMoney(new BigDecimal(v.getSubscriptionMoney()));
@ -3794,6 +3819,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
loanRepaymentHistoryFeign.saveHistoryByEntity(historyEntity);
}
}
}
});

5
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanmonthlyaccrualapply/LoanMonthlyAccrualApplyService.java

@ -682,8 +682,11 @@ public class LoanMonthlyAccrualApplyService extends MybatisBaseService<LoanMonth
private void pushAccrualVoucher(String businessSid) {
List<LoanMonthlyAccrualRecord> records = loanMonthlyAccrualRecordService.selByMainSid(businessSid);
// xxxxxxxxx
if (!records.isEmpty()) {
}
}

13
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanrepaymenthistory/LoanRepaymentHistoryService.java

@ -713,12 +713,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
qw.ne("h.buckleKey", "002");
qw.ne("h.buckleKey", "003");
qw.eq("h.updateState", "0");
List<String> monthHeadAndLast = getMonthHeadAndLast(new Date());
String head = monthHeadAndLast.get(0);
String last = monthHeadAndLast.get(1);
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')"
);
List<String> histories = baseMapper.selUpdateStateList(qw);
if (!histories.isEmpty()) {
for (String historySid : histories) {
@ -753,12 +747,7 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen
qw.like("p.orgSidPath", orgSidPath);
qw.ne("h.buckleKey", "002");
qw.ne("h.buckleKey", "003");
List<String> monthHeadAndLast = getMonthHeadAndLast(new Date());
String head = monthHeadAndLast.get(0);
String last = monthHeadAndLast.get(1);
qw.apply(StringUtils.isNotEmpty(head), "date_format (h.actualDate,'%Y-%m-%d') >= date_format('" + head + "','%Y-%m-%d')").
apply(StringUtils.isNotEmpty(last), "date_format (h.actualDate,'%Y-%m-%d') <= date_format('" + last + "','%Y-%m-%d')"
);
qw.eq("h.updateState","1");
List<LoanRepaymentHistoryVo> histories = baseMapper.selbuckleNewInitList(qw);
Set<String> planSids = new HashSet<>();
if (!histories.isEmpty()) {

Loading…
Cancel
Save