diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicle.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicle.java index 19c2adde51..a9ca136811 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicle.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicle.java @@ -93,7 +93,7 @@ public class BusSalesOrderVehicle extends BaseEntity { private String vehMark; @ApiModelProperty("结清申请提交时间") private Date settleApplyDate; - //风控状态(0正常,1交回,2赎回,3转租,4不追偿,5处置损失,6亏损立案,7亏损执行,8亏损结案、9赎回中,10 二次销售中、11转租中) + //风控状态(0正常,1交回,2赎回,3转租,4赎回中、5二次销售中、6转租中、7处置损失、8不追偿、9未交回立案、10交回立案、11亏损立案、12执行、13诉讼结案、14执行结案) @ApiModelProperty("风控状态") private Integer riskState; //是否生成资金占用费(1生成,0不生成.默认生成,交回后改为不生成,若赎回改为生成) diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeignFallback.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeignFallback.java index 6a609984fd..c31a968dac 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeignFallback.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeignFallback.java @@ -203,4 +203,9 @@ public class BusSalesOrderVehicleFeignFallback implements BusSalesOrderVehicleFe return null; } + @Override + public List selectListBySid(List busVinSidList) { + return null; + } + } diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java index 28a16f49ab..92d15aa9a9 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java @@ -4726,10 +4726,12 @@ public class FinCollectionConfirmationService extends MybatisBaseService list2 = new ArrayList<>(); List list3 = new ArrayList<>(); List list4 = new ArrayList<>(); + List list5 = new ArrayList<>(); BigDecimal all = BigDecimal.ZERO;//赎回 BigDecimal all2 = BigDecimal.ZERO;//二次销售 BigDecimal all3 = BigDecimal.ZERO;//亏损立案 - BigDecimal all4 = BigDecimal.ZERO;//亏损立案 + BigDecimal all4 = BigDecimal.ZERO;//未交回立案 + BigDecimal all5 = BigDecimal.ZERO;//执行 BigDecimal otherMoney = BigDecimal.ZERO; String payType = ""; DictCommonVo dictCommonVo = dictCommonFeign.selectBykey(finalConfirmation.getCollectionTypeKey(), "payVoucherType").getData(); @@ -4796,11 +4798,11 @@ public class FinCollectionConfirmationService extends MybatisBaseService 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); + }else{ + 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 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); + } + } + } + } + } + } + } + - }else if("7".equals(busSalesOrderVehicle.getRiskState().toString())){//亏损执行 - if("诉讼费".equals(v.getReceivablesName())){ + }else if("9".equals(busSalesOrderVehicle.getRiskState().toString())){//未交回立案 + //---------应收贷款车欠款_待处理欠款_诉讼车辆 + if ("月还".equals(v.getReceivablesName()) || "资方逾期利息".equals(v.getReceivablesName())) { Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); all4 = all4.add(new BigDecimal(v.getSubscriptionMoney())); - voucherResultDetailDtoDf.setSummary(customerNumber+"执行回款诉讼费"); - voucherResultDetailDtoDf.setSubjectNo("2191.25"); + voucherResultDetailDtoDf.setSummary(customerNumber+"诉讼回款"); + voucherResultDetailDtoDf.setSubjectNo("1201.03.03"); //核算部门 voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); //核算客户 voucherResultDetailDtoDf.setDimensionCustom(customerNumber); voucherResultDetailDtoDf.setCredit(v.getSubscriptionMoney()); list4.add(voucherResultDetailDtoDf); - - } - if("资金占用费".equals(v.getReceivablesName())){ - Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); - all4 = all4.add(new BigDecimal(v.getSubscriptionMoney())); - voucherResultDetailDtoDf2.setSummary(customerNumber+"执行回款-资金占用费"); - voucherResultDetailDtoDf2.setSubjectNo("1201.02.02"); - //核算部门 - voucherResultDetailDtoDf2.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoDf2.setDimensionCustom(customerNumber); - voucherResultDetailDtoDf2.setCredit(v.getSubscriptionMoney()); - list4.add(voucherResultDetailDtoDf2); - //------------------------资金占用费转收入 - Voucher.VoucherResultDetailDto voucherResultDetailDtoJfZjzyf = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoJfZjzyf.setSummary("资金占用费转收入"); - voucherResultDetailDtoJfZjzyf.setSubjectNo("2191.05.00"); - //核算部门 - voucherResultDetailDtoJfZjzyf.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoJfZjzyf.setDimensionCustom(customerNumber); - voucherResultDetailDtoJfZjzyf.setDebit(v.getSubscriptionMoney()); - list4.add(voucherResultDetailDtoJfZjzyf); - //资金占用费转收入--其他业务收入_消贷收入_消贷利息 - Voucher.VoucherResultDetailDto voucherResultDetailDtoDfZjzyf = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoDfZjzyf.setSummary("资金占用费转收入"); - voucherResultDetailDtoDfZjzyf.setSubjectNo("6002.01.19"); - //核算部门 - voucherResultDetailDtoDfZjzyf.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoDfZjzyf.setDimensionCustom(customerNumber); - voucherResultDetailDtoDfZjzyf.setCredit(v.getSubscriptionMoney()); - list4.add(voucherResultDetailDtoDfZjzyf); - } - //ToDo:多收款转收入 - //TodO:应收贷款车欠款_待处理欠款_待执行 - - } - } - - } - //客户赎回收款 - if (all.compareTo(BigDecimal.ZERO) > 0) { - Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); - if (StringUtils.isNotBlank(finalConfirmation.getCollectionBankNum())) { - voucherResultDetailDtoJf.setBankAccount(finalConfirmation.getCollectionBankNum()); - } - voucherResultDetailDtoJf.setSubjectNo(payType); - voucherResultDetailDtoJf.setSummary("收款-"+finalConfirmation.getPayerName() + "(" + collectionDate + ")"); - voucherResultDetailDtoJf.setDebit(String.valueOf(all)); - list.add(voucherResultDetailDtoJf); - } - - if (otherMoney.compareTo(BigDecimal.ZERO) > 0) { - Voucher.VoucherResultDetailDto voucherResultDetailDtoJf2 = new Voucher.VoucherResultDetailDto(); - all2 = all2.add(otherMoney); - voucherResultDetailDtoJf2.setSummary(customerNumber+"扣回车辆再次销售-费用(违章、年检、保险、过户)"); - voucherResultDetailDtoJf2.setSubjectNo("1133.10.00"); - //核算部门 - voucherResultDetailDtoJf2.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoJf2.setDimensionCustom(customerNumber); - voucherResultDetailDtoJf2.setDebit(otherMoney.negate().toString()); - list2.add(voucherResultDetailDtoJf2); - } + if("月还".equals(v.getReceivablesName())){ + //推送间还认款记录 + 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 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); + }else{ + 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 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); + } + } + } + } + } + } + } + //---------预提费用_诉讼保全费 + if("诉讼保全费".equals(v.getReceivablesName()) || "诉讼费用".equals(v.getReceivablesName())){ + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); + all4 = all4.add(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoDf.setSummary(customerNumber+"诉讼回款诉讼费"); + voucherResultDetailDtoDf.setSubjectNo("2191.25"); + //核算部门 + voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf.setCredit(v.getSubscriptionMoney()); + list4.add(voucherResultDetailDtoDf); + } + + //---------营业费用_催收费用 评估费/律师费 + if("律师费".equals(v.getReceivablesName())){ + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); + all4 = all4.subtract(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoJf.setSummary(customerNumber+"诉讼回款-律师费"); + voucherResultDetailDtoJf.setSubjectNo("6601.32.06"); + //核算部门 + voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf.setDebit(new BigDecimal(v.getSubscriptionMoney()).negate().toString()); + list4.add(voucherResultDetailDtoJf); + } + + + //--------应收贷款车欠款_到期欠款_逾期利息-资金占用费 + if ("资金占用费".equals(v.getReceivablesName())) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); + all4 = all4.add(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoDf2.setSummary(customerNumber+"诉讼回款资金占用费"); + voucherResultDetailDtoDf2.setSubjectNo("1201.02.02"); + //核算部门 + voucherResultDetailDtoDf2.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf2.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf2.setCredit(v.getSubscriptionMoney()); + list4.add(voucherResultDetailDtoDf2); + //------------------------资金占用费转收入 + Voucher.VoucherResultDetailDto voucherResultDetailDtoJfZjzyf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoJfZjzyf.setSummary("资金占用费转收入"); + voucherResultDetailDtoJfZjzyf.setSubjectNo("2191.05.00"); + //核算部门 + voucherResultDetailDtoJfZjzyf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJfZjzyf.setDimensionCustom(customerNumber); + voucherResultDetailDtoJfZjzyf.setDebit(v.getSubscriptionMoney()); + list4.add(voucherResultDetailDtoJfZjzyf); + //资金占用费转收入--其他业务收入_消贷收入_消贷利息 + Voucher.VoucherResultDetailDto voucherResultDetailDtoDfZjzyf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoDfZjzyf.setSummary("资金占用费转收入"); + voucherResultDetailDtoDfZjzyf.setSubjectNo("6002.01.19"); + //核算部门 + voucherResultDetailDtoDfZjzyf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDfZjzyf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDfZjzyf.setCredit(v.getSubscriptionMoney()); + list4.add(voucherResultDetailDtoDfZjzyf); + } + + + + + }else if("12".equals(busSalesOrderVehicle.getRiskState().toString())){//执行 + if("诉讼保全费".equals(v.getReceivablesName()) || "诉讼费用".equals(v.getReceivablesName())){ + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); + all5 = all5.add(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoDf.setSummary(customerNumber+"执行回款诉讼费"); + voucherResultDetailDtoDf.setSubjectNo("2191.25"); + //核算部门 + voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf.setCredit(v.getSubscriptionMoney()); + list5.add(voucherResultDetailDtoDf); + + } + if("律师费".equals(v.getReceivablesName())){ + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); + all5 = all5.subtract(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoJf.setSummary(customerNumber+"执行回款-律师费"); + voucherResultDetailDtoJf.setSubjectNo("6601.32.06"); + //核算部门 + voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf.setDebit(new BigDecimal(v.getSubscriptionMoney()).negate().toString()); + list5.add(voucherResultDetailDtoJf); + } + if("资金占用费".equals(v.getReceivablesName())){ + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); + all5 = all5.add(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoDf2.setSummary(customerNumber+"执行回款-资金占用费"); + voucherResultDetailDtoDf2.setSubjectNo("1201.02.02"); + //核算部门 + voucherResultDetailDtoDf2.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf2.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf2.setCredit(v.getSubscriptionMoney()); + list5.add(voucherResultDetailDtoDf2); + //------------------------资金占用费转收入 + Voucher.VoucherResultDetailDto voucherResultDetailDtoJfZjzyf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoJfZjzyf.setSummary("资金占用费转收入"); + voucherResultDetailDtoJfZjzyf.setSubjectNo("2191.05.00"); + //核算部门 + voucherResultDetailDtoJfZjzyf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJfZjzyf.setDimensionCustom(customerNumber); + voucherResultDetailDtoJfZjzyf.setDebit(v.getSubscriptionMoney()); + list5.add(voucherResultDetailDtoJfZjzyf); + //资金占用费转收入--其他业务收入_消贷收入_消贷利息 + Voucher.VoucherResultDetailDto voucherResultDetailDtoDfZjzyf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoDfZjzyf.setSummary("资金占用费转收入"); + voucherResultDetailDtoDfZjzyf.setSubjectNo("6002.01.19"); + //核算部门 + voucherResultDetailDtoDfZjzyf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDfZjzyf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDfZjzyf.setCredit(v.getSubscriptionMoney()); + list5.add(voucherResultDetailDtoDfZjzyf); + } + //ToDo:多收款转收入 + if("其他收入".equals(v.getReceivablesName())){ + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); + all5 = all5.add(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoDf.setSummary("多收款转收入"); + voucherResultDetailDtoDf.setSubjectNo("6002.01.21"); + //核算部门 + voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf.setCredit(v.getSubscriptionMoney()); + list5.add(voucherResultDetailDtoDf); + + } + //TodO:应收贷款车欠款_待处理欠款_待执行 + if ("月还".equals(v.getReceivablesName()) || "资方逾期利息".equals(v.getReceivablesName())) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); + all5 = all5.add(new BigDecimal(v.getSubscriptionMoney())); + voucherResultDetailDtoDf.setSummary(customerNumber+"执行回款"); + voucherResultDetailDtoDf.setSubjectNo("1201.03.05"); + //核算部门 + voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf.setCredit(v.getSubscriptionMoney()); + list5.add(voucherResultDetailDtoDf); + if("月还".equals(v.getReceivablesName())){ + //推送间还认款记录 + 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 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); + }else{ + 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 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); + } + } + } + } + } + } + } + } + } + + } + //客户赎回收款 + if (all.compareTo(BigDecimal.ZERO) > 0) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); + if (StringUtils.isNotBlank(finalConfirmation.getCollectionBankNum())) { + voucherResultDetailDtoJf.setBankAccount(finalConfirmation.getCollectionBankNum()); + } + voucherResultDetailDtoJf.setSubjectNo(payType); + voucherResultDetailDtoJf.setSummary("收款-"+finalConfirmation.getPayerName() + "(" + collectionDate + ")"); + voucherResultDetailDtoJf.setDebit(String.valueOf(all)); + list.add(voucherResultDetailDtoJf); + } + + if (otherMoney.compareTo(BigDecimal.ZERO) > 0) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf2 = new Voucher.VoucherResultDetailDto(); + all2 = all2.add(otherMoney); + voucherResultDetailDtoJf2.setSummary(customerNumber+"扣回车辆再次销售-费用(违章、年检、保险、过户)"); + voucherResultDetailDtoJf2.setSubjectNo("1133.10.00"); + //核算部门 + voucherResultDetailDtoJf2.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf2.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf2.setDebit(otherMoney.negate().toString()); + list2.add(voucherResultDetailDtoJf2); + } if (all2.compareTo(BigDecimal.ZERO) > 0) { Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); if (StringUtils.isNotBlank(finalConfirmation.getCollectionBankNum())) { @@ -5428,10 +6074,21 @@ public class FinCollectionConfirmationService extends MybatisBaseService 0) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); + if (StringUtils.isNotBlank(finalConfirmation.getCollectionBankNum())) { + voucherResultDetailDtoJf.setBankAccount(finalConfirmation.getCollectionBankNum()); + } + voucherResultDetailDtoJf.setSubjectNo(payType); + voucherResultDetailDtoJf.setSummary("收款" +finalConfirmation.getPayerName()+ "(" + collectionDate + ")"); + voucherResultDetailDtoJf.setDebit(String.valueOf(all5)); + list5.add(voucherResultDetailDtoJf); + } + if (!list.isEmpty()) {//赎回收款(风控状态赎回中以及交回推送) voucher.setResultDetails(list); @@ -5446,10 +6103,14 @@ public class FinCollectionConfirmationService extends MybatisBaseService { + @Autowired + private SysUserFeign sysUserFeign; + @Autowired + private SysOrganizationFeign sysOrganizationFeign; + @Autowired + private SysStaffOrgFeign sysStaffOrgFeign; + @Autowired + private LoanCaseExecuteVehService loanCaseExecuteVehService; + @Autowired + private LoanCaseProgressService loanCaseProgressService; + @Autowired + private LoanCaseProgressTrialService loanCaseProgressTrialService; + @Autowired + private LoanCaseProgressVehService loanCaseProgressVehService; + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private LoanFileService loanFileService; + @Autowired + private FlowableFeign flowableFeign; + @Autowired + private MessageFeign messageFeign; + @Autowired + private FlowTaskFeign flowTaskFeign; + @Autowired + private FlowFeign flowFeign; + @Autowired + private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; + @Autowired + private BusSalesOrderFeign busSalesOrderFeign; + @Autowired + private FinKingDeeFeign finKingDeeFeign; + @Autowired + private BusSalesOrderBorrowerFeign busSalesOrderBorrowerFeign; + @Autowired + private BasePurchaseSystemFeign basePurchaseSystemFeign; + @Autowired + private LoanRestoreReportApplyService loanRestoreReportApplyService; + @Autowired + private LoanRepaymentPlanDetailsService loanRepaymentPlanDetailsService; + + public PagerVo listPageVo(PagerQuery pq) { + LoanCaseExecuteApplyQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + //========================================数据授权开始 + if (StringUtils.isNotBlank(query.getMenuUrl())) { + PrivilegeQuery privilegeQuery = new PrivilegeQuery(); + privilegeQuery.setOrgPath(query.getOrgPath()); + privilegeQuery.setMenuUrl(query.getMenuUrl()); + privilegeQuery.setMenuSid(query.getMenuSid()); + privilegeQuery.setUserSid(query.getUserSid()); + ResultBean defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); + if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { + //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) + String orgSidPath = query.getOrgPath(); + orgSidPath = orgSidPath + "/"; + int i1 = orgSidPath.indexOf("/"); + int i2 = orgSidPath.indexOf("/", i1 + 1); + int i3 = orgSidPath.indexOf("/", i2 + 1); + int i4 = orgSidPath.indexOf("/", i3 + 1); + String orgLevelKey = defaultIdReltBean.getData(); + if ("1".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i1); + qw.like("orgPath", orgSidPath); + } else if ("2".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i2); + qw.like("orgPath", orgSidPath); + } else if ("3".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i3); + qw.like("orgPath", orgSidPath); + } else if ("4".equals(orgLevelKey)) { + orgSidPath = orgSidPath.substring(0, i4); + qw.like("orgPath", orgSidPath); + } else if ("5".equals(orgLevelKey)) { + qw.eq("createBySid", query.getUserSid()); + } else { + PagerVo p = new PagerVo<>(); + return p; + } + } else { + PagerVo p = new PagerVo<>(); + return p; + } + } + if (StringUtils.isNotBlank(query.getUseOrgName())) { + qw.like("useOrgName", query.getUseOrgName()); + } + if (StringUtils.isNotBlank(query.getDeptName())) { + qw.like("deptName", query.getDeptName()); + } + if (StringUtils.isNotBlank(query.getCreateByName())) { + qw.like("createByName", query.getCreateByName()); + } + qw.apply(StringUtils.isNotBlank(query.getCreateStartTime()), "date_format (createTime,'%Y-%m-%d') >= date_format('" + query.getCreateStartTime() + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(query.getCreateEndTime()), "date_format (createTime,'%Y-%m-%d') <= date_format('" + query.getCreateEndTime() + "','%Y-%m-%d')" + ); + if (StringUtils.isNotBlank(query.getModifyStartTime()) && StringUtils.isNotBlank(query.getModifyEndTime())) { + qw.and(wrapper -> wrapper.eq("nodeState", "终止").or().eq("nodeState", "已办结")); + } + qw.apply(StringUtils.isNotBlank(query.getModifyStartTime()), "date_format (modifyTime,'%Y-%m-%d') >= date_format('" + query.getModifyStartTime() + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(query.getModifyEndTime()), "date_format (modifyTime,'%Y-%m-%d') <= date_format('" + query.getModifyEndTime() + "','%Y-%m-%d')" + ); + if (StringUtils.isNotBlank(query.getLoanContract())){ + qw.like("loanContract",query.getLoanContract()); + } + if (StringUtils.isNotBlank(query.getCustomName())){ + qw.like("customName",query.getCustomName()); + } + if (StringUtils.isNotBlank(query.getLenderName())){ + qw.like("lenderName",query.getLenderName()); + } + if (StringUtils.isNotBlank(query.getExecuteDeadline())){ + qw.like("executeDeadline",query.getExecuteDeadline()); + } + if (StringUtils.isNotBlank(query.getExecuteRegisMoney())){ + qw.like("executeRegisMoney",query.getExecuteRegisMoney()); + } + qw.apply(StringUtils.isNotBlank(query.getExecuteRegisStartDate()), "date_format (executeRegisDate,'%Y-%m-%d') >= date_format('" + query.getExecuteRegisStartDate() + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(query.getExecuteRegisEndDate()), "date_format (executeRegisDate,'%Y-%m-%d') <= date_format('" + query.getExecuteRegisEndDate() + "','%Y-%m-%d')" + ); + qw.orderByDesc("createTime"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + for (LoanCaseExecuteApplyVo record : pagging.getRecords()) { + if ("终止".equals(record.getNodeState()) || "已办结".equals(record.getNodeState())) { + DateTime modifyTime = DateUtil.parse(record.getModifyTime()); + record.setModifyTime(DateUtil.formatDate(modifyTime)); + } else { + record.setModifyTime(""); + } + } + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public String saveOrUpdateDto(LoanCaseExecuteApplyDto dto){ + String dtoSid = dto.getSid(); + List pjclFiles = dto.getPjclFiles(); + List zxclFiles = dto.getZxclFiles(); + List loanCaseExecuteVehList = dto.getLoanCaseExecuteVehList(); + if (StringUtils.isBlank(dtoSid)) { + //生成单据编号 + String billNo = ""; + String date = DateUtil.format(DateUtil.date(), "yyyyMM"); + SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); + billNo = "AJZXLA" + sysOrganizationVo.getOrgCode() + date; + String i = baseMapper.selectNum(billNo); + if (StringUtils.isNotBlank(i)) { + billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); + } else { + billNo = Rule.getBillNo(billNo, 0); + } + dto.setBillNo(billNo); + String sid = this.insertByDto(dto); + for (LoanCaseExecuteVehDto loanCaseExecuteVehDto : loanCaseExecuteVehList) { + loanCaseExecuteVehDto.setMainSid(sid); + loanCaseExecuteVehService.saveOrUpdateDto(loanCaseExecuteVehDto); + } + if (pjclFiles != null && pjclFiles.size() > 0) { + for (LoanCaseExecuteFile file : pjclFiles) { + LoanFile loanFile = new LoanFile(); + loanFile.setLinkSid(sid); + loanFile.setAttachType(LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); + String filePath = file.getUrl(); + if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { + filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); + } + loanFile.setFilePath(filePath); + loanFileService.save(loanFile); + } + } + if (zxclFiles != null && zxclFiles.size() > 0) { + for (LoanCaseExecuteFile file : zxclFiles) { + LoanFile loanFile = new LoanFile(); + loanFile.setLinkSid(sid); + loanFile.setAttachType(LoanFileEnum.EXECUTE.getAttachType()); + String filePath = file.getUrl(); + if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { + filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); + } + loanFile.setFilePath(filePath); + loanFileService.save(loanFile); + } + } + return sid; + } + this.updateByDto(dto); + loanCaseExecuteVehService.delByMainSid(dtoSid); + for (LoanCaseExecuteVehDto loanCaseExecuteVehDto : loanCaseExecuteVehList) { + loanCaseExecuteVehDto.setSid(""); + loanCaseExecuteVehDto.setMainSid(dtoSid); + loanCaseExecuteVehService.saveOrUpdateDto(loanCaseExecuteVehDto); + } + loanFileService.delByLinkSidOrType(dtoSid, LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); + if (pjclFiles != null && pjclFiles.size() > 0) { + for (LoanCaseExecuteFile file : pjclFiles) { + LoanFile loanFile = new LoanFile(); + loanFile.setLinkSid(dtoSid); + loanFile.setAttachType(LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); + String filePath = file.getUrl(); + if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { + filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); + } + loanFile.setFilePath(filePath); + loanFileService.save(loanFile); + } + } + loanFileService.delByLinkSidOrType(dtoSid, LoanFileEnum.EXECUTE.getAttachType()); + if (zxclFiles != null && zxclFiles.size() > 0) { + for (LoanCaseExecuteFile file : zxclFiles) { + LoanFile loanFile = new LoanFile(); + loanFile.setLinkSid(dtoSid); + loanFile.setAttachType(LoanFileEnum.EXECUTE.getAttachType()); + String filePath = file.getUrl(); + if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { + filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); + } + loanFile.setFilePath(filePath); + loanFileService.save(loanFile); + } + } + return dtoSid; + } + + public String insertByDto(LoanCaseExecuteApplyDto dto){ + LoanCaseExecuteApply entity = new LoanCaseExecuteApply(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + entity.setNodeState("待提交"); + baseMapper.insert(entity); + return entity.getSid(); + } + + public void updateByDto(LoanCaseExecuteApplyDto dto){ + String dtoSid = dto.getSid(); @Autowired private SysUserFeign sysUserFeign; @Autowired @@ -394,6 +630,46 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService loanCaseExecuteVehDetailsVoList = loanCaseExecuteVehService.selByMainSid(sid); + vo.setLoanCaseExecuteVehList(loanCaseExecuteVehDetailsVoList); + List pjcl = loanFileService.selectByLinkSid(sid, LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); + List pjclFiles = new ArrayList<>(); + if (pjcl != null && pjcl.size() > 0) { + for (LoanFile loanFile : pjcl) { + LoanCaseExecuteFile loanCaseExecuteFile = new LoanCaseExecuteFile(); + String filePath = loanFile.getFilePath(); + String urlPrefix = fileUploadComponent.getUrlPrefix(); + filePath = urlPrefix + filePath; + loanCaseExecuteFile.setUrl(filePath); + pjclFiles.add(loanCaseExecuteFile); + } + } + vo.setPjclFiles(pjclFiles); + List zxcl = loanFileService.selectByLinkSid(sid, LoanFileEnum.ANSWERRELATE.getAttachType()); + List zxclFiles = new ArrayList<>(); + if (zxcl != null && zxcl.size() > 0) { + for (LoanFile loanFile : zxcl) { + LoanCaseExecuteFile loanCaseExecuteFile = new LoanCaseExecuteFile(); + String filePath = loanFile.getFilePath(); + String urlPrefix = fileUploadComponent.getUrlPrefix(); + filePath = urlPrefix + filePath; + loanCaseExecuteFile.setUrl(filePath); + zxclFiles.add(loanCaseExecuteFile); + } + } + vo.setZxclFiles(zxclFiles); + return vo; + } public ResultBean delAll(String[] sids) { ResultBean rb = ResultBean.fireFail(); @@ -562,6 +838,77 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService variables = new HashMap<>(); + Map appMap = new HashMap<>(); + appMap.put("sid", businessSid); + variables.put("app", appMap); + FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); + if (StringUtils.isBlank(loanCaseExecuteApply.getProcDefId())) { + flowProcessMapQuery.setProDefKey(bv.getModelId()); + } else { + flowProcessMapQuery.setProDefKey(loanCaseExecuteApply.getProcDefId()); + } + flowProcessMapQuery.setVariables(variables); + variables = flowableFeign.getMap(flowProcessMapQuery).getData(); + //======================================= + bv.setFormVariables(variables); + bv.setOrgSidPath(loanCaseExecuteApply.getOrgPath()); + if (bv.getTaskId().equals(loanCaseExecuteApply.getTaskId())) { + ResultBean resultBean = flowFeign.handleProsess(bv); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + UpdateFlowFieldVo ufVo = resultBean.getData(); + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { + try { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + ExecutorService pool = new org.apache.tomcat.util.threads.ThreadPoolExecutor(2, 100, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new org.apache.tomcat.util.threads.ThreadPoolExecutor.AbortPolicy()); + LoanCaseExecuteApply finalLoanCaseExecuteApply = loanCaseExecuteApply; + Future future1 = pool.submit(() -> { + //推送财务凭证 + //TOdO: + pushRiskToFin(bv.getBusinessSid()); + //修改风控状态为执行 + //--更新销售订单车辆表的风控状态为执行 + List busVinSidList = loanCaseProgressVehService.selectByMainSid(finalLoanCaseExecuteApply.getBusSid()); + BusVinStateSetQuery busVinStateSetQuery = new BusVinStateSetQuery(); + busVinStateSetQuery.setState(12); + busVinStateSetQuery.setBusVinSidList(busVinSidList); + ResultBean resultBean1 = busSalesOrderVehicleFeign.setRiskState(busVinStateSetQuery); + }); + } catch (Exception e) { + e.printStackTrace(); + } + + } else { + //极光推送 + loanCaseExecuteApply = fetchBySid(businessSid); + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + ufVo.setProcDefId(loanCaseExecuteApply.getProcDefId()); + ufVo.setProcInsId(loanCaseExecuteApply.getProcInstSid()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap(appMap); + messageFlowableQuery.setBusinessSid(businessSid); + messageFlowableQuery.setModuleName("案件执行立案申请"); + messageFlowableQuery.setMsgContent(loanCaseExecuteApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("案件执行立案申请"); + messageFeign.pushMessage(messageFlowableQuery); + } + return rb.success().setData(resultBean.getData()); + } else { + return rb.setMsg("操作失败!提交的数据不一致"); + } + } public void pushRiskToFin(String sid) { LoanCaseExecuteApply loanCaseExecuteApply = fetchBySid(sid); @@ -628,7 +975,156 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService voucherResultDetailDtos = new ArrayList<>(); + List voucherResultDetailDtos2 = new ArrayList<>(); + SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(loanCaseExecuteApply.getDeptSid()).getData(); + List busVinSidList = loanCaseProgressVehService.selectByMainSid(loanCaseExecuteApply.getBusSid()); + for (int i = 0; i < busVinSidList.size(); i++) { + String busVinSid = busVinSidList.get(i); + BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.details(busVinSid).getData(); + String customerNumber = ""; + BusSalesOrder salesOrder = busSalesOrderFeign.fetchBySid(busSalesOrderVehicle.getSalesOrderSid()).getData(); + if (salesOrder != null && busSalesOrderVehicle != null) { + //判断财务系统是否有客户 + Boolean aBoolean = finKingDeeFeign.customerExistState(busSalesOrderVehicle.getTemporaryNo()).getData(); + String linkNo = ""; + BusSalesOrderBorrowerDetailsVo borrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(busSalesOrderVehicle.getBorrowerSid()).getData(); + if (!aBoolean) { + BdCustomer bdCustomer = new BdCustomer(); + bdCustomer.setFNumber(busSalesOrderVehicle.getTemporaryNo()); + bdCustomer.setFShortName(salesOrder.getContractNo()); + if (StringUtils.isNotBlank(salesOrder.getPurchaseSystemSid())) { + BasePurchaseSystemDetailsVo data = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); + bdCustomer.setTOrgIds(data.getOrgCode()); + } + bdCustomer.setTOrgIds(deptVo.getOrgCode()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(busSalesOrderVehicle.getLinkNo())) { + String vinNo = busSalesOrderVehicle.getLinkNo(); + if (vinNo.length() > 8) { + linkNo = vinNo.substring(vinNo.length() - 8); + } else { + linkNo = busSalesOrderVehicle.getLinkNo(); + } + if (null != borrowerDetailsVo) { + bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + linkNo); + } + } else { + if (null != borrowerDetailsVo) { + bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + busSalesOrderVehicle.getTemporaryNo()); + } + } + // bdCustomers.add(bdCustomer); + ResultBean resultBean = finKingDeeFeign.draftBdCustomer(bdCustomer); + if (resultBean.getSuccess()) { + customerNumber = bdCustomer.getFNumber(); + } + } else { + customerNumber = busSalesOrderVehicle.getTemporaryNo(); + } + } + AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr2(busVinSid); + //应收贷款车欠款_待处理欠款_处置车辆_已诉讼-当前欠款合计--不含资金占用费 + BigDecimal all = BigDecimal.ZERO; + //预申请坏账金额 + BigDecimal ysqhz = BigDecimal.ZERO; + //其中执行欠款金额 + BigDecimal qzzxqk = BigDecimal.ZERO; + String allMoney = loanRepaymentPlanDetailsService.selectAllMoney(busVinSid); + String wdqMoney = loanRepaymentPlanDetailsService.getWdq(busVinSid); + all = all.add(StringUtils.isNotBlank(allMoney)?new BigDecimal(allMoney):BigDecimal.ZERO).add(StringUtils.isNotBlank(wdqMoney)?new BigDecimal(wdqMoney):BigDecimal.ZERO); + if("11".equals(busSalesOrderVehicle.getRiskState().toString())){//亏损立案---二次销售后的诉讼后的执行 + //-------------------------------------------应收贷款车欠款_待处理欠款_处置车辆_已诉讼-当前欠款合计 + if (all.compareTo(BigDecimal.ZERO) > 0) { + //贷方 + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoDf.setSummary(customerNumber+"转执行"); + voucherResultDetailDtoDf.setSubjectNo("1201.03.04.02"); + //核算部门 + voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf.setCredit(all.toString()); + voucherResultDetailDtos.add(voucherResultDetailDtoDf); + } + //---------------------------------------------待处理财产损溢 风险准备金(输入)-预申请坏账金额 + if (ysqhz.compareTo(BigDecimal.ZERO) > 0) { + //借方 + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoJf.setSummary(customerNumber+"转执行"); + voucherResultDetailDtoJf.setSubjectNo("1911.05"); + //核算部门 + voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf.setDebit(ysqhz.toString()); + voucherResultDetailDtos.add(voucherResultDetailDtoJf); + } + //--------------------------------------------应收贷款车欠款_待处理欠款_待执行-其中执行欠款金额 + if (qzzxqk.compareTo(BigDecimal.ZERO) > 0) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf2 = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoJf2.setSummary(customerNumber+"转执行"); + voucherResultDetailDtoJf2.setSubjectNo("1201.03.05"); + //核算部门 + voucherResultDetailDtoJf2.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf2.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf2.setDebit(qzzxqk.toString()); + voucherResultDetailDtos.add(voucherResultDetailDtoJf2); + } + } + if("9".equals(busSalesOrderVehicle.getRiskState().toString()) || "10".equals(busSalesOrderVehicle.getRiskState().toString())){ + //未交回立案-交回立案后的执行 + //-------------------------------------------应收贷款车欠款_待处理欠款_诉讼车辆 + if (all.compareTo(BigDecimal.ZERO) > 0) { + //贷方 + Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoDf.setSummary(customerNumber+"转执行"); + voucherResultDetailDtoDf.setSubjectNo("1201.03.03"); + //核算部门 + voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoDf.setDimensionCustom(customerNumber); + voucherResultDetailDtoDf.setCredit(all.toString()); + voucherResultDetailDtos2.add(voucherResultDetailDtoDf); + } + //---------------------------------------------待处理财产损溢 风险准备金(输入)-预申请坏账金额 + if (ysqhz.compareTo(BigDecimal.ZERO) > 0) { + //借方 + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoJf.setSummary(customerNumber+"转执行"); + voucherResultDetailDtoJf.setSubjectNo("1911.05"); + //核算部门 + voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf.setDebit(ysqhz.toString()); + voucherResultDetailDtos2.add(voucherResultDetailDtoJf); + } + //--------------------------------------------应收贷款车欠款_待处理欠款_待执行-其中执行欠款金额 + if (qzzxqk.compareTo(BigDecimal.ZERO) > 0) { + Voucher.VoucherResultDetailDto voucherResultDetailDtoJf2 = new Voucher.VoucherResultDetailDto(); + voucherResultDetailDtoJf2.setSummary(customerNumber+"转执行"); + voucherResultDetailDtoJf2.setSubjectNo("1201.03.05"); + //核算部门 + voucherResultDetailDtoJf2.setDimensionDept(deptVo.getOrgCode()); + //核算客户 + voucherResultDetailDtoJf2.setDimensionCustom(customerNumber); + voucherResultDetailDtoJf2.setDebit(qzzxqk.toString()); + voucherResultDetailDtos2.add(voucherResultDetailDtoJf2); + } + + } + } //贷方 Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); @@ -677,6 +1173,16 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService busVinSidList = redemptionVinLists.stream().map(v->v.getBusVinSid()).collect(Collectors.toList()); - busVinStateSetQuery.setState(9);//客户赎回中 + busVinStateSetQuery.setState(4);//客户赎回中 ResultBean resultBean1 = busSalesOrderVehicleFeign.setRiskState(busVinStateSetQuery); //--------更新风控状态结束 FinUncollectedReceivablesDetailedJR finUncollectedReceivablesDetailedJR = new FinUncollectedReceivablesDetailedJR(); diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java index cdb768a7ba..12dccbbd2d 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java @@ -559,7 +559,7 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService busVinSidList = list.stream().map(v->v.getBusVinSid()).collect(Collectors.toList()); - busVinStateSetQuery.setState(10);//二次销售中 + busVinStateSetQuery.setState(5);//二次销售中 ResultBean resultBeanss = busSalesOrderVehicleFeign.setRiskState(busVinStateSetQuery); //--------更新风控状态结束 diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java index 06b6d43625..3b7d0fc212 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java @@ -702,7 +702,7 @@ public class LoanSubletApplyService extends MybatisBaseService busVinSidList = subletVinLists.stream().map(v->v.getBusVinSid()).collect(Collectors.toList()); - busVinStateSetQuery.setState(11);//二次转租中 + busVinStateSetQuery.setState(6);//二次转租中 ResultBean resultBeanss = busSalesOrderVehicleFeign.setRiskState(busVinStateSetQuery); try { ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()