| 
						
						
							
								
							
						
						
					 | 
					@ -21,7 +21,9 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import cn.afterturn.easypoi.excel.entity.TemplateExportParams; | 
					 | 
					 | 
					import cn.afterturn.easypoi.excel.entity.TemplateExportParams; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.excel.EasyExcel; | 
					 | 
					 | 
					import com.alibaba.excel.EasyExcel; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.excel.ExcelWriter; | 
					 | 
					 | 
					import com.alibaba.excel.ExcelWriter; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.alibaba.excel.enums.WriteDirectionEnum; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.excel.write.metadata.WriteSheet; | 
					 | 
					 | 
					import com.alibaba.excel.write.metadata.WriteSheet; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.alibaba.excel.write.metadata.fill.FillConfig; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.excel.write.metadata.fill.FillWrapper; | 
					 | 
					 | 
					import com.alibaba.excel.write.metadata.fill.FillWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.annotation.LoginUser; | 
					 | 
					 | 
					import com.epmet.commons.tools.annotation.LoginUser; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -54,6 +56,7 @@ import org.springframework.web.multipart.MultipartFile; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import javax.servlet.http.HttpServletResponse; | 
					 | 
					 | 
					import javax.servlet.http.HttpServletResponse; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.io.FileOutputStream; | 
					 | 
					 | 
					import java.io.FileOutputStream; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.io.IOException; | 
					 | 
					 | 
					import java.io.IOException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.io.InputStream; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.io.OutputStream; | 
					 | 
					 | 
					import java.io.OutputStream; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.net.URLEncoder; | 
					 | 
					 | 
					import java.net.URLEncoder; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.nio.file.Files; | 
					 | 
					 | 
					import java.nio.file.Files; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -167,7 +170,14 @@ public class IcResiUserController { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); | 
					 | 
					 | 
					        return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    @RequestMapping(value = "/exportExcel") | 
					 | 
					 | 
					    /** | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * desc :备用 easypoi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param customerId | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param pageFormDTO | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param response | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @throws Exception | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    @RequestMapping(value = "/exportExcel2") | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { | 
					 | 
					 | 
					    public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        pageFormDTO.setCustomerId(customerId); | 
					 | 
					 | 
					        pageFormDTO.setCustomerId(customerId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        pageFormDTO.setPageFlag(false); | 
					 | 
					 | 
					        pageFormDTO.setPageFlag(false); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -228,7 +238,7 @@ public class IcResiUserController { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<Integer, Map<String, Object>> sheetMap = new HashMap<>(); | 
					 | 
					 | 
					        Map<Integer, Map<String, Object>> sheetMap = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String, Object> mapData = new HashMap<>(); | 
					 | 
					 | 
					        Map<String, Object> mapData = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        mapData.put("list", resiMainList.values()); | 
					 | 
					 | 
					        mapData.put("list", resiMainList.values()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        System.out.println("========="+JSON.toJSONString(resiMainList.values())); | 
					 | 
					 | 
					        System.out.println("===resiMainList==="+"  "+JSON.toJSONString(resiMainList.values())); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        sheetMap.put(0, mapData); | 
					 | 
					 | 
					        sheetMap.put(0, mapData); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        AtomicInteger n = new AtomicInteger(); | 
					 | 
					 | 
					        AtomicInteger n = new AtomicInteger(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        for (FormItem item : resiFormItems.getItemList()) { | 
					 | 
					 | 
					        for (FormItem item : resiFormItems.getItemList()) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -241,7 +251,7 @@ public class IcResiUserController { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    Map<String, Object> mapData2 = new HashMap<>(); | 
					 | 
					 | 
					                    Map<String, Object> mapData2 = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    mapData2.put("list", resiChildMap.values()); | 
					 | 
					 | 
					                    mapData2.put("list", resiChildMap.values()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    System.out.println("========="+JSON.toJSONString(mapData2)); | 
					 | 
					 | 
					                    System.out.println("===resiChildMap==="+item.getChildGroup().getTableName()+"  "+JSON.toJSONString(resiChildMap.values())); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    sheetMap.put(n.incrementAndGet(), mapData2); | 
					 | 
					 | 
					                    sheetMap.put(n.incrementAndGet(), mapData2); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -252,7 +262,7 @@ public class IcResiUserController { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        workbook.write(getOutputStream("居民基本信息.xls",response)); | 
					 | 
					 | 
					        workbook.write(getOutputStream("居民基本信息.xls",response)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    @RequestMapping(value = "/exportExcel2") | 
					 | 
					 | 
					    @RequestMapping(value = "/exportExcel") | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    public void exportExcelByEasyExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { | 
					 | 
					 | 
					    public void exportExcelByEasyExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        pageFormDTO.setCustomerId(customerId); | 
					 | 
					 | 
					        pageFormDTO.setCustomerId(customerId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        pageFormDTO.setPageFlag(false); | 
					 | 
					 | 
					        pageFormDTO.setPageFlag(false); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -307,13 +317,14 @@ 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()); | 
					 | 
					 | 
					        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\"}]");
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String templatePath = this.getClass().getResource("/excel/ic_resi_info_cid_for_easy_excel.xls").getPath(); | 
					 | 
					 | 
					        String templatePath = this.getClass().getResource("/excel/ic_resi_info_cid_for_easy_excel.xls").getPath(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String fileName = "居民基本信息.xls"; | 
					 | 
					 | 
					        String fileName = "居民基本信息.xls"; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        ExcelWriter excelWriter = EasyExcel.write(getOutputStream(fileName,response)).withTemplate(templatePath).build(); | 
					 | 
					 | 
					        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        ExcelWriter excelWriter = EasyExcel.write(getOutputStream(fileName,response)).withTemplate(inputStream).build(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        WriteSheet fistSheet = EasyExcel.writerSheet(NumConstant.ZERO).build(); | 
					 | 
					 | 
					        WriteSheet fistSheet = EasyExcel.writerSheet(NumConstant.ZERO).build(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        excelWriter.fill(new FillWrapper("t1", resiMainList.values()), fistSheet); | 
					 | 
					 | 
					        System.out.println("===resiMainList==="+"  "+JSON.toJSONString(resiMainList.values())); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        excelWriter.fill(new FillWrapper("t1", resiMainList.values()),fillConfig, fistSheet); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //=======================================
 | 
					 | 
					 | 
					        //=======================================
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        AtomicInteger n = new AtomicInteger(); | 
					 | 
					 | 
					        AtomicInteger n = new AtomicInteger(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -323,11 +334,11 @@ public class IcResiUserController { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { | 
					 | 
					 | 
					                if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName()); | 
					 | 
					 | 
					                    Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions()); | 
					 | 
					 | 
					                    Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key))); | 
					 | 
					 | 
					                    //resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    int sheetNo = n.incrementAndGet(); | 
					 | 
					 | 
					                    int sheetNo = n.incrementAndGet(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    WriteSheet writeSheet = EasyExcel.writerSheet(sheetNo).build(); | 
					 | 
					 | 
					                    WriteSheet writeSheet = EasyExcel.writerSheet(sheetNo).build(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    System.out.println("======"+JSON.toJSONString(resiChildMap.values())); | 
					 | 
					 | 
					                    System.out.println("===resiChildMap==="+item.getChildGroup().getTableName()+"  "+JSON.toJSONString(resiChildMap.values())); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    excelWriter.fill(new FillWrapper("t"+(sheetNo+1), resiChildMap.values()), writeSheet); | 
					 | 
					 | 
					                    excelWriter.fill(new FillWrapper("t"+(sheetNo+1), resiChildMap.values()), writeSheet); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |