Browse Source

导出程序调整

dev
sunyuchao 3 years ago
parent
commit
fcefb9e355
  1. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java
  2. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java
  3. 43
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPsTripReportRecordExportExcel.java
  4. 123
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExportExcel.java

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java

@ -156,7 +156,7 @@ public class IcTripReportRecordDTO implements Serializable {
@ColumnWidth(25) @ColumnWidth(25)
@ExcelProperty(value = "来到本地时间",order = 8) @ExcelProperty(value = "来到本地时间",order = 8)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date arriveDate; private String arriveDate;
/** /**
* 离开日期 * 离开日期
@ -164,7 +164,7 @@ public class IcTripReportRecordDTO implements Serializable {
@ColumnWidth(25) @ColumnWidth(25)
@ExcelProperty(value = "离开本地时间",order = 13) @ExcelProperty(value = "离开本地时间",order = 13)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date leaveDate; private String leaveDate;
/** /**
* pc行程上报-列表返参最近一次通知时间 * pc行程上报-列表返参最近一次通知时间
@ -332,7 +332,7 @@ public class IcTripReportRecordDTO implements Serializable {
* 上报时间磐石 * 上报时间磐石
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date reportingTime; private String reportingTime;
/** /**
* 管控措施磐石 * 管控措施磐石
*/ */

9
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcTripReportRecordController.java

@ -28,6 +28,7 @@ import com.epmet.dto.result.EmphasisTripListResultDTO;
import com.epmet.dto.result.EmphasisTripPieDetailResultDTO; import com.epmet.dto.result.EmphasisTripPieDetailResultDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.excel.IcPsTripReportRecordExportExcel; import com.epmet.excel.IcPsTripReportRecordExportExcel;
import com.epmet.excel.IcTripReportRecordExportExcel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.IcTripReportRecordService; import com.epmet.service.IcTripReportRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -230,13 +231,15 @@ public class IcTripReportRecordController implements ResultDataResolver {
// 这里 需要指定写用哪个class去写 // 这里 需要指定写用哪个class去写
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = "行程上报信息".concat(today); String fileName = "行程上报信息".concat(today);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordDTO.class).build(); excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordExportExcel.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<IcTripReportRecordDTO> data = null; PageData<IcTripReportRecordDTO> data = null;
List<IcTripReportRecordExportExcel> list = null;
do { do {
data = icTripReportRecordService.page(formDTO); data = icTripReportRecordService.page(formDTO);
list = ConvertUtils.sourceToTarget(data.getList(), IcTripReportRecordExportExcel.class);
formDTO.setPageNo(++pageNo); formDTO.setPageNo(++pageNo);
excelWriter.write(data.getList(), writeSheet); excelWriter.write(list, writeSheet);
} while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); } while (CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize());
} catch (Exception e) { } catch (Exception e) {
@ -409,7 +412,7 @@ public class IcTripReportRecordController implements ResultDataResolver {
// 这里 需要指定写用哪个class去写 // 这里 需要指定写用哪个class去写
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD); String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
String fileName = "行程上报信息".concat(today); String fileName = "行程上报信息".concat(today);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcTripReportRecordDTO.class).build(); excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcPsTripReportRecordExportExcel.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build();
PageData<IcTripReportRecordDTO> data = null; PageData<IcTripReportRecordDTO> data = null;
List<IcPsTripReportRecordExportExcel> list = null; List<IcPsTripReportRecordExportExcel> list = null;

43
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcPsTripReportRecordExportExcel.java

@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum; import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@ -41,107 +42,107 @@ public class IcPsTripReportRecordExportExcel implements Serializable {
/** /**
* 户籍地 磐石 * 户籍地 磐石
*/ */
@ColumnWidth(40) @ColumnWidth(30)
@ExcelProperty(value = "户籍地(省市县区)",order = 4) @ExcelProperty(value = "户籍地(省市县区)",order = 4)
private String registeredResidence; private String registeredResidence;
/** /**
* 手机号 * 手机号
*/ */
@ColumnWidth(25) @ColumnWidth(15)
@ExcelProperty(value = "手机号",order = 5) @ExcelProperty(value = "手机号",order = 5)
private String mobile; private String mobile;
/** /**
* 来自地区格式---街道-社区 * 来自地区格式---街道-社区
*/ */
@ColumnWidth(40) @ColumnWidth(30)
@ExcelProperty(value = "来自地区(格式:省-市-区-街道-社区)",order = 6) @ExcelProperty(value = "来自地区(格式:省-市-区-街道-社区)",order = 6)
private String sourceAddress; private String sourceAddress;
/** /**
* 来自地区详细地址 source_address字段的说明 * 来自地区详细地址 source_address字段的说明
*/ */
@ColumnWidth(40) @ColumnWidth(30)
@ExcelProperty(value = "来自地区详细地址",order = 7) @ExcelProperty(value = "来自地区详细地址",order = 7)
private String sourceDetailAddress; private String sourceDetailAddress;
/** /**
* 来曹事由100字以内磐石 * 来曹事由100字以内磐石
*/ */
@ColumnWidth(40) @ColumnWidth(25)
@ExcelProperty(value = "来曹事由(100字以内)",order = 8) @ExcelProperty(value = "来曹事由(100字以内)",order = 8)
private String describe; private String describeContent;
/** /**
* 48小时核酸检测 0:阴性 1:阳性 -中国字 * 48小时核酸检测 0:阴性 1:阳性 -中国字
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "48小时核酸检测",order = 9) @ExcelProperty(value = "48小时核酸检测",order = 9)
private String isNatRecordName; private String isNatRecordName;
/** /**
* 来到本地时间2022-01-01 * 来到本地时间2022-01-01
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "来到本地时间(2022-01-01)",order = 10) @ExcelProperty(value = "来到本地时间(2022-01-01)",order = 10)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date arriveDate; private String arriveDate;
/** /**
* 现居地 * 现居地
*/ */
@ColumnWidth(40) @ColumnWidth(30)
@ExcelProperty(value = "现居地",order = 11) @ExcelProperty(value = "现居地",order = 11)
private String presentAddress; private String presentAddress;
/** /**
* 现居地详细地址 * 现居地详细地址
*/ */
@ColumnWidth(40) @ColumnWidth(30)
@ExcelProperty(value = "现居地详细地址",order = 12) @ExcelProperty(value = "现居地详细地址",order = 12)
private String detailAddress; private String detailAddress;
/** /**
* 交通方式-中国字 * 交通方式-中国字
*/ */
@ColumnWidth(30) @ColumnWidth(15)
@ExcelProperty(value = "返回方式",order = 13) @ExcelProperty(value = "返回方式",order = 13)
private String trafficTypeName; private String trafficTypeName;
/** /**
* 其他返回方式交通方式为其他时此列需要有值 * 其他返回方式交通方式为其他时此列需要有值
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "其他返回方式",order = 14) @ExcelProperty(value = "其他返回方式",order = 14)
private String trafficTypeExplain; private String trafficTypeExplain;
/** /**
* 7天内旅居史情况字典表(sojourn_history)磐石-中国字 * 7天内旅居史情况字典表(sojourn_history)磐石-中国字
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "7天内旅居史情况",order = 15) @ExcelProperty(value = "7天内旅居史情况",order = 15)
private String sojournHistoryName; private String sojournHistoryName;
/** /**
* 隔离状态字典表(isolate_type)磐石-中国字 * 隔离状态字典表(isolate_type)磐石-中国字
*/ */
@ColumnWidth(30) @ColumnWidth(15)
@ExcelProperty(value = "隔离状态",order = 16) @ExcelProperty(value = "隔离状态",order = 16)
private String isolateTypeName; private String isolateTypeName;
/** /**
* 备注500字以内 * 备注500字以内
*/ */
@ColumnWidth(50) @ColumnWidth(35)
@ExcelProperty(value = "备注(500字以内)",order = 17) @ExcelProperty(value = "备注(500字以内)",order = 17)
private String remark; private String remark;
/** /**
* 是否落实"落地检" 0: 1:磐石-中国字 * 是否落实"落地检" 0: 1:磐石-中国字
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "是否落实“落地检”",order = 18) @ExcelProperty(value = "是否落实“落地检”",order = 18)
private String isArriveCheckName; private String isArriveCheckName;
/** /**
* 是否达到曹县 0: 1:磐石-中国字 * 是否达到曹县 0: 1:磐石-中国字
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "是否达到曹县",order = 19) @ExcelProperty(value = "是否达到曹县",order = 19)
private String isArriveName; private String isArriveName;
/** /**
* 上报时间2022-01-01磐石 * 上报时间2022-01-01磐石
*/ */
@ColumnWidth(30) @ColumnWidth(20)
@ExcelProperty(value = "上报时间(2022-01-01)",order = 20) @ExcelProperty(value = "上报时间(2022-01-01)",order = 20)
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date reportingTime; private String reportingTime;
/** /**
* 管控措施500字以内磐石 * 管控措施500字以内磐石
*/ */
@ -151,7 +152,7 @@ public class IcPsTripReportRecordExportExcel implements Serializable {
/** /**
* 类型省内省外市内县内字典表(trip_data_type)磐石-中国字 * 类型省内省外市内县内字典表(trip_data_type)磐石-中国字
*/ */
@ColumnWidth(35) @ColumnWidth(25)
@ExcelProperty(value = "类型(省内、省外、市内、县内)",order = 22) @ExcelProperty(value = "类型(省内、省外、市内、县内)",order = 22)
private String tripDataTypeName; private String tripDataTypeName;
} }

123
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcTripReportRecordExportExcel.java

@ -0,0 +1,123 @@
package com.epmet.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 行程上报信息
*
*/
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44)
@Data
public class IcTripReportRecordExportExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 姓名
*/
@ColumnWidth(15)
@ExcelProperty(value = "姓名", order = 1)
private String name;
/**
* 证件号
*/
@ColumnWidth(20)
@ExcelProperty(value = "证件号",order = 2)
private String idCard;
/**
* 手机号
*/
@ColumnWidth(15)
@ExcelProperty(value = "手机号",order = 3)
private String mobile;
/**
* 现居地名称eg:山东省青岛市黄岛区玫瑰山路社区
*/
@ColumnWidth(30)
@ExcelProperty(value = "现居地",order = 4)
private String presentAddress;
/**
* 详细地址
*/
@ColumnWidth(30)
@ExcelProperty(value = "现居地详细地址",order = 5)
private String detailAddress;
/**
* 来源地区地址
*/
@ColumnWidth(30)
@ExcelProperty(value = "来自地区",order = 6)
private String sourceAddress;
/**
* 来自地区详细地址 source_address字段的说明
*/
@ColumnWidth(30)
@ExcelProperty(value = "来自地区详细地址",order = 7)
private String sourceDetailAddress;
/**
* 到达日期
*/
@ColumnWidth(20)
@ExcelProperty(value = "来到本地时间",order = 8)
@JsonFormat(pattern = "yyyy-MM-dd")
private String arriveDate;
/**
* 交通方式-中国字
*/
@ColumnWidth(15)
@ExcelProperty(value = "返回方式",order = 9)
private String trafficTypeName;
/**
* 其他返回方式交通方式为其他时此列需要有值
*/
@ColumnWidth(20)
@ExcelProperty(value = "其他返回方式",order = 10)
private String trafficTypeExplain;
/**
* 是否有48小时核算记录 0: 1: 小寨子-中国字
*/
@ColumnWidth(20)
@ExcelProperty(value = "48小时核酸检测",order = 11)
private String isNatRecordName;
/**
* 疫苗接种针次 -中国字(0针 1针 2针 3针)
*/
@ColumnWidth(20)
@ExcelProperty(value = "疫苗接种针次",order = 12)
private String vaccineNumName;
/**
* 离开日期
*/
@ColumnWidth(20)
@ExcelProperty(value = "离开本地时间",order = 13)
@JsonFormat(pattern = "yyyy-MM-dd")
private String leaveDate;
/**
* 备注信息
*/
@ColumnWidth(40)
@ExcelProperty(value = "备注",order = 14)
private String remark;
}
Loading…
Cancel
Save