Browse Source

灵山企业档案=原产品重点危化品企业;导出,导入模板调整

master
yinzuomei 2 years ago
parent
commit
9f1833d9bb
  1. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java
  2. 32
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java
  3. BIN
      epmet-module/gov-org/gov-org-server/src/main/resources/excel/lingshan_dangerous_chemicals_template.xlsx

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java

@ -153,9 +153,11 @@ public class IcDangerousChemicalsController {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition");
response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("重点危化管理导入模板", "UTF-8") + ".xlsx"); // response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("重点危化管理导入模板", "UTF-8") + ".xlsx");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("企业档案导入模板", "UTF-8") + ".xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/dangerous_chemicals_template.xlsx"); // InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/dangerous_chemicals_template.xlsx");
InputStream is = this.getClass().getClassLoader().getResourceAsStream("excel/lingshan_dangerous_chemicals_template.xlsx");
try { try {
ServletOutputStream os = response.getOutputStream(); ServletOutputStream os = response.getOutputStream();
IOUtils.copy(is, os); IOUtils.copy(is, os);
@ -182,7 +184,8 @@ public class IcDangerousChemicalsController {
formDTO.setPageNo(NumConstant.ONE); formDTO.setPageNo(NumConstant.ONE);
formDTO.setPageSize(NumConstant.TEN_THOUSAND); formDTO.setPageSize(NumConstant.TEN_THOUSAND);
try { try {
String fileName = "重点危化管理" + DateUtils.format(new Date()) + ".xlsx"; // String fileName = "重点危化管理" + DateUtils.format(new Date()) + ".xlsx";
String fileName = "企业档案" + DateUtils.format(new Date()) + ".xlsx";
// 头的策略 // 头的策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 背景设置为红色 // 背景设置为红色

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcDangerousChemicalsExcel.java

@ -13,27 +13,31 @@ import lombok.Data;
@Data @Data
public class IcDangerousChemicalsExcel { public class IcDangerousChemicalsExcel {
@ExcelProperty(value = "所属组织")
@ColumnWidth(25)
private String gridName;
@ExcelProperty(value = "企业名称") @ExcelProperty(value = "企业名称")
@ColumnWidth(25) @ColumnWidth(25)
private String name; private String name;
@ExcelProperty(value = "企业类") @ExcelProperty(value = "企业类")
@ColumnWidth(20) @ColumnWidth(20)
private String categoryName; private String categoryName;
@ExcelProperty(value = "周边安全距离") // @ExcelProperty(value = "周边安全距离")
@ColumnWidth(20) // @ColumnWidth(20)
private String safeDistanceName; // private String safeDistanceName;
//
// @ExcelProperty(value = "危化品种类")
// @ColumnWidth(20)
// private String dangerTypeName;
@ExcelProperty(value = "危化品种类") @ExcelProperty(value = "企业地址")
@ColumnWidth(20)
private String dangerTypeName;
@ExcelProperty(value = "经营地址")
@ColumnWidth(25) @ColumnWidth(25)
private String address; private String address;
@ExcelProperty(value = "负责人") @ExcelProperty(value = "联系人")
@ColumnWidth(20) @ColumnWidth(20)
private String principalName; private String principalName;
@ -41,8 +45,12 @@ public class IcDangerousChemicalsExcel {
@ColumnWidth(20) @ColumnWidth(20)
private String principalMobile; private String principalMobile;
@ExcelProperty(value = "备注") @ExcelProperty(value = "安全负责人")
@ColumnWidth(25)
private String securityPrincipalName;
@ExcelProperty(value = "安全负责电话人")
@ColumnWidth(25) @ColumnWidth(25)
private String remark; private String securityPrincipalMobile;
} }

BIN
epmet-module/gov-org/gov-org-server/src/main/resources/excel/lingshan_dangerous_chemicals_template.xlsx

Binary file not shown.
Loading…
Cancel
Save