diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index fa30ff3a3c..92c190c7ec 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -214,8 +214,11 @@ public enum EpmetErrorCode { SAME_RULE_NAME(8916,"该积分事件已存在,请重新调整保存"), UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"), - BADGE_CHECK(8918,""); + BADGE_CHECK(8918,""), + ORG_ADD_FAILED(8919,"添加失败"), + ORG_EDIT_FAILED(8920,"编辑失败"), + ORG_DEL_FAILED(8921,"删除失败"); private int code; private String msg; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java new file mode 100644 index 0000000000..74a38b8e2b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingUnitFormDTO.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +@Data +public class IcBulidingUnitFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @NotBlank(message = "楼栋ID不能为空") + private String buildingId; + + + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java index fa78b6f791..2e65729cab 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -19,6 +19,8 @@ package com.epmet.controller; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.security.dto.TokenDto; @@ -28,12 +30,15 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.constant.NeighborhoodConstant; +import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dto.BuildingTreeLevelDTO; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.form.IcBulidingFormDTO; +import com.epmet.dto.form.IcBulidingUnitFormDTO; import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.entity.IcBuildingUnitEntity; import com.epmet.excel.IcBuildingExcel; import com.epmet.excel.IcHouseExcel; import com.epmet.excel.IcNeighborHoodExcel; @@ -77,13 +82,15 @@ public class BuildingController { private IcBuildingService icBuildingService; @Autowired private BuildingService buildingService; + @Autowired + private IcBuildingUnitDao icBuildingUnitDao; @PostMapping("buildinglist") public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); IcNeighborHoodResultDTO icNeighborHoodResultDTO = buildingService.listBuilding(formDTO); return new Result().ok(icNeighborHoodResultDTO); @@ -126,13 +133,12 @@ public class BuildingController { } /** * 导出模板 - * @param formDTO * @param response * @throws Exception */ @PostMapping("exporttemplate") - public void exportTemplate(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + public void exportTemplate( HttpServletResponse response) throws Exception { + TemplateExportParams templatePath = new TemplateExportParams("excel/building_template.xlsx"); Map map = new HashMap<>(); map.put("maplist",new ArrayList()); @@ -147,7 +153,7 @@ public class BuildingController { */ @RequestMapping("exportbuildinginfo") public void exportbuildinginfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); buildingService.exportBuildinginfo(formDTO,response); } @@ -161,7 +167,7 @@ public class BuildingController { @GetMapping("export") public void export(HttpServletResponse response) throws Exception { ListIcNeighborHoodFormDTO formDTO = new ListIcNeighborHoodFormDTO(); - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); buildingService.exportBuildinginfo(formDTO,response); } @@ -186,7 +192,7 @@ public class BuildingController { for ( IcBuildingExcel entity : failList) { log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 } - return new Result().error(8000,failList.get(0).getErrorMsg()); + return new Result().error(8001,failList.get(0).getErrorMsg()); } List result =importResult.getList(); @@ -194,5 +200,25 @@ public class BuildingController { return new Result().ok("导入成功"); } + /** + * 查看楼宇单元列表 + * @param tokenDTO + * @return + * @throws IOException + */ + @PostMapping("buildingunitlist") + public Result buildingunitlist(@LoginUser TokenDto tokenDTO,@RequestBody IcBulidingUnitFormDTO icBulidingUnitFormDTO ){ + ValidatorUtils.validateEntity(icBulidingUnitFormDTO); + List icBuildingUnitEntityList = icBuildingUnitDao.selectList(new QueryWrapper().lambda().eq(IcBuildingUnitEntity::getBuildingId, icBulidingUnitFormDTO.getBuildingId())); + List result = new ArrayList<>(); + icBuildingUnitEntityList.forEach(item->{ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("id",item.getId()); + jsonObject.put("unitName",item.getUnitName()); + jsonObject.put("unitNum",item.getUnitNum()); + result.add(jsonObject); + }); + return new Result().ok(result); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 9f8f92188a..8bc4378e8f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -67,7 +67,7 @@ public class HouseController { @PostMapping("houselist") public Result houseList(@RequestBody ListIcNeighborHoodFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); IcNeighborHoodResultDTO icNeighborHoodResultDTO = houseService.listNeighborhood(formDTO); return new Result().ok(icNeighborHoodResultDTO); @@ -103,13 +103,12 @@ public class HouseController { } /** * 导出模板 - * @param formDTO * @param response * @throws Exception */ @PostMapping("exporttemplate") - public void exportTemplate(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + public void exportTemplate(HttpServletResponse response) throws Exception { +// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); TemplateExportParams templatePath = new TemplateExportParams("excel/house_template.xlsx"); Map map = new HashMap<>(); map.put("maplist",new ArrayList()); @@ -124,7 +123,7 @@ public class HouseController { */ @RequestMapping("exporthouseinfo") public void exporthouseinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); houseService.exportBuildinginfo(formDTO,response); } @@ -149,7 +148,7 @@ public class HouseController { for ( IcHouseExcel entity : failList) { log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 } - return new Result().error(8000,failList.get(0).getErrorMsg()); + return new Result().error(8001,failList.get(0).getErrorMsg()); } List result =importResult.getList(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java index 8d98ad3c8a..823363814a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java @@ -80,7 +80,7 @@ public class NeighborHoodController { @PostMapping("neighborhoodlist") public Result neighborhoodlist(@RequestBody ListIcNeighborHoodFormDTO formDTO){ //效验数据 - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); IcNeighborHoodResultDTO icNeighborHoodResultDTO = neighborHoodService.listNeighborhood(formDTO); return new Result().ok(icNeighborHoodResultDTO); @@ -115,7 +115,7 @@ public class NeighborHoodController { //判断是否存在楼宇,如果存在不能删除 List icBuildingEntities = icBuildingDao.selectList(new QueryWrapper().lambda().eq(IcBuildingEntity::getNeighborHoodId, neighborHoodId)); if(!CollectionUtils.isEmpty(icBuildingEntities)){ - return new Result().error(8000,"小区下已存在楼宇,无法删除"); + return new Result().error(8001,"小区下已存在楼宇,无法删除"); } neighborHoodService.DelNeighborhood(neighborHoodId); return new Result().ok("删除成功"); @@ -130,19 +130,18 @@ public class NeighborHoodController { */ @PostMapping("exportneighborhoodinfo") public void exportneighborhoodinfo(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + ValidatorUtils.validateEntity(formDTO); neighborHoodService.exportNeighborhoodinfo(formDTO,response); } /** * 导出模板 - * @param formDTO * @param response * @throws Exception */ @PostMapping("exporttemplate") - public void exportTemplate(@RequestBody ListIcNeighborHoodFormDTO formDTO, HttpServletResponse response) throws Exception { - ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); + public void exportTemplate( HttpServletResponse response) throws Exception { +// ValidatorUtils.validateEntity(ListIcNeighborHoodFormDTO.class); TemplateExportParams templatePath = new TemplateExportParams("excel/neighbor_template.xlsx"); Map map = new HashMap<>(); map.put("maplist",new ArrayList()); @@ -211,7 +210,7 @@ public class NeighborHoodController { for ( IcNeighborHoodExcel entity : failList) { log.error("第{}行,{}",entity.getRowNum(),entity.getErrorMsg());//打印失败的行 和失败的信息 } - return new Result().error(8000,failList.get(0).getErrorMsg()); + return new Result().error(8001,failList.get(0).getErrorMsg()); } List result =importResult.getList(); // log.info(JSON.toJSONString(result)); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 7842454149..10371e3369 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -8,16 +8,19 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.*; -import com.epmet.dto.*; +import com.epmet.dto.BuildingTreeLevelDTO; +import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.form.IcBulidingFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; -import com.epmet.dto.result.ExtStaffPermissionResultDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.*; import com.epmet.enums.BuildingTypeEnums; import com.epmet.excel.IcBuildingExcel; -import com.epmet.excel.IcNeighborHoodExcel; -import com.epmet.service.*; +import com.epmet.service.BuildingService; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcHouseService; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -374,7 +377,7 @@ public class BuildingServiceImpl implements BuildingService { List icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, formDTO.getBuildingId())); if(!CollectionUtils.isEmpty(icHouseEntities)){ // - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),"楼宇单元下存在房屋,无法更新"); + throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼宇单元下存在房屋,无法更新"); // icHouseEntities.forEach(item->{ // item.setNeighborHoodId(formDTO.getNeighborHoodId()); // }); @@ -403,7 +406,7 @@ public class BuildingServiceImpl implements BuildingService { icBuildingUnitService.insertBatch(unitList); }else{ //如果小于,判断是否存在房屋,如果存在就提示不能更改 - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),"楼宇单元下存在房屋,无法更新"); + throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(),"楼宇单元下存在房屋,无法更新"); } @@ -420,7 +423,7 @@ public class BuildingServiceImpl implements BuildingService { //如果存在房屋,无法删除 List icHouseEntities = icHouseDao.selectList(new QueryWrapper().lambda().eq(IcHouseEntity::getBuildingId, buildingId)); if(!CollectionUtils.isEmpty(icHouseEntities)){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(),"楼宇单元下存在房屋,无法删除"); + throw new RenException(EpmetErrorCode.ORG_DEL_FAILED.getCode(),"楼宇单元下存在房屋,无法删除"); } //删除楼宇 icBuildingService.deleteById(buildingId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index 2d41fdc8fb..00d96f74f6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.NeighborhoodConstant; import com.epmet.dao.*; @@ -18,8 +17,6 @@ import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ListIcNeighborHoodFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; import com.epmet.entity.*; -import com.epmet.excel.IcBuildingExcel; -import com.epmet.excel.IcHouseExcel; import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcNeighborHoodPropertyService; diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index a70950c101..c6417f095f 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -140,6 +140,16 @@ true + + org.apache.maven.plugins + maven-resources-plugin + + + xls + xlsx + + + ${project.basedir}/src/main/java diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 02b2068020..2aaeba1cb0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -144,14 +144,7 @@ public class IcResiUserController { @GetMapping("download/template") public void downloadTemplate(@RequestParam String customerId) throws Exception { - CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); - queryDTO.setFormCode("resi_base_info"); - queryDTO.setCustomerId(customerId); - Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); - if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } - System.out.println(JSON.toJSONString(resultForm.getData())); + CustomerFormResultDTO resultForm = getResiFormItems(customerId); XSSFWorkbook workbook = new XSSFWorkbook(); Map> sheetHeaderMap = buildHeaderByItem(resultForm); @@ -175,11 +168,24 @@ public class IcResiUserController { } @NotNull - private Map> buildHeaderByItem(Result resultForm) { + private CustomerFormResultDTO getResiFormItems(String customerId) { + CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); + queryDTO.setFormCode("resi_base_info"); + queryDTO.setCustomerId(customerId); + Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); + if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + System.out.println(JSON.toJSONString(resultForm.getData())); + return resultForm.getData(); + } + + @NotNull + private Map> buildHeaderByItem(CustomerFormResultDTO resultForm) { //form中的itemlist 为一级表头 但是要排除每个item中含有childGroup的 - List itemList = resultForm.getData().getItemList(); - List groupList = resultForm.getData().getGroupList(); + List itemList = resultForm.getItemList(); + List groupList = resultForm.getGroupList(); Map> everySheetHeaderMap = new LinkedHashMap<>(); @@ -196,7 +202,7 @@ public class IcResiUserController { firstSheetHeaderList.add(header); return; } - everySheetHeaderMap.putIfAbsent(resultForm.getData().getFormName(),firstSheetHeaderList); + everySheetHeaderMap.putIfAbsent(resultForm.getFormName(),firstSheetHeaderList); //这些是动态的 formGroup if (item.getChildGroup() != null){ @@ -326,29 +332,31 @@ public class IcResiUserController { public void exportExcel(/*@LoginUser TokenDto tokenDto,*/ @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws IOException { pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); pageFormDTO.setPageFlag(false); - PageData> mapPageData = icResiUserService.pageResiMap(pageFormDTO); - List> list = mapPageData.getList(); + //PageData> mapPageData = icResiUserService.pageResiMap(pageFormDTO); + //List> list = mapPageData.getList(); + List> list = (List>)JSON.parse("[{\"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\"}]" + ); Map mapData = new HashMap<>(); log.info("list:{}", JSON.toJSONString(list)); mapData.put("list", list); - String templatePath = "excel/ic_resi_info_cid.xls"; + CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); + String templatePath = "excel/ic_resi_info_cid.xls"; + TemplateExportParams params = new TemplateExportParams(templatePath, 0,1); Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath), mapData); //header response.setHeader("content-Type", "application/vnd.ms-excel"); - response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("继续追踪导出详情-" + ".xlsx", "UTF-8")); + response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("继续追踪导出详情-" + ".xls", "UTF-8")); workbook.write(response.getOutputStream()); - /* - //方式1 通过mv导出 + /* //方式1 通过mv导出 ModelAndView mv = new ModelAndView(new EasypoiTemplateExcelView()); - mv.addObject(TemplateExcelConstants.FILE_NAME, "继续追踪导出详情-".concat(DateUtils.formatDate())); - mv.addObject(TemplateExcelConstants.PARAMS, new TemplateExportParams(templatePath,dataType)); + mv.addObject(TemplateExcelConstants.FILE_NAME, "继续追踪导出详情-")); + mv.addObject(TemplateExcelConstants.PARAMS, new TemplateExportParams(templatePath)); mv.addObject(TemplateExcelConstants.MAP_DATA, mapData); - return mv; - */ + return mv;*/ } diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls new file mode 100644 index 0000000000..51a5d41a94 Binary files /dev/null and b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid.xls differ