diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index 14c48ce05e..a995ff482f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -2,13 +2,19 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelPoiUtils; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.form.*; +import com.epmet.excel.NatExportExcel; +import com.epmet.excel.UserResiRegisterVisitExcel; +import com.epmet.excel.VaccinationExportExcel; import com.epmet.service.IcEpidemicSpecialAttentionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -102,7 +108,7 @@ public class IcEpidemicSpecialAttentionController { } /** - * Desc: 【疫苗接种关注名单】导出 + * Desc: 【疫苗接种关注名单,核酸检测关注名单】导出 * @param response * @param formDTO * @param tokenDto @@ -110,10 +116,19 @@ public class IcEpidemicSpecialAttentionController { * @date 2022/3/28 13:57 */ @PostMapping("vaccination-export") - public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + public void vaccinationExport(HttpServletResponse response,@RequestBody VaccinationListFormDTO formDTO, @LoginUser TokenDto tokenDto) throws Exception { ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); + formDTO.setPage(false); + PageData pageData = icEpidemicSpecialAttentionService.vaccinationList(formDTO); + // 关注类型,核酸检测:2,疫苗接种:1 + if (formDTO.getAttentionType().equals(NumConstant.ONE)){ + ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), VaccinationExportExcel.class); + }else { + ExcelUtils.exportExcelToTarget(response, null, pageData.getList(), NatExportExcel.class); + } + } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java new file mode 100644 index 0000000000..cc3d827af0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java @@ -0,0 +1,35 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class NatExportExcel { + + @Excel(name = "排序",width = 10) + private Integer sort; + + @Excel(name = "姓名",width = 20) + private String name; + + @Excel(name = "电话",width = 20) + private String mobile; + + @Excel(name = "身份证",width = 30) + private String idCard; + + @Excel(name = "备注",width = 40) + private String remark; + + @Excel(name = "关注原因",width = 40) + private String reason; + + @Excel(name = "最近一次通知时间",width = 20) + private String lastInformTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java new file mode 100644 index 0000000000..65534756cd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java @@ -0,0 +1,35 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/3/29 10:24 + * @DESC + */ +@Data +public class VaccinationExportExcel { + + @Excel(name = "排序",width = 10) + private Integer sort; + + @Excel(name = "姓名",width = 20) + private String name; + + @Excel(name = "电话",width = 20) + private String mobile; + + @Excel(name = "身份证",width = 30) + private String idCard; + + @Excel(name = "备注",width = 40) + private String remark; + + @Excel(name = "接种针次",width = 10) + private Integer vaccinationCount; + + @Excel(name = "最近一次通知时间",width = 20) + private String lastInformTime; + +}