sunyuchao 3 years ago
parent
commit
d2ee9a9f7e
  1. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcMoveInListFormDTO.java
  2. 279
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcMoveInListResultDTO.java
  3. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcMoveInRecordController.java
  4. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java
  5. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java
  6. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcMoveInRecordServiceImpl.java
  7. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml

2
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;

279
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<IcMoveInList> 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;
}

22
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<IcMoveInListResultDTO> list(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){
public Result<PageData<IcMoveInListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<IcMoveInListResultDTO>().ok(icMoveInRecordService.list(formDTO));
return new Result<PageData<IcMoveInListResultDTO>>().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<IcMoveInRecordExcel> 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<IcMoveInListResultDTO> data = null;
List<IcMoveInRecordExcel> 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<IcMoveInListResultDTO.IcMoveInList> detail(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){
public Result<IcMoveInListResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody IcMoveInListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<IcMoveInListResultDTO.IcMoveInList>().ok(icMoveInRecordService.detail(formDTO));
return new Result<IcMoveInListResultDTO>().ok(icMoveInRecordService.detail(formDTO));
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcMoveInRecordDao.java

@ -21,5 +21,5 @@ public interface IcMoveInRecordDao extends BaseDao<IcMoveInRecordEntity> {
* @Author sun
* @Description 迁入管理列表查询
**/
List<IcMoveInListResultDTO.IcMoveInList> selectMoveInList(IcMoveInListFormDTO formDTO);
List<IcMoveInListResultDTO> selectMoveInList(IcMoveInListFormDTO formDTO);
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcMoveInRecordService.java

@ -36,7 +36,7 @@ public interface IcMoveInRecordService extends BaseService<IcMoveInRecordEntity>
* @author generator
* @date 2022-05-09
*/
IcMoveInListResultDTO list(IcMoveInListFormDTO formDTO);
PageData<IcMoveInListResultDTO> list(IcMoveInListFormDTO formDTO);
/**
* 单条查询
@ -78,5 +78,5 @@ public interface IcMoveInRecordService extends BaseService<IcMoveInRecordEntity>
*/
void delete(String[] ids);
IcMoveInListResultDTO.IcMoveInList detail(IcMoveInListFormDTO formDTO);
IcMoveInListResultDTO detail(IcMoveInListFormDTO formDTO);
}

33
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<IcMoveInRecordDao
}
@Override
public IcMoveInListResultDTO list(IcMoveInListFormDTO formDTO) {
IcMoveInListResultDTO resultDTO = new IcMoveInListResultDTO();
public PageData<IcMoveInListResultDTO> list(IcMoveInListFormDTO formDTO) {
//列表/导出查询
PageInfo<IcMoveInListResultDTO.IcMoveInList> 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<IcMoveInListResultDTO> list = baseDao.selectMoveInList(formDTO);
PageInfo<IcMoveInListResultDTO> pageInfo = new PageInfo<>(list);
//查询封装房屋信息
if (!CollectionUtils.isEmpty(resultDTO.getList())) {
if (!CollectionUtils.isEmpty(list)) {
Map<String, String> map = new HashMap<>();
//查询房屋信息
Set<String> houseIds = resultDTO.getList().stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet());
Set<String> houseIds = list.stream().filter(l -> StringUtils.isNotBlank(l.getHomeId())).map(m -> m.getHomeId()).collect(Collectors.toSet());
Result<List<HouseInfoDTO>> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
@ -99,7 +100,7 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao
Map<String, String> 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<IcMoveInRecordDao
}
}
return resultDTO;
return new PageData<>(list, pageInfo.getTotal());
}
private QueryWrapper<IcMoveInRecordEntity> getWrapper(Map<String, Object> params){
@ -265,10 +266,10 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao
}
@Override
public IcMoveInListResultDTO.IcMoveInList detail(IcMoveInListFormDTO formDTO) {
IcMoveInListResultDTO.IcMoveInList resultDTO = new IcMoveInListResultDTO.IcMoveInList();
public IcMoveInListResultDTO detail(IcMoveInListFormDTO formDTO) {
IcMoveInListResultDTO resultDTO = new IcMoveInListResultDTO();
//1.查询迁入记录信息
List<IcMoveInListResultDTO.IcMoveInList> list = baseDao.selectMoveInList(formDTO);
List<IcMoveInListResultDTO> list = baseDao.selectMoveInList(formDTO);
//2.查询网格房屋信息
if (!CollectionUtils.isEmpty(list)) {
resultDTO = list.get(NumConstant.ZERO);
@ -290,6 +291,12 @@ public class IcMoveInRecordServiceImpl extends BaseServiceImpl<IcMoveInRecordDao
if (null != gridInfo) {
resultDTO.setGridName(gridInfo.getGridName());
}
//与户主关系字典表数据
if(StringUtils.isNotBlank(resultDTO.getHouseholderRelation())){
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
resultDTO.setHouseholderRelationName(statusMap.get(resultDTO.getHouseholderRelation()));
}
}
return resultDTO;

2
epmet-user/epmet-user-server/src/main/resources/mapper/IcMoveInRecordDao.xml

@ -3,7 +3,7 @@
<mapper namespace="com.epmet.dao.IcMoveInRecordDao">
<select id="selectMoveInList" resultType="com.epmet.dto.result.IcMoveInListResultDTO$IcMoveInList">
<select id="selectMoveInList" resultType="com.epmet.dto.result.IcMoveInListResultDTO">
SELECT
id moveInId,
grid_id gridId,

Loading…
Cancel
Save