parent
d101f6ecd3
commit
41335b5423
13 changed files with 275 additions and 5 deletions
@ -0,0 +1,25 @@ |
||||
package com.daqing.financial.guarantee.model.request; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2020/11/12 17:14 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Data |
||||
public class GuaranteeLetterRequest { |
||||
|
||||
@ApiModelProperty(value = "当前页码,默认为第一页") |
||||
private Integer page = 1; |
||||
|
||||
@ApiModelProperty(value = "每页记录数,默认显示10条") |
||||
private Integer size = 10; |
||||
|
||||
@ApiModelProperty(value = "流程状态:1->审核中、2->拒绝、3->已审核") |
||||
private Integer status; |
||||
|
||||
@ApiModelProperty(value = "业务编号/客户名称") |
||||
private String CustomerNumberOrName; |
||||
} |
@ -0,0 +1,56 @@ |
||||
package com.daqing.financial.guarantee.model.response; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.daqing.framework.utils.excel.StatusConverter; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2020/11/12 17:36 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Data |
||||
public class GuaranteeLetterResponse { |
||||
|
||||
@ApiModelProperty("业务编号") |
||||
@ExcelProperty(value = "业务编号",index = 0) |
||||
private String businessCode; |
||||
|
||||
@ApiModelProperty("客户名称") |
||||
@ExcelProperty(value = "客户名称",index = 1) |
||||
private String name; |
||||
|
||||
@ApiModelProperty("联系电话") |
||||
@ExcelProperty(value = "联系电话",index = 2) |
||||
private String phone; |
||||
|
||||
@ApiModelProperty("业务类别") |
||||
@ExcelProperty(value = "业务类别",index = 3) |
||||
private String businessType; |
||||
|
||||
@ApiModelProperty("金额") |
||||
@ExcelProperty(value = "金额",index = 4) |
||||
private Double applyAmount; |
||||
|
||||
@ApiModelProperty("期限") |
||||
@ExcelProperty(value = "期数",index = 5) |
||||
private String applyTime; |
||||
|
||||
@ApiModelProperty("申请日期") |
||||
@ExcelProperty(value = "申请日期",index = 6) |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
private Date createTime; |
||||
|
||||
@ApiModelProperty("当前审批人") |
||||
@ExcelProperty(value = "当前审批人",index = 7) |
||||
private String empName; |
||||
|
||||
@ApiModelProperty("状态") |
||||
@ExcelProperty(value = "状态",index = 8,converter = StatusConverter.class) |
||||
private Integer status; |
||||
|
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.daqing.framework.utils.excel; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.io.IOException; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2020/10/19 14:45 |
||||
* @Version 1.0 |
||||
*/ |
||||
public class EasyExcelUtil { |
||||
public static void download(HttpServletResponse response, Class head, List list, String fileName, String sheetName) throws IOException { |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding("utf-8"); |
||||
response.setHeader("Content-disposition", "attachment;filename="+fileName+""); |
||||
EasyExcel.write(response.getOutputStream(), head).sheet(sheetName).doWrite(list); |
||||
} |
||||
} |
@ -0,0 +1,72 @@ |
||||
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 StatusConverter 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 1: |
||||
return new CellData("审核中"); |
||||
case 2: |
||||
return new CellData("拒绝"); |
||||
case 3: |
||||
return new CellData("已审核"); |
||||
default: |
||||
return new CellData(String.valueOf(value)); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue