zxc 3 years ago
parent
commit
a1409758c8
  1. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java
  2. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/NatExportExcel.java
  3. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/VaccinationExportExcel.java

19
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.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; 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.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; 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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcEpidemicSpecialAttentionDTO; import com.epmet.dto.IcEpidemicSpecialAttentionDTO;
import com.epmet.dto.form.*; 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 com.epmet.service.IcEpidemicSpecialAttentionService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -102,7 +108,7 @@ public class IcEpidemicSpecialAttentionController {
} }
/** /**
* Desc: 疫苗接种关注名单导出 * Desc: 疫苗接种关注名单核酸检测关注名单导出
* @param response * @param response
* @param formDTO * @param formDTO
* @param tokenDto * @param tokenDto
@ -110,10 +116,19 @@ public class IcEpidemicSpecialAttentionController {
* @date 2022/3/28 13:57 * @date 2022/3/28 13:57
*/ */
@PostMapping("vaccination-export") @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); ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId()); 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);
}
} }
/** /**

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

35
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;
}
Loading…
Cancel
Save