Browse Source

信息采集详情返回与户主关系名称

master
yinzuomei 2 years ago
parent
commit
dc8d20f7de
  1. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java
  2. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java
  3. 34
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
  4. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  5. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectHouseInfoResultDTO.java

@ -3,7 +3,6 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author wgf
@ -54,4 +53,6 @@ public class CollectHouseInfoResultDTO implements Serializable {
* 房主姓名
*/
private String ownerName;
}

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java

@ -1,6 +1,5 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -26,7 +25,8 @@ public class CollectListResultDTO implements Serializable {
// 组织Id
private String agencyId;
private String gridId;
private String gridName;
/**
* 居住地址
*/
@ -113,7 +113,21 @@ public class CollectListResultDTO implements Serializable {
* 与户主关系
*/
private String relationship;
/**
* 来源于字典表
* 暂不清楚0
* 本人1
* 配偶2
* 子女3
* 父母4
* 岳父母或公婆5
* 祖父母6
* 媳婿7
* 孙子女8
* 兄弟姐妹9
* 其他10
*/
private String relationShipName;
/**
* 人脸照片
*/

34
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java

@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.RelationshipEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
@ -29,7 +30,7 @@ import com.epmet.entity.IcResiCollectEntity;
import com.epmet.entity.IcResiMemberEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiCollectService;
@ -65,19 +66,15 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
private IcResiMemberDao icResiMemberDao;
@Autowired
private IcResiUserDao icResiUserDao;
@Autowired
private IcResiCollectDao icResiCollectDao;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private IcUserChangeRecordService icUserChangeRecordService;
@Autowired
private DhDeviceUtil dhDeviceUtil;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Override
@Transactional(rollbackFor = Exception.class)
@ -139,6 +136,12 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
List<CollectListResultDTO> collectList = baseDao.getCollectList(formDTO);
result.setList(collectList);
}
result.getList().forEach(collectDTO->{
GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(collectDTO.getGridId());
if(null!=gridInfoCache){
collectDTO.setGridName(gridInfoCache.getGridNamePath());
}
});
return result;
}
@ -152,7 +155,18 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
public CollectListResultDTO detail(CollectListFormDTO formDTO) {
List<CollectListResultDTO> list = baseDao.getCollectList(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(NumConstant.ZERO);
CollectListResultDTO resultDTO=list.get(NumConstant.ZERO);
GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(resultDTO.getGridId());
if(null!=gridInfoCache){
resultDTO.setGridName(gridInfoCache.getGridNamePath());
}
Result<Map<String, String>> relationShipRes=adminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode());
for(CollectListResultDTO.CollectListMemberResultDTO member:resultDTO.getList()){
if(StringUtils.isNotBlank(member.getRelationship())&&relationShipRes.success()&&relationShipRes.getData().containsKey(member.getRelationship())){
member.setRelationShipName(relationShipRes.getData().get(member.getRelationship()));
}
}
return resultDTO;
}
return null;
}
@ -518,13 +532,13 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao,
changeRecordEntity.setBeforeChangeName("-");
HouseInfoCache originHouseInfoCache= CustomerIcHouseRedis.getHouseInfo(icResiCollectEntity.getCustomerId(),existedUserEntity.getHomeId());
if(null!=originHouseInfoCache){
changeRecordEntity.setBeforeChangeName(originHouseInfoCache.getAgencyPathName().concat(StrConstant.HYPHEN).concat(originHouseInfoCache.getGridName()).concat(StrConstant.HYPHEN).concat(originHouseInfoCache.getAllName()));
changeRecordEntity.setBeforeChangeName(originHouseInfoCache.getGridName().concat(StrConstant.HYPHEN).concat(originHouseInfoCache.getAllName()));
}
changeRecordEntity.setAfterChangeName("-");
HouseInfoCache newHouseInfoCache = CustomerIcHouseRedis.getHouseInfo(icResiCollectEntity.getCustomerId(), icResiCollectEntity.getHomeId());
if (null != newHouseInfoCache) {
//信息采集时居民自己填写的房屋 以他填写的为准!!!!!!
changeRecordEntity.setAfterChangeName(newHouseInfoCache.getAgencyPathName().concat(StrConstant.HYPHEN).concat(newHouseInfoCache.getGridName()).concat(StrConstant.HYPHEN).concat(newHouseInfoCache.getAllName()));
changeRecordEntity.setAfterChangeName(newHouseInfoCache.getGridName().concat(StrConstant.HYPHEN).concat(newHouseInfoCache.getAllName()));
}
changeRecordEntity.setChangeTime(new java.util.Date());
changeRecordEntity.setReason("来源于信息采集:更新居民所属房屋信息");

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -328,7 +328,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (map.containsKey("YHZGX") && RelationshipEnum.SELF.getCode().equals(map.get("YHZGX"))) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, map.get("HOME_ID"));
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
@ -597,7 +598,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (entity != null && !RelationshipEnum.SELF.getCode().equals(entity.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, entity.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
@ -2770,7 +2772,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, dto.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
@ -2792,7 +2795,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, dto.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
@ -2842,7 +2846,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";
@ -2874,7 +2879,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) {
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, houseInfo.getHouseId());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode());
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode())
.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
List<IcResiUserEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(entityList)) {
String errorMsg = "房屋下已存在户主";

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

@ -19,6 +19,7 @@
<result property="homeId" column="homeId"/>
<result property="checkState" column="checkState"/>
<result property="agencyId" column="agencyId"/>
<result property="gridId" column="gridId"/>
<result property="domicilePlace" column="domicilePlace"></result>
<collection property="list" ofType="com.epmet.dto.result.CollectListResultDTO$CollectListMemberResultDTO" column="{id=id,domicilePlace=domicile_place}" select="selectMemberList"/>
</resultMap>
@ -32,6 +33,7 @@
c.HOME_ID as homeId,
c.CHECK_STATE as checkState,
c.AGENCY_ID as agencyId,
c.GRID_ID as gridId,
#{domicilePlace} as domicile_place
FROM ic_resi_collect c
left join ic_resi_member m on(c.id=m.IC_RESI_COLLECT_ID and m.del_flag='0')

Loading…
Cancel
Save