From 722f91f2c71e8796503c7ffa6fbf2d23fdefabc8 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Tue, 23 Mar 2021 10:06:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=82=AC=E6=94=B6=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial/crms/dao/CustomerAppletDao.java | 2 + .../impl/CustomerAppletServiceImpl.java | 7 + .../mapper/crms/CustomerAppletDao.xml | 9 + .../controller/AlCollectionController.java | 47 ++++- .../guarantee/mapper/AlCollectionMapper.java | 18 +- .../mapper/AlRepaymentEntryMapper.java | 4 + .../request/AlCollectionListRequest.java | 34 ++++ .../model/request/AlCollectionRequest.java | 36 ++++ .../model/response/AlCollectionResponse.java | 55 ++++++ .../response/MoreOverdueDetailResponse.java | 64 +++++++ .../model/response/OverdueDetailResponse.java | 50 +++++ .../service/IAlCollectionService.java | 14 +- .../service/impl/AlCollectionServiceImpl.java | 171 +++++++++++++++++- .../mapper/guarantee/AlCollectionMapper.xml | 52 +++++- .../guarantee/AlRepaymentEntryMapper.xml | 15 ++ .../domain/guarantee/AlCollection.java | 38 ++++ .../domain/guarantee/po/AlCollectionPO.java | 8 +- 17 files changed, 615 insertions(+), 9 deletions(-) create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionListRequest.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionResponse.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/MoreOverdueDetailResponse.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/OverdueDetailResponse.java diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java index 86ff1f59..bd6adbf7 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java @@ -35,5 +35,7 @@ public interface CustomerAppletDao extends BaseMapper { List getApplyMount(Integer companyId); + Integer businessUnderwayCount(Integer companyId); + ApplyDetailPO getApplyDetail(Integer id); } diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java index 692d609d..64054425 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java @@ -372,12 +372,19 @@ public class CustomerAppletServiceImpl extends ServiceImpl 0) { + map.put("underway", 1.00); + } // 查询申请记录信息 List applicationRecordPOList = this.getBaseMapper().getApplyMount(companyId); if (applicationRecordPOList.size() < 1) { diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml b/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml index 3c7e37a2..a51a7126 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml @@ -59,6 +59,15 @@ AND b.business_status = 2 + + SELECT i.id AS id,i.business_code AS code,i.customer_name AS name,i.phone AS phone,i.business_type AS type, - i.guarantee_amount AS amount,i.department AS department,i.payment_status AS status + i.guarantee_amount AS amount,i.department AS department,i.payment_status AS status,COUNT(c.id) AS numberOfCollection FROM al_insurance_list AS i INNER JOIN al_repayment_entry AS r ON i.id = r.insurance_id - WHERE r.repayment_status = 3 + INNER JOIN al_collection AS c + ON i.id = c.insurance_id + WHERE r.is_overdue = 0 + + AND i.status = #{status} + + + AND (i.customer_name like CONCAT('%',#{codeOrName},'%') OR i.business_code like CONCAT('%',#{codeOrName},'%')) + GROUP BY i.id + + + INSERT INTO al_collection (insurance_id,collection_method,collection_time,collection_feedback,enclosure_file + ,overdue_amount,overdue_interest,other_expenses,collection_user,overdue_periods) + VALUES (#{collection.insuranceId},#{collection.collectionMethod},#{collection.collectionTime}, + #{collection.collectionFeedback},#{collection.enclosureFile}, + #{collection.overdueAmount},#{collection.overdueInterest},#{collection.otherExpenses}, + #{collection.collectionUser},#{collection.overduePeriods}) + + + + + + + + + + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml index cf87e53e..ea79bdfb 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml @@ -61,4 +61,19 @@ left join al_insurance_list il on re.insurance_id=il.id + + + + + + diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollection.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollection.java index 0c5b7e1c..b3692533 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollection.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollection.java @@ -3,9 +3,13 @@ package com.daqing.framework.domain.guarantee; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -18,6 +22,7 @@ import java.util.Date; */ @Data @TableName("al_collection") +@ToString public class AlCollection implements Serializable { private static final long serialVersionUID = 1L; @@ -31,25 +36,58 @@ public class AlCollection implements Serializable { /** * 保后主键id */ + @ApiModelProperty("保后id") private Integer insuranceId; + /** + * 逾期金额 + */ + @ApiModelProperty("逾期金额") + private BigDecimal overdueAmount; + + /** + * 逾期利息 + */ + @ApiModelProperty("逾期利息") + private BigDecimal overdueInterest; + + /** + * 逾期费用 + */ + @ApiModelProperty("逾期费用") + private BigDecimal otherExpenses; + + /** + * 逾期期数 + */ + private Integer overduePeriods; + /** * 催收方式:1->电话催收;2->上门/外访; */ + @ApiModelProperty("催收方式:1->电话催收;2->上门/外访") private Integer collectionMethod; + + @ApiModelProperty("催收人") + private Integer collectionUser; + /** * 催收时间 */ + @ApiModelProperty("催收时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date collectionTime; /** * 催收反馈 */ + @ApiModelProperty("催收反馈") private String collectionFeedback; /** * 附件 */ + @ApiModelProperty("附件") private String enclosureFile; } diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/AlCollectionPO.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/AlCollectionPO.java index 1af7a40f..11a07bfb 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/AlCollectionPO.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/AlCollectionPO.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; /** * 催熟管理数据接收 @@ -43,13 +44,18 @@ public class AlCollectionPO implements Serializable { /** * 担保额度 */ - private Double amount; + private BigDecimal amount; /** * 所属部门 */ private String department; + /** + * 催收次数 + */ + private Integer numberOfCollection; + /** * 状态 */ From a65fc3e428699ee072c47d5e4326f16b4d2366b6 Mon Sep 17 00:00:00 2001 From: river <1376754470@qq.com> Date: Thu, 25 Mar 2021 14:47:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=82=AC=E6=94=B6=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E3=80=81=E5=AF=BC=E5=87=BA=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E7=AD=89=E5=82=AC=E6=94=B6=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=AE=A2=E6=88=B7=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=B7=B2=E8=B4=B7=E6=AC=BE=E9=87=91=E9=A2=9D=E3=80=81=E8=83=BD?= =?UTF-8?q?=E5=90=A6=E8=B4=B7=E6=AC=BE=E7=8A=B6=E6=80=81=E7=AD=89=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=A8=A1=E5=9D=97=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../response/ApplicationRecordResponse.java | 3 +- .../impl/CustomerAppletServiceImpl.java | 15 +- .../src/main/resources/bootstrap.properties | 2 +- .../controller/AlCollectionController.java | 55 ++++- .../guarantee/mapper/AlCollectionMapper.java | 11 +- .../request/AlCollectionListRequest.java | 3 + .../model/request/AlCollectionRequest.java | 9 + .../DgLoanCommitteeConsiderRequest.java | 3 +- .../response/AlCollectionListResponse.java | 70 +++++++ .../model/response/AlCollectionResponse.java | 18 +- .../model/response/AlRepaymentCountRes.java | 1 - .../DgComplianceInvestigationResponse.java | 3 +- .../DgLoanCommitteeConsiderInfoResponse.java | 3 +- .../DgLoanCommitteeConsiderResponse.java | 3 +- .../DgStatisticsExcelRefuseResponse.java | 3 +- .../response/DgStatisticsExcelResponse.java | 3 +- .../DgStatisticsListRefuseResponse.java | 3 +- .../response/DgStatisticsListResponse.java | 25 +-- .../response/DgWorkConferenceResponse.java | 3 +- .../service/IAlCollectionService.java | 8 + .../service/impl/AlCollectionServiceImpl.java | 198 ++++++++++++++++-- .../service/impl/DgLoanNoticeServiceImpl.java | 4 +- .../src/main/resources/bootstrap.properties | 2 +- .../mapper/guarantee/AlCollectionMapper.xml | 43 ++-- .../guarantee/AlRepaymentEntryMapper.xml | 4 +- .../src/main/resources/bootstrap.properties | 2 +- .../src/main/resources/bootstrap.properties | 2 +- .../domain/crms/ext/ApplicationRecordPO.java | 3 +- .../domain/guarantee/AlRepaymentEntry.java | 5 + .../guarantee/DgLoanCommitteeConsider.java | 3 +- .../guarantee/po/AlCollectionListPO.java | 76 +++++++ .../domain/guarantee/po/DgStatisticsPO.java | 6 +- .../guarantee/po/DgStatisticsRefusePO.java | 3 +- .../guarantee/po/DgWorkConferencePO.java | 3 +- .../utils/excel/CollectionConverter.java | 48 +++++ .../src/main/resources/bootstrap.properties | 2 +- 36 files changed, 573 insertions(+), 75 deletions(-) create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionListResponse.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/AlCollectionListPO.java create mode 100644 dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/CollectionConverter.java diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/response/ApplicationRecordResponse.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/response/ApplicationRecordResponse.java index 3f1fd98c..5d3677e1 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/response/ApplicationRecordResponse.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/model/response/ApplicationRecordResponse.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -29,7 +30,7 @@ public class ApplicationRecordResponse implements Serializable { private String amountWide; @ApiModelProperty("申请额度") - private Double applyAmount; + private BigDecimal applyAmount; @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @ApiModelProperty("申请日期") diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java index 64054425..8a83ff51 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java @@ -37,6 +37,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.*; /** @@ -367,13 +368,15 @@ public class CustomerAppletServiceImpl extends ServiceImpl map = new HashMap<>(); + // 这个是否填小数没有影响,主要要是看赋予或计算的值是否包含小数 + BigDecimal company = new BigDecimal(0.00); + // Double company = 0.00; + Map map = new HashMap<>(); map.put("company", company); // 个人类型暂时没有 - map.put("personal", 0.00); + map.put("personal", new BigDecimal(0.00)); // 是否与业务正在申请中 - map.put("underway", 0.00); + map.put("underway", new BigDecimal(0)); Integer customerId = this.getBaseMapper().getCustomerId(Integer.parseInt(this.getUserId()), 1); // 如果查询不到认证信息,直接返回0.00 if (customerId == null) { @@ -383,7 +386,7 @@ public class CustomerAppletServiceImpl extends ServiceImpl 0) { - map.put("underway", 1.00); + map.put("underway", new BigDecimal(1)); } // 查询申请记录信息 List applicationRecordPOList = this.getBaseMapper().getApplyMount(companyId); @@ -391,7 +394,7 @@ public class CustomerAppletServiceImpl extends ServiceImpl * 保后催收 前端控制器 @@ -34,7 +42,8 @@ public class AlCollectionController { @GetMapping("/list") @ApiOperation(value = "催收管理列表", notes = "催收管理列表", response = AlCollectionResponse.class) public ResponseResult list(@RequestParam("page") Integer page, @RequestParam("size") Integer size, - @ApiParam("客户编号/名称") String codeOrName, @ApiParam("状态") Integer status) { + @RequestParam(name = "codeOrName", required = false) String codeOrName, + @RequestParam(name = "status", required = false) Integer status) { return ResponseResult.SUCCESS(alCollectionService.list(page, size, codeOrName, status)); } @@ -43,7 +52,7 @@ public class AlCollectionController { */ @PostMapping("/collection") @ApiOperation(value = "催收", notes = "催收") - public ResponseResult collection(@RequestBody AlCollectionRequest alCollectionRequest) { + public ResponseResult collection(@RequestBody @Valid AlCollectionRequest alCollectionRequest) { Boolean result = alCollectionService.collection(alCollectionRequest); return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); @@ -58,4 +67,46 @@ public class AlCollectionController { return ResponseResult.SUCCESS(alCollectionService.overdueDetail(insuranceId)); } + + /** + * 催收列表 + */ + @PostMapping("/collection/list") + @ApiOperation(value = "催收列表", notes = "催收列表", response = AlCollectionListResponse.class) + public ResponseResult collectionList(@RequestBody AlCollectionListRequest alCollectionListRequest) { + + return ResponseResult.SUCCESS(alCollectionService.collectionList(alCollectionListRequest)); + } + + /** + * 查看时的催收详情 + */ + @GetMapping("/examine/detail") + @ApiOperation(value = "查看时的催收详情", notes = "查看时的催收详情", response = MoreOverdueDetailResponse.class) + public ResponseResult moreOverdueDetail(@RequestParam("id") Integer id) { + + return ResponseResult.SUCCESS(alCollectionService.moreOverdueDetail(id)); + } + + /** + * 催收管理列表导出 + */ + @ApiOperation(value = "催收管理列表导出", notes = "催收管理列表导出") + @GetMapping("/list/export/excel") + public ResponseResult listExportExcel(@RequestParam("insuranceIds") List insuranceIds, HttpServletResponse response) throws IOException { + + alCollectionService.listExportExcel(insuranceIds, response); + return ResponseResult.SUCCESS(); + } + + /** + * 催收列表导出 + */ + @ApiOperation(value = "催收列表导出", notes = "催收列表导出") + @PostMapping("/collection/list/export/excel") + public ResponseResult collectionListExportExcel(@RequestBody List ids, HttpServletResponse response) throws IOException { + + alCollectionService.collectionListExportExcel(ids, response); + return ResponseResult.SUCCESS(); + } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java index 2fe310e9..14436944 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java @@ -3,9 +3,11 @@ package com.daqing.financial.guarantee.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.daqing.financial.guarantee.model.request.AlCollectionListRequest; import com.daqing.financial.guarantee.model.response.MoreOverdueDetailResponse; import com.daqing.financial.guarantee.model.response.OverdueDetailResponse; import com.daqing.framework.domain.guarantee.AlCollection; +import com.daqing.framework.domain.guarantee.po.AlCollectionListPO; import com.daqing.framework.domain.guarantee.po.AlCollectionPO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -27,13 +29,16 @@ public interface AlCollectionMapper extends BaseMapper { IPage list(@Param("page") Page page, @Param("codeOrName") String codeOrName, @Param("status") Integer status); - Boolean collection(@Param("collection") AlCollection alCollection); + // collection是个关键字,尽量不要用,特别是别名 + Boolean collection(@Param("ac") AlCollection alCollection); OverdueDetailResponse getOverdueDetailByInsuranceId(Integer insuranceId); - List collectionList(String codeOrName); - MoreOverdueDetailResponse moreOverdueDetail(Integer id); Integer getInsuranceIdById(Integer id); + + IPage collectionList(@Param("page") Page page, @Param("acr") AlCollectionListRequest alCollectionListRequest); + + List collectionListExcel(@Param("ids") List ids); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionListRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionListRequest.java index 16f0772c..81e1aae1 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionListRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionListRequest.java @@ -1,5 +1,6 @@ package com.daqing.financial.guarantee.model.request; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; @@ -23,9 +24,11 @@ public class AlCollectionListRequest implements Serializable { @ApiModelProperty("size") private Integer size; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @ApiModelProperty("开始时间") private Date startTime; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @ApiModelProperty("结束时间") private Date endTime; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java index 325c2e1b..88734f53 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java @@ -5,6 +5,9 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -22,15 +25,21 @@ public class AlCollectionRequest implements Serializable { private Integer insuranceId; @ApiModelProperty("催收方式:1->电话催收;2->上门/外访") + @Min(value = 1, message = "参数格式不正确") + @Max(value = 2, message = "参数格式不正确") private Integer collectionMethod; @ApiModelProperty("催收时间") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @NotNull(message = "请选择催收时间") private Date collectionTime; @ApiModelProperty("催收反馈") + @NotNull(message = "请输入催收反馈") private String collectionFeedback; @ApiModelProperty("附件") + @NotNull(message = "请上传催收附件") private String enclosureFile; + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgLoanCommitteeConsiderRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgLoanCommitteeConsiderRequest.java index 442fe9e2..ce9e9db1 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgLoanCommitteeConsiderRequest.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/DgLoanCommitteeConsiderRequest.java @@ -7,6 +7,7 @@ import lombok.ToString; import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -30,7 +31,7 @@ public class DgLoanCommitteeConsiderRequest implements Serializable { private String additionalItems; @ApiModelProperty("贷款金额") - private Double loanMoney; + private BigDecimal loanMoney; @ApiModelProperty("贷款期限") private String loanTern; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionListResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionListResponse.java new file mode 100644 index 00000000..88dade19 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionListResponse.java @@ -0,0 +1,70 @@ +package com.daqing.financial.guarantee.model.response; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 催收列表返回类 + * + * @auther River + * @date 2021/3/23 10:39 + */ +@Data +@ToString +public class AlCollectionListResponse extends BaseRowModel implements Serializable { + + @ExcelIgnore + @ApiModelProperty("id") + private Integer id; + + @ExcelProperty(value = "客户编号", index = 0) + @ApiModelProperty("客户编号") + private String code; + + @ExcelProperty(value = "客户名称", index = 1) + @ApiModelProperty("客户名称") + private String name; + + @ExcelProperty(value = "逾期金额", index = 2) + @ApiModelProperty("逾期金额") + private BigDecimal overdueAmount; + + @ExcelProperty(value = "逾期利息", index = 3) + @ApiModelProperty("逾期利息") + private BigDecimal overdueInterest; + + @ExcelProperty(value = "其他费用", index = 4) + @ApiModelProperty("其他费用") + private BigDecimal otherExpenses; + + @ExcelProperty(value = "逾期次数", index = 5) + @ApiModelProperty("逾期次数") + private Integer overduePeriods; + + @ExcelProperty(value = "催收方法", index = 6) + @ApiModelProperty("催收方法") + private Integer collectionMethod; + + @ExcelProperty(value = "催收人", index = 7) + @ApiModelProperty("催收人") + private String collectionUserName; + + @ExcelProperty(value = "催收时间", index = 8) + @ApiModelProperty("催收时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date collectionTime; + + @ExcelProperty(value = "催收反馈", index = 9) + @ApiModelProperty("催收反馈") + private String collectionFeedback; + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionResponse.java index dcbd8d91..20cab49e 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionResponse.java @@ -1,5 +1,9 @@ package com.daqing.financial.guarantee.model.response; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.metadata.BaseRowModel; +import com.daqing.framework.utils.excel.CollectionConverter; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; @@ -15,41 +19,53 @@ import java.math.BigDecimal; */ @Data @ToString -public class AlCollectionResponse implements Serializable { +public class AlCollectionResponse extends BaseRowModel implements Serializable { + @ExcelIgnore @ApiModelProperty("id") private Integer id; + @ExcelProperty(value = "客户编号", index = 0) @ApiModelProperty("客户编号") private String code; + @ExcelProperty(value = "客户名称", index = 1) @ApiModelProperty("客户名称") private String name; + @ExcelProperty(value = "联系电话", index = 2) @ApiModelProperty("联系电话") private String phone; + @ExcelProperty(value = "业务类别", index = 3) @ApiModelProperty("业务类别") private String type; + @ExcelProperty(value = "担保额度", index = 4) @ApiModelProperty("担保额度") private BigDecimal amount; + @ExcelProperty(value = "逾期期数", index = 5) @ApiModelProperty("逾期期数") private Integer overduePeriods; + @ExcelProperty(value = "逾期额度", index = 6) @ApiModelProperty("逾期额度") private BigDecimal overdueAmount; + @ExcelProperty(value = "逾期利息", index = 7) @ApiModelProperty("逾期利息") private BigDecimal overdueInterest; + @ExcelProperty(value = "所属部门", index = 8) @ApiModelProperty("所属部门") private String department; + @ExcelProperty(value = "催收次数", index = 9) @ApiModelProperty("催收次数") private Integer numberOfCollection; + @ExcelProperty(value = "还款状态", index = 10, converter = CollectionConverter.class) @ApiModelProperty("状态,1->还款中;2->已逾期;3->已还清;4->已结项") private Integer status; } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlRepaymentCountRes.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlRepaymentCountRes.java index 37dac47e..55cdc66b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlRepaymentCountRes.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlRepaymentCountRes.java @@ -3,7 +3,6 @@ package com.daqing.financial.guarantee.model.response; import com.alibaba.excel.metadata.BaseRowModel; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; -import org.apache.poi.hpsf.Decimal; import java.io.Serializable; import java.math.BigDecimal; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgComplianceInvestigationResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgComplianceInvestigationResponse.java index 1529958e..c0b0017f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgComplianceInvestigationResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgComplianceInvestigationResponse.java @@ -11,6 +11,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -45,7 +46,7 @@ public class DgComplianceInvestigationResponse extends BaseRowModel implements S @ExcelProperty(value = "金额", index = 4) @ApiModelProperty("金额") - private Double applyAmount; + private BigDecimal applyAmount; @ExcelProperty(value = "期限", index = 5) @ApiModelProperty("期限") diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderInfoResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderInfoResponse.java index 86cc49ae..4e6a25fd 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderInfoResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderInfoResponse.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -33,7 +34,7 @@ public class DgLoanCommitteeConsiderInfoResponse implements Serializable { * 贷款金额(贷审会意见) */ @ApiModelProperty("贷款金额(贷审会意见)") - private Integer loanMoney; + private BigDecimal loanMoney; /** * 贷款期限(贷审会意见) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderResponse.java index 5c29ac50..69b95609 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgLoanCommitteeConsiderResponse.java @@ -12,6 +12,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -46,7 +47,7 @@ public class DgLoanCommitteeConsiderResponse extends BaseRowModel implements Ser @ExcelProperty(value = "金额" , index = 4) @ApiModelProperty("金额") - private Double applyAmount; + private BigDecimal applyAmount; @ExcelProperty(value = "期限" , index = 5) @ApiModelProperty("期限") diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java index dcd8976e..3c4d140a 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelRefuseResponse.java @@ -9,6 +9,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -39,7 +40,7 @@ public class DgStatisticsExcelRefuseResponse extends BaseRowModel implements Ser @ApiModelProperty("申请额度") @ExcelProperty(value = "金额", index = 4) - private Double applyAmount; + private BigDecimal applyAmount; @ApiModelProperty("申请期限") @ExcelProperty(value = "期数", index = 5) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java index bcdd9e79..e30dbed8 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsExcelResponse.java @@ -9,6 +9,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -39,7 +40,7 @@ public class DgStatisticsExcelResponse extends BaseRowModel implements Serializa @ApiModelProperty("申请额度") @ExcelProperty(value = "金额", index = 4) - private Double applyAmount; + private BigDecimal applyAmount; @ApiModelProperty("申请期限") @ExcelProperty(value = "期数", index = 5) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListRefuseResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListRefuseResponse.java index 8d9c5d3d..ca062828 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListRefuseResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListRefuseResponse.java @@ -8,6 +8,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -39,7 +40,7 @@ public class DgStatisticsListRefuseResponse extends BaseRowModel implements Seri @ApiModelProperty("申请额度") @ExcelProperty(value = "金额",index = 4) - private Double applyAmount; + private BigDecimal applyAmount; @ApiModelProperty("申请期限") @ExcelProperty(value = "期数",index = 5) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListResponse.java index 13461c23..eabc4b91 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgStatisticsListResponse.java @@ -8,6 +8,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -22,49 +23,49 @@ import java.util.List; public class DgStatisticsListResponse extends BaseRowModel implements Serializable { @ApiModelProperty("业务编号") - @ExcelProperty(value = "业务编号",index = 0) + @ExcelProperty(value = "业务编号", index = 0) private String businessCode; @ApiModelProperty("客户姓名") - @ExcelProperty(value = "客户姓名",index = 1) + @ExcelProperty(value = "客户姓名", index = 1) private String name; @ApiModelProperty("客户联系方式") - @ExcelProperty(value = "联系电话",index = 2) + @ExcelProperty(value = "联系电话", index = 2) private String phone; @ApiModelProperty("业务类型") - @ExcelProperty(value = "产品类型",index = 3) + @ExcelProperty(value = "产品类型", index = 3) private String businessType; @ApiModelProperty("申请额度") - @ExcelProperty(value = "金额",index = 4) - private Double applyAmount; + @ExcelProperty(value = "金额", index = 4) + private BigDecimal applyAmount; @ApiModelProperty("申请期限") - @ExcelProperty(value = "期数",index = 5) + @ExcelProperty(value = "期数", index = 5) private String applyTime; @ApiModelProperty("申请日期") - @ExcelProperty(value = "申请日期",index = 6) + @ExcelProperty(value = "申请日期", index = 6) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date createTime; @ApiModelProperty("完成任务节点id") - @ExcelProperty(value = "完成任务节点id",index = 8) + @ExcelProperty(value = "完成任务节点id", index = 8) private Integer processId; @ApiModelProperty("最新操作时间") - @ExcelProperty(value = "任务分配时间",index = 9) + @ExcelProperty(value = "任务分配时间", index = 9) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date operationTime; @ApiModelProperty("提单人姓名") - @ExcelProperty(value = "提单人",index = 10) + @ExcelProperty(value = "提单人", index = 10) private String employeeName; @ApiModelProperty("部门") - @ExcelProperty(value = "所属部门",index = 11) + @ExcelProperty(value = "所属部门", index = 11) private List department; } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgWorkConferenceResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgWorkConferenceResponse.java index abd22e1c..f1716f7c 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgWorkConferenceResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/DgWorkConferenceResponse.java @@ -12,6 +12,7 @@ import lombok.Data; import lombok.ToString; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -46,7 +47,7 @@ public class DgWorkConferenceResponse extends BaseRowModel implements Serializab @ExcelProperty(value = "金额", index = 4) @ApiModelProperty("金额") - private Double applyAmount; + private BigDecimal applyAmount; @ExcelProperty(value = "期限", index = 5) @ApiModelProperty("期限") diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlCollectionService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlCollectionService.java index c4e64280..e1d72974 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlCollectionService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlCollectionService.java @@ -9,6 +9,10 @@ import com.daqing.financial.guarantee.model.response.OverdueDetailResponse; import com.daqing.framework.domain.guarantee.AlCollection; import com.daqing.framework.utils.PageUtils; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + /** *

* 保后催收 服务类 @@ -28,4 +32,8 @@ public interface IAlCollectionService extends IService { PageUtils collectionList(AlCollectionListRequest alCollectionListRequest); MoreOverdueDetailResponse moreOverdueDetail(Integer id); + + void listExportExcel(List insuranceIds, HttpServletResponse response) throws IOException; + + void collectionListExportExcel(List ids, HttpServletResponse response) throws IOException; } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java index 30a7707e..3fea0d0b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java @@ -1,12 +1,18 @@ package com.daqing.financial.guarantee.service.impl; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.daqing.financial.guarantee.feign.HrmsFeignService; import com.daqing.financial.guarantee.mapper.AlCollectionMapper; import com.daqing.financial.guarantee.mapper.AlRepaymentEntryMapper; import com.daqing.financial.guarantee.model.request.AlCollectionListRequest; import com.daqing.financial.guarantee.model.request.AlCollectionRequest; +import com.daqing.financial.guarantee.model.response.AlCollectionListResponse; import com.daqing.financial.guarantee.model.response.AlCollectionResponse; import com.daqing.financial.guarantee.model.response.MoreOverdueDetailResponse; import com.daqing.financial.guarantee.model.response.OverdueDetailResponse; @@ -14,11 +20,15 @@ import com.daqing.financial.guarantee.service.IAlCollectionService; import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.AlCollection; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; +import com.daqing.framework.domain.guarantee.po.AlCollectionListPO; import com.daqing.framework.domain.guarantee.po.AlCollectionPO; +import com.daqing.framework.domain.hrms.ext.EmployeeVO; import com.daqing.framework.exception.ExceptionCast; import com.daqing.framework.model.response.CommonCode; +import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; +import com.daqing.framework.utils.excel.ExcelUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -26,11 +36,11 @@ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.net.URLEncoder; +import java.util.*; /** *

@@ -46,6 +56,9 @@ public class AlCollectionServiceImpl extends ServiceImpl alCollectionList= this.getBaseMapper().list(new Page(page, size), codeOrName, status); + IPage alCollectionList = this.getBaseMapper().list(new Page(page, size), codeOrName, status); // 复制分页信息 IPage response = new Page<>(); BeanUtils.copyProperties(alCollectionList, response); @@ -73,9 +86,9 @@ public class AlCollectionServiceImpl extends ServiceImpl iPage = alRepaymentEntryMapper.pageByCondition(new Page(), null, null, insuranceId); + overdueDetailResponse.setAlRepaymentEntryList(iPage.getRecords()); return overdueDetailResponse; } @@ -140,7 +156,37 @@ public class AlCollectionServiceImpl extends ServiceImpl alCollectionListPO = this.getBaseMapper().collectionList(new Page(alCollectionListRequest.getPage(), alCollectionListRequest.getSize()), + alCollectionListRequest); + // 创建返回分页类 + Page iPage = new Page<>(); + // 获取所有的用户id并远程转换成名称 + if (alCollectionListPO.getRecords() != null && alCollectionListPO.getRecords().size() != 0) { + Integer[] userIds = new Integer[alCollectionListPO.getRecords().size()]; + for (int i = 0; i < userIds.length; i++) { + userIds[i] = alCollectionListPO.getRecords().get(i).getCollectionUser(); + } + ResponseResult> result = hrmsFeignService.listEmpNameByUserId(userIds); + // 复制分页信息、拼装信息并返回 + BeanUtils.copyProperties(alCollectionListPO, iPage); + if (result.getData() != null && result.getData().size() != 0) { + List response = this.jointName(alCollectionListPO.getRecords(), result.getData()); + iPage.setRecords(response); + } + } + return new PageUtils(iPage); } /** @@ -163,18 +209,126 @@ public class AlCollectionServiceImpl extends ServiceImpl insuranceIds, HttpServletResponse response) throws IOException { + IPage alCollectionList = this.getBaseMapper().list(new Page(), null, null); + // 返回数据集合 + List alCollectionResponsesList = new ArrayList<>(); + // 还款记录信息 + List alRepaymentList = alRepaymentEntryMapper.listAlRepayment(); + // 拼装信息 + List records = alCollectionList.getRecords(); + for (AlCollectionPO record : records) { + AlCollectionResponse alCollectionResponse = new AlCollectionResponse(); + // 逾期次数 + Integer overduePeriods = 0; + // 逾期额度 + BigDecimal overdueAmount = new BigDecimal(0.00); + // 逾期利息 + BigDecimal overdueInterest = new BigDecimal(0.00); + for (AlRepaymentEntry repayment : alRepaymentList) { + if (record.getId().equals(repayment.getInsuranceId())) { + overdueAmount = overdueAmount.add(repayment.getCurrentRepayment()); + overdueInterest = overdueInterest.add(repayment.getInterest()); + overduePeriods++; + } + } + BeanUtils.copyProperties(record, alCollectionResponse); + alCollectionResponse.setOverdueAmount(overdueAmount); + alCollectionResponse.setOverdueInterest(overdueInterest); + alCollectionResponse.setOverduePeriods(overduePeriods); + alCollectionResponsesList.add(alCollectionResponse); + Iterator iterator = alCollectionResponsesList.iterator(); + // 迭代器遍历,删除不需要的数据 + while (iterator.hasNext()) { + boolean flag = false; + // Iterator类的next( )方法在同一循环中不能出现两次,会导致最后一次的游标指向空值 + AlCollectionResponse next = iterator.next(); + for (Integer insuranceId : insuranceIds) { + if (null != next.getId() && next.getId().equals(insuranceId)) { + flag = true; + } + } + if (!flag) { + iterator.remove(); + } + } + } + ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build(); + try { + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyExcel没有关系 + String fileName = URLEncoder.encode("催收管理列表数据一览表", "UTF-8").replaceAll("\\+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + WriteSheet writeSheet = EasyExcel.writerSheet(0, "template").head(AlCollectionResponse.class).build(); + excelWriter.write(alCollectionResponsesList, writeSheet); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + /** + * 催收列表导出 + * + * @param ids 催收id集合 + */ + @Override + public void collectionListExportExcel(List ids, HttpServletResponse response) throws IOException { + // 导出的数据集合 + List list = new ArrayList<>(); + // 根据id查询出数据 + List alCollectionListPOS = this.getBaseMapper().collectionListExcel(ids); + if (alCollectionListPOS != null && alCollectionListPOS.size() != 0) { + Integer[] userIds = new Integer[alCollectionListPOS.size()]; + for (int i = 0; i < userIds.length; i++) { + userIds[i] = alCollectionListPOS.get(i).getCollectionUser(); + } + // 根据用户id查询用户姓名 + ResponseResult> result = hrmsFeignService.listEmpNameByUserId(userIds); + if (result.getData() != null && result.getData().size() != 0) { + // 转换用户id为姓名 + list = this.jointName(alCollectionListPOS, result.getData()); + } + } + ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build(); + try { + // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + // 这里URLEncoder.encode可以防止中文乱码 当然和easyExcel没有关系 + String fileName = URLEncoder.encode("催收列表数据一览表", "UTF-8").replaceAll("\\+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + WriteSheet writeSheet = EasyExcel.writerSheet(0, "template").head(AlCollectionListResponse.class).build(); + excelWriter.write(list, writeSheet); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + private Map getOverdueConditionByInsuranceId(Integer insuranceId) { List alRepaymentList = alRepaymentEntryMapper.listAlRepaymentByInsuranceId(insuranceId); // 逾期金额 - BigDecimal overdueAmount = new BigDecimal("0.00"); + BigDecimal overdueAmount = new BigDecimal(0.00); // 逾期利息 - BigDecimal overdueInterest = new BigDecimal("0.00"); + BigDecimal overdueInterest = new BigDecimal(0.00); // 其他费用 - BigDecimal otherExpenses = new BigDecimal("0.00"); + BigDecimal otherExpenses = new BigDecimal(0.00); for (AlRepaymentEntry alRepayment : alRepaymentList) { overdueAmount = overdueAmount.add(alRepayment.getCurrentRepayment()); overdueInterest = overdueInterest.add(alRepayment.getInterest()); @@ -200,4 +354,22 @@ public class AlCollectionServiceImpl extends ServiceImpl jointName(List alCollectionListPO, List employeeVO) { + List response = new ArrayList<>(); + for (AlCollectionListPO collectionListPO : alCollectionListPO) { + AlCollectionListResponse alCollectionListResponse = new AlCollectionListResponse(); + for (EmployeeVO employee : employeeVO) { + if (Objects.equals(collectionListPO.getCollectionUser().longValue(), employee.getId())) { + alCollectionListResponse.setCollectionUserName(employee.getName()); + } + } + BeanUtils.copyProperties(collectionListPO, alCollectionListResponse); + response.add(alCollectionListResponse); + } + return response; + } } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java index bf23cdb3..e1bd800f 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java @@ -151,7 +151,7 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl().eq("business_id", businessId)); - Integer loanMoney = loanCommitteeConsider.getLoanMoney(); + BigDecimal loanMoney = loanCommitteeConsider.getLoanMoney(); String loanTern = loanCommitteeConsider.getLoanTern(); //添加数据到保后管理 AlInsuranceList alInsuranceList = new AlInsuranceList(); @@ -161,7 +161,7 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl - AND i.status = #{status} + AND i.payment_status = #{status} AND (i.customer_name like CONCAT('%',#{codeOrName},'%') OR i.business_code like CONCAT('%',#{codeOrName},'%')) @@ -35,10 +33,10 @@ INSERT INTO al_collection (insurance_id,collection_method,collection_time,collection_feedback,enclosure_file ,overdue_amount,overdue_interest,other_expenses,collection_user,overdue_periods) - VALUES (#{collection.insuranceId},#{collection.collectionMethod},#{collection.collectionTime}, - #{collection.collectionFeedback},#{collection.enclosureFile}, - #{collection.overdueAmount},#{collection.overdueInterest},#{collection.otherExpenses}, - #{collection.collectionUser},#{collection.overduePeriods}) + VALUES (#{ac.insuranceId},#{ac.collectionMethod},#{ac.collectionTime}, + #{ac.collectionFeedback},#{ac.enclosureFile}, + #{ac.overdueAmount},#{ac.overdueInterest},#{ac.otherExpenses}, + #{ac.collectionUser},#{ac.overduePeriods}) - SELECT c.id AS id,c.overdue_amount AS overdue_amount,c.overdue_interest AS overdue_interest,c.other_expenses AS other_expenses, - c.collection_method AS collection_method,c.collection_user AS collection_user,c.collection_time AS collection_time, - c.collection_feedback AS collection_feedback,c.enclosure_file AS enclosure_file,i.business_code AS code, - i.customer_name AS name,i.business_type AS type + c.overdue_periods AS overdue_periods,c.collection_method AS collection_method,c.collection_user AS collection_user, + c.collection_time AS collection_time,c.collection_feedback AS collection_feedback,i.business_code AS code, + i.customer_name AS name FROM al_collection AS c INNER JOIN al_insurance_list AS i ON i.id = c.insurance_id + WHERE c.insurance_id = #{acr.insuranceId} + + AND collection_time BETWEEN #{acr.startTime} AND #{acr.endTime} + + + + diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml index 5880c438..5f2cb655 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml @@ -66,14 +66,14 @@