From 005655da1d12dc1ae4f25e8b54911f5549475363 Mon Sep 17 00:00:00 2001 From: dimengzhe Date: Fri, 26 Jan 2024 16:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E5=9B=9E=E8=BD=A6=E8=BE=86=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E9=94=80=E5=94=AE=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoanSecondarySalesApplyDetailsVo.java | 7 ++ .../LoanSecondarySalesApplyDto.java | 7 ++ .../LoanSecondarySalesApplyFeign.java | 2 +- .../LoanSecondarySalesCost.java | 9 ++ .../LoanSecondarySalesCostVo.java | 10 ++ .../LoanSecondarySalesApplyMapper.xml | 2 +- .../LoanSecondarySalesApplyService.java | 110 +++++++++++++++++- .../LoanSecondarySalesCostMapper.xml | 2 +- doc/databases/risk_center.sql | 8 ++ 9 files changed, 148 insertions(+), 9 deletions(-) diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDetailsVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDetailsVo.java index 401976b889..62bc675c9c 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDetailsVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDetailsVo.java @@ -28,8 +28,12 @@ public class LoanSecondarySalesApplyDetailsVo { private String createDate; @ApiModelProperty("客户名称") private String customerName; + @ApiModelProperty("客户sid") + private String customerSid; @ApiModelProperty("贷款人") private String loanName; + @ApiModelProperty("贷款人sid") + private String loanSid; @ApiModelProperty("贷款合同编号") private String loanContractNo; @ApiModelProperty("资方") @@ -87,5 +91,8 @@ public class LoanSecondarySalesApplyDetailsVo { private String files; + @ApiModelProperty("销售订单sid") + private String salesOrderSid; + } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDto.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDto.java index 29f381db9e..066f061695 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDto.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDto.java @@ -28,6 +28,10 @@ public class LoanSecondarySalesApplyDto { private String createDate; @ApiModelProperty("客户名称") private String customerName; + @ApiModelProperty("客户sid") + private String customerSid; + @ApiModelProperty("贷款人sid") + private String loanSid; @ApiModelProperty("贷款人") private String loanName; @ApiModelProperty("贷款合同编号") @@ -80,4 +84,7 @@ public class LoanSecondarySalesApplyDto { private String userSid; private String orgPath; + + @ApiModelProperty("销售订单sid") + private String salesOrderSid; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyFeign.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyFeign.java index b989d251d2..39a5fdef7d 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyFeign.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyFeign.java @@ -42,7 +42,7 @@ public interface LoanSecondarySalesApplyFeign { @ApiOperation("详情初始化") @PostMapping("/details") - ResultBean details(LoanSecondarySalesApplyDetailsQuery query); + ResultBean details(@RequestBody LoanSecondarySalesApplyDetailsQuery query); @ApiOperation("删除/批量删除") @DeleteMapping("/delBySids") diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCost.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCost.java index aa207d7bfe..7cbbac89af 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCost.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCost.java @@ -29,30 +29,37 @@ public class LoanSecondarySalesCost extends BaseEntity { private BigDecimal bankSettleCost; @ApiModelProperty("资方结清费用承担方") private String bankSettleCostAssume; + private String bankSettleCostAssumeKey; @ApiModelProperty("车辆违章费用") private BigDecimal vehicleViolationCost; @ApiModelProperty("车辆违章费用承担方") private String vehicleViolationCostAssume; + private String vehicleViolationCostAssumeKey; @ApiModelProperty("年检费") private BigDecimal inspectYearCost; @ApiModelProperty("年检费承担方") private String inspectYearCostAssume; + private String inspectYearCostAssumeKey; @ApiModelProperty("保险费") private BigDecimal insureCost; @ApiModelProperty("保险费承担方") private String insureCostAssume; + private String insureCostAssumeKey; @ApiModelProperty("过户费") private BigDecimal ownershipCost; @ApiModelProperty("过户费承担方") private String ownershipCostAssume; + private String ownershipCostAssumeKey; @ApiModelProperty("停车费") private BigDecimal stopCost; @ApiModelProperty("停车费承担方") private String stopCostAssume; + private String stopCostAssumeKey; @ApiModelProperty("其他费用") private BigDecimal otherCost; @ApiModelProperty("其他费用承担方") private String otherCostAssume; + private String otherCostAssumeKey; @ApiModelProperty("费用说明") private String costDescription; @ApiModelProperty("预计亏损金额") @@ -61,6 +68,8 @@ public class LoanSecondarySalesCost extends BaseEntity { private String debtDisposal; @ApiModelProperty("附件") private String files; + @ApiModelProperty("车辆评估") + private String vehicleEvaluation; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCostVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCostVo.java index e52abb26e5..355e52d37a 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCostVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCostVo.java @@ -28,30 +28,37 @@ public class LoanSecondarySalesCostVo { private String bankSettleCost; @ApiModelProperty("资方结清费用承担方") private String bankSettleCostAssume; + private String bankSettleCostAssumeKey; @ApiModelProperty("车辆违章费用") private String vehicleViolationCost; @ApiModelProperty("车辆违章费用承担方") private String vehicleViolationCostAssume; + private String vehicleViolationCostAssumeKey; @ApiModelProperty("年检费") private String inspectYearCost; @ApiModelProperty("年检费承担方") private String inspectYearCostAssume; + private String inspectYearCostAssumeKey; @ApiModelProperty("保险费") private String insureCost; @ApiModelProperty("保险费承担方") private String insureCostAssume; + private String insureCostAssumeKey; @ApiModelProperty("过户费") private String ownershipCost; @ApiModelProperty("过户费承担方") private String ownershipCostAssume; + private String ownershipCostAssumeKey; @ApiModelProperty("停车费") private String stopCost; @ApiModelProperty("停车费承担方") private String stopCostAssume; + private String stopCostAssumeKey; @ApiModelProperty("其他费用") private String otherCost; @ApiModelProperty("其他费用承担方") private String otherCostAssume; + private String otherCostAssumeKey; @ApiModelProperty("费用说明") private String costDescription; @ApiModelProperty("预计亏损金额") @@ -61,4 +68,7 @@ public class LoanSecondarySalesCostVo { @ApiModelProperty("附件") private List files = new ArrayList<>(); + @ApiModelProperty("车辆评估") + private String vehicleEvaluation; + } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyMapper.xml b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyMapper.xml index c19151b078..ea33883056 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyMapper.xml +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyMapper.xml @@ -83,7 +83,7 @@ la.nper, la.currentPeriod, la.alRepaidMoneyConPeriod, - la.beOverdueMoneyAndPeriod + la.beOverdueMoneyAndPeriod,la.loanSid,la.customerSid,la.salesOrderSid from loan_secondary_sales_apply la where sid = #{sid} 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 a43a18e95b..4979bfce13 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 @@ -38,10 +38,16 @@ import com.yxt.anrui.riskcenter.api.loansecondarysalesapply.flowable.*; import com.yxt.anrui.riskcenter.api.loansecondarysalescost.LoanSecondarySalesCostVo; import com.yxt.anrui.riskcenter.api.loansecondarysalesveh.LoanSecondarySalesVeh; import com.yxt.anrui.riskcenter.api.loansecondarysalesveh.LoanSecondarySalesVehVo; +import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutions; +import com.yxt.anrui.riskcenter.api.loansolutionsdetail.LoanSolutionsDetail; +import com.yxt.anrui.riskcenter.biz.loanrestorereportapply.LoanRestoreReportApplyService; import com.yxt.anrui.riskcenter.biz.loanreturninboundapply.LoanReturnInboundApplyService; import com.yxt.anrui.riskcenter.biz.loanreturnvehledger.LoanReturnVehLedgerService; import com.yxt.anrui.riskcenter.biz.loansecondarysalescost.LoanSecondarySalesCostService; import com.yxt.anrui.riskcenter.biz.loansecondarysalesveh.LoanSecondarySalesVehService; +import com.yxt.anrui.riskcenter.biz.loansolutions.LoanSolutionsMapper; +import com.yxt.anrui.riskcenter.biz.loansolutions.LoanSolutionsService; +import com.yxt.anrui.riskcenter.biz.loansolutionsdetail.LoanSolutionsDetailService; import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; @@ -56,6 +62,7 @@ import org.apache.tomcat.util.threads.ThreadPoolExecutor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; import java.util.*; import java.util.concurrent.*; import java.util.stream.Collectors; @@ -92,6 +99,12 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService listPageVo(PagerQuery pq) { LoanSecondarySalesApplyQuery query = pq.getParams(); @@ -538,7 +551,33 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService filss = dto.getFilesList(); + if (!filss.isEmpty()) { + List filesList = filss.stream().map(v -> v.getUrl()).collect(Collectors.toList()); + if (!filesList.isEmpty()) { + String files = String.join(",", filesList).replaceAll(fileUploadComponent.getUrlPrefix(), ""); + loanSecondarySalesApply.setFiles(files); + } + } else { + loanSecondarySalesApply.setFiles(""); + } + //保存车辆 + List loanSecondarySalesVehVoList = dto.getLoanSecondarySalesVehVoList(); + loanSecondarySalesVehVoList.removeAll(Collections.singleton(null)); + if (!loanSecondarySalesVehVoList.isEmpty()) { + loanSecondarySalesVehService.saveVeh(loanSecondarySalesVehVoList, sid); + } + LoanSecondarySalesCostVo loanSecondarySalesCost = dto.getLoanSecondarySalesCost(); + if (loanSecondarySalesCost != null) { + loanSecondarySalesCostService.saveCost(loanSecondarySalesCost, sid); + } + baseMapper.updateById(loanSecondarySalesApply); } return rb.success().setData(sid); } @@ -593,8 +632,6 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService vinNoLists = new ArrayList<>(); List bankContractNoList = new ArrayList<>(); List loanSecondarySalesVehVoList = new ArrayList<>(); @@ -611,19 +648,66 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService list = new ArrayList<>(); + if (StringUtils.isNotBlank(loanReturnInboundApply.getFiles())) { + List fileList = Arrays.asList(loanReturnInboundApply.getFiles().split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList()); + for (int j = 0; j < fileList.size(); j++) { + UrlQuery urlQuery = new UrlQuery(); + urlQuery.setUrl(fileList.get(j)); + list.add(urlQuery); + } + loanSecondarySalesApplyDetailsVo.setFilesList(list); + } + } + LoanSecondarySalesCostVo loanSecondarySalesCost = new LoanSecondarySalesCostVo(); + AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr(busVinSid); + if (alrepaidAndArrVo != null) { + BeanUtil.copyProperties(alrepaidAndArrVo, loanSecondarySalesApplyDetailsVo); + BigDecimal bigDecimal = BigDecimal.ZERO; + if (StringUtils.isNotBlank(alrepaidAndArrVo.getCurrentBeMoney())) { + bigDecimal = bigDecimal.add(new BigDecimal(alrepaidAndArrVo.getCurrentBeMoney())); + } + if (StringUtils.isNotBlank(alrepaidAndArrVo.getUnexpiredMoney())) { + bigDecimal = bigDecimal.add(new BigDecimal(alrepaidAndArrVo.getUnexpiredMoney())); + } + loanSecondarySalesCost.setArrearsAll(bigDecimal.toString()); + } + loanSecondarySalesApplyDetailsVo.setLoanSecondarySalesCost(loanSecondarySalesCost); + //根据销售订单查询金额方案 + LoanSolutions loanSolutions = loanSolutionsMapper.selectBySaleOrderSid(loanReturnVehLedger.getSaleOrderSid()); + if (loanSolutions != null) { + LoanSolutionsDetail loanSolutionsDetail = loanSolutionsDetailService.selectLoanSid(loanSolutions.getSid()); + if (loanSolutionsDetail != null) { + loanSecondarySalesCost.setLoanDeposit(loanSolutionsDetail.getBondAmounts().toString()); + } + } + } //根据主车查询挂车信息 LoanReturnVehLedger loanReturnVehLedgerT = loanReturnVehLedgerService.selectByPSid(loanReturnVehLedger.getSid()); - if ("未处置".equals(loanReturnVehLedgerT.getVehType())) { + if ("未处置".equals(loanReturnVehLedgerT.getDisposal())) { loanSecondarySalesVehVo = new LoanSecondarySalesVehVo(); loanSecondarySalesVehVo.setVehType(loanReturnVehLedgerT.getVehType()); loanSecondarySalesVehVo.setVehMark(loanReturnVehLedgerT.getVehMark()); @@ -632,15 +716,29 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService delete - from loan_secondary_sales_veh + from loan_secondary_sales_cost where mainSid = #{s} diff --git a/doc/databases/risk_center.sql b/doc/databases/risk_center.sql index fd0d1e9bf7..5aec1577c7 100644 --- a/doc/databases/risk_center.sql +++ b/doc/databases/risk_center.sql @@ -1636,22 +1636,30 @@ CREATE TABLE `loan_secondary_sales_cost` `collectionCost` decimal(10, 2) DEFAULT NULL COMMENT '催收费用', `bankSettleCost` decimal(10, 2) DEFAULT NULL COMMENT '资方结清费用', `bankSettleCostAssume` varchar(64) DEFAULT NULL COMMENT '资方结清费用承担方', + `bankSettleCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '资方结清费用承担方', `vehicleViolationCost` decimal(10, 2) DEFAULT NULL COMMENT '车辆违章费用', `vehicleViolationCostAssume` varchar(64) DEFAULT NULL COMMENT '车辆违章费用承担方', + `vehicleViolationCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '车辆违章费用承担方', `inspectYearCost` decimal(10, 2) DEFAULT NULL COMMENT '年检费', `inspectYearCostAssume` varchar(64) DEFAULT NULL COMMENT '年检费承担方', + `inspectYearCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '年检费承担方', `insureCost` decimal(10, 2) DEFAULT NULL COMMENT '保险费', `insureCostAssume` varchar(64) DEFAULT NULL COMMENT '保险费承担方', + `insureCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '保险费承担方', `ownershipCost` decimal(10, 2) DEFAULT NULL COMMENT '过户费', `ownershipCostAssume` varchar(64) DEFAULT NULL COMMENT '过户费承担方', + `ownershipCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '过户费承担方', `stopCost` decimal(10, 2) DEFAULT NULL COMMENT '停车费', `stopCostAssume` varchar(64) DEFAULT NULL COMMENT '停车费承担方', + `stopCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '停车费承担方', `otherCost` decimal(10, 2) DEFAULT NULL COMMENT '其他费用', `otherCostAssume` varchar(64) DEFAULT NULL COMMENT '其他费用承担方', + `otherCostAssumeKey` varchar(64) DEFAULT NULL COMMENT '其他费用承担方', `costDescription` text DEFAULT NULL COMMENT '费用说明', `lossPrice` decimal(10, 2) DEFAULT NULL COMMENT '预计亏损金额', `debtDisposal` text DEFAULT NULL COMMENT '后续欠款处置方向', `files` text DEFAULT NULL COMMENT '附件', + `vehicleEvaluation` text DEFAULT NULL COMMENT '车辆评估', PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE = INNODB