Merge remote-tracking branch 'origin/master'

master
river 4 years ago
commit c0e7a67444
  1. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlInsuranceListMapper.java
  2. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/AlRepaymentEntryMapper.java
  3. 26
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlInsuranceListRes.java
  4. 22
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/AlRepaymentRes.java
  5. 10
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlInsuranceListServiceImpl.java
  6. 10
      dq-financial-guarantee/src/main/resources/mapper/guarantee/AlRepaymentEntryMapper.xml
  7. 76
      dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/InsuranceStatusConverter.java
  8. 76
      dq-framework-utils/src/main/java/com/daqing/framework/utils/excel/RepaymentStatusConverter.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.model.response.AlInsuranceListRes;
import com.daqing.framework.domain.guarantee.AlInsuranceList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -22,5 +23,5 @@ public interface AlInsuranceListMapper extends BaseMapper<AlInsuranceList> {
IPage<AlInsuranceListRes> pageByCondition(Page page, String customerNumberOrName,Integer paymentStatus);
List<AlInsuranceListRes> selectListByIds(List<String> ids);
List<AlInsuranceListRes> selectListByIds(@Param("ids")List<String> ids);
}

@ -9,6 +9,7 @@ import com.daqing.financial.guarantee.model.response.AlRepaymentEntryRes;
import com.daqing.financial.guarantee.model.response.AlRepaymentRes;
import com.daqing.framework.domain.guarantee.AlRepaymentEntry;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -25,7 +26,7 @@ public interface AlRepaymentEntryMapper extends BaseMapper<AlRepaymentEntry> {
IPage<AlRepaymentEntryListRes> pageByCondition(Page page, String customerNumberOrName, Integer status, Integer insuranceId);
List<AlRepaymentRes> selectListByIds(List<String> ids);
List<AlRepaymentRes> selectListByIds(@Param("ids")List<String> ids);
List<AlRepaymentEntry> listAlRepayment();

@ -1,9 +1,12 @@
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.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.daqing.framework.utils.excel.InsuranceStatusConverter;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -30,6 +33,7 @@ public class AlInsuranceListRes extends BaseRowModel implements Serializable {
/**
* 主键id
*/
@ExcelIgnore
@ApiModelProperty(value = "企业id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ -37,85 +41,107 @@ public class AlInsuranceListRes extends BaseRowModel implements Serializable {
/**
* 业务编号
*/
@ExcelProperty(value = "业务编号",index = 0)
@ApiModelProperty(value = "业务编号")
private String businessCode;
/**
* 客户名称
*/
@ExcelProperty(value = "客户名称",index = 1)
@ApiModelProperty(value = "客户名称")
private String customerName;
/**
* 联系电话
*/
@ExcelProperty(value = "联系电话",index = 2)
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 业务类别
*/
@ExcelProperty(value = "业务类型",index = 3)
@ApiModelProperty(value = "业务类别")
private String businessType;
/**
* 担保额度
*/
@ExcelProperty(value = "担保额度(元)",index = 4)
@ApiModelProperty(value = "担保额度(元)")
private BigDecimal guaranteeAmount;
/**
* 担保期限
*/
@ExcelProperty(value = "担保期限",index = 5)
@ApiModelProperty(value = "担保期限")
private String guaranteeTime;
/**
* 申请日期
*/
@ExcelProperty(value = "申请日期",index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty(value = "申请日期")
private Date applyTime;
@ExcelIgnore
@ApiModelProperty(value = "贷款银行(用中划线隔开)")
private String bank;
@ExcelIgnore
@ApiModelProperty(value = "贷款用途")
private String amountWide;
/**
* 还款额度
*/
@ExcelProperty(value = "还款额度(元)",index = 7)
@ApiModelProperty(value = "还款额度(元)")
private BigDecimal repaymentAmount;
/**
* 剩余额度
*/
@ExcelProperty(value = "剩余额度(元)",index = 8)
@ApiModelProperty(value = "剩余额度(元)")
private BigDecimal remainAmount;
/**
* 还款期数
*/
@ExcelProperty(value = "还款期数",index = 9)
@ApiModelProperty(value = "还款期数")
private String repaymentTime;
/**
* 所属部门
*/
@ExcelProperty(value = "所属部门",index = 10)
@ApiModelProperty(value = "所属部门")
private String department;
/**
* 还款状态1->还款中2->已逾期3->已还清4->已结项
*/
@ExcelProperty(value = "还款状态",index = 11,converter = InsuranceStatusConverter.class)
@ApiModelProperty(value = "还款状态:1->还款中;2->已逾期;3->已还清;4->已结项;")
private Integer paymentStatus;
/**
* 创建时间
*/
@ExcelIgnore
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@ExcelIgnore
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}

@ -1,7 +1,10 @@
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.baomidou.mybatisplus.annotation.*;
import com.daqing.framework.utils.excel.RepaymentStatusConverter;
import lombok.Data;
import java.io.Serializable;
@ -25,83 +28,102 @@ public class AlRepaymentRes extends BaseRowModel implements Serializable {
/**
* 主键id
*/
@ExcelIgnore
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 保后外键id
*/
@ExcelIgnore
private Integer insuranceId;
/**
* 应还款日
*/
@ExcelProperty(value = "应还款日",index = 0)
private Date repaymentDate;
/**
* 实际还款日
*/
@ExcelProperty(value = "实际还款日",index = 1)
private Date actualRepaymentDate;
@ExcelProperty(value = "担保额度(元)",index = 2)
private BigDecimal guaranteeAmount;
/**
* 逾期天数
*/
@ExcelProperty(value = "逾期天数",index = 8)
private Integer overdueDays;
/**
* 还款总额
*/
@ExcelProperty(value = "还款总额(元)",index = 6)
private BigDecimal totalRepayment;
/**
* 本次还款
*/
@ExcelProperty(value = "本次还款(元)",index = 3)
private BigDecimal currentRepayment;
/**
* 利息
*/
@ExcelProperty(value = "本次利息(元)",index = 4)
private BigDecimal interest;
/**
* 其他费用
*/
@ExcelProperty(value = "其他费用(元)",index = 5)
private BigDecimal otherExpenses;
/**
* 减免金额
*/
@ExcelProperty(value = "减免金额(元)",index = 7)
private BigDecimal deductionAmount;
/**
* 还款备注
*/
@ExcelProperty(value = "还款备注",index = 12)
private String repaymentNotes;
/**
* 还款状态1->待还款2->已还款3->已逾期4->未到期
*/
@ExcelProperty(value = "状态",index = 9,converter = RepaymentStatusConverter.class)
private Integer repaymentStatus;
/**
* 提交人id
*/
@ExcelIgnore
private Integer submitterId;
/**
* 提交人名称
*/
@ExcelProperty(value = "提交人名称",index = 10)
private String submitterName;
/**
* 创建时间
*/
@ExcelIgnore
@TableField(fill= FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@ExcelProperty(value = "提交时间",index = 11)
@TableField(fill= FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -57,15 +57,19 @@ public class AlInsuranceListServiceImpl extends ServiceImpl<AlInsuranceListMappe
public AlInsuranceListRes insuranceDetail(Integer id) {
AlInsuranceList alInsuranceList = this.baseMapper.selectById(id);
AlInsuranceListRes res = new AlInsuranceListRes();
BeanUtils.copyProperties(alInsuranceList,res);
return res;
if(alInsuranceList!=null){
BeanUtils.copyProperties(alInsuranceList,res);
return res;
}else{
return null;
}
}
@Override
public Boolean excelExport(List<String> ids, HttpServletResponse response) {
List<AlInsuranceListRes>alInsuranceList = this.baseMapper.selectListByIds(ids);
try {
ExcelUtil.writeExcelWithSheets(response, alInsuranceList, "还款记录一览表", "repaymentEntry", new AlInsuranceListRes())
ExcelUtil.writeExcelWithSheets(response, alInsuranceList, "保后管理一览表", "repaymentEntry", new AlInsuranceListRes())
.finish();
return true;
} catch (Exception e) {

@ -27,7 +27,7 @@
re.repayment_status = #{status}
</if>
<if test="customerNumberOrName != null and customerNumberOrName != '' ">
AND re.repayment_date = #{customerNumberOrName}
AND re.repayment_date LIKE CONCAT('%',#{customerNumberOrName},'%')
</if>
<if test="insuranceId != null">
AND re.insurance_id = #{insuranceId}
@ -37,14 +37,16 @@
</select>
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.AlRepaymentRes">
select * from al_repayment_entry
select re.*,il.guarantee_amount as guaranteeAmount
from al_repayment_entry re
left join al_insurance_list il on il.id=re.insurance_id
<where>
id IN
re.id IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
</where>
order by create_time desc
order by re.create_time desc
</select>
<select id="selectRepaymentList" resultType="com.daqing.financial.guarantee.model.response.AlRepaymentCountRes">

@ -0,0 +1,76 @@
package com.daqing.framework.utils.excel;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
/**
* @Author chen
* @DATE 2020/10/19 15:44
* @Version 1.0
* 保后状态转换器
*/
public class InsuranceStatusConverter implements Converter<Integer> {
@Override
public Class supportJavaTypeKey() {
return Integer.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
/**
* 这里读的时候会调用
*
* @param cellData
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration
* NotNull
* @return
*/
@Override
public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return 0;
}
/**
* 这里是写的时候会调用
*
* @param value
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration
* NotNull
* @return
*/
@Override
public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
switch (value){
case 0:
return new CellData("未定义");
case 1:
return new CellData("还款中");
case 2:
return new CellData("已逾期");
case 3:
return new CellData("已还清");
case 4:
return new CellData("已结项");
default:
return new CellData(String.valueOf(value));
}
}
}

@ -0,0 +1,76 @@
package com.daqing.framework.utils.excel;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
/**
* @Author chen
* @DATE 2020/10/19 15:44
* @Version 1.0
* 还款记录状态转换器
*/
public class RepaymentStatusConverter implements Converter<Integer> {
@Override
public Class supportJavaTypeKey() {
return Integer.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
/**
* 这里读的时候会调用
*
* @param cellData
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration
* NotNull
* @return
*/
@Override
public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return 0;
}
/**
* 这里是写的时候会调用
*
* @param value
* NotNull
* @param contentProperty
* Nullable
* @param globalConfiguration
* NotNull
* @return
*/
@Override
public CellData convertToExcelData(Integer value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
switch (value){
case 0:
return new CellData("未定义");
case 1:
return new CellData("待还款");
case 2:
return new CellData("已还款");
case 3:
return new CellData("已逾期");
case 4:
return new CellData("未到期");
default:
return new CellData(String.valueOf(value));
}
}
}
Loading…
Cancel
Save