diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInListFormDTO.java index 7dc30d24f1..e7e510d247 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInListFormDTO.java @@ -69,7 +69,7 @@ public class IcMoveInListFormDTO implements Serializable { */ private Integer pageSize = 20; - private Boolean isPage = false; + private Boolean isPage = true; private String customerId; private String moveInId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcMoveInListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcMoveInListResultDTO.java index bcc6d70f55..92eef807fd 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcMoveInListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcMoveInListResultDTO.java @@ -16,152 +16,139 @@ import java.util.List; @Data public class IcMoveInListResultDTO implements Serializable { private static final long serialVersionUID = 1L; + + /** + * 迁入Id + */ + private String moveInId; + /** + * 网格ID + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 所属小区ID + */ + private String villageId; + /** + * 所属小区名称 + */ + private String villageName; + /** + * 所属楼宇Id + */ + private String buildId; + /** + * 所属楼宇名称 + */ + private String buildName; + /** + * 单元id + */ + private String unitId; + /** + * 单元名称 + */ + private String unitName; + /** + * 所属家庭Id + */ + private String homeId; + /** + * 所属家庭名称 + */ + private String homeName; + /** + * 所属家庭Id + */ + private String allName; + /** + * 姓名 + */ + private String name; + /** + * 是否享受福利【否:0 是:1】 + */ + private String isWeifare; + /** + * 是否勾选补充居民信息0否 1是 + */ + private String isCheck; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 性别(1男2女0未知) + */ + private String genderName; + + /** + * 年龄 + */ + private Integer age; + + /** + * 迁入时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date inTime; + + /** + * 迁入原因 + */ + private String inReason; + + /** + * 来源地区编码 + */ + private String sourceAddressCode; + /** + * 来源地区编码全路径 + */ + private String sourceAddressPathCode; + /** + * 来源地区地址 + */ + private String sourceAddress; + /** + * 详细地址 + */ + private String address; + + /** + * 迁移证号码 + */ + private String moveNumber; + + /** + * 户主姓名 + */ + private String householderName; + /** - * 议题总数 - */ - private Integer total; - - /** - * 议题列表 - */ - private List list; - - @Data - public static class IcMoveInList { - /** - * 迁入Id - */ - private String moveInId; - /** - * 网格ID - */ - private String gridId; - /** - * 网格名称 - */ - private String gridName; - /** - * 所属小区ID - */ - private String villageId; - /** - * 所属小区名称 - */ - private String villageName; - /** - * 所属楼宇Id - */ - private String buildId; - /** - * 所属楼宇名称 - */ - private String buildName; - /** - * 单元id - */ - private String unitId; - /** - * 单元名称 - */ - private String unitName; - /** - * 所属家庭Id - */ - private String homeId; - /** - * 所属家庭名称 - */ - private String homeName; - /** - * 所属家庭Id - */ - private String allName; - /** - * 姓名 - */ - private String name; - /** - * 是否享受福利【否:0 是:1】 - */ - private String isWeifare; - /** - * 是否勾选补充居民信息0否 1是 - */ - private String isCheck; - - /** - * 手机号 - */ - private String mobile; - - /** - * 身份证号 - */ - private String idCard; - - /** - * 性别(1男2女0未知) - */ - private String gender; - - /** - * 性别(1男2女0未知) - */ - private String genderName; - - /** - * 年龄 - */ - private Integer age; - - /** - * 迁入时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - private Date inTime; - - /** - * 迁入原因 - */ - private String inReason; - - /** - * 来源地区编码 - */ - private String sourceAddressCode; - /** - * 来源地区编码全路径 - */ - private String sourceAddressPathCode; - /** - * 来源地区地址 - */ - private String sourceAddress; - /** - * 详细地址 - */ - private String address; - - /** - * 迁移证号码 - */ - private String moveNumber; - - /** - * 户主姓名 - */ - private String householderName; - - /** - * 与户主关系[字典表] - */ - private String householderRelation; - - /** - * 与户主关系[字典表] - */ - private String householderRelationName; - - } + * 与户主关系[字典表] + */ + private String householderRelation; + + /** + * 与户主关系[字典表] + */ + private String householderRelationName; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java index aef718c8c9..4989355df4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; +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.DateUtils; @@ -18,10 +19,12 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcBirthRecordDTO; import com.epmet.dto.IcMoveInRecordDTO; import com.epmet.dto.form.IcMoveInAddEditFormDTO; import com.epmet.dto.form.IcMoveInListFormDTO; import com.epmet.dto.result.IcMoveInListResultDTO; +import com.epmet.excel.IcBirthRecordExcel; import com.epmet.excel.IcMoveInRecordExcel; import com.epmet.service.IcMoveInRecordService; import lombok.extern.slf4j.Slf4j; @@ -57,9 +60,9 @@ public class IcMoveInRecordController { @RequestMapping("list") @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) - public Result list(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){ + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); - return new Result().ok(icMoveInRecordService.list(formDTO)); + return new Result>().ok(icMoveInRecordService.list(formDTO)); } @NoRepeatSubmit @@ -89,13 +92,9 @@ public class IcMoveInRecordController { } @PostMapping("export") - public void export(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO, HttpServletResponse response) throws Exception { + public void export(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO, HttpServletResponse response) { formDTO.setCustomerId(tokenDto.getCustomerId()); - /* formDTO.setIsPage(true); - IcMoveInListResultDTO resultDTO = icMoveInRecordService.list(formDTO); - List list = ConvertUtils.sourceToTarget(resultDTO.getList(), IcMoveInRecordExcel.class); - ExcelUtils.exportExcelToTarget(response, null, list, IcMoveInRecordExcel.class);*/ - + formDTO.setIsPage(false); ExcelWriter excelWriter = null; formDTO.setPageSize(NumConstant.TEN_THOUSAND); int pageNo = NumConstant.ONE; @@ -103,9 +102,10 @@ public class IcMoveInRecordController { String fileName = "迁入管理"+DateUtils.format(new Date())+".xlsx"; excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcMoveInRecordExcel.class).build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; List list = null; do { - IcMoveInListResultDTO data = icMoveInRecordService.list(formDTO); + data = icMoveInRecordService.list(formDTO); list = ConvertUtils.sourceToTarget(data.getList(), IcMoveInRecordExcel.class); formDTO.setPageNo(++pageNo); excelWriter.write(list, writeSheet); @@ -120,10 +120,10 @@ public class IcMoveInRecordController { } @RequestMapping("detail") - public Result detail(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){ + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); - return new Result().ok(icMoveInRecordService.detail(formDTO)); + return new Result().ok(icMoveInRecordService.detail(formDTO)); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java index 9d568a8abd..e15d2d0b97 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java @@ -21,5 +21,5 @@ public interface IcMoveInRecordDao extends BaseDao { * @Author sun * @Description 【迁入管理】列表查询 **/ - List selectMoveInList(IcMoveInListFormDTO formDTO); + List selectMoveInList(IcMoveInListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java index 14704378b5..07eef5d36a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java @@ -36,7 +36,7 @@ public interface IcMoveInRecordService extends BaseService * @author generator * @date 2022-05-09 */ - IcMoveInListResultDTO list(IcMoveInListFormDTO formDTO); + PageData list(IcMoveInListFormDTO formDTO); /** * 单条查询 @@ -78,5 +78,5 @@ public interface IcMoveInRecordService extends BaseService */ void delete(String[] ids); - IcMoveInListResultDTO.IcMoveInList detail(IcMoveInListFormDTO formDTO); + IcMoveInListResultDTO detail(IcMoveInListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java index 3b545c8981..4c8f3b1252 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -18,6 +19,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcMoveInRecordDao; import com.epmet.dto.ChangeWelfareDTO; +import com.epmet.dto.IcBirthRecordDTO; import com.epmet.dto.IcMoveInRecordDTO; import com.epmet.dto.form.IcMoveInAddEditFormDTO; import com.epmet.dto.form.IcMoveInListFormDTO; @@ -25,6 +27,7 @@ import com.epmet.dto.form.IcResiUserTransferFormDTO; import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcMoveInListResultDTO; import com.epmet.dto.result.SyncResiResDTO; +import com.epmet.entity.IcBirthRecordEntity; import com.epmet.entity.IcMoveInRecordEntity; import com.epmet.entity.IcResiUserEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -78,19 +81,17 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl list(IcMoveInListFormDTO formDTO) { //列表/导出查询 - PageInfo data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()) - .doSelectPageInfo(() -> baseDao.selectMoveInList(formDTO)); - resultDTO.setTotal((int) data.getTotal()); - resultDTO.setList(data.getList()); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectMoveInList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); //查询封装房屋信息 - if (!CollectionUtils.isEmpty(resultDTO.getList())) { + if (!CollectionUtils.isEmpty(list)) { Map map = new HashMap<>(); //查询房屋信息 - Set houseIds = resultDTO.getList().stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet()); + Set houseIds = list.stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet()); Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId()); List houseInfoDTOList = houseInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); Map houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); @@ -99,7 +100,7 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); //封装数据 - for (IcMoveInListResultDTO.IcMoveInList v : resultDTO.getList()) { + for (IcMoveInListResultDTO v : list) { if (!map.containsKey(v.getGridId())) { //获取网格缓存信息 GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(v.getGridId()); @@ -119,7 +120,7 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } private QueryWrapper getWrapper(Map params){ @@ -265,10 +266,10 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl list = baseDao.selectMoveInList(formDTO); + List list = baseDao.selectMoveInList(formDTO); //2.查询网格房屋信息 if (!CollectionUtils.isEmpty(list)) { resultDTO = list.get(NumConstant.ZERO); @@ -290,6 +291,12 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + resultDTO.setHouseholderRelationName(statusMap.get(resultDTO.getHouseholderRelation())); + } } return resultDTO; diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml index 663aa09060..1c3d49016e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml @@ -3,7 +3,7 @@ - SELECT id moveInId, grid_id gridId,