From 08e951199fcfa3aafa5814272713a77696d5679c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 3 Nov 2021 14:22:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/FinancialSituationDTO.java | 31 ++++++++ .../com/epmet/dto/form/PersonDataFormDTO.java | 22 ++++++ .../epmet/dto/form/SearchByNameFormDTO.java | 30 ++++++++ .../epmet/dto/result/PersonDataResultDTO.java | 72 +++++++++++++++++++ .../dto/result/SearchByNameResultDTO.java | 66 +++++++++++++++++ .../controller/IcResiUserController.java | 25 +++++++ .../java/com/epmet/dao/IcResiUserDao.java | 20 ++++++ .../com/epmet/service/IcResiUserService.java | 20 ++++++ .../service/impl/IcResiUserServiceImpl.java | 55 +++++++++++--- .../main/resources/mapper/IcResiUserDao.xml | 38 ++++++++++ 10 files changed, 371 insertions(+), 8 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java new file mode 100644 index 0000000000..4a1607748d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/FinancialSituationDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/3 10:24 上午 + * @DESC + */ +@Data +public class FinancialSituationDTO implements Serializable { + + private static final long serialVersionUID = -3984106138099267996L; + + /** + * 月收入 + */ + private String monthlyIncome; + + /** + * 退休金额 + */ + private String retirementAmount; + + public FinancialSituationDTO() { + this.monthlyIncome = ""; + this.retirementAmount = ""; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java new file mode 100644 index 0000000000..52d96870a2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/2 5:16 下午 + * @DESC + */ +@Data +public class PersonDataFormDTO implements Serializable { + + private static final long serialVersionUID = 3238490888792654922L; + + public interface PersonDataForm{} + + @NotBlank(message = "userId不能为空",groups = PersonDataForm.class) + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java new file mode 100644 index 0000000000..8f4abca17f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SearchByNameFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/3 1:34 下午 + * @DESC + */ +@Data +public class SearchByNameFormDTO implements Serializable { + + private static final long serialVersionUID = -5017695783909884799L; + + public interface SearchByNameForm{} + + @NotBlank(message = "name不能为空",groups = SearchByNameForm.class) + private String name; + + @NotNull(message = "pageSize不能为空",groups = SearchByNameForm.class) + private Integer pageSize; + + @NotNull(message = "pageNo不能为空",groups = SearchByNameForm.class) + private Integer pageNo; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java new file mode 100644 index 0000000000..22a6fc3c41 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import com.epmet.dto.FinancialSituationDTO; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2021/11/2 5:34 下午 + * @DESC + */ +@Data +public class PersonDataResultDTO implements Serializable { + + private static final long serialVersionUID = 5210308218052783909L; + + /** + * 工作单位 + */ + private String workUnit; + + /** + * 人员类别 + */ + private String personCategory; + + /** + * 网格名 + */ + private String gridName; + + /** + * 姓名 + */ + private String name; + + /** + * 经济状况:包括 月收入:monthlyIncome 和 退休金额:retirementAmount + */ + private FinancialSituationDTO financialSituation; + + /** + * 房屋信息 + */ + private List houseInfo; + + /** + * 志愿者类别 + */ + private String volunteerCategory; + + public PersonDataResultDTO() { + this.workUnit = ""; + this.personCategory = ""; + this.gridName = ""; + this.name = ""; + this.financialSituation = new FinancialSituationDTO(); + this.houseInfo = new ArrayList<>(); + this.volunteerCategory = ""; + } + + /** + * 身份证 + */ + @JsonIgnore + private String idCard; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java new file mode 100644 index 0000000000..0451dafaf0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/SearchByNameResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/3 1:36 下午 + * @DESC + */ +@Data +public class SearchByNameResultDTO implements Serializable { + + private static final long serialVersionUID = 8783929181468322960L; + + /** + * 排序 + */ + private Integer sort; + + /** + * 姓名 + */ + private String name; + + /** + * 网格名 + */ + private String gridName; + + @JsonIgnore + private String gridId; + + /** + * 小区名 + */ + private String neighborHoodName; + + @JsonIgnore + private String neighborHoodId; + + /** + * 楼号 + */ + private String buildNum; + + @JsonIgnore + private String buildId; + + /** + * 用户ID + */ + private String userId; + + public SearchByNameResultDTO() { + this.sort = NumConstant.ZERO; + this.name = ""; + this.gridName = ""; + this.neighborHoodName = ""; + this.buildNum = ""; + this.userId = ""; + } +} 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 eacd60c613..8bd5d64f1c 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 @@ -392,4 +392,29 @@ public class IcResiUserController { formDTO.getResultTableName(), formDTO.getConditions())); } + + /** + * @Description 查询个人数据 + * @param formDTO + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + @PostMapping("persondata") + public Result personData(@RequestBody PersonDataFormDTO formDTO){ + return new Result().ok(icResiUserService.personData(formDTO)); + } + + /** + * @Description 根据名字搜索 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/3 1:42 下午 + */ + @PostMapping("searchbyname") + public Result> searchByName(@RequestBody SearchByNameFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, SearchByNameFormDTO.SearchByNameForm.class); + return new Result>().ok(icResiUserService.searchByName(formDTO,tokenDto)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 1d4f66a4cb..329447a24f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -20,6 +20,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.result.IcFormResColumnDTO; +import com.epmet.dto.result.PersonDataResultDTO; +import com.epmet.dto.result.SearchByNameResultDTO; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -95,4 +97,22 @@ public interface IcResiUserDao extends BaseDao { @Param("resultTableName")String resultTableName, @Param("conditions") List conditions, @Param("subTables") List subTables); + + /** + * @Description 查询个人信息 + * @param userId + * @author zxc + * @date 2021/11/3 10:28 上午 + */ + PersonDataResultDTO personData(@Param("userId") String userId); + + /** + * @Description 根据名字,组织查询人 + * @param name + * @param agencyId + * @author zxc + * @date 2021/11/3 2:05 下午 + */ + List searchByName(@Param("name")String name, @Param("agencyId")String agencyId,@Param("pageNo")Integer pageNo); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 8391e0967e..2d132a988b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -23,6 +23,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.HomeUserResultDTO; +import com.epmet.dto.result.PersonDataResultDTO; +import com.epmet.dto.result.SearchByNameResultDTO; import com.epmet.entity.IcResiUserEntity; import com.epmet.service.impl.IcResiUserServiceImpl; @@ -135,6 +137,24 @@ public interface IcResiUserService extends BaseService { String resultTableName, List conditions); + /** + * @Description 查询个人数据 + * @param formDTO + * @author zxc + * @date 2021/11/3 9:21 上午 + */ + PersonDataResultDTO personData(PersonDataFormDTO formDTO); + + /** + * @Description 根据名字搜索 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2021/11/3 1:42 下午 + */ + List searchByName(SearchByNameFormDTO formDTO,TokenDto tokenDto); + + /** * desc:条件导出 * @param customerId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index b572a781e4..e7b968123c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.enums.GenderEnum; import com.epmet.commons.tools.enums.HouseTypeEnum; @@ -34,6 +35,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -76,7 +78,7 @@ import java.util.stream.Collectors; @Slf4j @Service public class IcResiUserServiceImpl extends BaseServiceImpl implements IcResiUserService, ResultDataResolver { - private Logger logger = LogManager.getLogger(IcResiUserServiceImpl.class); + private final Logger logger = LogManager.getLogger(IcResiUserServiceImpl.class); @Autowired private IcResiUserRedis icResiUserRedis; @Autowired @@ -488,15 +490,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl headerColumnWrapper, List> dataRows, + private void persist(Map headerColumnWrapper, List> dataRows, String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, String tableName) { for (Map row : dataRows) { // 当前行的列们 // List columnsOfCurrRow = new ArrayList<>(); - - List columnNames = new ArrayList<>(); - List columnValues = new ArrayList<>(); + + List columnNames = new ArrayList<>(); + List columnValues = new ArrayList<>(); for (Map.Entry columnWrapperEntry : headerColumnWrapper.entrySet()) { @@ -647,8 +649,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl optionValues = colIndexs.stream().filter(i -> { String cellContent = dataRow.get(i); - if (StringUtils.isNotBlank(cellContent) && cellContent.equals("是")) return true; - return false; + return StringUtils.isNotBlank(cellContent) && cellContent.equals("是"); }).map(i -> { String checkboxOptionLabel = checkboxOptions.get(i); return options.get(checkboxOptionLabel); @@ -666,7 +667,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl searchByName(SearchByNameFormDTO formDTO, TokenDto tokenDto) { + // 查询工作人员所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new RenException("未查询到当前工作人员所属组织"); + } + Integer no = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.searchByName(formDTO.getName(), staffInfo.getAgencyId(), no)); + List result = pageInfo.getList(); + // 查询小区,楼号,网格 + // TODO + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + /** * desc:条件导出 * diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 616d55e711..12b430d2f3 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -122,4 +122,42 @@ group by IC_RESI_USER.id order by ic_resi_user.CREATED_TIME desc + + + + + + + + + + + + + + \ No newline at end of file From 0f6ad0d77ce4d4ede96794c7f226a9875578edbb Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 3 Nov 2021 14:30:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=BB=8F=E6=B5=8E?= =?UTF-8?q?=E4=BD=8E=E4=BF=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/UserConstant.java | 5 +- .../controller/IcResiUserController.java | 75 +++++++++++++++--- .../com/epmet/entity/IcResiUserEntity.java | 9 +-- .../com/epmet/service/IcResiUserService.java | 6 +- .../service/impl/IcResiUserServiceImpl.java | 46 ++++++++--- .../main/resources/excel/ic_resi_info_cid.xls | Bin 79872 -> 80384 bytes 6 files changed, 111 insertions(+), 30 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index 31d86dadf7..87278ba55f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -102,5 +102,8 @@ public interface UserConstant { String GENDER="GENDER"; String HOUSE_TYPE_KEY="HOUSE_TYPE"; String HOME_ID = "HOME_ID"; - + /** + * 居民信息 子表中的主表id + */ + String IC_RESI_USER = "IC_RESI_USER"; } 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 eacd60c613..3f137f6113 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 @@ -29,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -327,32 +328,84 @@ public class IcResiUserController { @RequestMapping(value = "/exportExcel") 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(); - List> list = icResiUserService.getDataForExport(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); - //list = (List>)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("list:{}", JSON.toJSONString(list)); + CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); + /* Map> checkListMap = new HashMap<>(); + for (FormItem item : resiFormItems.getItemList()) { + if ("checkbox".equals(item.getItemType())) { + List options = null; + if ("remote".equals(item.getOptionSourceType())) { + } else if ("local".equals(item.getOptionSourceType())) { + options = item.getOptions(); + } + checkListMap.put(item.getColumnName().concat(item.getColumnNum().equals(0) ? "" : item.getColumnNum().toString()), options); + } + }*/ - CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId()); + //PageData> mapPageData = icResiUserService.pageResiMap(pageFormDTO); + //List> resiMainList = mapPageData.getList(); + Map itemMap = new HashMap<>(); + for (FormItem formItem : resiFormItems.getItemList()) { + if (StringUtils.isNotBlank(formItem.getColumnName())){ + itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem); + } + if (formItem.getChildGroup() != null) { + for (FormItem2 item2 : formItem.getChildGroup().getItemList()) { + if (item2.getItemType().equals("checkbox")) { + itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2,FormItem.class)); + } + } + + } + } + for (FormGroupDTO groupItem : resiFormItems.getGroupList()) { + if (groupItem.getItemList() != null) { + for (FormItem2 item : groupItem.getItemList()) { + if (StringUtils.isBlank(item.getColumnName())){ + continue; + } + System.out.println(item.getColumnName()+item.getColumnNum()); + itemMap.put(item.getColumnName().concat(item.getColumnNum() == 0 ? "" : item.getColumnNum().toString()), ConvertUtils.sourceToTarget(item,FormItem.class)); + } + } + } + Map> resiMainList = icResiUserService.getDataForExport(itemMap,pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions()); + //resiMainList = (List>)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"; TemplateExportParams params = new TemplateExportParams(templatePath,true); Map> sheetMap = new HashMap<>(); Map mapData = new HashMap<>(); - mapData.put("list", list); + mapData.put("list", resiMainList.values()); sheetMap.put(0,mapData); AtomicInteger n = new AtomicInteger(); - resiFormItems.getItemList().forEach(item->{ - if (item.getChildGroup() != null){ + for (FormItem item : resiFormItems.getItemList()) { + + + if (item.getChildGroup() != null) { if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) { - sheetMap.put(n.incrementAndGet() ,mapData); + //itemMap = item.getChildGroup().getItemList().stream().filter(o -> o.getItemType().equals("checkbox")).collect(Collectors.toMap(o -> o.getColumnName().concat(o.getColumnNum() == 0 ? "" : o.getColumnNum().toString()), o -> ConvertUtils.sourceToTarget(o,FormItem.class))); + + + + Map> resiChildMap = icResiUserService.getDataForExport(itemMap, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions()); + resiChildMap.forEach((key,value)->{ + value.putAll(resiMainList.get(key)); + }); + + Map mapData2 = new HashMap<>(); + mapData2.put("list", resiChildMap.values()); + System.out.println("========="+item.getChildGroup().getTableName()+" data:"+resiChildMap.size()); + sheetMap.put(n.incrementAndGet(),mapData2); } } - }); + } Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params); workbook.setActiveSheet(0); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java index 603b530781..6f9f7d4068 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserEntity.java @@ -44,12 +44,12 @@ public class IcResiUserEntity extends BaseEpmetEntity { private String customerId; /** - * + * */ private String agencyId; /** - * + * */ private String pids; @@ -373,11 +373,6 @@ public class IcResiUserEntity extends BaseEpmetEntity { */ private String ysr; - /** - * 是否经济低保 - */ - private String isJjdb; - /** * 籍贯 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 8391e0967e..ff43d4c68c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -22,9 +22,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.FormItem; import com.epmet.dto.result.HomeUserResultDTO; import com.epmet.entity.IcResiUserEntity; -import com.epmet.service.impl.IcResiUserServiceImpl; import java.util.List; import java.util.Map; @@ -137,12 +137,14 @@ public interface IcResiUserService extends BaseService { /** * desc:条件导出 + * + * @param itemList * @param customerId * @param formCode * @param baseTableName * @param conditions * @return */ - List> getDataForExport(String customerId, String formCode, String baseTableName, List conditions); + Map> getDataForExport(Map itemList, String customerId, String formCode, String baseTableName, List conditions); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index b572a781e4..3651d0b97f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -488,15 +488,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl headerColumnWrapper, List> dataRows, + private void persist(Map headerColumnWrapper, List> dataRows, String currUserAgencyId, Map checkBoxOptionColumnIdxAndLabel, String tableName) { for (Map row : dataRows) { // 当前行的列们 // List columnsOfCurrRow = new ArrayList<>(); - - List columnNames = new ArrayList<>(); - List columnValues = new ArrayList<>(); + + List columnNames = new ArrayList<>(); + List columnValues = new ArrayList<>(); for (Map.Entry columnWrapperEntry : headerColumnWrapper.entrySet()) { @@ -666,7 +666,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> getDataForExport(String customerId, String formCode, String baseTableName, List conditions) { + public Map> getDataForExport(Map formItemMap, String customerId, String formCode, String baseTableName, List conditions) { List> mapList = this.dynamicQuery(customerId, formCode, baseTableName, conditions); - mapList.parallelStream().forEach(map -> { + + Map> result = new LinkedHashMap<>(); + mapList.stream().filter(Objects::nonNull).forEach(map -> { + String resiId = (String) map.getOrDefault(UserConstant.IC_RESI_USER, ""); + formItemMap.forEach((k, v)->{ + Object temp = map.get(k); + if (temp != null){ + if (v.getOptionSourceType().equals("remote")){ + //todo 获取 options + } + v.getOptions().forEach(optionDTO -> { + map.put(optionDTO.getValue(),temp.toString().contains(optionDTO.getValue())?"是":"否"); + }); + } + }); + if ("ic_resi_user".equals(baseTableName)) { + resiId = (String) map.get("ID"); + } + if (StringUtils.isBlank(resiId)){ + log.error("getDataForExport error,resiId:{}",resiId); + return; + } + result.put(resiId, map); + if (!"ic_resi_user".equals(baseTableName)) { + return; + } Object gridId = map.get(UserConstant.GRID_ID); if (gridId != null) { CustomerGridFormDTO formDTO = new CustomerGridFormDTO(); @@ -927,14 +954,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl houseIds = new HashSet<>(); houseIds.add(homeId.toString()); Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds); - if (houseInfoRes != null && houseInfoRes.success() && CollectionUtils.isNotEmpty(houseInfoRes.getData())){ + if (houseInfoRes != null && houseInfoRes.success() && CollectionUtils.isNotEmpty(houseInfoRes.getData())) { HouseInfoDTO houseInfoDTO = houseInfoRes.getData().get(NumConstant.ZERO); map.put("VILLAGE_NAME", houseInfoDTO.getNeighborHoodName()); map.put("BUILD_NAME", houseInfoDTO.getBuildingName()); map.put("HOME_ID", houseInfoDTO.getDoorName()); } } + }); - return mapList; + return result; } } 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 index f40d8555313a62e7fad26213612b328a689d55a9..33a4346d5b91697e6784511ed670a01f2f07b2b2 100644 GIT binary patch delta 2613 zcmZYBc~n$Y90%~WR$k z$(PehaK2ZNs-cg^rTss;!!Vm>HaXs=h3iep6GOT?{TTiwBQ>Q*htUzF7Sa$} zLNjR=ot5tZu`S`v;!MmY3^1*&k zk*Gg3S2O@B77c`QMF~)e=pJaEXb?1?$Y(u%Ft|X1_d-vJhCmBN_d%tiMCfVJQ0N)a zFldozIJ8)FKePlIVa|R8_^bp+LQ6%XpyxynK+E)$?D%#|mx8wCa>s+v3ejk2rDzP) zwjg7nwgT`#tK`mypy!Rf*EU+YYO6b<2pUH(h@4QF$OWwtxuLb9NNAlX3R*9UhF-M9XO4%` zMGDH$FV3zg*dT2YXnRTIgkBc8Fx^~{8?lX|Naz(2Z_GPmP{bQ^Q~B@Fs*CZ*oKvxm zIt+ajJ{r5FeL512zgC{pl60#RGaZ{noQ_vToDM$XxH1SCA4lbS^@&IHjIw!2eAIHg zLPEV%A#y@|)S5A#Or^+88MMu~S=Q`!RJ}osu>UHaG9@%)> zF5;0@iFjmhhx;ZjCw$z3dS2LcJx5f!?;n%jTtYz3#*a{kQE4eD6p*&+lCk zFV;?x3)&^(#loDdx$|P}7V%=$h@ugDUlaq?Ldw>WY-FcNq>M9F-e^18!i-+VdYhyE z0CIH*-)cu%^JUcdo%Vt{s|Rxx_lP)G^&-yI2O`cDe=(VB%DMVb#6|s)h;!xV^;Q8r zvutjmhd#DqyyhO-E8?8&6LC)Vi#R73d%K(*6h$G{AmW^SVixeE1O5od<Sr-_c9 zAwxBXDx>r9rJCzg>wdF74z-Oh(nFs~Up&6g&AyhNtc`G7{gtTn8c}qU)z_E{MVk6T z-+ehN>u|eIrP2|RlTzuZ$OU~Vazn>Nku-t65=BAB^{gvXkT>H>iSKJGVr$(g--vjp zoDlI&!Gv4$WW!$b(kT&tAAc+2O8QR3+kUEuE9rZPD@j8oc~ME#jagknk71)mc2rbn zwA?DUs~_6(rg`Y}ovf$Y0yQ=@)e&~Mv!V?>6^-w=srm0fxJxx?Nk3XoF{|w-5m(#K zBCfVGBCfWxZO=;a(l1ubJU7mXI2-3hoQ(@2H$6-j1321TG3D;z>N;Pp`3I`Kn*GME vb+v(mgH*t-HkX$ss#Uhw{()PGDy>5|KI8bGKR(a+6yx{&st8OOsjAd}i>(?! delta 2552 zcmZYBdr(wm6aet^?OgM(;B{qsdYYcL;?;IEr&T9OASu7;EXg8U_OM3TJ&GypE*{9qTX`|7 zvLH8qbxvvh4hV%dJ4Fm)B>H}f}#KUGN zg*8wJ6|fPi@Ut90D-|iDKzNM7y(s|RAcu{_8wT$K7=937SH2w4YE%APX7#o|f}Q>g z29UrH(!nXSi~L;_;G#em1)=h}&0v?qb;1fL-hUCgeH}#-Sc(#iQ1eHxg{UW4x1ctnlGNEJAvbaG zR@7!zGU_STBGeZ7p}dgdt^6z%pVhE#LphiAc2q6L7NeXCvIOO9B@MNWzj+60yE2qF z*He$rgdD%k;wynW-D9odox2iVv`{k4!6e#nUi~##(?{gY<=OJtu1KY-#9ME#(^>=Y zfu-;?%NMnSWkfy0GNE>|{805QGwNBEKWdjII#$vkizQImd&^pjck?43eDoa47xg^L zh?BiqHUdl-Yv7n4>ID{U%d0~WK-;phsX~M(!Q}&ih6aoTH3CdD&B{fB5?nVdrR>p~ zP;;@DMY)h!l#3Txl#3>LanD_HOqsX5b?2%SI^L*a1ZFfH=x|l#i)vxfbm(wZVqV;)&WyV%sWzqUz ze>0;12tXawM5~n!S@MdWB-yilz5NhBr&+zuqD4B)GNRsK(IR!QXp!Dz(IVk2wfXyF z>@8LR>TQ(J%>f zbCwZxl4U}jV)?-`_=06deJNLuKa4pW9Iv#0rA2fzd*d{V_Qn8<_QuyN6Y30$et|I+ zGg;CBRna#r+Un<6R7KySsEQ=4qI9gH{-1M$Jv(q~UUC!AphQkJ>&17@oQXlqQm>EU zP>_J~Z~^n8<*2DiN1RdgNhz3otrF;@{DDQ)^&^X_>pY99>jJmGHZ>iFw3vE2{KTRR z46`T$BP$tT-m==g0is;^>VN4!w|@s}e<>ZX()oIZ@c$0_mSO VI-#2IqI