From 044f6a04c4002625dbeb9505ce1e64be59c07d29 Mon Sep 17 00:00:00 2001 From: God <10745413@qq.com> Date: Thu, 4 Jan 2024 18:09:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=20=E8=BF=9C=E7=A8=8B=E8=A7=A3=E6=8E=A7?= =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=88=97=E8=A1=A8=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=A7=A3=E6=8E=A7=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoanBeCollectionApply.java | 3 +- .../LoanBeCollectionApplyDetailsVo.java | 2 + .../LoanBeCollectionApplyDto.java | 2 + .../LoanBeCollectionApplyFeign.java | 2 - .../LoanBeCollectionApplyFeignFallback.java | 2 +- .../LoanVehClearanceApplyDetailsVo.java | 2 + .../LoanVehClearanceApplyFeign.java | 16 +- .../LoanVehClearanceApplyFeignFallback.java | 12 + .../LoanVehClearanceInitQuery.java | 59 ++ .../LoanVehClearanceLockCarQuery.java | 64 ++ .../LoanVehClearanceLockCarVo.java | 73 +++ .../LoanVehClearanceVehInit.java | 46 ++ .../LoanBeCollectionApplyMapper.java | 1 + .../LoanBeCollectionApplyMapper.xml | 65 ++- .../LoanBeCollectionApplyRest.java | 4 +- .../LoanBeCollectionApplyService.java | 25 +- .../LoanBeCollectionVehMapper.java | 2 + .../LoanBeCollectionVehMapper.xml | 34 +- .../LoanBeCollectionVehService.java | 4 + .../LoanVehClearanceApplyMapper.java | 7 + .../LoanVehClearanceApplyMapper.xml | 124 +++- .../LoanVehClearanceApplyRest.java | 27 +- .../LoanVehClearanceApplyService.java | 550 ++++++++++-------- 23 files changed, 823 insertions(+), 303 deletions(-) create mode 100644 anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceInitQuery.java create mode 100644 anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarQuery.java create mode 100644 anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarVo.java create mode 100644 anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceVehInit.java diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApply.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApply.java index 0d11160424..9730aa6cfa 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApply.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApply.java @@ -76,5 +76,6 @@ public class LoanBeCollectionApply extends BaseEntity { private String nodeState; // 流程状态 @ApiModelProperty("任务id") private String taskId; // 任务id - + @ApiModelProperty("远程控制提醒") + private String lockCarRemarks; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDetailsVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDetailsVo.java index ec9d5409d6..3009e9d3b4 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDetailsVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDetailsVo.java @@ -94,4 +94,6 @@ public class LoanBeCollectionApplyDetailsVo implements Vo { private List files = new ArrayList<>(); @ApiModelProperty("逾期车辆列表") private List loanBeCollectionVehDetails; + @ApiModelProperty("远程控制提醒") + private String lockCarRemarks; } \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDto.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDto.java index 71fd47435d..d89954b94d 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDto.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyDto.java @@ -89,6 +89,8 @@ public class LoanBeCollectionApplyDto implements Dto { private String nodeState; // 流程状态 @ApiModelProperty("任务id") private String taskId; // 任务id + @ApiModelProperty("远程控制提醒") + private String lockCarRemarks; @ApiModelProperty("附件") private List files = new ArrayList<>(); @ApiModelProperty("逾期车辆列表") diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java index 8f33f537ce..88a3905cfe 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeign.java @@ -26,8 +26,6 @@ package com.yxt.anrui.riskcenter.api.loanbecollectionapply; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.flowable.*; -import com.yxt.anrui.riskcenter.api.loanbecollectionrecord.LoanBeCollectionRecordInit; -import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import com.yxt.common.core.query.PagerQuery; diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java index d960861edc..1629993d53 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanbecollectionapply/LoanBeCollectionApplyFeignFallback.java @@ -26,7 +26,7 @@ package com.yxt.anrui.riskcenter.api.loanbecollectionapply; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.flowable.*; -import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.LoanBePadsincereNodeVo; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyDetailsVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyDetailsVo.java index 6108495129..7278ddd477 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyDetailsVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyDetailsVo.java @@ -59,6 +59,8 @@ public class LoanVehClearanceApplyDetailsVo implements Vo { @ApiModelProperty("申请日期") private String createTime; + @ApiModelProperty("创建人sid") + private String createBySid; @ApiModelProperty("创建人") private String createByName; // 创建人 @ApiModelProperty("申请编号") diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeign.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeign.java index b53ae4252c..390563f47f 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeign.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeign.java @@ -25,6 +25,10 @@ *********************************************************/ package com.yxt.anrui.riskcenter.api.loanvehclearanceapply; +import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyDetailsVo; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarQuery; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceVehDetailsVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import com.yxt.common.core.query.PagerQuery; @@ -33,8 +37,6 @@ import com.yxt.common.core.vo.PagerVo; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; -import java.util.List; - /** * Project: anrui-riskcenter(车辆远程解控申请)
* File: LoanVehClearanceApplyFeign.java
@@ -61,6 +63,11 @@ public interface LoanVehClearanceApplyFeign { @ResponseBody public ResultBean> listPage(@RequestBody PagerQuery pq); + @ApiOperation("远程控制成功车辆列表") + @PostMapping("/lockCarList") + @ResponseBody + public ResultBean> lockCarList(@RequestBody PagerQuery pq); + @ApiOperation("新增或修改") @PostMapping("/save") @ResponseBody @@ -70,6 +77,11 @@ public interface LoanVehClearanceApplyFeign { @DeleteMapping("/delBySids") @ResponseBody public ResultBean delBySids(@RequestBody String[] sids); + + @ApiOperation("初始化") + @PostMapping("/init") + @ResponseBody + public ResultBean init(@RequestBody LoanVehClearanceInitQuery loanVehClearanceInitQuery); @ApiOperation("根据SID获取一条记录") @GetMapping("/fetchDetailsBySid/{sid}") diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeignFallback.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeignFallback.java index 7dfa83e972..251c88fa43 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeignFallback.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceApplyFeignFallback.java @@ -25,6 +25,8 @@ *********************************************************/ package com.yxt.anrui.riskcenter.api.loanvehclearanceapply; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarQuery; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -54,6 +56,11 @@ public class LoanVehClearanceApplyFeignFallback implements LoanVehClearanceApply return rb.setMsg("接口anrui-riskcenter/loanvehclearanceapply/listPage无法访问"); } + @Override + public ResultBean> lockCarList(PagerQuery pq) { + return null; + } + @Override public ResultBean save(LoanVehClearanceApplyDto dto){ return ResultBean.fireFail().setMsg("接口anrui-riskcenter/loanvehclearanceapply/save无法访问"); @@ -64,6 +71,11 @@ public class LoanVehClearanceApplyFeignFallback implements LoanVehClearanceApply return ResultBean.fireFail().setMsg("接口anrui-riskcenter/loanvehclearanceapply/delBySids无法访问"); } + @Override + public ResultBean init(LoanVehClearanceInitQuery loanVehClearanceInitQuery) { + return null; + } + @Override public ResultBean fetchDetailsBySid(String sid){ ResultBean rb = ResultBean.fireFail(); diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceInitQuery.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceInitQuery.java new file mode 100644 index 0000000000..88fc48919f --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceapply/LoanVehClearanceInitQuery.java @@ -0,0 +1,59 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.riskcenter.api.loanvehclearanceapply; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * Project: anrui-riskcenter(车辆远程解控申请)
+ * File: LoanVehClearanceApplyQuery.java
+ * Class: com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApplyQuery
+ * Description: 车辆远程解控申请 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-12-29 10:25:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "车辆远程解控申请 查询条件", description = "车辆远程解控申请 查询条件") +public class LoanVehClearanceInitQuery implements Query { + + @ApiModelProperty("销售订单车辆sid") + private List saleVehSids; + @ApiModelProperty("组织全路径") + private String orgPath; + @ApiModelProperty("用户sid") + private String userSid; +} diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarQuery.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarQuery.java new file mode 100644 index 0000000000..609fdee32b --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarQuery.java @@ -0,0 +1,64 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.riskcenter.api.loanvehclearanceveh; + + +import com.yxt.common.core.query.Query; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * Project: anrui-riskcenter(催收措施申请)
+ * File: LoanBeCollectionVehVo.java
+ * Class: com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehVo
+ * Description: 逾期催收车辆 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-12-12 16:06:20
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "逾期催收车辆 视图数据详情", description = "逾期催收车辆 视图数据详情") +public class LoanVehClearanceLockCarQuery implements Query { + + @ApiModelProperty("客户名称") + private String custName; + @ApiModelProperty("贷款人姓名") + private String borrowerName; + @ApiModelProperty("车牌号") + private String carNum; + @ApiModelProperty("分公司sid") + private String useOrgSid; + @ApiModelProperty + private List saleVehSids; +} \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarVo.java new file mode 100644 index 0000000000..f1cdbfaf30 --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceLockCarVo.java @@ -0,0 +1,73 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.riskcenter.api.loanvehclearanceveh; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionFileVo; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Project: anrui-riskcenter(催收措施申请)
+ * File: LoanBeCollectionVehVo.java
+ * Class: com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehVo
+ * Description: 逾期催收车辆 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-12-12 16:06:20
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "逾期催收车辆 视图数据详情", description = "逾期催收车辆 视图数据详情") +public class LoanVehClearanceLockCarVo implements Vo { + + @ApiModelProperty("销售订单车辆sid") + private String saleVehSid; + @ApiModelProperty("贷款合同编号") + private String loanContractNo; + @ApiModelProperty("车架号") + private String vinNo; + @ApiModelProperty("车牌号") + private String carNum; + @ApiModelProperty("资方") + private String bankName; + @ApiModelProperty("资方合同号") + private String bankContractNo; + @ApiModelProperty("客户名称") + private String custName; + @ApiModelProperty("贷款人姓名") + private String borrowerName; +} \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceVehInit.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceVehInit.java new file mode 100644 index 0000000000..bbfbc4ecc7 --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanvehclearanceveh/LoanVehClearanceVehInit.java @@ -0,0 +1,46 @@ +package com.yxt.anrui.riskcenter.api.loanvehclearanceveh; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehFile; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class LoanVehClearanceVehInit { + + @ApiModelProperty("贷款合同编号") + private String loanContractNo; + @ApiModelProperty("车架号") + private String vinNo; + @ApiModelProperty("车牌号") + private String carNum; + @ApiModelProperty("资方") + private String bankName; + @ApiModelProperty("资方合同编号") + private String bankContractNo; + @ApiModelProperty("客户名称") + private String custName; + @ApiModelProperty("贷款人") + private String loanName; + @ApiModelProperty("首次逾期日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date firstBeDate; + @ApiModelProperty("逾期期数") + private String beOverduePeriod; + @ApiModelProperty("逾期金额") + private String beOverdueMoney; + @ApiModelProperty("逾期金额换算期数") + private String beOverdueMoneyAndPeriod; + @ApiModelProperty("销售订单sid") + private String salesOrderSid; + @ApiModelProperty("销售订单车辆sid") + private String saleVehSid; + @ApiModelProperty("远程控制费用") + private String lockCarMoney; + + @ApiModelProperty + private List sids; +} diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java index 11523f43cf..dae1201ae5 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.java @@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml index 705cb06343..baa515cad1 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyMapper.xml @@ -1,36 +1,43 @@ - - - - - + + + - + - - UPDATE loan_be_collection_apply - SET nodeState=#{nodeState}, nodeSid=#{taskDefKey}, modifyTime = NOW() - - , procDefId=#{procDefId} - - - , procInstSid=#{procInsId} - - - , taskId=#{taskId} - - WHERE sid=#{sid} + + + + UPDATE loan_be_collection_apply + SET nodeState=#{nodeState}, nodeSid=#{taskDefKey}, modifyTime = NOW() + + , procDefId=#{procDefId} + + + , procInstSid=#{procInsId} + + + , taskId=#{taskId} + + WHERE sid=#{sid} \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java index fdb71c2744..4f105f8351 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyRest.java @@ -29,7 +29,7 @@ import cn.hutool.core.bean.BeanUtil; import com.yxt.anrui.flowable.api.utils.ProcDefEnum; import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.flowable.*; -import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.flowable.LoanBePadsincereNodeVo; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -39,7 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; -import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApply; + import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyQuery; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyVo; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyDetailsVo; diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java index 2fdd71c7a1..15ce6c63ce 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionapply/LoanBeCollectionApplyService.java @@ -50,6 +50,7 @@ import com.yxt.anrui.flowable.api.utils.ProcDefEnum; import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; +import com.yxt.anrui.portal.api.sysparameter.SysParameterFeign; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; import com.yxt.anrui.portal.api.sysuser.SysUserFeign; @@ -57,10 +58,10 @@ import com.yxt.anrui.portal.api.sysuser.SysUserVo; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.*; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.flowable.*; import com.yxt.anrui.riskcenter.api.loanbecollectionrecord.LoanBeCollectionRecordVehInit; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehDetailsVo; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehDto; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehFile; -import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.LoanBePadsincereApplyVo; import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutions; @@ -134,6 +135,8 @@ public class LoanBeCollectionApplyService extends MybatisBaseService createQueryWrapper(LoanBeCollectionApplyQuery query) { // todo: 这里根据具体业务调整查询条件 @@ -250,6 +253,10 @@ public class LoanBeCollectionApplyService extends MybatisBaseService collMeasures = dto.getCollMeasures(); + if (!collMeasures.contains("远程控制")){ + loanBeCollectionVehDetail.setLockCarMoney("0"); + } loanBeCollectionVehDetail.setMainSid(sid); String vehSid = loanBeCollectionVehService.saveOrUpdateDto(loanBeCollectionVehDetail); List hkxyFiles = loanBeCollectionVehDetail.getHkxyFiles(); @@ -432,10 +439,21 @@ public class LoanBeCollectionApplyService extends MybatisBaseService loanBeCollectionRecordVehInits = loanBeOverdueVehService.initVehListByBorrSid(busSalesOrderVehicle.getBorrowerSid()); List loanBeCollectionVehDetailsVos = new ArrayList<>(); + String yckzVinNo = ""; for (LoanBeCollectionRecordVehInit loanBeCollectionRecordVehInit : loanBeCollectionRecordVehInits) { - List loanBeCollectionVehFiles = new ArrayList<>(); LoanBeCollectionVehDetailsVo loanBeCollectionVehDetailsVo = new LoanBeCollectionVehDetailsVo(); BeanUtil.copyProperties(loanBeCollectionRecordVehInit, loanBeCollectionVehDetailsVo); + //远程控制费用获取 + int i = loanBeCollectionVehService.selBjBySaleVehSid(loanBeCollectionRecordVehInit.getSaleVehSid()); + String parameterValue = sysParameterFeign.fetchByParNo("FK_YCKZSFGZ").getData(); + String[] parameterValues = parameterValue.split(","); + if (i < 3){ + loanBeCollectionVehDetailsVo.setLockCarMoney(parameterValues[i]); + }else { + loanBeCollectionVehDetailsVo.setLockCarMoney(parameterValues[2]); + yckzVinNo = yckzVinNo + loanBeCollectionVehDetailsVo.getVinNo() + ','; + } + List loanBeCollectionVehFiles = new ArrayList<>(); BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(loanBeCollectionRecordVehInit.getSalesOrderSid()).getData(); BusSalesOrderVehicle busSalesOrderVehicle1 = busSalesOrderVehicleFeign.details(loanBeCollectionRecordVehInit.getSaleVehSid()).getData(); //催收记录sid @@ -473,6 +491,9 @@ public class LoanBeCollectionApplyService extends MybatisBaseService - - - - - + + + + + + + \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionveh/LoanBeCollectionVehService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionveh/LoanBeCollectionVehService.java index d74ef310a0..b494ef796f 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionveh/LoanBeCollectionVehService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanbecollectionveh/LoanBeCollectionVehService.java @@ -254,4 +254,8 @@ public class LoanBeCollectionVehService extends MybatisBaseService selectListVo(); String selectNum(String billNo); + + IPage lockCarList(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + LoanVehClearanceVehInit initVehListBySaleVehSid(String saleVehSid); } \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyMapper.xml b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyMapper.xml index 2eaccd9737..f1bf77888f 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyMapper.xml +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyMapper.xml @@ -1,21 +1,113 @@ - - - - - + + + - + + + + + + + \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyRest.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyRest.java index 7aa370ad74..96f3aaa193 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyRest.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyRest.java @@ -25,6 +25,10 @@ *********************************************************/ package com.yxt.anrui.riskcenter.biz.loanvehclearanceapply; +import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.*; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarQuery; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceLockCarVo; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceVehDetailsVo; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -33,14 +37,6 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.List; -import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApply; -import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApplyQuery; -import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApplyVo; -import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApplyDetailsVo; -import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApplyDto; -import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.LoanVehClearanceApplyFeign; - /** * Project: anrui-riskcenter(车辆远程解控申请)
* File: LoanVehClearanceApplyFeignFallback.java
@@ -71,6 +67,13 @@ public class LoanVehClearanceApplyRest implements LoanVehClearanceApplyFeign { return rb.success().setData(pv); } + @Override + public ResultBean> lockCarList(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = loanVehClearanceApplyService.lockCarList(pq); + return rb.success().setData(pv); + } + @Override @ApiOperation("新增或修改") @PostMapping("/save") @@ -89,6 +92,13 @@ public class LoanVehClearanceApplyRest implements LoanVehClearanceApplyFeign { return rb.success(); } + @Override + public ResultBean init(LoanVehClearanceInitQuery loanVehClearanceInitQuery) { + ResultBean rb = ResultBean.fireFail(); + LoanVehClearanceApplyDetailsVo loanVehClearanceApplyDetailsVo = loanVehClearanceApplyService.init(loanVehClearanceInitQuery); + return rb.success().setData(loanVehClearanceApplyDetailsVo); + } + @Override @ApiOperation("根据SID获取一条记录") @GetMapping("/fetchDetailsBySid/{sid}") @@ -97,4 +107,5 @@ public class LoanVehClearanceApplyRest implements LoanVehClearanceApplyFeign { LoanVehClearanceApplyDetailsVo vo = loanVehClearanceApplyService.fetchDetailsVoBySid(sid); return rb.success().setData(vo); } + } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyService.java index bb6f6ea60e..b16e821efb 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanvehclearanceapply/LoanVehClearanceApplyService.java @@ -38,22 +38,19 @@ import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice; import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeign; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; +import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; import com.yxt.anrui.portal.api.sysuser.SysUserFeign; -import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApply; +import com.yxt.anrui.portal.api.sysuser.SysUserVo; import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyDetailsVo; -import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionApplyVo; -import com.yxt.anrui.riskcenter.api.loanbecollectionapply.LoanBeCollectionFileVo; +import com.yxt.anrui.riskcenter.api.loanbecollectionrecord.LoanBeCollectionRecordVehInit; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehDetailsVo; -import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehDto; import com.yxt.anrui.riskcenter.api.loanbecollectionveh.LoanBeCollectionVehFile; import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; import com.yxt.anrui.riskcenter.api.loansolutions.LoanSolutions; import com.yxt.anrui.riskcenter.api.loanvehclearanceapply.*; -import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceVehDetailsVo; -import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceVehDto; -import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.LoanVehClearanceVehFile; +import com.yxt.anrui.riskcenter.api.loanvehclearanceveh.*; import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; import com.yxt.anrui.riskcenter.biz.loanhomevisitinvestigate.LoanHomevisitInvestigateService; import com.yxt.anrui.riskcenter.biz.loansolutions.LoanSolutionsService; @@ -71,7 +68,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Date; import java.util.List; /** @@ -90,230 +87,321 @@ import java.util.List; @Service public class LoanVehClearanceApplyService extends MybatisBaseService { - @Autowired - private SysUserFeign sysUserFeign; - @Resource - private SysOrganizationFeign sysOrganizationFeign; - @Autowired - private FileUploadComponent fileUploadComponent; - @Autowired - private LoanFileService loanFileService; - @Autowired - private LoanVehClearanceVehService loanVehClearanceVehService; - @Autowired - private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; - @Autowired - private BusSalesOrderFeign busSalesOrderFeign; - @Autowired - private LoanSolutionsService loanSolutionsService; - @Autowired - private FinVehicleInvoiceFeign finVehicleInvoiceFeign; - @Autowired - private LoanHomevisitInvestigateService loanHomevisitInvestigateService; + @Autowired + private SysUserFeign sysUserFeign; + @Resource + private SysOrganizationFeign sysOrganizationFeign; + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private LoanFileService loanFileService; + @Autowired + private LoanVehClearanceVehService loanVehClearanceVehService; + @Autowired + private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; + @Autowired + private BusSalesOrderFeign busSalesOrderFeign; + @Autowired + private LoanSolutionsService loanSolutionsService; + @Autowired + private FinVehicleInvoiceFeign finVehicleInvoiceFeign; + @Autowired + private LoanHomevisitInvestigateService loanHomevisitInvestigateService; + @Autowired + SysStaffOrgFeign sysStaffOrgFeign; - public PagerVo listPageVo(PagerQuery pq) { - LoanVehClearanceApplyQuery 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')" - ); - 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')" - ); - qw.orderByDesc("createTime"); - IPage page = PagerUtil.queryToPage(pq); - IPage pagging = baseMapper.selectPageVo(page, qw); - PagerVo p = PagerUtil.pageToVo(pagging, null); - return p; - } - - public String saveOrUpdateDto(LoanVehClearanceApplyDto dto){ - String dtoSid = dto.getSid(); - List loanVehClearanceVehDtoList = dto.getLoanVehClearanceVehDtoList(); - List files = dto.getFiles(); - if (StringUtils.isBlank(dtoSid)) { - //生成单据编号 - String billNo = ""; - String date = DateUtil.format(DateUtil.date(), "yyyyMM"); - SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); - billNo = "CLYCJK" + 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); - if (files != null && files.size() > 0){ - for (LoanVehClearanceFileVo file : files) { - LoanFile loanFile = new LoanFile(); - loanFile.setLinkSid(sid); - loanFile.setAttachType(LoanFileEnum.VEHCLEARANCE.getAttachType()); - String filePath = file.getUrl(); - if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { - filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); - } - loanFile.setFilePath(filePath); - loanFileService.save(loanFile); - } - } - for (LoanVehClearanceVehDto loanVehClearanceVehDto : loanVehClearanceVehDtoList) { - loanVehClearanceVehDto.setMainSid(sid); - loanVehClearanceVehService.saveOrUpdateDto(loanVehClearanceVehDto); - } - return sid; - } - this.updateByDto(dto); - loanFileService.delByLinkSidOrType(dtoSid,LoanFileEnum.VEHCLEARANCE.getAttachType()); - if (files != null && files.size() > 0){ - for (LoanVehClearanceFileVo file : files) { - LoanFile loanFile = new LoanFile(); - loanFile.setLinkSid(dtoSid); - loanFile.setAttachType(LoanFileEnum.VEHCLEARANCE.getAttachType()); - String filePath = file.getUrl(); - if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { - filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); - } - loanFile.setFilePath(filePath); - loanFileService.save(loanFile); - } - } - loanVehClearanceVehService.delByMainSid(dtoSid); - for (LoanVehClearanceVehDto loanVehClearanceVehDto : loanVehClearanceVehDtoList) { - loanVehClearanceVehDto.setMainSid(dtoSid); - loanVehClearanceVehDto.setSid(""); - loanVehClearanceVehService.saveOrUpdateDto(loanVehClearanceVehDto); - } - return dtoSid; - } - - public String insertByDto(LoanVehClearanceApplyDto dto){ - LoanVehClearanceApply entity = new LoanVehClearanceApply(); - BeanUtil.copyProperties(dto, entity, "id", "sid"); - entity.setNodeState("待提交"); - baseMapper.insert(entity); - return entity.getSid(); - } - - public void updateByDto(LoanVehClearanceApplyDto dto){ - String dtoSid = dto.getSid(); + public PagerVo listPageVo(PagerQuery pq) { + LoanVehClearanceApplyQuery 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')" + ); + 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')" + ); + qw.orderByDesc("createTime"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public PagerVo lockCarList(PagerQuery pq) { + LoanVehClearanceLockCarQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("la.useOrgSid", query.getUseOrgSid()); + qw.eq("lv.lockCarState","1"); + if (StringUtils.isNotBlank(query.getCustName())) { + qw.like("lv.customerName", query.getCustName()); + } + if (StringUtils.isNotBlank(query.getBorrowerName())) { + qw.like("lv.borrowerName", query.getBorrowerName()); + } + if (StringUtils.isNotBlank(query.getCarNum())) { + qw.like("lv.carNum", query.getCarNum()); + } + if (query.getSaleVehSids().size() != 0) { + qw.notIn("lv.saleVehSid", query.getSaleVehSids()); + } + qw.groupBy("lv.saleVehSid"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.lockCarList(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public String saveOrUpdateDto(LoanVehClearanceApplyDto dto) { + String dtoSid = dto.getSid(); + List loanVehClearanceVehDtoList = dto.getLoanVehClearanceVehDtoList(); + List files = dto.getFiles(); + if (StringUtils.isBlank(dtoSid)) { + //生成单据编号 + String billNo = ""; + String date = DateUtil.format(DateUtil.date(), "yyyyMM"); + SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); + billNo = "CLYCJK" + 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); + if (files != null && files.size() > 0) { + for (LoanVehClearanceFileVo file : files) { + LoanFile loanFile = new LoanFile(); + loanFile.setLinkSid(sid); + loanFile.setAttachType(LoanFileEnum.VEHCLEARANCE.getAttachType()); + String filePath = file.getUrl(); + if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { + filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); + } + loanFile.setFilePath(filePath); + loanFileService.save(loanFile); + } + } + for (LoanVehClearanceVehDto loanVehClearanceVehDto : loanVehClearanceVehDtoList) { + loanVehClearanceVehDto.setMainSid(sid); + loanVehClearanceVehService.saveOrUpdateDto(loanVehClearanceVehDto); + } + return sid; + } + this.updateByDto(dto); + loanFileService.delByLinkSidOrType(dtoSid, LoanFileEnum.VEHCLEARANCE.getAttachType()); + if (files != null && files.size() > 0) { + for (LoanVehClearanceFileVo file : files) { + LoanFile loanFile = new LoanFile(); + loanFile.setLinkSid(dtoSid); + loanFile.setAttachType(LoanFileEnum.VEHCLEARANCE.getAttachType()); + String filePath = file.getUrl(); + if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { + filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); + } + loanFile.setFilePath(filePath); + loanFileService.save(loanFile); + } + } + loanVehClearanceVehService.delByMainSid(dtoSid); + for (LoanVehClearanceVehDto loanVehClearanceVehDto : loanVehClearanceVehDtoList) { + loanVehClearanceVehDto.setMainSid(dtoSid); + loanVehClearanceVehDto.setSid(""); + loanVehClearanceVehService.saveOrUpdateDto(loanVehClearanceVehDto); + } + return dtoSid; + } + + public String insertByDto(LoanVehClearanceApplyDto dto) { + LoanVehClearanceApply entity = new LoanVehClearanceApply(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + entity.setNodeState("待提交"); + baseMapper.insert(entity); + return entity.getSid(); + } + + public void updateByDto(LoanVehClearanceApplyDto dto) { + String dtoSid = dto.getSid(); if (StringUtils.isBlank(dtoSid)) { return; - } - LoanVehClearanceApply entity = fetchBySid(dtoSid); - BeanUtil.copyProperties(dto, entity, "id", "sid"); - baseMapper.updateById(entity); - } - - public LoanVehClearanceApplyDetailsVo fetchDetailsVoBySid(String sid){ - LoanVehClearanceApply entity = fetchBySid(sid); - LoanVehClearanceApplyDetailsVo vo = new LoanVehClearanceApplyDetailsVo(); - BeanUtil.copyProperties(entity, vo); - vo.setCreateTime(DateUtil.formatDate(entity.getCreateTime())); - List loanFiles = loanFileService.selectByLinkSid(sid, LoanFileEnum.VEHCLEARANCE.getAttachType()); - List loanVehClearanceFileVos = new ArrayList<>(); - if (loanFiles != null && loanFiles.size() > 0){ - for (LoanFile loanFile : loanFiles) { - LoanVehClearanceFileVo loanVehClearanceFileVo = new LoanVehClearanceFileVo(); - String filePath = loanFile.getFilePath(); - String urlPrefix = fileUploadComponent.getUrlPrefix(); - filePath = urlPrefix + filePath; - loanVehClearanceFileVo.setUrl(filePath); - loanVehClearanceFileVos.add(loanVehClearanceFileVo); - } - } - vo.setFiles(loanVehClearanceFileVos); - List loanVehClearanceVehDetailsVoList = loanVehClearanceVehService.selByMainSid(sid); - for (LoanVehClearanceVehDetailsVo loanVehClearanceVehDetailsVo : loanVehClearanceVehDetailsVoList) { - List loanVehClearanceVehFiles = new ArrayList<>(); - BusSalesOrderVehicle busSalesOrderVehicle1 = busSalesOrderVehicleFeign.details(loanVehClearanceVehDetailsVo.getSaleVehSid()).getData(); - BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(busSalesOrderVehicle1.getSalesOrderSid()).getData(); - //催收记录sid - LoanVehClearanceVehFile loanVehClearanceVehFile1 = new LoanVehClearanceVehFile(); - loanVehClearanceVehFile1.setName("催收记录"); - loanVehClearanceVehFile1.setSid(loanVehClearanceVehDetailsVo.getSaleVehSid()); - loanVehClearanceVehFiles.add(loanVehClearanceVehFile1); - //开票管理sid - FinVehicleInvoice finVehicleInvoice = finVehicleInvoiceFeign.selectByVinAndContractNo(busSalesOrderVehicle1.getLinkSid(), busSalesOrder.getContractNo()).getData(); - LoanVehClearanceVehFile loanVehClearanceVehFile2 = new LoanVehClearanceVehFile(); - loanVehClearanceVehFile2.setName("开票信息"); - loanVehClearanceVehFile2.setSid(finVehicleInvoice.getSid()); - loanVehClearanceVehFiles.add(loanVehClearanceVehFile2); - //月还明细sid - LoanVehClearanceVehFile loanVehClearanceVehFile3 = new LoanVehClearanceVehFile(); - loanVehClearanceVehFile3.setName("月还明细"); - loanVehClearanceVehFile3.setSid(loanVehClearanceVehDetailsVo.getSaleVehSid()); - loanVehClearanceVehFiles.add(loanVehClearanceVehFile3); - //金融方案sid - LoanSolutions loanSolutions = loanSolutionsService.selectBySaleOrderSid(busSalesOrder.getSid()); - LoanVehClearanceVehFile loanVehClearanceVehFile4 = new LoanVehClearanceVehFile(); - loanVehClearanceVehFile4.setName("金融方案"); - loanVehClearanceVehFile4.setSid(loanSolutions.getSid()); - loanVehClearanceVehFiles.add(loanVehClearanceVehFile4); - //家访考察报告sid - String jfkcSid = loanHomevisitInvestigateService.selectByBorrSid(busSalesOrderVehicle1.getBorrowerSid()); - LoanVehClearanceVehFile loanVehClearanceVehFile5 = new LoanVehClearanceVehFile(); - loanVehClearanceVehFile5.setName("家访考察报告"); - loanVehClearanceVehFile5.setSid(jfkcSid); - loanVehClearanceVehFiles.add(loanVehClearanceVehFile5); - //家访考察资料sid - LoanVehClearanceVehFile loanVehClearanceVehFile6 = new LoanVehClearanceVehFile(); - loanVehClearanceVehFile6.setName("家访考察资料"); - loanVehClearanceVehFile6.setSid(jfkcSid); - loanVehClearanceVehFiles.add(loanVehClearanceVehFile6); - loanVehClearanceVehDetailsVo.setSids(loanVehClearanceVehFiles); - } - vo.setLoanVehClearanceVehDetailsVoList(loanVehClearanceVehDetailsVoList); - return vo; - } + } + LoanVehClearanceApply entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public LoanVehClearanceApplyDetailsVo fetchDetailsVoBySid(String sid) { + LoanVehClearanceApply entity = fetchBySid(sid); + LoanVehClearanceApplyDetailsVo vo = new LoanVehClearanceApplyDetailsVo(); + BeanUtil.copyProperties(entity, vo); + vo.setCreateTime(DateUtil.formatDate(entity.getCreateTime())); + List loanFiles = loanFileService.selectByLinkSid(sid, LoanFileEnum.VEHCLEARANCE.getAttachType()); + List loanVehClearanceFileVos = new ArrayList<>(); + if (loanFiles != null && loanFiles.size() > 0) { + for (LoanFile loanFile : loanFiles) { + LoanVehClearanceFileVo loanVehClearanceFileVo = new LoanVehClearanceFileVo(); + String filePath = loanFile.getFilePath(); + String urlPrefix = fileUploadComponent.getUrlPrefix(); + filePath = urlPrefix + filePath; + loanVehClearanceFileVo.setUrl(filePath); + loanVehClearanceFileVos.add(loanVehClearanceFileVo); + } + } + vo.setFiles(loanVehClearanceFileVos); + List loanVehClearanceVehDetailsVoList = loanVehClearanceVehService.selByMainSid(sid); + for (LoanVehClearanceVehDetailsVo loanVehClearanceVehDetailsVo : loanVehClearanceVehDetailsVoList) { + List loanVehClearanceVehFiles = new ArrayList<>(); + BusSalesOrderVehicle busSalesOrderVehicle1 = busSalesOrderVehicleFeign.details(loanVehClearanceVehDetailsVo.getSaleVehSid()).getData(); + BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(busSalesOrderVehicle1.getSalesOrderSid()).getData(); + //催收记录sid + LoanVehClearanceVehFile loanVehClearanceVehFile1 = new LoanVehClearanceVehFile(); + loanVehClearanceVehFile1.setName("催收记录"); + loanVehClearanceVehFile1.setSid(loanVehClearanceVehDetailsVo.getSaleVehSid()); + loanVehClearanceVehFiles.add(loanVehClearanceVehFile1); + //开票管理sid + FinVehicleInvoice finVehicleInvoice = finVehicleInvoiceFeign.selectByVinAndContractNo(busSalesOrderVehicle1.getLinkSid(), busSalesOrder.getContractNo()).getData(); + LoanVehClearanceVehFile loanVehClearanceVehFile2 = new LoanVehClearanceVehFile(); + loanVehClearanceVehFile2.setName("开票信息"); + loanVehClearanceVehFile2.setSid(finVehicleInvoice.getSid()); + loanVehClearanceVehFiles.add(loanVehClearanceVehFile2); + //月还明细sid + LoanVehClearanceVehFile loanVehClearanceVehFile3 = new LoanVehClearanceVehFile(); + loanVehClearanceVehFile3.setName("月还明细"); + loanVehClearanceVehFile3.setSid(loanVehClearanceVehDetailsVo.getSaleVehSid()); + loanVehClearanceVehFiles.add(loanVehClearanceVehFile3); + //金融方案sid + LoanSolutions loanSolutions = loanSolutionsService.selectBySaleOrderSid(busSalesOrder.getSid()); + LoanVehClearanceVehFile loanVehClearanceVehFile4 = new LoanVehClearanceVehFile(); + loanVehClearanceVehFile4.setName("金融方案"); + loanVehClearanceVehFile4.setSid(loanSolutions.getSid()); + loanVehClearanceVehFiles.add(loanVehClearanceVehFile4); + //家访考察报告sid + String jfkcSid = loanHomevisitInvestigateService.selectByBorrSid(busSalesOrderVehicle1.getBorrowerSid()); + LoanVehClearanceVehFile loanVehClearanceVehFile5 = new LoanVehClearanceVehFile(); + loanVehClearanceVehFile5.setName("家访考察报告"); + loanVehClearanceVehFile5.setSid(jfkcSid); + loanVehClearanceVehFiles.add(loanVehClearanceVehFile5); + //家访考察资料sid + LoanVehClearanceVehFile loanVehClearanceVehFile6 = new LoanVehClearanceVehFile(); + loanVehClearanceVehFile6.setName("家访考察资料"); + loanVehClearanceVehFile6.setSid(jfkcSid); + loanVehClearanceVehFiles.add(loanVehClearanceVehFile6); + loanVehClearanceVehDetailsVo.setSids(loanVehClearanceVehFiles); + } + vo.setLoanVehClearanceVehDetailsVoList(loanVehClearanceVehDetailsVoList); + return vo; + } + + + public LoanVehClearanceApplyDetailsVo init(LoanVehClearanceInitQuery query) { + List saleVehSids = query.getSaleVehSids(); + LoanVehClearanceApplyDetailsVo loanVehClearanceApplyDetailsVo = new LoanVehClearanceApplyDetailsVo(); + SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.selectByOrgSidPath(query.getOrgPath()).getData(); + loanVehClearanceApplyDetailsVo.setDeptSid(sysOrganizationVo.getSid()); + loanVehClearanceApplyDetailsVo.setDeptName(sysOrganizationVo.getName()); + SysUserVo sysUserVo = sysUserFeign.fetchBySid(query.getUserSid()).getData(); + loanVehClearanceApplyDetailsVo.setCreateBySid(query.getUserSid()); + loanVehClearanceApplyDetailsVo.setCreateByName(sysUserVo.getName()); + loanVehClearanceApplyDetailsVo.setCreateTime(DateUtil.formatDate(new Date())); + String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); + SysOrganizationVo sysOrganizationVo1 = sysOrganizationFeign.fetchBySid(useOrgSid).getData(); + loanVehClearanceApplyDetailsVo.setUseOrgSid(useOrgSid); + loanVehClearanceApplyDetailsVo.setUseOrgName(sysOrganizationVo1.getName()); + loanVehClearanceApplyDetailsVo.setOrgPath(query.getOrgPath()); + List loanVehClearanceVehDetailsVoList = new ArrayList<>(); + for (String saleVehSid : saleVehSids) { + LoanVehClearanceVehInit loanVehClearanceVehInit = baseMapper.initVehListBySaleVehSid(saleVehSid); + LoanVehClearanceVehDetailsVo loanVehClearanceVehDetailsVo = new LoanVehClearanceVehDetailsVo(); + BeanUtil.copyProperties(loanVehClearanceVehInit, loanVehClearanceVehDetailsVo); + loanVehClearanceVehDetailsVo.setCustomerName(loanVehClearanceVehInit.getCustName()); + loanVehClearanceVehDetailsVo.setBorrowerName(loanVehClearanceVehInit.getLoanName()); + List loanVehClearanceVehFiles = new ArrayList<>(); + BusSalesOrder busSalesOrder = busSalesOrderFeign.fetchBySid(loanVehClearanceVehInit.getSalesOrderSid()).getData(); + BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.details(loanVehClearanceVehInit.getSaleVehSid()).getData(); + //催收记录sid + LoanVehClearanceVehFile LoanVehClearanceVehFile1 = new LoanVehClearanceVehFile(); + LoanVehClearanceVehFile1.setName("催收记录"); + LoanVehClearanceVehFile1.setSid(loanVehClearanceVehInit.getSaleVehSid()); + loanVehClearanceVehFiles.add(LoanVehClearanceVehFile1); + //开票管理sid + FinVehicleInvoice finVehicleInvoice = finVehicleInvoiceFeign.selectByVinAndContractNo(busSalesOrderVehicle.getLinkSid(), busSalesOrder.getContractNo()).getData(); + LoanVehClearanceVehFile LoanVehClearanceVehFile2 = new LoanVehClearanceVehFile(); + LoanVehClearanceVehFile2.setName("开票信息"); + LoanVehClearanceVehFile2.setSid(finVehicleInvoice.getSid()); + loanVehClearanceVehFiles.add(LoanVehClearanceVehFile2); + //月还明细sid + LoanVehClearanceVehFile LoanVehClearanceVehFile3 = new LoanVehClearanceVehFile(); + LoanVehClearanceVehFile3.setName("月还明细"); + LoanVehClearanceVehFile3.setSid(saleVehSid); + loanVehClearanceVehFiles.add(LoanVehClearanceVehFile3); + //金融方案sid + LoanVehClearanceVehFile LoanVehClearanceVehFile4 = new LoanVehClearanceVehFile(); + LoanVehClearanceVehFile4.setName("金融方案"); + LoanVehClearanceVehFile4.setSid(loanVehClearanceVehInit.getSalesOrderSid()); + loanVehClearanceVehFiles.add(LoanVehClearanceVehFile4); + //家访考察报告sid + String sid = loanHomevisitInvestigateService.selectByBorrSid(busSalesOrderVehicle.getBorrowerSid()); + LoanVehClearanceVehFile LoanVehClearanceVehFile5 = new LoanVehClearanceVehFile(); + LoanVehClearanceVehFile5.setName("家访考察报告"); + LoanVehClearanceVehFile5.setSid(sid); + loanVehClearanceVehFiles.add(LoanVehClearanceVehFile5); + //家访考察资料sid + LoanVehClearanceVehFile LoanVehClearanceVehFile6 = new LoanVehClearanceVehFile(); + LoanVehClearanceVehFile6.setName("家访考察资料"); + LoanVehClearanceVehFile6.setSid(sid); + loanVehClearanceVehFiles.add(LoanVehClearanceVehFile6); + loanVehClearanceVehDetailsVo.setSids(loanVehClearanceVehFiles); + loanVehClearanceVehDetailsVoList.add(loanVehClearanceVehDetailsVo); + } + loanVehClearanceApplyDetailsVo.setLoanVehClearanceVehDetailsVoList(loanVehClearanceVehDetailsVoList); + return loanVehClearanceApplyDetailsVo; + } } \ No newline at end of file From 0420954e1f98151242c2918ecc833d1f2bc77272 Mon Sep 17 00:00:00 2001 From: God <10745413@qq.com> Date: Fri, 5 Jan 2024 10:02:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=AE=B6?= =?UTF-8?q?=E8=AE=BF=E8=80=83=E5=AF=9F=E8=AF=A6=E6=83=85=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E3=80=81=E9=87=91=E8=9E=8D=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E5=B0=81=E8=A3=85=E7=B1=BB=E8=BF=94=E5=9B=9E=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yxt/anrui/terminal/api/base/common/CarModelVo.java | 2 ++ .../api/risk/loanhomevisitinvestigate/AppLoanHomeVisitVo.java | 2 ++ .../com/yxt/anrui/terminal/biz/base/common/CommonService.java | 2 ++ 3 files changed, 6 insertions(+) diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/base/common/CarModelVo.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/base/common/CarModelVo.java index 1cad2ab602..3bad6c6290 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/base/common/CarModelVo.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/base/common/CarModelVo.java @@ -43,4 +43,6 @@ public class CarModelVo implements Vo { private List aRouterParamType; private List aRouterParamValue; + + private String btnName; } diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/loanhomevisitinvestigate/AppLoanHomeVisitVo.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/loanhomevisitinvestigate/AppLoanHomeVisitVo.java index 2ca422c300..284884e6a6 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/loanhomevisitinvestigate/AppLoanHomeVisitVo.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/loanhomevisitinvestigate/AppLoanHomeVisitVo.java @@ -42,4 +42,6 @@ public class AppLoanHomeVisitVo implements Vo { private List aRouterParamType; private List aRouterParamValue; + + private String btnName; } diff --git a/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/base/common/CommonService.java b/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/base/common/CommonService.java index a88df0d932..f4cd0235ee 100644 --- a/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/base/common/CommonService.java +++ b/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/base/common/CommonService.java @@ -114,6 +114,7 @@ public class CommonService { aRouterParamValue.add(saleOrderSid); carModelVo.setARouterParamType(aRouterParamType); carModelVo.setARouterParamValue(aRouterParamValue); + carModelVo.setBtnName("销售订单"); return rb.success().setData(carModelVo); } @@ -143,6 +144,7 @@ public class CommonService { aRouterParamValue.add("true"); carModelVo.setARouterParamType(aRouterParamType); carModelVo.setARouterParamValue(aRouterParamValue); + carModelVo.setBtnName("金融方案"); return rb.success().setData(carModelVo); } From 2507d2014fec836913f74935c9b0e8d6a03e8850 Mon Sep 17 00:00:00 2001 From: dimengzhe Date: Fri, 5 Jan 2024 15:47:24 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/databases/报表中心.sql | 387 ++++++++++++++++++++++++--------- 1 file changed, 279 insertions(+), 108 deletions(-) diff --git a/doc/databases/报表中心.sql b/doc/databases/报表中心.sql index 8f99ba6de0..fc65409564 100644 --- a/doc/databases/报表中心.sql +++ b/doc/databases/报表中心.sql @@ -11,13 +11,16 @@ UPDATE daily_report r and LENGTH(offlineDate) > 0 and bo.sid not in (select bbbbo.linkSid from anrui_buscenter.bus_sales_vehicle_order bbbbo) group by bo.createOrgSid - union all - select ifnull(sum(bo.platformNo), 0) as scount, bo.useOrgSid, bd.vehicleSid, bd.configSid modelConfigSid + union all + select ifnull(sum(bo.platformNo), 0) as scount, + bo.useOrgSid, + bd.vehicleSid, + bd.configSid modelConfigSid from anrui_base.bus_vehicle_order bo - left join anrui_base.bus_vehicle_apply_detail bd on bd.sid = bo.purchaseApplyMediumModelSid - where - bo.isDelete <> 1 - and LENGTH(offlineDate) = 0 and bo.orderStatus != '已作废' + left join anrui_base.bus_vehicle_apply_detail bd on bd.sid = bo.purchaseApplyMediumModelSid + where bo.isDelete <> 1 + and LENGTH(offlineDate) = 0 + and bo.orderStatus != '已作废' and bo.sid not in (select bbbbo.linkSid from anrui_buscenter.bus_sales_vehicle_order bbbbo) group by bo.createOrgSid ) as v @@ -36,22 +39,42 @@ UPDATE daily_report r INNER JOIN ( select sum(v.scount) as scount, v.useOrgSid, v.modelSid, v.modelConfigSid from ( - select ifnull(sum(si.num), 0) as scount, si.useOrgSid, si.modelSid, si.configSid modelConfigSid - from anrui_base.bus_vehicle_order bo - left join anrui_scm.scm_apply_inbound si on bo.purchaseRequisitionSid = si.vehicleOrderSid - where (si.nodeState != '已办结' and si.nodeState != '终止') - and bo.isDelete <> 1 - and LENGTH(offlineDate) > 0 - and bo.sid in (select bbbbo.linkSid from anrui_buscenter.bus_sales_vehicle_order bbbbo) - group by bo.createOrgSid - union all - select ifnull(sum(bo.id), 0) as scount, bo.useOrgSid, bd.vehicleSid, bd.configSid modelConfigSid - from anrui_base.bus_vehicle_order bo - left join anrui_base.bus_vehicle_apply_detail bd on bd.sid = bo.purchaseApplyMediumModelSid - where - bo.isDelete <> 1 - and LENGTH(offlineDate) >0 - and bo.sid in (select bbbbo.linkSid from anrui_buscenter.bus_sales_vehicle_order bbbbo) + /* select ifnull(sum(si.num), 0) as scount, si.useOrgSid, si.modelSid, si.configSid modelConfigSid + from anrui_base.bus_vehicle_order bo + left join anrui_scm.scm_apply_inbound si on bo.purchaseRequisitionSid = si.vehicleOrderSid + where (si.nodeState != '已办结' and si.nodeState != '终止') + and bo.isDelete <> 1 + and LENGTH(offlineDate) > 0 + and bo.sid in (select bbbbo.linkSid from anrui_buscenter.bus_sales_vehicle_order bbbbo) + group by bo.createOrgSid + union all + select ifnull(sum(bo.platformNo), 0) as scount, bo.useOrgSid, bd.vehicleSid, bd.configSid modelConfigSid + from anrui_base.bus_vehicle_order bo + left join anrui_base.bus_vehicle_apply_detail bd on bd.sid = bo.purchaseApplyMediumModelSid + where + bo.isDelete <> 1 + and LENGTH(offlineDate) >0 + and bo.sid in (select bbbbo.linkSid from anrui_buscenter.bus_sales_vehicle_order bbbbo) + group by bo.createOrgSid*/ + SELECT si.useOrgSid, + si.modelSid, + si.configSid modelConfigSid, + bo.sid, + ifnull(ab.counts, 0) as scount + FROM anrui_base.bus_vehicle_order bo + LEFT JOIN anrui_scm.scm_apply_inbound si ON bo.purchaseRequisitionSid = si.vehicleOrderSid + LEFT JOIN ( + SELECT bbbbo.linkSid, + ifnull(count(bbbbo.linkSid), 0) as counts + FROM anrui_buscenter.bus_sales_vehicle_order bbbbo + LEFT JOIN anrui_buscenter.bus_sales_order bb ON bb.sid = bbbbo.salesOrderSid + WHERE LENGTH(bb.nodeState) > 0 + AND bb.nodeState != '终止' + group by bbbbo.linkSid + ) ab ON ab.linkSid = bo.sid + WHERE (si.nodeState != '已办结' AND si.nodeState != '终止') + AND bo.isDelete <> 1 + AND LENGTH(offlineDate) > 0 group by bo.createOrgSid ) as v GROUP BY v.`useOrgSid`, @@ -253,7 +276,9 @@ UPDATE daily_report r left join anrui_base.base_vehicle_out bvo on bv.sid = bvo.vinSid left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid where bv.salesDate like concat('%', CURDATE(), '%') - and bvoa.saleTypeKey = '001' and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or length(bvo.materialTypeValue) = 0) + and bvoa.saleTypeKey = '001' + and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or + length(bvo.materialTypeValue) = 0) group by bv.useOrgSid, bv.modelSid, bv.modelConfigSid) ss group by ss.useOrgSid, ss.modelSid, ss.modelConfigSid ) AS s ON r.useOrgSid = s.useOrgSid @@ -269,7 +294,9 @@ UPDATE daily_report r left join anrui_base.base_vehicle_out bvo on bv.sid = bvo.vinSid left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid where bv.salesDate like concat('%', CURDATE(), '%') - and bvoa.saleTypeKey = '002' and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or length(bvo.materialTypeValue) = 0) + and bvoa.saleTypeKey = '002' + and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or + length(bvo.materialTypeValue) = 0) group by bv.useOrgSid, bv.modelSid, bv.modelConfigSid) ss group by ss.useOrgSid, ss.modelSid, ss.modelConfigSid ) AS s ON r.useOrgSid = s.useOrgSid @@ -302,7 +329,9 @@ UPDATE daily_report r left join anrui_base.base_vehicle_out bvo on bv.sid = bvo.vinSid left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid where bv.salesDate like concat('%', DATE_FORMAT(CURDATE(), '%Y-%m'), '%') - and bvoa.saleTypeKey = '001' and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or length(bvo.materialTypeValue) = 0) + and bvoa.saleTypeKey = '001' + and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or + length(bvo.materialTypeValue) = 0) group by bv.useOrgSid, bv.modelSid, bv.modelConfigSid) ss group by ss.useOrgSid, ss.modelSid, ss.modelConfigSid ) AS s ON r.useOrgSid = s.useOrgSid @@ -318,7 +347,9 @@ UPDATE daily_report r left join anrui_base.base_vehicle_out bvo on bv.sid = bvo.vinSid left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid where bv.salesDate like concat('%', DATE_FORMAT(CURDATE(), '%Y-%m'), '%') - and bvoa.saleTypeKey = '002' and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or length(bvo.materialTypeValue) = 0) + and bvoa.saleTypeKey = '002' + and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or + length(bvo.materialTypeValue) = 0) group by bv.useOrgSid, bv.modelSid, bv.modelConfigSid) ss group by ss.useOrgSid, ss.modelSid, ss.modelConfigSid ) AS s ON r.useOrgSid = s.useOrgSid @@ -351,7 +382,9 @@ UPDATE daily_report r left join anrui_base.base_vehicle_out bvo on bv.sid = bvo.vinSid left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid where bv.salesDate like concat('%', DATE_FORMAT(CURDATE(), '%Y'), '%') - and bvoa.saleTypeKey = '001' and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or length(bvo.materialTypeValue) = 0) + and bvoa.saleTypeKey = '001' + and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or + length(bvo.materialTypeValue) = 0) group by bv.useOrgSid, bv.modelSid, bv.modelConfigSid) ss group by ss.useOrgSid, ss.modelSid, ss.modelConfigSid ) AS s ON r.useOrgSid = s.useOrgSid @@ -367,7 +400,9 @@ UPDATE daily_report r left join anrui_base.base_vehicle_out bvo on bv.sid = bvo.vinSid left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid where bv.salesDate like concat('%', DATE_FORMAT(CURDATE(), '%Y'), '%') - and bvoa.saleTypeKey = '002' and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or length(bvo.materialTypeValue) = 0) + and bvoa.saleTypeKey = '002' + and (bvo.materialTypeKey = '001' or bvo.materialTypeValue is null or + length(bvo.materialTypeValue) = 0) group by bv.useOrgSid, bv.modelSid, bv.modelConfigSid) ss group by ss.useOrgSid, ss.modelSid, ss.modelConfigSid ) AS s ON r.useOrgSid = s.useOrgSid @@ -635,46 +670,98 @@ where DATE_FORMAT(createTime, '%Y-%m-%d') = CURDATE(); -- ============================================== -- 欠款出库数量、欠款出库金额万元、金融未放款数量、金融未放款金额(万元) -- 欠款出库数量--截止当日欠款出库申请通过且未回清款的台数 -update daily_report r inner join (select sum(cc.scount) as scount, cc.useOrgSid, cc.vehMConfigSid, cc.vehModelSid - from ( - select count(bdad.id) as scount, - ba.useOrgSid, - bm.modelConfigSid as vehMConfigSid, - bm.modelSid as vehModelSid - from anrui_buscenter.bus_delivered_apply_details bdad - left join anrui_buscenter.bus_delivered_apply ba on ba.sid = bdad.applySid - left join anrui_buscenter.bus_sales_order_vehicle bv on bv.sid = bdad.busVinSid - left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid - left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bo.sid - left join anrui_fin.fin_uncollected_receivables_detailed fd - on fd.busVinSid = bdad.busVinSid - left join anrui_fin.fin_selected_receivables_detailed fs - on fs.receivablesSid = fd.sid - where ba.nodeState = '已办结' - and ba.typeState = 1 - group by bdad.busVinSid, ba.useOrgSid, bm.modelSid, bm.modelConfigSid - having sum(fd.reveivableMoney) > ifnull(sum(fs.subscriptionMoney), 0) - union all - select count(bdad.id) as scount, - ba.useOrgSid, - bm.modelConfigSid as vehMConfigSid, - bm.modelSid as vehModelSid - from anrui_buscenter.bus_arrears_carry_vehicle_details bdad - left join anrui_buscenter.bus_arrears_carry_vehicle_apply ba - on ba.sid = bdad.applySid - left join anrui_buscenter.bus_sales_order_vehicle bv on bv.linkSid = bdad.vinSid - left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid - left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bo.sid - left join anrui_fin.fin_uncollected_receivables_detailed fd - on fd.busVinSid = bv.sid - left join anrui_fin.fin_selected_receivables_detailed fs - on fs.receivablesSid = fd.sid - left join anrui_base.base_vehicle bbv on bbv.sid = bv.linkSid - where ba.nodeState = '已办结' - and ba.paymentMethodKey = 1 - and bbv.vehicleState = '0002' - group by bv.sid, ba.useOrgSid, bm.modelSid, bm.modelConfigSid - having sum(fd.reveivableMoney) > ifnull(sum(fs.subscriptionMoney), 0)) cc +update daily_report r inner join (SELECT SUM(cc.scount) AS scount, + cc.useOrgSid, + cc.vehMConfigSid, + cc.vehModelSid + FROM ( + SELECT COUNT(a.id) AS scount, + a.useOrgSid, + a.NAME, + a.contractNo, + a.vehMConfigSid, + a.vehModelSid + FROM ( + SELECT bdad.id, + ba.useOrgSid, + bm.modelConfigSid AS vehMConfigSid, + bm.modelSid AS vehModelSid, + so.NAME, + SUM(s.reveivableMoney), + SUM(s.subscriptionMoney), + bo.contractNo + FROM anrui_buscenter.bus_delivered_apply_details bdad + LEFT JOIN anrui_buscenter.bus_delivered_apply ba ON ba.sid = bdad.applySid + LEFT JOIN anrui_buscenter.bus_sales_order_vehicle bv ON bv.sid = bdad.busVinSid + LEFT JOIN anrui_buscenter.bus_sales_order bo ON bo.sid = bv.salesOrderSid + LEFT JOIN anrui_buscenter.bus_sales_order_model bm ON bm.salesOrderSid = bo.sid + LEFT JOIN ( + SELECT fd.reveivableMoney, + fd.busVinSid, + IFNULL(SUM(fs.subscriptionMoney), 0) AS subscriptionMoney + FROM anrui_fin.fin_uncollected_receivables_detailed fd + LEFT JOIN anrui_fin.fin_selected_receivables_detailed fs + ON fs.receivablesSid = fd.sid + WHERE fd.kxState = '01' + AND fs.auditState = 3 + GROUP BY fd.sid + ) s ON s.busVinSid = bv.sid + LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid + WHERE ba.nodeState = '已办结' + AND ba.typeState = 1 + GROUP BY bv.sid, + ba.useOrgSid, + bm.modelSid, + bm.modelConfigSid + HAVING SUM(s.reveivableMoney) > SUM(s.subscriptionMoney)) a + GROUP BY a.useOrgSid, + a.vehMConfigSid, + a.vehModelSid + UNION ALL + SELECT COUNT(a.id) AS scount, + a.useOrgSid, + a.name, + a.contractNo, + a.vehMConfigSid, + a.vehModelSid + FROM (SELECT bdad.id, + ba.useOrgSid, + bm.modelConfigSid AS vehMConfigSid, + bm.modelSid AS vehModelSid, + so.name, + SUM(s.reveivableMoney), + SUM(s.subscriptionMoney), + bo.contractNo + FROM anrui_buscenter.bus_arrears_carry_vehicle_details bdad + LEFT JOIN anrui_buscenter.bus_arrears_carry_vehicle_apply ba + ON ba.sid = bdad.applySid + LEFT JOIN anrui_buscenter.bus_sales_order_vehicle bv ON bv.linkSid = bdad.vinSid + LEFT JOIN anrui_buscenter.bus_sales_order bo ON bo.sid = bv.salesOrderSid + LEFT JOIN anrui_buscenter.bus_sales_order_model bm ON bm.salesOrderSid = bo.sid + LEFT JOIN anrui_base.base_vehicle bbv ON bbv.sid = bv.linkSid + LEFT JOIN (SELECT fd.reveivableMoney, + fd.busVinSid, + IFNULL(SUM(fs.subscriptionMoney), 0) AS subscriptionMoney + FROM anrui_fin.fin_uncollected_receivables_detailed fd + LEFT JOIN anrui_fin.fin_selected_receivables_detailed fs + ON fs.receivablesSid = fd.sid + WHERE fd.kxState = '01' + AND fs.auditState = 3 + GROUP BY fd.sid) s ON s.busVinSid = bv.sid + LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid + WHERE ba.nodeState = '已办结' + AND ba.paymentMethodKey = 1 + AND bbv.vehicleState = '0002' + GROUP BY bv.sid, + ba.useOrgSid, + bm.modelSid, + bm.modelConfigSid + HAVING SUM(s.reveivableMoney) > SUM(s.subscriptionMoney)) a + GROUP BY a.useOrgSid, + a.vehMConfigSid, a.vehModelSid) cc + GROUP BY cc.useOrgSid, + cc.vehMConfigSid, + cc.vehModelSid ) s on r.useOrgSid = s.useOrgSid and r.vehModelSid = s.vehModelSid @@ -684,46 +771,130 @@ where DATE_FORMAT(createTime, '%Y-%m-%d') = CURDATE(); -- 欠款出库金融--截止当日欠款出库申请通过且未回清款的台数欠款总额 -update daily_report r inner join (select sum(cc.scount) as scount, cc.useOrgSid, cc.vehMConfigSid, cc.vehModelSid - from ( - select (sum(fd.reveivableMoney) - sum(fs.subscriptionMoney)) as scount, - ba.useOrgSid, - bm.modelConfigSid as vehMConfigSid, - bm.modelSid as vehModelSid - from anrui_buscenter.bus_delivered_apply_details bdad - left join anrui_buscenter.bus_delivered_apply ba on ba.sid = bdad.applySid - left join anrui_buscenter.bus_sales_order_vehicle bv on bv.sid = bdad.busVinSid - left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid - left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bo.sid - left join anrui_fin.fin_uncollected_receivables_detailed fd - on fd.busVinSid = bdad.busVinSid - left join anrui_fin.fin_selected_receivables_detailed fs - on fs.receivablesSid = fd.sid - where ba.nodeState = '已办结' - and ba.typeState = 1 - group by bdad.busVinSid, ba.useOrgSid, bm.modelSid, bm.modelConfigSid - having sum(fd.reveivableMoney) > ifnull(sum(fs.subscriptionMoney), 0) - union all - select (sum(fd.reveivableMoney) - sum(fs.subscriptionMoney)) as scount, - ba.useOrgSid, - bm.modelConfigSid as vehMConfigSid, - bm.modelSid as vehModelSid - from anrui_buscenter.bus_arrears_carry_vehicle_details bdad - left join anrui_buscenter.bus_arrears_carry_vehicle_apply ba - on ba.sid = bdad.applySid - left join anrui_buscenter.bus_sales_order_vehicle bv on bv.linkSid = bdad.vinSid - left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid - left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bo.sid - left join anrui_fin.fin_uncollected_receivables_detailed fd - on fd.busVinSid = bv.sid - left join anrui_fin.fin_selected_receivables_detailed fs - on fs.receivablesSid = fd.sid - left join anrui_base.base_vehicle bbv on bbv.sid = bv.linkSid - where ba.nodeState = '已办结' - and ba.paymentMethodKey = 1 - and bbv.vehicleState = '0002' - group by bv.sid, ba.useOrgSid, bm.modelSid, bm.modelConfigSid - having sum(fd.reveivableMoney) > ifnull(sum(fs.subscriptionMoney), 0)) cc +update daily_report r inner join (SELECT + sum( cc.scount ) AS scount, + cc.useOrgSid, + cc.vehMConfigSid, + cc.vehModelSid + FROM + ( + SELECT + SUM( a.scount ) AS scount, + a.useOrgSid, + a.NAME, + a.contractNo, + a.vehMConfigSid, + a.vehModelSid + FROM + ( + SELECT + bdad.id, + ba.useOrgSid, + bm.modelConfigSid AS vehMConfigSid, + bm.modelSid AS vehModelSid, + so.NAME, + SUM( s.reveivableMoney ), + SUM( s.subscriptionMoney ), + bo.contractNo, + ( + SUM( s.reveivableMoney ) - SUM( s.subscriptionMoney )) AS scount + FROM + anrui_buscenter.bus_delivered_apply_details bdad + LEFT JOIN anrui_buscenter.bus_delivered_apply ba ON ba.sid = bdad.applySid + LEFT JOIN anrui_buscenter.bus_sales_order_vehicle bv ON bv.sid = bdad.busVinSid + LEFT JOIN anrui_buscenter.bus_sales_order bo ON bo.sid = bv.salesOrderSid + LEFT JOIN anrui_buscenter.bus_sales_order_model bm ON bm.salesOrderSid = bo.sid + LEFT JOIN ( + SELECT + fd.reveivableMoney, + fd.busVinSid, + IFNULL( SUM( fs.subscriptionMoney ), 0 ) AS subscriptionMoney + FROM + anrui_fin.fin_uncollected_receivables_detailed fd + LEFT JOIN anrui_fin.fin_selected_receivables_detailed fs ON fs.receivablesSid = fd.sid + WHERE + fd.kxState = '01' + AND fs.auditState = 3 + GROUP BY + fd.sid + ) s ON s.busVinSid = bv.sid + LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid + WHERE + ba.nodeState = '已办结' + AND ba.typeState = 1 + GROUP BY + bv.sid, + ba.useOrgSid, + bm.modelSid, + bm.modelConfigSid + HAVING + SUM( s.reveivableMoney ) > SUM( s.subscriptionMoney )) a + GROUP BY + a.useOrgSid, + a.vehMConfigSid, + a.vehModelSid UNION ALL + SELECT + SUM( a.scount ) AS scount, + a.useOrgSid, + a.NAME, + a.contractNo, + a.vehMConfigSid, + a.vehModelSid + FROM + ( + SELECT + bdad.id, + ba.useOrgSid, + bm.modelConfigSid AS vehMConfigSid, + bm.modelSid AS vehModelSid, + so.NAME, + SUM( s.reveivableMoney ), + SUM( s.subscriptionMoney ), + bo.contractNo, + ( + SUM( s.reveivableMoney ) - SUM( s.subscriptionMoney )) AS scount + FROM + anrui_buscenter.bus_arrears_carry_vehicle_details bdad + LEFT JOIN anrui_buscenter.bus_arrears_carry_vehicle_apply ba ON ba.sid = bdad.applySid + LEFT JOIN anrui_buscenter.bus_sales_order_vehicle bv ON bv.linkSid = bdad.vinSid + LEFT JOIN anrui_buscenter.bus_sales_order bo ON bo.sid = bv.salesOrderSid + LEFT JOIN anrui_buscenter.bus_sales_order_model bm ON bm.salesOrderSid = bo.sid + LEFT JOIN anrui_base.base_vehicle bbv ON bbv.sid = bv.linkSid + LEFT JOIN ( + SELECT + fd.reveivableMoney, + fd.busVinSid, + IFNULL( SUM( fs.subscriptionMoney ), 0 ) AS subscriptionMoney + FROM + anrui_fin.fin_uncollected_receivables_detailed fd + LEFT JOIN anrui_fin.fin_selected_receivables_detailed fs ON fs.receivablesSid = fd.sid + WHERE + fd.kxState = '01' + AND fs.auditState = 3 + GROUP BY + fd.sid + ) s ON s.busVinSid = bv.sid + LEFT JOIN anrui_portal.sys_organization so ON so.sid = ba.useOrgSid + WHERE + ba.nodeState = '已办结' + AND ba.paymentMethodKey = 1 + AND bbv.vehicleState = '0002' + GROUP BY + bv.sid, + ba.useOrgSid, + bm.modelSid, + bm.modelConfigSid + HAVING + SUM( s.reveivableMoney ) > SUM( s.subscriptionMoney )) a + GROUP BY + a.useOrgSid, + a.vehMConfigSid, + a.vehModelSid + ) cc + GROUP BY + cc.useOrgSid, + cc.vehMConfigSid, + cc.vehModelSid ) s on r.useOrgSid = s.useOrgSid and r.vehModelSid = s.vehModelSid From ef5af533b6f513e6db9031b419366bd1520b7627 Mon Sep 17 00:00:00 2001 From: dimengzhe Date: Fri, 5 Jan 2024 16:25:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/databases/报表中心.sql | 123 ++++++++++++++++++++++++++------- 1 file changed, 97 insertions(+), 26 deletions(-) diff --git a/doc/databases/报表中心.sql b/doc/databases/报表中心.sql index fc65409564..8ba08a7e2d 100644 --- a/doc/databases/报表中心.sql +++ b/doc/databases/报表中心.sql @@ -905,38 +905,109 @@ where DATE_FORMAT(createTime, '%Y-%m-%d') = CURDATE(); -- 金融未放款数量--- 截止当日贷款业务已出库且融资放款未认款的台数 update daily_report r inner join ( - select count(bv.id) as scount, bo.useOrgSid, bm.modelSid, bm.modelConfigSid, fd.reveivableMoney - from anrui_buscenter.bus_sales_order_vehicle bv - left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid - left join anrui_base.base_vehicle bbv on bbv.sid = bv.linkSid - left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bv.salesOrderSid - left join anrui_fin.fin_uncollected_receivables_detailed fd on fd.busVinSid = bv.sid - left join anrui_fin.fin_selected_receivables_detailed fs on fs.receivablesSid = fd.sid - where bo.payTypeKey = 2 - and fd.receivablesName = '融资放款' - and bbv.vehicleState = '0002' - group by bv.sid, bo.useOrgSid, bm.modelSid, bm.modelConfigSid - having fd.reveivableMoney > ifnull(sum(fs.subscriptionMoney), 0)) as s on - r.useOrgSid = s.useOrgSid AND r.vehModelSid = s.modelSid AND r.vehMConfigSid = s.modelConfigSid + SELECT + count( a.id ) AS scount, + a.useOrgSid, + a.NAME, + a.contractNo, + a.vehMConfigSid, + a.vehModelSid + FROM + (SELECT bv.id, + bo.useOrgSid, + bm.modelConfigSid AS vehMConfigSid, + bm.modelSid AS vehModelSid, + so.NAME, + SUM(s.reveivableMoney), + SUM(s.subscriptionMoney), + bo.contractNo + from anrui_buscenter.bus_sales_order_vehicle bv + left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid + left join anrui_base.base_vehicle bbv on bbv.sid = bv.linkSid + left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bv.salesOrderSid + LEFT JOIN ( + SELECT + fd.reveivableMoney, + fd.busVinSid, + IFNULL( SUM( fs.subscriptionMoney ), 0 ) AS subscriptionMoney + FROM + anrui_fin.fin_uncollected_receivables_detailed fd + LEFT JOIN anrui_fin.fin_selected_receivables_detailed fs ON fs.receivablesSid = fd.sid + WHERE + fd.kxState = '01' + AND fs.auditState = 3 + and fd.receivablesName = '融资放款' + GROUP BY + fd.sid + ) s ON s.busVinSid = bv.sid + LEFT JOIN anrui_portal.sys_organization so ON so.sid = bo.useOrgSid + where bo.payTypeKey = 2 + + and bbv.vehicleState = '0002' + group by bv.sid, bo.useOrgSid, bm.modelSid, bm.modelConfigSid + HAVING + SUM( s.reveivableMoney ) > SUM( s.subscriptionMoney )) a + GROUP BY + a.useOrgSid, + a.vehMConfigSid, + a.vehModelSid) as s on + r.useOrgSid = s.useOrgSid AND r.vehModelSid = s.vehModelSid AND r.vehMConfigSid = s.vehMConfigSid SET r.`loan_not_count`=s.scount WHERE DATE_FORMAT(createTime, '%Y-%m-%d') = CURDATE(); -- 金融未放款金额-- 截止当日贷款业务已出库且融资放款未认款的台数融资放款金额之和 update daily_report r inner join ( - select sum(fd.reveivableMoney) as scount, bo.useOrgSid, bm.modelSid, bm.modelConfigSid, fd.reveivableMoney - from anrui_buscenter.bus_sales_order_vehicle bv - left join anrui_buscenter.bus_sales_order bo on bo.sid = bv.salesOrderSid - left join anrui_base.base_vehicle bbv on bbv.sid = bv.linkSid - left join anrui_buscenter.bus_sales_order_model bm on bm.salesOrderSid = bv.salesOrderSid - left join anrui_fin.fin_uncollected_receivables_detailed fd on fd.busVinSid = bv.sid - left join anrui_fin.fin_selected_receivables_detailed fs on fs.receivablesSid = fd.sid - where bo.payTypeKey = 2 - and fd.receivablesName = '融资放款' - and bbv.vehicleState = '0002' - group by bv.sid, bo.useOrgSid, bm.modelSid, bm.modelConfigSid - having fd.reveivableMoney > ifnull(sum(fs.subscriptionMoney), 0)) as s on - r.useOrgSid = s.useOrgSid AND r.vehModelSid = s.modelSid AND r.vehMConfigSid = s.modelConfigSid + SELECT + SUM( a.scount ) AS scount, + a.useOrgSid, + a.NAME, + a.contractNo, + a.vehMConfigSid, + a.vehModelSid + FROM + (SELECT + bv.id, + bo.useOrgSid, + bm.modelConfigSid AS vehMConfigSid, + bm.modelSid AS vehModelSid, + so.NAME, + SUM( s.reveivableMoney ), + SUM( s.subscriptionMoney ), + bo.contractNo, + ( + SUM( s.reveivableMoney ) - SUM( s.subscriptionMoney )) AS scount + FROM anrui_buscenter.bus_sales_order_vehicle bv + LEFT JOIN anrui_buscenter.bus_sales_order bo ON bo.sid = bv.salesOrderSid + LEFT JOIN anrui_base.base_vehicle bbv ON bbv.sid = bv.linkSid + LEFT JOIN anrui_buscenter.bus_sales_order_model bm ON bm.salesOrderSid = bv.salesOrderSid + LEFT JOIN ( + SELECT + fd.reveivableMoney, + fd.busVinSid, + IFNULL( SUM( fs.subscriptionMoney ), 0 ) AS subscriptionMoney + FROM + anrui_fin.fin_uncollected_receivables_detailed fd + LEFT JOIN anrui_fin.fin_selected_receivables_detailed fs ON fs.receivablesSid = fd.sid + WHERE + fd.kxState = '01' + AND fs.auditState = 3 + AND fd.receivablesName = '融资放款' + GROUP BY + fd.sid + ) s ON s.busVinSid = bv.sid + LEFT JOIN anrui_portal.sys_organization so ON so.sid = bo.useOrgSid + WHERE bo.payTypeKey = 2 + + AND bbv.vehicleState = '0002' + GROUP BY bv.sid, bo.useOrgSid, bm.modelSid, bm.modelConfigSid + HAVING + SUM( s.reveivableMoney ) > SUM( s.subscriptionMoney )) a + GROUP BY + a.useOrgSid, + a.vehMConfigSid, + a.vehModelSid) as s on + r.useOrgSid = s.useOrgSid AND r.vehModelSid = s.vehModelSid AND r.vehMConfigSid = s.vehMConfigSid SET r.`loan_not_amount`=ROUND(s.scount / 10000, 2) WHERE DATE_FORMAT(createTime, '%Y-%m-%d') = CURDATE();