|
|
@ -169,7 +169,7 @@ public class IcResiUserController { |
|
|
|
} |
|
|
|
|
|
|
|
@RequestMapping(value = "/exportExcel") |
|
|
|
public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws IOException { |
|
|
|
public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { |
|
|
|
pageFormDTO.setCustomerId(customerId); |
|
|
|
pageFormDTO.setPageFlag(false); |
|
|
|
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); |
|
|
@ -223,7 +223,7 @@ public class IcResiUserController { |
|
|
|
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); |
|
|
|
//resiMainList = (List<Map<String, Object>>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]");
|
|
|
|
log.info("resiMainList:{}", JSON.toJSONString(resiMainList)); |
|
|
|
String templatePath = "excel/ic_resi_info_cid.xls"; |
|
|
|
String templatePath = "excel/ic_resi_info_cid.xlsx"; |
|
|
|
TemplateExportParams params = new TemplateExportParams(templatePath, true); |
|
|
|
|
|
|
|
Map<Integer, Map<String, Object>> sheetMap = new HashMap<>(); |
|
|
@ -250,11 +250,7 @@ public class IcResiUserController { |
|
|
|
|
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); |
|
|
|
workbook.setActiveSheet(0); |
|
|
|
|
|
|
|
String fileName = "居民基本信息.xls"; |
|
|
|
response.setHeader("content-Type", "application/vnd.ms-excel"); |
|
|
|
response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); |
|
|
|
workbook.write(response.getOutputStream()); |
|
|
|
workbook.write(getOutputStream("居民基本信息.xlsx",response)); |
|
|
|
} |
|
|
|
|
|
|
|
@RequestMapping(value = "/exportExcel2") |
|
|
@ -397,7 +393,7 @@ public class IcResiUserController { |
|
|
|
fileName = URLEncoder.encode(fileName, "UTF-8"); |
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding("utf8"); |
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); |
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
|
|
|
response.addHeader("Access-Control-Expose-Headers", "Content-disposition"); |
|
|
|
|
|
|
|
return response.getOutputStream(); |
|
|
|