催收模块接口

master
river 4 years ago
parent 08a54f70a3
commit 722f91f2c7
  1. 2
      dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerAppletDao.java
  2. 7
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java
  3. 9
      dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml
  4. 47
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/AlCollectionController.java
  5. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlCollectionMapper.java
  6. 4
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java
  7. 34
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionListRequest.java
  8. 36
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/AlCollectionRequest.java
  9. 55
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlCollectionResponse.java
  10. 64
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/MoreOverdueDetailResponse.java
  11. 50
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/OverdueDetailResponse.java
  12. 14
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IAlCollectionService.java
  13. 171
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlCollectionServiceImpl.java
  14. 52
      dq-financial-guarantee/src/main/resources/mapper/guarantee/AlCollectionMapper.xml
  15. 15
      dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml
  16. 38
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/AlCollection.java
  17. 8
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/AlCollectionPO.java

@ -35,5 +35,7 @@ public interface CustomerAppletDao extends BaseMapper<CustomerEntity> {
List<ApplicationRecordPO> getApplyMount(Integer companyId);
Integer businessUnderwayCount(Integer companyId);
ApplyDetailPO getApplyDetail(Integer id);
}

@ -372,12 +372,19 @@ public class CustomerAppletServiceImpl extends ServiceImpl<CustomerAppletDao, Cu
map.put("company", company);
// 个人类型暂时没有
map.put("personal", 0.00);
// 是否与业务正在申请中
map.put("underway", 0.00);
Integer customerId = this.getBaseMapper().getCustomerId(Integer.parseInt(this.getUserId()), 1);
// 如果查询不到认证信息,直接返回0.00
if (customerId == null) {
map.put("company", company);
} else {
Integer companyId = this.getBaseMapper().getCompanyId(customerId);
// 正在进行贷款数量
Integer count= this.getBaseMapper().businessUnderwayCount(companyId);
if (count > 0) {
map.put("underway", 1.00);
}
// 查询申请记录信息
List<ApplicationRecordPO> applicationRecordPOList = this.getBaseMapper().getApplyMount(companyId);
if (applicationRecordPOList.size() < 1) {

@ -59,6 +59,15 @@
AND b.business_status = 2
</select>
<select id="businessUnderwayCount" parameterType="integer" resultType="integer">
SELECT COUNT(a.id)
FROM dg_apply_amount_info AS a
INNER JOIN dg_business_process_status AS b
ON a.id = b.business_id
WHERE a.company_id = #{companyId}
AND b.business_status = 1
</select>
<!-- 获取申请记录详情 -->
<select id="getApplyDetail" parameterType="integer" resultType="com.daqing.framework.domain.crms.ext.ApplyDetailPO">
SELECT l.status AS audit_status,l.apply_content AS remark,b.business_status AS business_status

@ -1,9 +1,16 @@
package com.daqing.financial.guarantee.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.daqing.financial.guarantee.model.request.AlCollectionRequest;
import com.daqing.financial.guarantee.model.response.AlCollectionResponse;
import com.daqing.financial.guarantee.service.IAlCollectionService;
import com.daqing.framework.domain.guarantee.AlCollection;
import com.daqing.framework.model.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
@ -15,6 +22,40 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/al-collection")
@Api(value = "催收管理", tags = "催收管理")
public class AlCollectionController {
@Autowired
private IAlCollectionService alCollectionService;
/**
* 催收管理列表
*/
@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) {
return ResponseResult.SUCCESS(alCollectionService.list(page, size, codeOrName, status));
}
/**
* 催收
*/
@PostMapping("/collection")
@ApiOperation(value = "催收", notes = "催收")
public ResponseResult collection(@RequestBody AlCollectionRequest alCollectionRequest) {
Boolean result = alCollectionService.collection(alCollectionRequest);
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
/**
* 催收时展示的详情
*/
@GetMapping("/overdue/detail")
@ApiOperation(value = "催收时展示的详情", notes = "催收时展示的详情")
public ResponseResult overdueDetail(@RequestParam("insuranceId") Integer insuranceId) {
return ResponseResult.SUCCESS(alCollectionService.overdueDetail(insuranceId));
}
}

@ -3,11 +3,16 @@ 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.response.MoreOverdueDetailResponse;
import com.daqing.financial.guarantee.model.response.OverdueDetailResponse;
import com.daqing.framework.domain.guarantee.AlCollection;
import com.daqing.framework.domain.guarantee.po.AlCollectionPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
* 保后催收 Mapper 接口
@ -19,5 +24,16 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface AlCollectionMapper extends BaseMapper<AlCollection> {
IPage<AlCollectionPO> list(@Param("page") Page page, @Param("codeOrName") String codeOrName);
IPage<AlCollectionPO> list(@Param("page") Page page, @Param("codeOrName") String codeOrName,
@Param("status") Integer status);
Boolean collection(@Param("collection") AlCollection alCollection);
OverdueDetailResponse getOverdueDetailByInsuranceId(Integer insuranceId);
List<AlCollection> collectionList(String codeOrName);
MoreOverdueDetailResponse moreOverdueDetail(Integer id);
Integer getInsuranceIdById(Integer id);
}

@ -26,6 +26,10 @@ public interface AlRepaymentEntryMapper extends BaseMapper<AlRepaymentEntry> {
List<AlRepaymentRes> selectListByIds(List<String> ids);
List<AlRepaymentEntry> listAlRepayment();
List<AlRepaymentEntry> listAlRepaymentByInsuranceId(Integer id);
List<AlRepaymentCountRes> selectRepaymentList();
List<AlRepaymentEntryRes> selectOverDueDays();

@ -0,0 +1,34 @@
package com.daqing.financial.guarantee.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* 催收列表请求参数
*
* @auther River
* @date 2021/3/23 10:01
*/
@Data
@ToString
public class AlCollectionListRequest implements Serializable {
@ApiModelProperty("page")
private Integer page;
@ApiModelProperty("size")
private Integer size;
@ApiModelProperty("开始时间")
private Date startTime;
@ApiModelProperty("结束时间")
private Date endTime;
@ApiModelProperty("保后id")
private Integer insuranceId;
}

@ -0,0 +1,36 @@
package com.daqing.financial.guarantee.model.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* 催收请求参数
*
* @auther River
* @date 2021/3/22 16:29
*/
@Data
@ToString
public class AlCollectionRequest implements Serializable {
@ApiModelProperty("保后id")
private Integer insuranceId;
@ApiModelProperty("催收方式:1->电话催收;2->上门/外访")
private Integer collectionMethod;
@ApiModelProperty("催收时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date collectionTime;
@ApiModelProperty("催收反馈")
private String collectionFeedback;
@ApiModelProperty("附件")
private String enclosureFile;
}

@ -0,0 +1,55 @@
package com.daqing.financial.guarantee.model.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 催收管理列表返回类
*
* @auther River
* @date 2021/3/19 16:14
*/
@Data
@ToString
public class AlCollectionResponse implements Serializable {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("客户编号")
private String code;
@ApiModelProperty("客户名称")
private String name;
@ApiModelProperty("联系电话")
private String phone;
@ApiModelProperty("业务类别")
private String type;
@ApiModelProperty("担保额度")
private BigDecimal amount;
@ApiModelProperty("逾期期数")
private Integer overduePeriods;
@ApiModelProperty("逾期额度")
private BigDecimal overdueAmount;
@ApiModelProperty("逾期利息")
private BigDecimal overdueInterest;
@ApiModelProperty("所属部门")
private String department;
@ApiModelProperty("催收次数")
private Integer numberOfCollection;
@ApiModelProperty("状态,1->还款中;2->已逾期;3->已还清;4->已结项")
private Integer status;
}

@ -0,0 +1,64 @@
package com.daqing.financial.guarantee.model.response;
import com.daqing.framework.domain.guarantee.AlRepaymentEntry;
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;
import java.util.List;
/**
* 查看时的催收详情
*
* @auther River
* @date 2021/3/22 17:00
*/
@Data
@ToString
public class MoreOverdueDetailResponse implements Serializable {
@ApiModelProperty("客户名称")
private String name;
@ApiModelProperty("业务类别")
private String type;
@ApiModelProperty("客户编号")
private String code;
@ApiModelProperty("逾期期数")
private Integer overduePeriods;
@ApiModelProperty("逾期金额")
private BigDecimal overdueAmount;
@ApiModelProperty("逾期利息")
private BigDecimal overdueInterest;
@ApiModelProperty("逾期费用")
private BigDecimal otherExpenses;
@ApiModelProperty("催收次数")
private Integer numberOfCollection;
@ApiModelProperty("还款记录")
private List<AlRepaymentEntry> alRepaymentEntryList;
@ApiModelProperty("催收方式")
private Integer collectionMethod;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("催收时间")
private Date collectionTime;
@ApiModelProperty("催收反馈")
private String collectionFeedback;
@ApiModelProperty("附件")
private String enclosureFile;
}

@ -0,0 +1,50 @@
package com.daqing.financial.guarantee.model.response;
import com.daqing.framework.domain.guarantee.AlRepaymentEntry;
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;
import java.util.List;
/**
* 催收详情返回类
*
* @auther River
* @date 2021/3/22 14:59
*/
@Data
@ToString
public class OverdueDetailResponse implements Serializable {
@ApiModelProperty("客户名称")
private String name;
@ApiModelProperty("业务类别")
private String type;
@ApiModelProperty("客户编号")
private String code;
@ApiModelProperty("逾期期数")
private Integer overduePeriods;
@ApiModelProperty("逾期金额")
private BigDecimal overdueAmount;
@ApiModelProperty("逾期利息")
private BigDecimal overdueInterest;
@ApiModelProperty("逾期费用")
private BigDecimal otherExpenses;
@ApiModelProperty("催收次数")
private Integer numberOfCollection;
@ApiModelProperty("还款记录")
private List<AlRepaymentEntry> alRepaymentEntryList;
}

@ -2,6 +2,10 @@ package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.AlCollectionListRequest;
import com.daqing.financial.guarantee.model.request.AlCollectionRequest;
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.utils.PageUtils;
@ -15,5 +19,13 @@ import com.daqing.framework.utils.PageUtils;
*/
public interface IAlCollectionService extends IService<AlCollection> {
PageUtils list(Integer page, Integer size, String codeOrName);
PageUtils list(Integer page, Integer size, String codeOrName, Integer status);
Boolean collection(AlCollectionRequest alCollectionRequest);
OverdueDetailResponse overdueDetail(Integer insuranceId);
PageUtils collectionList(AlCollectionListRequest alCollectionListRequest);
MoreOverdueDetailResponse moreOverdueDetail(Integer id);
}

@ -1,11 +1,36 @@
package com.daqing.financial.guarantee.service.impl;
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.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.AlCollectionResponse;
import com.daqing.financial.guarantee.model.response.MoreOverdueDetailResponse;
import com.daqing.financial.guarantee.model.response.OverdueDetailResponse;
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.AlCollectionPO;
import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.response.CommonCode;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.utils.PageUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -18,17 +43,161 @@ import org.springframework.stereotype.Service;
@Service
public class AlCollectionServiceImpl extends ServiceImpl<AlCollectionMapper, AlCollection> implements IAlCollectionService {
@Autowired
private AlRepaymentEntryMapper alRepaymentEntryMapper;
/**
* 催收管理列表
*
* @param codeOrName 客户编号或者名称
*/
@Override
public PageUtils list(Integer page, Integer size, String codeOrName) {
public PageUtils list(Integer page, Integer size, String codeOrName, Integer status) {
if (page == null || size == null) {
page = 1;
size = 10;
}
// 曾经逾期过的记录
IPage<AlCollectionPO> alCollectionList= this.getBaseMapper().list(new Page(page, size), codeOrName, status);
// 复制分页信息
IPage<AlCollectionResponse> response = new Page<>();
BeanUtils.copyProperties(alCollectionList, response);
// 返回数据集合
List<AlCollectionResponse> alCollectionResponsesList = new ArrayList<>();
// 还款记录信息
List<AlRepaymentEntry> alRepaymentList = alRepaymentEntryMapper.listAlRepayment();
// 拼装信息
List<AlCollectionPO> 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);
}
response.setRecords(alCollectionResponsesList);
return new PageUtils(response);
}
/**
* 催收
*/
@Override
public Boolean collection(AlCollectionRequest alCollectionRequest) {
if (alCollectionRequest.getInsuranceId() == null) {
ExceptionCast.cast(CommonCode.INVALID_PARAM);
}
AlCollection alCollection = new AlCollection();
BeanUtils.copyProperties(alCollectionRequest, alCollection);
// 当前记录逾期额度、逾期利息、其他费用、逾期次数
Map<String, Object> map = this.getOverdueConditionByInsuranceId(alCollectionRequest.getInsuranceId());
alCollection.setOverdueAmount((BigDecimal) map.get("overdueAmount"));
alCollection.setOverdueInterest((BigDecimal) map.get("overdueInterest"));
alCollection.setOtherExpenses((BigDecimal) map.get("otherExpenses"));
alCollection.setOverduePeriods((Integer) map.get("overduePeriods"));
// 当前催收用户
alCollection.setCollectionUser(Integer.parseInt(this.getUserId()));
return this.getBaseMapper().collection(alCollection);
}
/**
* 催收详情
* @param insuranceId 保后id
*/
@Override
public OverdueDetailResponse overdueDetail(Integer insuranceId) {
if (insuranceId == null) {
ExceptionCast.cast(CommonCode.INVALID_PARAM);
}
OverdueDetailResponse overdueDetailResponse = this.getBaseMapper().getOverdueDetailByInsuranceId(insuranceId);
// 逾期金额、逾期利息、其他费用、逾期次数
Map<String, Object> map = this.getOverdueConditionByInsuranceId(insuranceId);
overdueDetailResponse.setOverdueAmount((BigDecimal) map.get("overdueAmount"));
overdueDetailResponse.setOverdueInterest((BigDecimal) map.get("overdueInterest"));
overdueDetailResponse.setOtherExpenses((BigDecimal) map.get("otherExpenses"));
overdueDetailResponse.setOverduePeriods((Integer) map.get("overduePeriods"));
// 还款记录
return overdueDetailResponse;
}
/**
* 催收列表
*/
@Override
public PageUtils collectionList(AlCollectionListRequest alCollectionListRequest) {
return null;
}
/**
* 查看时的催收详情
*/
@Override
public MoreOverdueDetailResponse moreOverdueDetail(Integer id) {
if (id == null) {
ExceptionCast.cast(CommonCode.INVALID_PARAM);
}
// 催收时间、类型、反馈、附件等
MoreOverdueDetailResponse moreOverdueDetailResponse = this.getBaseMapper().moreOverdueDetail(id);
OverdueDetailResponse overdueDetailResponse = overdueDetail(this.getBaseMapper().getInsuranceIdById(id));
// 客户编号、姓名、类型、逾期、还款记录等
moreOverdueDetailResponse.setCode(overdueDetailResponse.getCode());
moreOverdueDetailResponse.setName(overdueDetailResponse.getName());
moreOverdueDetailResponse.setType(overdueDetailResponse.getType());
moreOverdueDetailResponse.setOverdueAmount(overdueDetailResponse.getOverdueAmount());
moreOverdueDetailResponse.setOverdueInterest(overdueDetailResponse.getOverdueInterest());
moreOverdueDetailResponse.setOtherExpenses(overdueDetailResponse.getOtherExpenses());
moreOverdueDetailResponse.setOverduePeriods(overdueDetailResponse.getOverduePeriods());
moreOverdueDetailResponse.setNumberOfCollection(overdueDetailResponse.getNumberOfCollection());
return moreOverdueDetailResponse;
}
private Map<String, Object> getOverdueConditionByInsuranceId(Integer insuranceId) {
List<AlRepaymentEntry> alRepaymentList = alRepaymentEntryMapper.listAlRepaymentByInsuranceId(insuranceId);
// 逾期金额
BigDecimal overdueAmount = new BigDecimal("0.00");
// 逾期利息
BigDecimal overdueInterest = new BigDecimal("0.00");
// 其他费用
BigDecimal otherExpenses = new BigDecimal("0.00");
for (AlRepaymentEntry alRepayment : alRepaymentList) {
overdueAmount = overdueAmount.add(alRepayment.getCurrentRepayment());
overdueInterest = overdueInterest.add(alRepayment.getInterest());
otherExpenses = otherExpenses.add(alRepayment.getOtherExpenses());
}
Map<String, Object> map = new HashMap<>();
map.put("overduePeriods", alRepaymentList.size());
map.put("overdueAmount", overdueAmount);
map.put("overdueInterest", overdueInterest);
map.put("otherExpenses", otherExpenses);
return map;
}
/**
* 获取当前登录用户信息
*/
private String getUserId() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
String userId = RedisUtil.get("dq:token:" + token);
if (userId == null || userId.length() == 0) {
ExceptionCast.cast(CommonCode.GET_LOGIN_USER_FAIL);
}
return userId;
}
}

@ -12,14 +12,62 @@
<result column="enclosure_file" property="enclosureFile" />
</resultMap>
<!-- 催收管理列表 -->
<select id="list" resultType="com.daqing.framework.domain.guarantee.po.AlCollectionPO">
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
<if test="status != null">
AND i.status = #{status}
</if>
<if test="codeOrName != null and codeOrName != ''">
AND (i.customer_name like CONCAT('%',#{codeOrName},'%') OR i.business_code like CONCAT('%',#{codeOrName},'%'))
</if>
GROUP BY i.id
</select>
<!-- 催收 -->
<insert id="collection" parameterType="com.daqing.framework.domain.guarantee.AlCollection">
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})
</insert>
<select id="getOverdueDetailByInsuranceId" parameterType="integer" resultType="com.daqing.financial.guarantee.model.response.OverdueDetailResponse">
SELECT i.business_code AS code,i.customer_name AS name,i.business_type AS type,COUNT(c.id) AS numberOfCollection
FROM al_insurance_list AS i
INNER JOIN al_collection AS c
ON i.id = c.insurance_id
WHERE i.id = #{insuranceId}
</select>
<!-- 催收列表 -->
<select id="collectionList" parameterType="string" resultType="com.daqing.framework.domain.guarantee.AlCollection">
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
FROM al_collection AS c
INNER JOIN al_insurance_list AS i
ON i.id = c.insurance_id
</select>
<select id="moreOverdueDetail" parameterType="integer" resultType="com.daqing.financial.guarantee.model.response.MoreOverdueDetailResponse">
SELECT collection_method,collection_time,collection_feedback,enclosure_file
FROM al_collection
WHERE id = #{id}
</select>
<select id="getInsuranceIdById" parameterType="integer" resultType="integer">
SELECT insurance_id FROM al_collection WHERE id = #{id}
</select>
</mapper>

@ -61,4 +61,19 @@
left join al_insurance_list il on re.insurance_id=il.id
</select>
<!-- 还款记录已逾期信息 -->
<select id="listAlRepayment" resultType="com.daqing.framework.domain.guarantee.AlRepaymentEntry">
SELECT insuranceId,currentRepayment,interest
FROM al_repayment_entry
WHERE repayment_status = 3
</select>
<!-- 还款记录已逾期信息 -->
<select id="listAlRepaymentByInsuranceId" parameterType="integer" resultType="com.daqing.framework.domain.guarantee.AlRepaymentEntry">
SELECT insuranceId,currentRepayment,interest,other_expenses
FROM al_repayment_entry
WHERE repayment_status = 3
AND insurance_id = #{insuranceId}
</select>
</mapper>

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

@ -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;
/**
* 状态
*/

Loading…
Cancel
Save