From 16351ae623ef34a14742a73f5ced7ec1971370e2 Mon Sep 17 00:00:00 2001 From: fanzongzhe <285169773@qq.com> Date: Wed, 17 Jan 2024 17:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E5=9B=9E=E8=BD=A6=E8=BE=86=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E8=BD=AC=E7=A7=9F=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anrui/flowable/api/utils/ProcDefEnum.java | 1 + .../riskcenter/api/loanfile/LoanFileEnum.java | 1 + .../api/loansubletapply/LoanSubletApply.java | 38 +- .../loansubletapply/LoanSubletApplyDto.java | 35 +- .../loansubletapply/LoanSubletApplyInit.java | 53 +- .../loansubletapply/LoanSubletApplyQuery.java | 2 + .../loansubletapply/LoanSubletApplyVo.java | 4 +- .../api/loansubletapply/SubletInitVo.java | 3 +- .../api/loansubletapply/SubletVinList.java | 1 + .../api/loansubletveh/LoanSubletVeh.java | 9 +- .../LoanSubletApplyMapper.java | 16 +- .../loansubletapply/LoanSubletApplyMapper.xml | 125 ++++- .../LoanSubletApplyService.java | 520 ++++++++---------- .../biz/loansubletveh/LoanSubletVehMapper.xml | 7 +- 14 files changed, 439 insertions(+), 376 deletions(-) diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java index 19540cfebe..3cb9c51ff3 100644 --- a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java @@ -72,6 +72,7 @@ public enum ProcDefEnum { LOANRESTOREREPORTAPPLY("车辆交回事前报备申请", "process_w796wtt7:1:7822504"), LOANREDEMPTIONAPPLY("车辆交回赎回申请", "process_qu4fq4r6:1:7820004"), LOANRETUENINBOUNDAPPLY("交回车辆入库申请", "process_h0i1vnn8:1:7945004"), + LOANSUBLETAPPLY("交回车辆二次转租申请", "process_lu7pdwzs:1:7940004"), /******************************测试流程id*********************************************/ diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanfile/LoanFileEnum.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanfile/LoanFileEnum.java index d737bd401c..b14da486c4 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanfile/LoanFileEnum.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanfile/LoanFileEnum.java @@ -30,6 +30,7 @@ public enum LoanFileEnum { VEHCLEARANCE("021", "车辆远程解控附件"), RESTOREREPORT("022", "车辆交回事前报备附件"), REDEMPTION("023", "车辆交回赎回申请附件"), + SUBLETAPPLY("024", "车辆交回二次转租申请附件"), ; diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApply.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApply.java index 4336a1944d..20e5b6ebea 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApply.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApply.java @@ -14,8 +14,8 @@ import java.util.Date; * @version 1.0 * @since 1.0 */ -@ApiModel(value = "赎回申请", description = "赎回申请") -@TableName("loan_redemption_apply") +@ApiModel(value = "车辆二次转租申请", description = "车辆二次转租申请") +@TableName("loan_sublet_apply") @Data public class LoanSubletApply extends BaseEntity { private static final long serialVersionUID = 1L; @@ -56,17 +56,31 @@ public class LoanSubletApply extends BaseEntity { private String customer; @ApiModelProperty("贷款人") private String borrowerName; - @ApiModelProperty("本次还款金额") + @ApiModelProperty("二次转租价格") private BigDecimal amount; - @ApiModelProperty("赎回方案") + @ApiModelProperty("转租方案说明") private String plan; - @ApiModelProperty("停放地点") - private String location; - @ApiModelProperty("相关费用") - private BigDecimal fees; - @ApiModelProperty("相关费用说明") - private String feesShows; - @ApiModelProperty("交回车辆主车台账sid") - private String ledgerSid; + @ApiModelProperty("0是1否") + private Integer agree; + @ApiModelProperty("新车主名称") + private String vinOwner; + @ApiModelProperty("客户类型key") + private String customerTypeKey; + @ApiModelProperty("客户类型") + private String customerType; + @ApiModelProperty("联系电话") + private String phoneNum; + @ApiModelProperty("证件地址") + private String cardAddress; + @ApiModelProperty("有效期") + private String endDate; + @ApiModelProperty("证件号码") + private String idNumber; + @ApiModelProperty("证件类型key") + private String certificateTypeKey; + @ApiModelProperty("证件类型(个人为身份证/企业为营业执照)") + private String certificateType; + @ApiModelProperty("新车主客户sid") + private String newCustomerSid; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyDto.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyDto.java index 57337c95a0..e6b38614c6 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyDto.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyDto.java @@ -15,7 +15,7 @@ import java.util.List; @Data public class LoanSubletApplyDto implements Dto { - private String ledgerSid; + private String sid; private String userSid; private String dept; @@ -33,17 +33,32 @@ public class LoanSubletApplyDto implements Dto { private String customer; @ApiModelProperty("贷款人") private String borrowerName; - @ApiModelProperty("本次还款金额") + @ApiModelProperty("二次转租价格") private String amount; - @ApiModelProperty("赎回方案") + @ApiModelProperty("转租方案说明") private String plan; - @ApiModelProperty("停放地点") - private String location; - @ApiModelProperty("相关费用") - private String fees; - @ApiModelProperty("相关费用说明") - private String feesShows; - private String busVinSid; //催收记录 + @ApiModelProperty("0是1否") + private String agree; + @ApiModelProperty("新车主名称") + private String vinOwner; + @ApiModelProperty("客户类型key") + private String customerTypeKey; + @ApiModelProperty("客户类型") + private String customerType; + @ApiModelProperty("联系电话") + private String phoneNum; + @ApiModelProperty("证件地址") + private String cardAddress; + @ApiModelProperty("有效期") + private String endDate; + @ApiModelProperty("证件号码") + private String idNumber; + @ApiModelProperty("证件类型key") + private String certificateTypeKey; + @ApiModelProperty("证件类型(个人为身份证/企业为营业执照)") + private String certificateType; + @ApiModelProperty("新车主客户sid") + private String newCustomerSid; private List files = new ArrayList<>(); private List vinList = new ArrayList<>(); } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyInit.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyInit.java index ad20ad9ad8..5adf89978c 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyInit.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyInit.java @@ -4,6 +4,7 @@ import com.yxt.common.core.vo.Vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -15,7 +16,6 @@ import java.util.List; @Data public class LoanSubletApplyInit implements Vo { - private String ledgerSid; private String sid; private String userSid; private String dept; @@ -37,35 +37,32 @@ public class LoanSubletApplyInit implements Vo { private String customer; @ApiModelProperty("贷款人") private String borrowerName; - @ApiModelProperty("本次还款金额") + @ApiModelProperty("二次转租价格") private String amount; - @ApiModelProperty("赎回方案") + @ApiModelProperty("转租方案说明") private String plan; - @ApiModelProperty("停放地点") - private String location; - @ApiModelProperty("相关费用") - private String fees; - @ApiModelProperty("相关费用说明") - private String feesShows; - //费用 - @ApiModelProperty("已还金额") - private String alRepaidMoney; // 已还金额 - @ApiModelProperty("当前逾期金额") - private String currentBeMoney; // 当前逾期金额 - @ApiModelProperty("其中资金占用费") - private String wheFundOccMoney; // 其中资金占用费 - @ApiModelProperty("未到期金额") - private String unexpiredMoney; // 未到期金额 - @ApiModelProperty("总期数") - private String nper; // 总期数 - @ApiModelProperty("当前期数") - private String currentPeriod; // 当前期数 - @ApiModelProperty("已还金额换算期数") - private String alRepaidMoneyConPeriod; // 已还金额换算期数 - @ApiModelProperty("逾期金额换算期数") - private String beOverdueMoneyAndPeriod; // 逾期金额换算期数 - private String busVinSid; //催收记录 - private String rksqSid; //入库申请sid + @ApiModelProperty("0是1否") + private String agree; + @ApiModelProperty("新车主名称") + private String vinOwner; + @ApiModelProperty("客户类型key") + private String customerTypeKey; + @ApiModelProperty("客户类型") + private String customerType; + @ApiModelProperty("联系电话") + private String phoneNum; + @ApiModelProperty("证件地址") + private String cardAddress; + @ApiModelProperty("有效期") + private String endDate; + @ApiModelProperty("证件号码") + private String idNumber; + @ApiModelProperty("证件类型key") + private String certificateTypeKey; + @ApiModelProperty("证件类型(个人为身份证/企业为营业执照)") + private String certificateType; + @ApiModelProperty("新车主客户sid") + private String newCustomerSid; private List files = new ArrayList<>(); private List vinList = new ArrayList<>(); diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyQuery.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyQuery.java index 71fef03166..274edcbb12 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyQuery.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyQuery.java @@ -44,4 +44,6 @@ public class LoanSubletApplyQuery implements Query { private String vehMark; @ApiModelProperty("申请部门") private String dept; + @ApiModelProperty("原车主是否同意0是1否") + private String agree; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyVo.java index 17d4a4d70c..8e1684f3e1 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/LoanSubletApplyVo.java @@ -39,10 +39,12 @@ public class LoanSubletApplyVo implements Vo { private String customer; @ApiModelProperty("贷款人") private String borrowerName; - @ApiModelProperty("本次还款金额") + @ApiModelProperty("二次转租价格") private String amount; @ApiModelProperty("车架号") private String vinNo; @ApiModelProperty("车牌号") private String vehMark; + @ApiModelProperty("原车主是否同意0是1否") + private String agree; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletInitVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletInitVo.java index 05bb52a518..8d042f31cb 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletInitVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletInitVo.java @@ -21,12 +21,11 @@ public class SubletInitVo { private String customer; @ApiModelProperty("贷款人") private String borrowerName; - @ApiModelProperty("停放地点") - private String location; private String busVinSid; private String vinSid; private String vinNo; private String vehMark; private String vehType; private String vehModel; + private String pSid; } diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletVinList.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletVinList.java index c26a6d0252..1b5cb55ff8 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletVinList.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletapply/SubletVinList.java @@ -9,6 +9,7 @@ import lombok.Data; */ @Data public class SubletVinList { + private String ledgerSid; private String vinSid; private String vinNo; private String vehMark; diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletveh/LoanSubletVeh.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletveh/LoanSubletVeh.java index 1c9406876f..983aa4b1ee 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletveh/LoanSubletVeh.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansubletveh/LoanSubletVeh.java @@ -11,8 +11,8 @@ import lombok.Data; * @version 1.0 * @since 1.0 */ -@ApiModel(value = "赎回车辆列表", description = "赎回车辆列表") -@TableName("loan_redemption_veh") +@ApiModel(value = "车辆二次转租车辆列表", description = "车辆二次转租车辆列表") +@TableName("loan_sublet_veh") @Data public class LoanSubletVeh extends BaseEntity { private static final long serialVersionUID = 1L; @@ -27,8 +27,11 @@ public class LoanSubletVeh extends BaseEntity { private String busVinSid; @ApiModelProperty("车辆sid") private String vinSid; - @ApiModelProperty("0主车1挂车") + @ApiModelProperty("主车/挂车") private String vehType; @ApiModelProperty("车型") private String vehModel; + @ApiModelProperty("交回车辆台账sid") + private String ledgerSid; + } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.java index 437b21ec74..8ea1a3d45a 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.java @@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Constants; import com.yxt.anrui.riskcenter.api.loanredemptionapply.*; -import com.yxt.anrui.riskcenter.api.loansubletapply.LoanSubletApply; -import com.yxt.anrui.riskcenter.api.loansubletapply.LoanSubletApplyVo; -import com.yxt.anrui.riskcenter.api.loansubletapply.SubletVinListQuery; -import com.yxt.anrui.riskcenter.api.loansubletapply.SubletVinListVo; +import com.yxt.anrui.riskcenter.api.loansubletapply.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -28,4 +25,15 @@ public interface LoanSubletApplyMapper extends BaseMapper { int updateFlowFiled(Map map); + SubletInitVo selReturnLegerBySid(@Param("ledgerSid") String ledgerSid); + + SubletInitVo selLoanInfoByMainVeh(@Param("busVinSid") String busVinSid); + + SubletVinList selReturnVinLegerBySid(@Param("ledgerSid") String ledgerSid); + + SubletVinList selReturnTrVinLegerByPSid(@Param("ledgerSid")String ledgerSid); + + SubletInitVo selLoanInfoByTrVeh(@Param("ledgerSid")String ledgerSid); + + SubletVinList selReturnTrVinLegerBySid(@Param("ledgerSid")String ledgerSid); } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.xml b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.xml index 4ae685ae0f..4cc6a588bf 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.xml +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyMapper.xml @@ -19,26 +19,38 @@ + + + + + + \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java index bdfe61a774..84966f19d2 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletapply/LoanSubletApplyService.java @@ -38,12 +38,14 @@ import com.yxt.anrui.riskcenter.api.loanrestorereportapply.AlrepaidAndArrVo; import com.yxt.anrui.riskcenter.api.loansubletapply.*; import com.yxt.anrui.riskcenter.api.loansubletapply.app.AppSubletDetailsVo; import com.yxt.anrui.riskcenter.api.loansubletapply.flow.*; +import com.yxt.anrui.riskcenter.api.loansubletveh.LoanSubletVeh; import com.yxt.anrui.riskcenter.biz.loanbuckleapplyrecord.LoanBuckleApplyRecordService; import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; import com.yxt.anrui.riskcenter.biz.loanredemptionveh.LoanRedemptionVehService; import com.yxt.anrui.riskcenter.biz.loanrepaymenthistory.LoanRepaymentHistoryService; import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService; import com.yxt.anrui.riskcenter.biz.loanrestorereportapply.LoanRestoreReportApplyService; +import com.yxt.anrui.riskcenter.biz.loansubletveh.LoanSubletVehService; import com.yxt.common.base.config.component.FileUploadComponent; import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.utils.PagerUtil; @@ -108,7 +110,7 @@ public class LoanSubletApplyService extends MybatisBaseService listPage(PagerQuery pq) { IPage page = PagerUtil.queryToPage(pq); @@ -121,37 +123,37 @@ public class LoanSubletApplyService extends MybatisBaseService defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); - if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { - //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) - String orgSidPath = pagerQuery.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("a.orgSidPath", orgSidPath); - } else if ("2".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i2); - qw.like("a.orgSidPath", orgSidPath); - } else if ("3".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i3); - qw.like("a.orgSidPath", orgSidPath); - } else if ("4".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i4); - qw.like("a.orgSidPath", orgSidPath); - } else if ("5".equals(orgLevelKey)) { - qw.eq("a.createBySid", pagerQuery.getUserSid()); - } else { - PagerVo p = new PagerVo<>(); - return p; - } - } else { - PagerVo p = new PagerVo<>(); - return p; - } +// if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { +// //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) +// String orgSidPath = pagerQuery.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("a.orgSidPath", orgSidPath); +// } else if ("2".equals(orgLevelKey)) { +// orgSidPath = orgSidPath.substring(0, i2); +// qw.like("a.orgSidPath", orgSidPath); +// } else if ("3".equals(orgLevelKey)) { +// orgSidPath = orgSidPath.substring(0, i3); +// qw.like("a.orgSidPath", orgSidPath); +// } else if ("4".equals(orgLevelKey)) { +// orgSidPath = orgSidPath.substring(0, i4); +// qw.like("a.orgSidPath", orgSidPath); +// } else if ("5".equals(orgLevelKey)) { +// qw.eq("a.createBySid", pagerQuery.getUserSid()); +// } else { +// PagerVo p = new PagerVo<>(); +// return p; +// } +// } else { +// PagerVo p = new PagerVo<>(); +// return p; +// } //======================= //分公司 if (StringUtils.isNotBlank(pagerQuery.getCompany())) { @@ -187,11 +189,11 @@ public class LoanSubletApplyService extends MybatisBaseService 1 AND a.vehType = '主车' ) OR (a.count = 1)"); IPage pagging = baseMapper.listPage(page, qw); PagerVo p = PagerUtil.pageToVo(pagging, null); return p; @@ -232,7 +234,7 @@ public class LoanSubletApplyService extends MybatisBaseService pagging = baseMapper.getVinList(page, qw); PagerVo p = PagerUtil.pageToVo(pagging, null); return p; @@ -240,72 +242,63 @@ public class LoanSubletApplyService extends MybatisBaseService subletInit(String ledgerSid) { ResultBean rb = ResultBean.fireFail(); - LoanRedemptionApplyInit vo = new LoanRedemptionApplyInit(); - RedemptionInitVo redemptionInitVo = baseMapper.redemptionInit(ledgerSid); - if (null != redemptionInitVo) { - BeanUtil.copyProperties(redemptionInitVo, vo); - if (StringUtils.isNotBlank(redemptionInitVo.getBusVinSid())) { - AlrepaidAndArrVo alrepaidAndArr = loanRestoreReportApplyService.getAlrepaidAndArr(redemptionInitVo.getBusVinSid()); - if (null != alrepaidAndArr) { - //已还金额 - if (StringUtils.isNotBlank(alrepaidAndArr.getAlRepaidMoney())) { - vo.setAlRepaidMoney(alrepaidAndArr.getAlRepaidMoney()); - } - //已还金额换算期数 - if (StringUtils.isNotBlank(alrepaidAndArr.getAlRepaidMoneyConPeriod())) { - vo.setAlRepaidMoneyConPeriod(alrepaidAndArr.getAlRepaidMoneyConPeriod()); - } - //逾期金额换算期数 - if (StringUtils.isNotBlank(alrepaidAndArr.getBeOverdueMoneyAndPeriod())) { - vo.setBeOverdueMoneyAndPeriod(alrepaidAndArr.getBeOverdueMoneyAndPeriod()); - } - //总期数 - if (StringUtils.isNotBlank(alrepaidAndArr.getNper())) { - vo.setNper(alrepaidAndArr.getNper()); + LoanSubletApplyInit vo = new LoanSubletApplyInit(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + vo.setApplyDate(sdf.format(new Date())); + List vinList = new ArrayList<>(); + SubletInitVo subletInitVo = baseMapper.selReturnLegerBySid(ledgerSid); + String vehType = ""; + if (null != subletInitVo) { + if (StringUtils.isNotBlank(subletInitVo.getCustomer())) { + vo.setCustomer(subletInitVo.getCustomer()); + } + if (StringUtils.isNotBlank(subletInitVo.getBorrowerName())) { + vo.setBorrowerName(subletInitVo.getBorrowerName()); + } + if (StringUtils.isNotBlank(subletInitVo.getVehType())) { + vehType = subletInitVo.getVehType(); + if (vehType.equals("主车")) { + SubletInitVo mainVeh = baseMapper.selLoanInfoByMainVeh(subletInitVo.getBusVinSid()); + if (null != mainVeh) { + if (StringUtils.isNotBlank(mainVeh.getBankName())) { + vo.setBankName(mainVeh.getBankName()); + } + if (StringUtils.isNotBlank(mainVeh.getLoanContractNo())) { + vo.setLoanContractNo(mainVeh.getLoanContractNo()); + } + if (StringUtils.isNotBlank(mainVeh.getBankContractNo())) { + vo.setBankContractNo(mainVeh.getBankContractNo()); + } } - //当前逾期金额 - if (StringUtils.isNotBlank(alrepaidAndArr.getCurrentBeMoney())) { - vo.setCurrentBeMoney(alrepaidAndArr.getCurrentBeMoney()); + SubletVinList mVeh = baseMapper.selReturnVinLegerBySid(ledgerSid); + if (null != mVeh) { + vinList.add(mVeh); } - //当前期数 - if (StringUtils.isNotBlank(alrepaidAndArr.getCurrentPeriod())) { - vo.setCurrentPeriod(alrepaidAndArr.getCurrentPeriod()); + SubletVinList tVeh = baseMapper.selReturnTrVinLegerByPSid(ledgerSid); + if (null != tVeh) { + vinList.add(tVeh); } - //未到期金额 - if (StringUtils.isNotBlank(alrepaidAndArr.getUnexpiredMoney())) { - vo.setUnexpiredMoney(alrepaidAndArr.getUnexpiredMoney()); + vo.setVinList(vinList); + } else if (vehType.equals("挂车")) { + SubletInitVo trVeh = baseMapper.selLoanInfoByTrVeh(ledgerSid); + if (null != trVeh) { + if (StringUtils.isNotBlank(trVeh.getBankName())) { + vo.setBankName(trVeh.getBankName()); + } + if (StringUtils.isNotBlank(trVeh.getLoanContractNo())) { + vo.setLoanContractNo(trVeh.getLoanContractNo()); + } + if (StringUtils.isNotBlank(trVeh.getBankContractNo())) { + vo.setBankContractNo(trVeh.getBankContractNo()); + } } - //其中资金占用费 - if (StringUtils.isNotBlank(alrepaidAndArr.getWheFundOccMoney())) { - vo.setWheFundOccMoney(alrepaidAndArr.getWheFundOccMoney()); + SubletVinList tVeh = baseMapper.selReturnTrVinLegerBySid(ledgerSid); + if (null != tVeh) { + vinList.add(tVeh); } + vo.setVinList(vinList); } } - List vinList = new ArrayList<>(); - RedemptionVinList mainVeh = new RedemptionVinList(); - if (StringUtils.isNotBlank(redemptionInitVo.getVinSid())) { - mainVeh.setVinSid(redemptionInitVo.getVinSid()); - } - if (StringUtils.isNotBlank(redemptionInitVo.getVinNo())) { - mainVeh.setVinNo(redemptionInitVo.getVinNo()); - } - if (StringUtils.isNotBlank(redemptionInitVo.getVehModel())) { - mainVeh.setVehModel(redemptionInitVo.getVehModel()); - } - if (StringUtils.isNotBlank(redemptionInitVo.getVehMark())) { - mainVeh.setVehMark(redemptionInitVo.getVehMark()); - } - if (StringUtils.isNotBlank(redemptionInitVo.getVehType())) { - mainVeh.setVehType(redemptionInitVo.getVehType()); - } - vinList.add(mainVeh); - if (StringUtils.isNotBlank(redemptionInitVo.getLedgerSid())) { - RedemptionVinList trailerVeh = baseMapper.selTrailerByLedgerSid(redemptionInitVo.getLedgerSid()); - if (null != trailerVeh) { - vinList.add(trailerVeh); - } - } - vo.setVinList(vinList); } return rb.success().setData(vo); } @@ -313,218 +306,163 @@ public class LoanSubletApplyService extends MybatisBaseService saveSublet(LoanSubletApplyDto dto) { -// ResultBean rb = ResultBean.fireFail(); -// String sid = ""; -// if (StringUtils.isNotBlank(dto.getSid())) { -// sid = dto.getSid(); -// LoanRedemptionApply updateEntity = fetchBySid(sid); -// if (null != updateEntity) { -// BeanUtil.copyProperties(dto, updateEntity, "id", "sid"); -// baseMapper.updateById(updateEntity); -// loanRedemptionVehService.deleteByMainSid(sid); -// //删除附件表中关于该linkSid的文件 -// loanFileService.deleteByLinkSid(sid); -// List filess = dto.getFiles(); -// if (!filess.isEmpty()) { -// List files = new ArrayList<>(); -// for (LoanRedemptionApplyFile file : filess) { -// files.add(file.getUrl()); -// } -// loanFileService.saveAll(sid, files, LoanFileEnum.REDEMPTION.getAttachType()); -// } -// List vinList = dto.getVinList(); -// if (!vinList.isEmpty()) { -// for (RedemptionVinList record : vinList) { -// LoanRedemptionVeh redemptionVeh = new LoanRedemptionVeh(); -// redemptionVeh.setMainSid(sid); -// if (StringUtils.isNotBlank(record.getVinSid())) { -// redemptionVeh.setVinSid(record.getVinSid()); -// } -// if (StringUtils.isNotBlank(record.getVinNo())) { -// redemptionVeh.setVinNo(record.getVinNo()); -// } -// if (StringUtils.isNotBlank(record.getVehMark())) { -// redemptionVeh.setVehMark(record.getVehMark()); -// } -// if (StringUtils.isNotBlank(record.getVehModel())) { -// redemptionVeh.setVehModel(record.getVehModel()); -// } -// if (StringUtils.isNotBlank(record.getVehType())) { -// redemptionVeh.setVehType(record.getVehType()); -// if (record.getVehType().equals("主车")) { -// if (StringUtils.isNotBlank(dto.getBusVinSid())) { -// redemptionVeh.setBusVinSid(dto.getBusVinSid()); -// } -// } -// } -// loanRedemptionVehService.insert(redemptionVeh); -// } -// } -// } -// } else { -// LoanRedemptionApply loanRedemptionApply = new LoanRedemptionApply(); -// sid = loanRedemptionApply.getSid(); -// BeanUtil.copyProperties(dto, loanRedemptionApply, "id", "sid"); -// loanRedemptionApply.setCreateBySid(dto.getUserSid()); -// loanRedemptionApply.setOrgSidPath(dto.getOrgPath()); -// ResultBean orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()); -// if (orgSidByPath.getSuccess()) { -// String userOrgSid = orgSidByPath.getData(); -// loanRedemptionApply.setUseOrgSid(userOrgSid); -// ResultBean organizationVo = sysOrganizationFeign.fetchBySid(userOrgSid); -// if (organizationVo.getSuccess()) { -// SysOrganizationVo organizationVoData = organizationVo.getData(); -// if (null != organizationVoData) { -// loanRedemptionApply.setUseOrgName(organizationVoData.getName()); -// } -// } -// } -// loanRedemptionApply.setNodeState("待提交"); -// baseMapper.insert(loanRedemptionApply); -// List vinList = dto.getVinList(); -// if (!vinList.isEmpty()) { -// for (RedemptionVinList record : vinList) { -// LoanRedemptionVeh redemptionVeh = new LoanRedemptionVeh(); -// redemptionVeh.setMainSid(sid); + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + LoanSubletApply updateEntity = fetchBySid(sid); + if (null != updateEntity) { + BeanUtil.copyProperties(dto, updateEntity, "id", "sid"); + baseMapper.updateById(updateEntity); + //todo 修改车辆交回台账 + List subletVinLists = loanSubletVehService.selByMainSid(sid); + if (!subletVinLists.isEmpty()) { + + } + loanSubletVehService.deleteByMainSid(sid); + //删除附件表中关于该linkSid的文件 + loanFileService.deleteByLinkSid(sid); + List filess = dto.getFiles(); + if (!filess.isEmpty()) { + List files = new ArrayList<>(); + for (LoanSubletApplyFile file : filess) { + files.add(file.getUrl()); + } + loanFileService.saveAll(sid, files, LoanFileEnum.SUBLETAPPLY.getAttachType()); + } + List vinList = dto.getVinList(); + if (!vinList.isEmpty()) { + for (SubletVinList record : vinList) { + LoanSubletVeh subletVeh = new LoanSubletVeh(); + BeanUtil.copyProperties(record, subletVeh, "id", "sid"); + subletVeh.setMainSid(sid); + loanSubletVehService.insert(subletVeh); + //todo 交回车辆状态处置状态修改 + } + } + } + } else { + LoanSubletApply apply = new LoanSubletApply(); + sid = apply.getSid(); + BeanUtil.copyProperties(dto, apply, "id", "sid"); + apply.setCreateBySid(dto.getUserSid()); + apply.setOrgSidPath(dto.getOrgPath()); + ResultBean orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()); + if (orgSidByPath.getSuccess()) { + String userOrgSid = orgSidByPath.getData(); + apply.setUseOrgSid(userOrgSid); + ResultBean organizationVo = sysOrganizationFeign.fetchBySid(userOrgSid); + if (organizationVo.getSuccess()) { + SysOrganizationVo organizationVoData = organizationVo.getData(); + if (null != organizationVoData) { + apply.setUseOrgName(organizationVoData.getName()); + } + } + } + apply.setNodeState("待提交"); + baseMapper.insert(apply); + List vinList = dto.getVinList(); + if (!vinList.isEmpty()) { + for (SubletVinList record : vinList) { + LoanSubletVeh subletVeh = new LoanSubletVeh(); + BeanUtil.copyProperties(record, subletVeh, "id", "sid"); + subletVeh.setMainSid(sid); // if (StringUtils.isNotBlank(record.getVinSid())) { -// redemptionVeh.setVinSid(record.getVinSid()); +// subletVeh.setVinSid(record.getVinSid()); // } // if (StringUtils.isNotBlank(record.getVinNo())) { -// redemptionVeh.setVinNo(record.getVinNo()); +// subletVeh.setVinNo(record.getVinNo()); // } // if (StringUtils.isNotBlank(record.getVehMark())) { -// redemptionVeh.setVehMark(record.getVehMark()); +// subletVeh.setVehMark(record.getVehMark()); // } // if (StringUtils.isNotBlank(record.getVehModel())) { -// redemptionVeh.setVehModel(record.getVehModel()); +// subletVeh.setVehModel(record.getVehModel()); // } // if (StringUtils.isNotBlank(record.getVehType())) { -// redemptionVeh.setVehType(record.getVehType()); -// if (record.getVehType().equals("主车")) { -// if (StringUtils.isNotBlank(dto.getBusVinSid())) { -// redemptionVeh.setBusVinSid(dto.getBusVinSid()); -// } -// } +// subletVeh.setVehType(record.getVehType()); // } -// loanRedemptionVehService.insert(redemptionVeh); -// //todo 交回车辆状态处置状态修改 -// } -// } -// //删除附件表中关于该linkSid的文件 -// loanFileService.deleteByLinkSid(sid); -// List filess = dto.getFiles(); -// if (!filess.isEmpty()) { -// List files = new ArrayList<>(); -// for (LoanRedemptionApplyFile file : filess) { -// files.add(file.getUrl()); -// } -// loanFileService.saveAll(sid, files, LoanFileEnum.REDEMPTION.getAttachType()); -// } -// } -// return rb.success().setData(sid); - return null; +// if (StringUtils.isNotBlank(record.getBusVinSid())) { +// subletVeh.setBusVinSid(record.getBusVinSid()); +// } +// if (StringUtils.isNotBlank(record.getLedgerSid())) { +// subletVeh.setLedgerSid(record.getLedgerSid()); +// } + loanSubletVehService.insert(subletVeh); + //todo 交回车辆状态处置状态修改 + } + } + //删除附件表中关于该linkSid的文件 + loanFileService.deleteByLinkSid(sid); + List filess = dto.getFiles(); + if (!filess.isEmpty()) { + List files = new ArrayList<>(); + for (LoanSubletApplyFile file : filess) { + files.add(file.getUrl()); + } + loanFileService.saveAll(sid, files, LoanFileEnum.SUBLETAPPLY.getAttachType()); + } + } + return rb.success().setData(sid); + } public ResultBean subletDetails(String sid) { -// ResultBean rb = ResultBean.fireFail(); -// LoanRedemptionApplyInit vo = new LoanRedemptionApplyInit(); -// LoanRedemptionApply entity = fetchBySid(sid); -// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); -// if (null != entity) { -// BeanUtil.copyProperties(entity, vo); -// if (null != entity.getApplyDate()) { -// vo.setApplyDate(sdf.format(entity.getApplyDate())); -// } -// if (StringUtils.isNotBlank(entity.getProcInstId())) { -// vo.setInstanceId(entity.getProcInstId()); -// } -// if (StringUtils.isNotBlank(entity.getCreateBySid())) { -// vo.setUserSid(entity.getCreateBySid()); -// } -// if (StringUtils.isNotBlank(entity.getOrgSidPath())) { -// vo.setOrgPath(entity.getOrgSidPath()); -// } -// List redemptionVinLists = loanRedemptionVehService.selByMainSid(sid); -// if (!redemptionVinLists.isEmpty()) { -// redemptionVinLists.stream().forEach(v -> { -// if (v.getVehType().equals("主车")) { -// vo.setBusVinSid(v.getBusVinSid()); -// } -// }); -// vo.setVinList(redemptionVinLists); -// } -// if (StringUtils.isNotBlank(vo.getBusVinSid())) { -// AlrepaidAndArrVo alrepaidAndArr = loanRestoreReportApplyService.getAlrepaidAndArr(vo.getBusVinSid()); -// if (null != alrepaidAndArr) { -// //已还金额 -// if (StringUtils.isNotBlank(alrepaidAndArr.getAlRepaidMoney())) { -// vo.setAlRepaidMoney(alrepaidAndArr.getAlRepaidMoney()); -// } -// //已还金额换算期数 -// if (StringUtils.isNotBlank(alrepaidAndArr.getAlRepaidMoneyConPeriod())) { -// vo.setAlRepaidMoneyConPeriod(alrepaidAndArr.getAlRepaidMoneyConPeriod()); -// } -// //逾期金额换算期数 -// if (StringUtils.isNotBlank(alrepaidAndArr.getBeOverdueMoneyAndPeriod())) { -// vo.setBeOverdueMoneyAndPeriod(alrepaidAndArr.getBeOverdueMoneyAndPeriod()); -// } -// //总期数 -// if (StringUtils.isNotBlank(alrepaidAndArr.getNper())) { -// vo.setNper(alrepaidAndArr.getNper()); -// } -// //当前逾期金额 -// if (StringUtils.isNotBlank(alrepaidAndArr.getCurrentBeMoney())) { -// vo.setCurrentBeMoney(alrepaidAndArr.getCurrentBeMoney()); -// } -// //当前期数 -// if (StringUtils.isNotBlank(alrepaidAndArr.getCurrentPeriod())) { -// vo.setCurrentPeriod(alrepaidAndArr.getCurrentPeriod()); -// } -// //未到期金额 -// if (StringUtils.isNotBlank(alrepaidAndArr.getUnexpiredMoney())) { -// vo.setUnexpiredMoney(alrepaidAndArr.getUnexpiredMoney()); -// } -// //其中资金占用费 -// if (StringUtils.isNotBlank(alrepaidAndArr.getWheFundOccMoney())) { -// vo.setWheFundOccMoney(alrepaidAndArr.getWheFundOccMoney()); -// } -// } -// } -// -// List fileList = loanFileService.selectByLinkSid(sid, LoanFileEnum.REDEMPTION.getAttachType()); -// fileList.removeAll(Collections.singleton(null)); -// if (!fileList.isEmpty()) { -// List files = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()). -// collect(Collectors.toList()); -// List applyFiles = new ArrayList<>(); -// for (String file : files) { -// LoanRedemptionApplyFile applyFile = new LoanRedemptionApplyFile(); -// applyFile.setUrl(file); -// applyFiles.add(applyFile); -// } -// vo.setFiles(applyFiles); -// } -// } -// return rb.success().setData(vo); - return null; + ResultBean rb = ResultBean.fireFail(); + LoanSubletApplyInit vo = new LoanSubletApplyInit(); + LoanSubletApply entity = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (null != entity) { + BeanUtil.copyProperties(entity, vo); + if (null != entity.getApplyDate()) { + vo.setApplyDate(sdf.format(entity.getApplyDate())); + } + if (StringUtils.isNotBlank(entity.getProcInstId())) { + vo.setInstanceId(entity.getProcInstId()); + } + if (StringUtils.isNotBlank(entity.getCreateBySid())) { + vo.setUserSid(entity.getCreateBySid()); + } + if (StringUtils.isNotBlank(entity.getOrgSidPath())) { + vo.setOrgPath(entity.getOrgSidPath()); + } + List vinLists = loanSubletVehService.selByMainSid(sid); + if (!vinLists.isEmpty()) { + vo.setVinList(vinLists); + } + List fileList = loanFileService.selectByLinkSid(sid, LoanFileEnum.SUBLETAPPLY.getAttachType()); + fileList.removeAll(Collections.singleton(null)); + if (!fileList.isEmpty()) { + List files = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()). + collect(Collectors.toList()); + List applyFiles = new ArrayList<>(); + for (String file : files) { + LoanSubletApplyFile applyFile = new LoanSubletApplyFile(); + applyFile.setUrl(file); + applyFiles.add(applyFile); + } + vo.setFiles(applyFiles); + } + } + return rb.success().setData(vo); } public ResultBean deleteBySids(String[] sids) { ResultBean rb = ResultBean.fireFail(); -// for (String sid : sids) { -// LoanRedemptionApply entity = fetchBySid(sid); -// if (null != entity) { -// if (!entity.getNodeState().equals("待提交")) { -// return rb.setMsg("删除的数据中包含已经提交审批的数据,删除失败"); -// } -// } -// entity.setIsDelete(1); -// int i = baseMapper.updateById(entity); -// if (i == 0) { -// return rb.setMsg("删除失败"); -// } -// //todo 修改交回车辆台账状态 -// } + for (String sid : sids) { + LoanSubletApply entity = fetchBySid(sid); + if (null != entity) { + if (!entity.getNodeState().equals("待提交")) { + return rb.setMsg("删除的数据中包含已经提交审批的数据,删除失败"); + } + } + entity.setIsDelete(1); + int i = baseMapper.updateById(entity); + if (i == 0) { + return rb.setMsg("删除失败"); + } + //todo 修改交回车辆台账状态 + } return ResultBean.fireSuccess().setMsg("删除成功"); } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletveh/LoanSubletVehMapper.xml b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletveh/LoanSubletVehMapper.xml index d5490e4caf..236e65d085 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletveh/LoanSubletVehMapper.xml +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansubletveh/LoanSubletVehMapper.xml @@ -4,7 +4,7 @@ DELETE - FROM loan_redemption_veh + FROM loan_sublet_veh WHERE mainSid = #{mainSid}