Browse Source

交回车辆二次销售相关接口

master
dimengzhe 1 year ago
parent
commit
005655da1d
  1. 7
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDetailsVo.java
  2. 7
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyDto.java
  3. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalesapply/LoanSecondarySalesApplyFeign.java
  4. 9
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCost.java
  5. 10
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansecondarysalescost/LoanSecondarySalesCostVo.java
  6. 2
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyMapper.xml
  7. 110
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalesapply/LoanSecondarySalesApplyService.java
  8. 2
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalescost/LoanSecondarySalesCostMapper.xml
  9. 8
      doc/databases/risk_center.sql

7
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;
}

7
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;
}

2
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<LoanSecondarySalesApplyDetailsVo> details(LoanSecondarySalesApplyDetailsQuery query);
ResultBean<LoanSecondarySalesApplyDetailsVo> details(@RequestBody LoanSecondarySalesApplyDetailsQuery query);
@ApiOperation("删除/批量删除")
@DeleteMapping("/delBySids")

9
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;
}

10
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<UrlQuery> files = new ArrayList<>();
@ApiModelProperty("车辆评估")
private String vehicleEvaluation;
}

2
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}
</select>

110
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<LoanSecon
private LoanReturnVehLedgerService loanReturnVehLedgerService;
@Autowired
private LoanReturnInboundApplyService loanReturnInboundApplyService;
@Autowired
private LoanRestoreReportApplyService loanRestoreReportApplyService;
@Autowired
private LoanSolutionsMapper loanSolutionsMapper;
@Autowired
private LoanSolutionsDetailService loanSolutionsDetailService;
public PagerVo<LoanSecondarySalesApplyVo> listPageVo(PagerQuery<LoanSecondarySalesApplyQuery> pq) {
LoanSecondarySalesApplyQuery query = pq.getParams();
@ -538,7 +551,33 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService<LoanSecon
loanSecondarySalesCostService.saveCost(loanSecondarySalesCost, sid);
}
} else {
LoanSecondarySalesApply loanSecondarySalesApply = fetchBySid(sid);
if (loanSecondarySalesApply == null) {
return rb.setMsg("该申请不存在");
}
dto.setUserSid(loanSecondarySalesApply.getCreateBySid());
BeanUtil.copyProperties(dto, loanSecondarySalesApply, "sid");
List<UrlQuery> filss = dto.getFilesList();
if (!filss.isEmpty()) {
List<String> 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<LoanSecondarySalesVehVo> 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<LoanSecon
return rb.setMsg("请选择车辆");
}
String busVinSid = "";
String vinNo = "";
String saleOrderSid = "";
List<String> vinNoLists = new ArrayList<>();
List<String> bankContractNoList = new ArrayList<>();
List<LoanSecondarySalesVehVo> loanSecondarySalesVehVoList = new ArrayList<>();
@ -611,19 +648,66 @@ public class LoanSecondarySalesApplyService extends MybatisBaseService<LoanSecon
}
busVinSid = loanReturnInboundApply.getBusVinSid();
if ("主车".equals(loanReturnVehLedger.getVehType())) {
if ("未处置".equals(loanReturnVehLedger.getVehType())) {
if ("未处置".equals(loanReturnVehLedger.getDisposal())) {
loanSecondarySalesVehVo.setBusVinSid(loanReturnVehLedger.getBusVinSid());
loanSecondarySalesVehVo.setVinNo(loanReturnVehLedger.getVinNo());
loanSecondarySalesVehVo.setVehMark(loanReturnVehLedger.getVehMark());
loanSecondarySalesVehVo.setModelName(loanReturnVehLedger.getVehModel());
loanSecondarySalesVehVo.setModelSid(loanReturnVehLedger.getVehModelSid());
loanSecondarySalesVehVo.setConfigSid(loanReturnVehLedger.getConfigSid());
loanSecondarySalesVehVo.setBusVinSid(busVinSid);
loanSecondarySalesVehVo.setVehType(loanReturnVehLedger.getVehType());
loanSecondarySalesVehVoList.add(loanSecondarySalesVehVo);
loanSecondarySalesApplyDetailsVo.setCustomerName(loanReturnVehLedger.getCustomer());
loanSecondarySalesApplyDetailsVo.setLoanName(loanReturnVehLedger.getBorrowerName());
loanSecondarySalesApplyDetailsVo.setCustomerSid(loanReturnVehLedger.getCustomerSid());
loanSecondarySalesApplyDetailsVo.setLoanSid(loanReturnVehLedger.getBorrowerSid());
loanSecondarySalesApplyDetailsVo.setLoanContractNo(loanReturnInboundApply.getLoanContractNo());
loanSecondarySalesApplyDetailsVo.setBankName(loanReturnInboundApply.getBankName());
loanSecondarySalesApplyDetailsVo.setBankContractNo(loanReturnInboundApply.getBankContractNo());
loanSecondarySalesApplyDetailsVo.setLocationName(loanReturnVehLedger.getLocation());
loanSecondarySalesApplyDetailsVo.setSalesOrderSid(loanReturnVehLedger.getSaleOrderSid());
loanSecondarySalesApplyDetailsVo.setFirstDate(loanReturnInboundApply.getFirstDate());
if (StringUtils.isNotBlank(loanReturnInboundApply.getFiles())) {
List<UrlQuery> list = new ArrayList<>();
if (StringUtils.isNotBlank(loanReturnInboundApply.getFiles())) {
List<String> 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<LoanSecon
loanSecondarySalesVehVoList.add(loanSecondarySalesVehVo);
}
}
if ("挂车".equals(loanReturnVehLedger.getVehType())) {
if ("未处置".equals(loanReturnVehLedger.getVehType())) {
if ("未处置".equals(loanReturnVehLedger.getDisposal())) {
loanSecondarySalesVehVo = new LoanSecondarySalesVehVo();
loanSecondarySalesVehVo.setVehType(loanReturnVehLedger.getVehType());
loanSecondarySalesVehVo.setVehMark(loanReturnVehLedger.getVehMark());
loanSecondarySalesVehVo.setVinNo(loanReturnVehLedger.getVinNo());
loanSecondarySalesVehVo.setModelName(loanReturnVehLedger.getVehModel());
loanSecondarySalesVehVoList.add(loanSecondarySalesVehVo);
loanSecondarySalesApplyDetailsVo.setCustomerName(loanReturnVehLedger.getCustomer());
loanSecondarySalesApplyDetailsVo.setLoanName(loanReturnVehLedger.getBorrowerName());
loanSecondarySalesApplyDetailsVo.setCustomerSid(loanReturnVehLedger.getCustomerSid());
loanSecondarySalesApplyDetailsVo.setLoanSid(loanReturnVehLedger.getBorrowerSid());
loanSecondarySalesApplyDetailsVo.setLoanContractNo(loanReturnInboundApply.getLoanContractNo());
loanSecondarySalesApplyDetailsVo.setBankName(loanReturnInboundApply.getBankName());
loanSecondarySalesApplyDetailsVo.setBankContractNo(loanReturnInboundApply.getBankContractNo());
loanSecondarySalesApplyDetailsVo.setLocationName(loanReturnVehLedger.getLocation());
loanSecondarySalesApplyDetailsVo.setSalesOrderSid(loanReturnVehLedger.getSaleOrderSid());
AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr(busVinSid);
if (alrepaidAndArrVo != null) {
BeanUtil.copyProperties(alrepaidAndArrVo, loanSecondarySalesApplyDetailsVo);
}
}
}
}

2
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalescost/LoanSecondarySalesCostMapper.xml

@ -3,7 +3,7 @@
<mapper namespace="com.yxt.anrui.riskcenter.biz.loansecondarysalescost.LoanSecondarySalesCostMapper">
<delete id="deleteByMainSid">
delete
from loan_secondary_sales_veh
from loan_secondary_sales_cost
where mainSid = #{s}
</delete>

8
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

Loading…
Cancel
Save