Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
yunuo970428 4 weeks ago
parent
commit
23f33aba96
  1. 496
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  2. 149
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java
  3. 6
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/risk/secondarysales/SecondarySalesService.java

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

@ -4418,260 +4418,258 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
//更新审核时间
finSelectedReceivablesDetailed.setAuditDate(DateUtil.today());
finSelectedReceivablesDetailedService.updateById(finSelectedReceivablesDetailed);
//认资方退还垫款或者结清时资方逾期利息
if (v.getReceivablesName().equals("资方退还垫款") || v.getReceivablesName().equals("贷款保证金扣罚")) {
CollectionVoucher.CollectionVoucherDetail d = getReturnBackMoneyVoucher(v, collectionDate);
voucherDetails.add(d);
}
//推送间还待转付列表
if (v.getReceivablesName().equals("月还") || v.getReceivablesName().equals("资方逾期利息")) {
String planSid = "";
if (v.getReceivablesName().equals("月还")) {
planSid = v.getReceivablesSid();
} else {
FinUncollectedReceivablesDetailedJR jr = finUncollectedReceivablesDetailedJRService.fetchBySid(v.getReceivablesSid());
if (jr != null) {
planSid = jr.getBusSid();
}
}
LoanRepaymentPlanDetails planDetails = loanRepaymentPlanDetailsFeign.fetchDetails(planSid).getData();
if (null != planDetails) {
if (v.getReceivablesName().equals("月还")) {
//推送间还认款记录
LoanRepaymentHistory historyEntity = new LoanRepaymentHistory();
historyEntity.setPlanDetailSid(planSid);
historyEntity.setScheduleSid(planDetails.getScheduleSid());
historyEntity.setSkdBillNo(finalConfirmation.getBillNo());
historyEntity.setUpdateTime(new DateTime());
historyEntity.setUpdateState("1");
historyEntity.setDataTime(new DateTime());
historyEntity.setBuckle("审核通过");
historyEntity.setBuckleKey("003");
historyEntity.setActualMoney(new BigDecimal(v.getSubscriptionMoney()));
historyEntity.setReturnWay("间还");
historyEntity.setReturnWayKey("02");
if (null != planDetails.getPaymentMoney()) {
if (planDetails.getPaymentMoney().compareTo(BigDecimal.ZERO) == 1) {
BigDecimal paymentMoney = planDetails.getPaymentMoney();
String subscriptionMoney = v.getSubscriptionMoney();
BigDecimal subtract = paymentMoney.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentMoney(subtract);
loanRepaymentPlanDetailsFeign.updateByEntity(planDetails);
String orderSid = planDetails.getSalesOrderSid();
String isOther = loanRepaymentScheduleFeign.returnBankOrOtherBankByPlanSid(planSid).getData();
String bankSid = "";
String scheduleSid = planDetails.getScheduleSid();
LoanRepaymentSchedule schedule = loanRepaymentScheduleFeign.fetchBySid(scheduleSid).getData();
if (isOther.equals("0")) {
if (StringUtils.isNotBlank(schedule.getBankSid())) {
bankSid = schedule.getBankSid();
}
} else if (isOther.equals("1")) {
if (StringUtils.isNotBlank(schedule.getOtherBankSid())) {
bankSid = schedule.getOtherBankSid();
}
}
ResultBean<LoanFinBank> bankResultBean = loanFinBankFeign.fetchEntityBySid(bankSid);
if (bankResultBean.getData() != null) {
LoanFinBank loanFinBank = bankResultBean.getData();
if (null != loanFinBank.getReAdvances()) {
if (loanFinBank.getReAdvances() == 1) {
try {
Date collDate = sdf.parse(finalConfirmation.getCollectionDate());
historyEntity.setActualDate(collDate);
if (planDetails.getDueDate().compareTo(collDate) > 0) {
//未逾期
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(planDetails.getDueDate());
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
} else {
//已逾期
historyEntity.setPrepareDate(new DateTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR();
jr.setCreateBySid(userSid);
SysUserVo userVo = sysUserFeign.fetchBySid(userSid).getData();
jr.setCreateByName(userVo.getName());
jr.setBusSid(planSid);
jr.setCurrentReceivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setReveivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setPayCostTitleKey("007");
jr.setPayCostTitleValue("资方退还垫款");
jr.setOrgSidPath(planDetails.getOrgSidPath());
jr.setUseOrgName(planDetails.getUseOrgName());
jr.setUseOrgSid(planDetails.getUseOrgSid());
jr.setStaffDeptName(planDetails.getDept());
jr.setStaffName(planDetails.getStaffName());
jr.setStaffDeptSid(planDetails.getDeptSid());
jr.setStaffUserSid(planDetails.getSalesUserSid());
finUncollectedReceivablesDetailedJRService.insert(jr);
}
}
}
} else if (planDetails.getPaymentMoney().compareTo(BigDecimal.ZERO) == 0) {
try {
Date collDate = sdf.parse(finalConfirmation.getCollectionDate());
historyEntity.setActualDate(collDate);
if (planDetails.getDueDate().compareTo(collDate) > 0) {
//未逾期
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(planDetails.getDueDate());
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
} else {
//已逾期
historyEntity.setPrepareDate(new DateTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
}
} else {
try {
Date collDate = sdf.parse(finalConfirmation.getCollectionDate());
historyEntity.setActualDate(collDate);
if (planDetails.getDueDate().compareTo(collDate) > 0) {
//未逾期
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(planDetails.getDueDate());
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
} else {
//已逾期
historyEntity.setPrepareDate(new DateTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
}
loanRepaymentHistoryFeign.saveHistoryByEntity(historyEntity);
}
if (v.getReceivablesName().equals("资方逾期利息")) {
if (null != planDetails.getPaymentInterest()) {
if (planDetails.getPaymentInterest().compareTo(BigDecimal.ZERO) == 1) {
BigDecimal paymentInterest = planDetails.getPaymentInterest();
String subscriptionMoney = v.getSubscriptionMoney();
BigDecimal subtract = paymentInterest.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentInterest(subtract);
BigDecimal paymentMoney = planDetails.getPaymentMoney();
BigDecimal subtract2 = paymentMoney.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentMoney(subtract2);
loanRepaymentPlanDetailsFeign.updateByEntity(planDetails);
String orderSid = planDetails.getSalesOrderSid();
String isOther = loanRepaymentScheduleFeign.returnBankOrOtherBankByPlanSid(planSid).getData();
String bankSid = "";
String scheduleSid = planDetails.getScheduleSid();
LoanRepaymentSchedule schedule = loanRepaymentScheduleFeign.fetchBySid(scheduleSid).getData();
if (isOther.equals("0")) {
if (StringUtils.isNotBlank(schedule.getBankSid())) {
bankSid = schedule.getBankSid();
}
} else if (isOther.equals("1")) {
if (StringUtils.isNotBlank(schedule.getOtherBankSid())) {
bankSid = schedule.getOtherBankSid();
}
}
ResultBean<LoanFinBank> bankResultBean = loanFinBankFeign.fetchEntityBySid(bankSid);
if (bankResultBean.getData() != null) {
LoanFinBank loanFinBank = bankResultBean.getData();
if (null != loanFinBank.getReAdvances()) {
if (loanFinBank.getReAdvances() == 1) {
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR();
jr.setCreateBySid(userSid);
SysUserVo userVo = sysUserFeign.fetchBySid(userSid).getData();
jr.setCreateByName(userVo.getName());
jr.setBusSid(planSid);
jr.setCurrentReceivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setReveivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setPayCostTitleKey("007");
jr.setPayCostTitleValue("资方退还垫款");
jr.setOrgSidPath(planDetails.getOrgSidPath());
jr.setUseOrgName(planDetails.getUseOrgName());
jr.setUseOrgSid(planDetails.getUseOrgSid());
jr.setStaffDeptName(planDetails.getDept());
jr.setStaffName(planDetails.getStaffName());
jr.setStaffDeptSid(planDetails.getDeptSid());
jr.setStaffUserSid(planDetails.getSalesUserSid());
finUncollectedReceivablesDetailedJRService.insert(jr);
}
}
}
}
}
}
}
//推送间还月还收款凭证
CollectionVoucher.CollectionVoucherDetail d = getDueMoneyAndOverDueMoneyVoucher(v, collectionDate);
voucherDetails.add(d);
}
//认资金占用费消减平台资金占用费
if (v.getReceivablesName().equals("资金占用费")) {
String planSid = "";
String planSid = "";
if (v.getReceivablesName().equals("月还")) {
planSid = v.getReceivablesSid();
} else {
FinUncollectedReceivablesDetailedJR jr = finUncollectedReceivablesDetailedJRService.fetchBySid(v.getReceivablesSid());
if (jr != null) {
planSid = jr.getBusSid();
}
LoanRepaymentPlanDetails planDetails = loanRepaymentPlanDetailsFeign.fetchDetails(planSid).getData();
if (null != planDetails) {
LoanPlanDetailsVoForFundVoucher f = loanRepaymentPlanDetailsFeign.getLoanPlanDetailsVoForFundVoucher(planDetails.getBusVinSid());
if (null != f) {
List<GeneralVoucher.GeneralVoucherDetail> g = getFundGenralVoucher(planDetails, f);
if (!g.isEmpty()) {
g.stream().forEach(gv -> {
generalVoucherDetails.add(gv);
});
}
LoanPushFundHistory loanPushFundHistory = new LoanPushFundHistory();
if (null != f.getDuePushMoney()) {
loanPushFundHistory.setFund(f.getDuePushMoney());
}
loanPushFundHistory.setBusVinSid(planDetails.getBusVinSid());
loanPushFundHistory.setUseOrgName(planDetails.getUseOrgName());
loanPushFundHistory.setUseOrgSid(planDetails.getUseOrgSid());
String lastTimes = loanPushFundHistoryFeign.getLastDateByBusVinSid(planDetails.getBusVinSid()).getData();
if (StringUtils.isNotBlank(lastTimes)) {
try {
loanPushFundHistory.setLastAccrualDate(sdfTimes.parse(lastTimes));
} catch (ParseException e) {
e.printStackTrace();
}
}
loanPushFundHistoryFeign.saveHistoryByEntity(loanPushFundHistory);
// fundHistoryList.add(loanPushFundHistory);
}
//推送资金占用费出纳确认后
CollectionVoucher.CollectionVoucherDetail d = getFundVoucher(v, collectionDate, planDetails);
if (null != d) {
CollectionVoucher.CollectionVoucherDetail v1 = new CollectionVoucher.CollectionVoucherDetail();
BeanUtil.copyProperties(d, v1);
v1.setSceneCode(SceneCodeEnum.FUND_VOUCHER1.getCode());
voucherDetails.add(v1);
CollectionVoucher.CollectionVoucherDetail v2 = new CollectionVoucher.CollectionVoucherDetail();
BeanUtil.copyProperties(d, v2);
v2.setSceneCode(SceneCodeEnum.FUND_VOUCHER2.getCode());
collectionAfterVoucherDetails.add(v2);
}
}
}
//认名义价、合同违约金、其他费用收款
if (v.getReceivablesName().equals("名义价") ||
v.getReceivablesName().equals("合同违约金") ||
v.getReceivablesName().equals("其他费用") ||
v.getReceivablesName().equals("结清时资方逾期利息")
) {
CollectionVoucher.CollectionVoucherDetail d = getBalanceMoneyVoucher(v, collectionDate);
voucherDetails.add(d);
}
LoanRepaymentPlanDetails planDetails = loanRepaymentPlanDetailsFeign.fetchDetails(planSid).getData();
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.details(planDetails.getBusVinSid()).getData();
if("0".equals(busSalesOrderVehicle.getRiskState().toString())){
//认资方退还垫款或者结清时资方逾期利息
if (v.getReceivablesName().equals("资方退还垫款") || v.getReceivablesName().equals("贷款保证金扣罚")) {
CollectionVoucher.CollectionVoucherDetail d = getReturnBackMoneyVoucher(v, collectionDate);
voucherDetails.add(d);
}
//推送间还待转付列表
if (v.getReceivablesName().equals("月还") || v.getReceivablesName().equals("资方逾期利息")) {
if (null != planDetails) {
if (v.getReceivablesName().equals("月还")) {
//推送间还认款记录
LoanRepaymentHistory historyEntity = new LoanRepaymentHistory();
historyEntity.setPlanDetailSid(planSid);
historyEntity.setScheduleSid(planDetails.getScheduleSid());
historyEntity.setSkdBillNo(finalConfirmation.getBillNo());
historyEntity.setUpdateTime(new DateTime());
historyEntity.setUpdateState("1");
historyEntity.setDataTime(new DateTime());
historyEntity.setBuckle("审核通过");
historyEntity.setBuckleKey("003");
historyEntity.setActualMoney(new BigDecimal(v.getSubscriptionMoney()));
historyEntity.setReturnWay("间还");
historyEntity.setReturnWayKey("02");
if (null != planDetails.getPaymentMoney()) {
if (planDetails.getPaymentMoney().compareTo(BigDecimal.ZERO) == 1) {
BigDecimal paymentMoney = planDetails.getPaymentMoney();
String subscriptionMoney = v.getSubscriptionMoney();
BigDecimal subtract = paymentMoney.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentMoney(subtract);
loanRepaymentPlanDetailsFeign.updateByEntity(planDetails);
String orderSid = planDetails.getSalesOrderSid();
String isOther = loanRepaymentScheduleFeign.returnBankOrOtherBankByPlanSid(planSid).getData();
String bankSid = "";
String scheduleSid = planDetails.getScheduleSid();
LoanRepaymentSchedule schedule = loanRepaymentScheduleFeign.fetchBySid(scheduleSid).getData();
if (isOther.equals("0")) {
if (StringUtils.isNotBlank(schedule.getBankSid())) {
bankSid = schedule.getBankSid();
}
} else if (isOther.equals("1")) {
if (StringUtils.isNotBlank(schedule.getOtherBankSid())) {
bankSid = schedule.getOtherBankSid();
}
}
ResultBean<LoanFinBank> bankResultBean = loanFinBankFeign.fetchEntityBySid(bankSid);
if (bankResultBean.getData() != null) {
LoanFinBank loanFinBank = bankResultBean.getData();
if (null != loanFinBank.getReAdvances()) {
if (loanFinBank.getReAdvances() == 1) {
try {
Date collDate = sdf.parse(finalConfirmation.getCollectionDate());
historyEntity.setActualDate(collDate);
if (planDetails.getDueDate().compareTo(collDate) > 0) {
//未逾期
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(planDetails.getDueDate());
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
} else {
//已逾期
historyEntity.setPrepareDate(new DateTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR();
jr.setCreateBySid(userSid);
SysUserVo userVo = sysUserFeign.fetchBySid(userSid).getData();
jr.setCreateByName(userVo.getName());
jr.setBusSid(planSid);
jr.setCurrentReceivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setReveivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setPayCostTitleKey("007");
jr.setPayCostTitleValue("资方退还垫款");
jr.setOrgSidPath(planDetails.getOrgSidPath());
jr.setUseOrgName(planDetails.getUseOrgName());
jr.setUseOrgSid(planDetails.getUseOrgSid());
jr.setStaffDeptName(planDetails.getDept());
jr.setStaffName(planDetails.getStaffName());
jr.setStaffDeptSid(planDetails.getDeptSid());
jr.setStaffUserSid(planDetails.getSalesUserSid());
finUncollectedReceivablesDetailedJRService.insert(jr);
}
}
}
} else if (planDetails.getPaymentMoney().compareTo(BigDecimal.ZERO) == 0) {
try {
Date collDate = sdf.parse(finalConfirmation.getCollectionDate());
historyEntity.setActualDate(collDate);
if (planDetails.getDueDate().compareTo(collDate) > 0) {
//未逾期
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(planDetails.getDueDate());
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
} else {
//已逾期
historyEntity.setPrepareDate(new DateTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
}
} else {
try {
Date collDate = sdf.parse(finalConfirmation.getCollectionDate());
historyEntity.setActualDate(collDate);
if (planDetails.getDueDate().compareTo(collDate) > 0) {
//未逾期
Calendar cal_1 = Calendar.getInstance();// 使用默认时区和语言环境获得一个日历
cal_1.setTime(planDetails.getDueDate());
cal_1.add(Calendar.DAY_OF_MONTH, -1);
historyEntity.setPrepareDate(cal_1.getTime());
} else {
//已逾期
historyEntity.setPrepareDate(new DateTime());
}
} catch (ParseException e) {
e.printStackTrace();
}
historyEntity.setPaymentState("待转付");
historyEntity.setPaymentStateKey("001");
}
loanRepaymentHistoryFeign.saveHistoryByEntity(historyEntity);
}
if (v.getReceivablesName().equals("资方逾期利息")) {
if (null != planDetails.getPaymentInterest()) {
if (planDetails.getPaymentInterest().compareTo(BigDecimal.ZERO) == 1) {
BigDecimal paymentInterest = planDetails.getPaymentInterest();
String subscriptionMoney = v.getSubscriptionMoney();
BigDecimal subtract = paymentInterest.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentInterest(subtract);
BigDecimal paymentMoney = planDetails.getPaymentMoney();
BigDecimal subtract2 = paymentMoney.subtract(new BigDecimal(subscriptionMoney));
planDetails.setPaymentMoney(subtract2);
loanRepaymentPlanDetailsFeign.updateByEntity(planDetails);
String orderSid = planDetails.getSalesOrderSid();
String isOther = loanRepaymentScheduleFeign.returnBankOrOtherBankByPlanSid(planSid).getData();
String bankSid = "";
String scheduleSid = planDetails.getScheduleSid();
LoanRepaymentSchedule schedule = loanRepaymentScheduleFeign.fetchBySid(scheduleSid).getData();
if (isOther.equals("0")) {
if (StringUtils.isNotBlank(schedule.getBankSid())) {
bankSid = schedule.getBankSid();
}
} else if (isOther.equals("1")) {
if (StringUtils.isNotBlank(schedule.getOtherBankSid())) {
bankSid = schedule.getOtherBankSid();
}
}
ResultBean<LoanFinBank> bankResultBean = loanFinBankFeign.fetchEntityBySid(bankSid);
if (bankResultBean.getData() != null) {
LoanFinBank loanFinBank = bankResultBean.getData();
if (null != loanFinBank.getReAdvances()) {
if (loanFinBank.getReAdvances() == 1) {
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR();
jr.setCreateBySid(userSid);
SysUserVo userVo = sysUserFeign.fetchBySid(userSid).getData();
jr.setCreateByName(userVo.getName());
jr.setBusSid(planSid);
jr.setCurrentReceivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setReveivableMoney(new BigDecimal(v.getSubscriptionMoney()));
jr.setPayCostTitleKey("007");
jr.setPayCostTitleValue("资方退还垫款");
jr.setOrgSidPath(planDetails.getOrgSidPath());
jr.setUseOrgName(planDetails.getUseOrgName());
jr.setUseOrgSid(planDetails.getUseOrgSid());
jr.setStaffDeptName(planDetails.getDept());
jr.setStaffName(planDetails.getStaffName());
jr.setStaffDeptSid(planDetails.getDeptSid());
jr.setStaffUserSid(planDetails.getSalesUserSid());
finUncollectedReceivablesDetailedJRService.insert(jr);
}
}
}
}
}
}
}
//推送间还月还收款凭证
CollectionVoucher.CollectionVoucherDetail d = getDueMoneyAndOverDueMoneyVoucher(v, collectionDate);
voucherDetails.add(d);
}
//认资金占用费消减平台资金占用费
if (v.getReceivablesName().equals("资金占用费")) {
if (null != planDetails) {
LoanPlanDetailsVoForFundVoucher f = loanRepaymentPlanDetailsFeign.getLoanPlanDetailsVoForFundVoucher(planDetails.getBusVinSid());
if (null != f) {
List<GeneralVoucher.GeneralVoucherDetail> g = getFundGenralVoucher(planDetails, f);
if (!g.isEmpty()) {
g.stream().forEach(gv -> {
generalVoucherDetails.add(gv);
});
}
LoanPushFundHistory loanPushFundHistory = new LoanPushFundHistory();
if (null != f.getDuePushMoney()) {
loanPushFundHistory.setFund(f.getDuePushMoney());
}
loanPushFundHistory.setBusVinSid(planDetails.getBusVinSid());
loanPushFundHistory.setUseOrgName(planDetails.getUseOrgName());
loanPushFundHistory.setUseOrgSid(planDetails.getUseOrgSid());
String lastTimes = loanPushFundHistoryFeign.getLastDateByBusVinSid(planDetails.getBusVinSid()).getData();
if (StringUtils.isNotBlank(lastTimes)) {
try {
loanPushFundHistory.setLastAccrualDate(sdfTimes.parse(lastTimes));
} catch (ParseException e) {
e.printStackTrace();
}
}
loanPushFundHistoryFeign.saveHistoryByEntity(loanPushFundHistory);
// fundHistoryList.add(loanPushFundHistory);
}
//推送资金占用费出纳确认后
CollectionVoucher.CollectionVoucherDetail d = getFundVoucher(v, collectionDate, planDetails);
if (null != d) {
CollectionVoucher.CollectionVoucherDetail v1 = new CollectionVoucher.CollectionVoucherDetail();
BeanUtil.copyProperties(d, v1);
v1.setSceneCode(SceneCodeEnum.FUND_VOUCHER1.getCode());
voucherDetails.add(v1);
CollectionVoucher.CollectionVoucherDetail v2 = new CollectionVoucher.CollectionVoucherDetail();
BeanUtil.copyProperties(d, v2);
v2.setSceneCode(SceneCodeEnum.FUND_VOUCHER2.getCode());
collectionAfterVoucherDetails.add(v2);
}
}
}
//认名义价、合同违约金、其他费用收款
if (v.getReceivablesName().equals("名义价") ||
v.getReceivablesName().equals("合同违约金") ||
v.getReceivablesName().equals("其他费用") ||
v.getReceivablesName().equals("结清时资方逾期利息")
) {
CollectionVoucher.CollectionVoucherDetail d = getBalanceMoneyVoucher(v, collectionDate);
voucherDetails.add(d);
}
}
});
//查询该申请已认款金额总数
subscriptionMoneyAll = finSelectedReceivablesDetailedVos.stream().map(FinSelectedReceivablesDetailedVo::getSubscriptionMoney).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add);

149
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java

@ -315,19 +315,6 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService<LoanSecon
bv.setModelId(loanSecondarySalesApply.getProcDefId());
Map<String, Object> variables = new HashMap<>();
Map<String, Object> appMap = new HashMap<>();
if ("Activity_0rm74ey".equals(bv.getTaskDefKey())) {//风控处置岗审批
/* if (StringUtils.isBlank(query.getVehicleEvaluation())) {
return rb.setMsg("请填写评估价格");
}*/
LoanSecondarySalesCost loanSecondarySalesCost = loanSecondarySalesCostMapper.selectMainSid(query.getBusinessSid());
if (loanSecondarySalesCost != null) {
if (new BigDecimal(query.getVehicleEvaluation()).compareTo(loanSecondarySalesCost.getVehPrice()) > 0) {
variables.put("isTrue", true);
} else {
variables.put("isTrue", false);
}
}
}
appMap.put("sid", query.getBusinessSid());
variables.put("app", appMap);
bv.setFormVariables(variables);
@ -616,69 +603,107 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService<LoanSecon
finUncollectedReceivablesDetailedJR.setOrgSidPath(loanSecondarySalesApply.getOrgSidPath());
finUncollectedReceivablesDetailedJR.setKxState("01");
if ("02".equals(loanSecondarySalesCost.getBankSettleCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("017");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("预计资方结清费用");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getBankSettleCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getBankSettleCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getBankSettleCost() != null){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("017");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("预计资方结清费用");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getBankSettleCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getBankSettleCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
if ("02".equals(loanSecondarySalesCost.getVehicleViolationCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("018");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("车辆违章费用");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getVehicleViolationCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getVehicleViolationCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getVehicleViolationCost() != null){
finUncollectedReceivablesDetailedJR.setSid(UUID.randomUUID().toString());
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("018");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("车辆违章费用");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getVehicleViolationCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getVehicleViolationCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
if ("02".equals(loanSecondarySalesCost.getInspectYearCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("019");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("年检费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getInspectYearCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getInspectYearCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getInspectYearCost() != null){
finUncollectedReceivablesDetailedJR.setSid(UUID.randomUUID().toString());
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("019");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("年检费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getInspectYearCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getInspectYearCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
if ("02".equals(loanSecondarySalesCost.getInsureCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("020");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("保险费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getInsureCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getInsureCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getInsureCost() != null){
finUncollectedReceivablesDetailedJR.setSid(UUID.randomUUID().toString());
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("020");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("保险费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getInsureCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getInsureCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
if ("02".equals(loanSecondarySalesCost.getOwnershipCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("021");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("过户费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getOwnershipCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getOwnershipCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getOwnershipCost() != null){
finUncollectedReceivablesDetailedJR.setSid(UUID.randomUUID().toString());
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("021");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("过户费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getOwnershipCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getOwnershipCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
if ("02".equals(loanSecondarySalesCost.getStopCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("022");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("停车费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getStopCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getStopCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getStopCost() != null){
finUncollectedReceivablesDetailedJR.setSid(UUID.randomUUID().toString());
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("022");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("停车费");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getStopCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getStopCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
if ("02".equals(loanSecondarySalesCost.getOtherCostAssumeKey())){
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("023 ");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("其他费用");
finUncollectedReceivablesDetailedJR.setReveivableMoney(new BigDecimal(loanSecondarySalesCost.getOtherCostAssume()));
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(new BigDecimal(loanSecondarySalesCost.getOtherCostAssume()));
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
if(loanSecondarySalesCost.getOtherCost() != null){
finUncollectedReceivablesDetailedJR.setSid(UUID.randomUUID().toString());
finUncollectedReceivablesDetailedJR.setPayCostTitleKey("023 ");
finUncollectedReceivablesDetailedJR.setPayCostTitleValue("其他费用");
finUncollectedReceivablesDetailedJR.setReveivableMoney(loanSecondarySalesCost.getOtherCost());
finUncollectedReceivablesDetailedJR.setCurrentReceivableMoney(loanSecondarySalesCost.getOtherCost());
finUncollectedReceivablesDetailedJRFeign.save(finUncollectedReceivablesDetailedJR);
}
}
} else {
//极光推送
loanSecondarySalesApply = fetchBySid(businessSid);
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery();
MessageFlowVo messageFlowVo = new MessageFlowVo();
BeanUtil.copyProperties(ufVo, messageFlowVo);
messageFlowVo.setProcDefId(loanSecondarySalesApply.getProcDefId());
messageFlowVo.setProcInsId(loanSecondarySalesApply.getProcInstId());
messageFlowableQuery.setUfVo(messageFlowVo);
messageFlowableQuery.setAppMap(appMap);
messageFlowableQuery.setBusinessSid(businessSid);
messageFlowableQuery.setModuleName("交回车辆二次销售申请");
messageFlowableQuery.setMsgContent(loanSecondarySalesApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批");
messageFlowableQuery.setMsgTitle("交回车辆二次销售申请");
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery);
try {
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("demo-pool-%d").build();
ExecutorService pool = new ThreadPoolExecutor(2, 100,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
LoanSecondarySalesApply finalLoanSecondarySalesApply = loanSecondarySalesApply;
Future future1 = pool.submit(() -> {
//极光推送
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery();
MessageFlowVo messageFlowVo = new MessageFlowVo();
BeanUtil.copyProperties(ufVo, messageFlowVo);
messageFlowVo.setProcDefId(finalLoanSecondarySalesApply.getProcDefId());
messageFlowVo.setProcInsId(finalLoanSecondarySalesApply.getProcInstId());
messageFlowableQuery.setUfVo(messageFlowVo);
messageFlowableQuery.setAppMap(appMap);
messageFlowableQuery.setBusinessSid(businessSid);
messageFlowableQuery.setModuleName("交回车辆二次销售申请");
messageFlowableQuery.setMsgContent(finalLoanSecondarySalesApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批");
messageFlowableQuery.setMsgTitle("交回车辆二次销售申请");
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery);
});
} catch (Exception e) {
e.printStackTrace();
}
}
return rb.success().setData(resultBean.getData());
} else {

6
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/risk/secondarysales/SecondarySalesService.java

@ -214,14 +214,14 @@ public class SecondarySalesService {
SecondSalesInitVo secondSalesInitVo = new SecondSalesInitVo();
LoanSecondarySalesApplyNodeQuery getNodeQuery = new LoanSecondarySalesApplyNodeQuery();
BeanUtil.copyProperties(query, getNodeQuery);
String data = "";
ResultBean<List<LoanSecondarySalesApplyNodeVo>> getNextNodesForSubmit = loanSecondarySalesApplyFeign.getAppNextNodesForSubmit(getNodeQuery);
String data = "风控中心风控部经理审批/结束";
/*ResultBean<List<LoanSecondarySalesApplyNodeVo>> getNextNodesForSubmit = loanSecondarySalesApplyFeign.getAppNextNodesForSubmit(getNodeQuery);
if (getNextNodesForSubmit.getSuccess()) {
getNextNodesForSubmit.getData().removeAll(Collections.singleton(null));
data = getNextNodesForSubmit.getData().get(0).getName();
} else {
return rb.setMsg(getNextNodesForSubmit.getMsg());
}
}*/
secondSalesInitVo.setTitle(data);
List<ItemEditTextInfoCommon> itemEditTextInfos = new ArrayList<>();
ItemEditTextInfoCommon itemEditTextInfo = new ItemEditTextInfoCommon();

Loading…
Cancel
Save