|
|
@ -5,14 +5,17 @@ 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; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.PidUtils; |
|
|
@ -27,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; |
|
|
@ -43,6 +46,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.function.Function; |
|
|
@ -62,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) |
|
|
@ -136,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; |
|
|
|
} |
|
|
|
|
|
|
@ -149,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; |
|
|
|
} |
|
|
@ -421,6 +438,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
updateUserInfo(icResiCollectEntity,memberList.get(i),false,formDTO,userIdCardEntity); |
|
|
|
}else{ |
|
|
|
// 人员房屋不一致(更新人员信息和变更记录)
|
|
|
|
// 数据库中:ic_resi_user已存在居民,但是不住在当前信息采集他填写的房屋,
|
|
|
|
updateUserInfo(icResiCollectEntity,memberList.get(i),true,formDTO,userIdCardEntity); |
|
|
|
} |
|
|
|
}else{ |
|
|
@ -446,7 +464,9 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
getHouseInfoToCollectFormDTO.setDoorName(formDTO.getDoorName()); |
|
|
|
Result<IcHouseInfoCollectResultDTO> resultDTOResult = govOrgFeignClient.getHouseInfoToCollect(getHouseInfoToCollectFormDTO); |
|
|
|
IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = resultDTOResult.getData(); |
|
|
|
|
|
|
|
if(null==icHouseInfoCollectResultDTO){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"房屋不存在","房屋不存在,请先新建同名房屋"); |
|
|
|
} |
|
|
|
// 新增房屋后需要collect更新上房屋ID
|
|
|
|
// log
|
|
|
|
icResiCollectEntity.setHomeId(icHouseInfoCollectResultDTO.getId()); |
|
|
@ -462,7 +482,9 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
private void updateHouseInfo(IcResiCollectEntity icResiCollectEntity){ |
|
|
|
CollectHouseFormDTO collectHouseFormDTO = new CollectHouseFormDTO(); |
|
|
|
collectHouseFormDTO.setId(icResiCollectEntity.getHomeId()); |
|
|
|
//户主姓名
|
|
|
|
collectHouseFormDTO.setOwnerName(icResiCollectEntity.getHouseHolderName()); |
|
|
|
// 房屋状态:1:出租 0:自住 2:闲置 3:未售出
|
|
|
|
collectHouseFormDTO.setRentFlag(Integer.parseInt(icResiCollectEntity.getHouseType())); |
|
|
|
collectHouseFormDTO.setCustomerId(icResiCollectEntity.getCustomerId()); |
|
|
|
collectHouseFormDTO.setResiNumber(icResiCollectEntity.getTotalResi()); |
|
|
@ -476,60 +498,86 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
* @param icResiCollectMemDetailDTO 登记城阳信息 |
|
|
|
* @param isUpdateLog 是否更新记录 |
|
|
|
* @param formDTO 入参 |
|
|
|
* @param userEntity 根据身份证号查询到的user信息 |
|
|
|
* @param existedUserEntity 根据身份证号查询到的user信息 |
|
|
|
*/ |
|
|
|
private void updateUserInfo(IcResiCollectEntity icResiCollectEntity,IcResiCollectMemDetailDTO icResiCollectMemDetailDTO,Boolean isUpdateLog, |
|
|
|
IcResiCollectCheckFormDTO formDTO,IcResiUserEntity userEntity){ |
|
|
|
private void updateUserInfo(IcResiCollectEntity icResiCollectEntity, |
|
|
|
IcResiCollectMemDetailDTO icResiCollectMemDetailDTO, |
|
|
|
Boolean isUpdateLog, |
|
|
|
IcResiCollectCheckFormDTO formDTO, |
|
|
|
IcResiUserEntity existedUserEntity){ |
|
|
|
|
|
|
|
// 这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户
|
|
|
|
if (RelationshipEnum.SELF.getCode().equals(icResiCollectMemDetailDTO.getRelationship())) { |
|
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId()); |
|
|
|
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); |
|
|
|
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) |
|
|
|
.ne(IcResiUserEntity::getIdCard,icResiCollectMemDetailDTO.getIdNum()); |
|
|
|
List<IcResiUserEntity> entityList = icResiUserDao.selectList(wrapper); |
|
|
|
if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
|
String errorMsg = "房屋下已存在户主"; |
|
|
|
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); |
|
|
|
String errorMsg = "当前房屋下已存在户主"; |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(icResiCollectEntity.getAgencyId()); |
|
|
|
if (null == agencyInfoCache) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所属组织查询异常,agencyId:" + icResiCollectEntity.getAgencyId(), "所属组织查询异常"); |
|
|
|
} |
|
|
|
// userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身
|
|
|
|
userEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); |
|
|
|
userEntity.setAgencyId(icResiCollectEntity.getAgencyId()); |
|
|
|
userEntity.setGridId(icResiCollectEntity.getGridId()); |
|
|
|
userEntity.setVillageId(icResiCollectEntity.getVillageId()); |
|
|
|
userEntity.setBuildId(icResiCollectEntity.getBuildId()); |
|
|
|
userEntity.setUnitId(icResiCollectEntity.getUnitId()); |
|
|
|
userEntity.setHomeId(icResiCollectEntity.getHomeId()); |
|
|
|
userEntity.setName(icResiCollectMemDetailDTO.getName()); |
|
|
|
userEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); |
|
|
|
userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); |
|
|
|
userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); |
|
|
|
userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); |
|
|
|
userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); |
|
|
|
userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); |
|
|
|
icResiUserDao.updateById(userEntity); |
|
|
|
|
|
|
|
// 判断是否需要更新记录
|
|
|
|
if(isUpdateLog){ |
|
|
|
//变更记录表
|
|
|
|
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); |
|
|
|
changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId()); |
|
|
|
changeRecordEntity.setOperatorId(formDTO.getUserId()); |
|
|
|
changeRecordEntity.setIcUserId(userEntity.getId()); |
|
|
|
changeRecordEntity.setIcUserId(existedUserEntity.getId()); |
|
|
|
changeRecordEntity.setOperatorName(formDTO.getRealName()); |
|
|
|
changeRecordEntity.setIcUserName(userEntity.getName()); |
|
|
|
changeRecordEntity.setType("update"); |
|
|
|
changeRecordEntity.setTypeName("修改"); |
|
|
|
changeRecordEntity.setIcUserName(existedUserEntity.getName()); |
|
|
|
changeRecordEntity.setType("transfer"); |
|
|
|
changeRecordEntity.setTypeName("调动"); |
|
|
|
changeRecordEntity.setBeforeChangeName("-"); |
|
|
|
HouseInfoCache originHouseInfoCache= CustomerIcHouseRedis.getHouseInfo(icResiCollectEntity.getCustomerId(),existedUserEntity.getHomeId()); |
|
|
|
if(null!=originHouseInfoCache){ |
|
|
|
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.getGridName().concat(StrConstant.HYPHEN).concat(newHouseInfoCache.getAllName())); |
|
|
|
} |
|
|
|
changeRecordEntity.setChangeTime(new java.util.Date()); |
|
|
|
changeRecordEntity.setReason("来源于信息采集:更新居民所属房屋信息"); |
|
|
|
icUserChangeRecordService.insert(changeRecordEntity); |
|
|
|
} |
|
|
|
|
|
|
|
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(icResiCollectEntity.getAgencyId()); |
|
|
|
if (null == agencyInfoCache) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所属组织查询异常,agencyId:" + icResiCollectEntity.getAgencyId(), "所属组织查询异常"); |
|
|
|
} |
|
|
|
// userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身
|
|
|
|
existedUserEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); |
|
|
|
// 组织Id
|
|
|
|
existedUserEntity.setAgencyId(icResiCollectEntity.getAgencyId()); |
|
|
|
// 网格id
|
|
|
|
existedUserEntity.setGridId(icResiCollectEntity.getGridId()); |
|
|
|
// 小区id
|
|
|
|
existedUserEntity.setVillageId(icResiCollectEntity.getVillageId()); |
|
|
|
// 楼栋id
|
|
|
|
existedUserEntity.setBuildId(icResiCollectEntity.getBuildId()); |
|
|
|
// 单元id
|
|
|
|
existedUserEntity.setUnitId(icResiCollectEntity.getUnitId()); |
|
|
|
// 房屋id
|
|
|
|
existedUserEntity.setHomeId(icResiCollectEntity.getHomeId()); |
|
|
|
// 姓名
|
|
|
|
existedUserEntity.setName(icResiCollectMemDetailDTO.getName()); |
|
|
|
// 手机号
|
|
|
|
existedUserEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); |
|
|
|
// 身份证号
|
|
|
|
existedUserEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); |
|
|
|
// 与户主关系
|
|
|
|
existedUserEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); |
|
|
|
// 工作单位
|
|
|
|
existedUserEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); |
|
|
|
// 备注
|
|
|
|
existedUserEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); |
|
|
|
// 户籍所在地
|
|
|
|
existedUserEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); |
|
|
|
icResiUserDao.updateById(existedUserEntity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -542,49 +590,65 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
if (RelationshipEnum.SELF.getCode().equals(icResiCollectMemDetailDTO.getRelationship())) { |
|
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId()); |
|
|
|
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); |
|
|
|
wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) |
|
|
|
.ne(IcResiUserEntity::getIdCard,icResiCollectMemDetailDTO.getIdNum()); |
|
|
|
List<IcResiUserEntity> entityList = icResiUserDao.selectList(wrapper); |
|
|
|
// 已经存在户主了,当前成员填写的也是户主... 暂不处理
|
|
|
|
if (CollectionUtils.isNotEmpty(entityList)) { |
|
|
|
String errorMsg = "房屋下已存在户主"; |
|
|
|
throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); |
|
|
|
String errorMsg = "当前房屋下已存在户主"; |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 新增人员
|
|
|
|
IcResiUserEntity userEntity = new IcResiUserEntity(); |
|
|
|
IcResiUserEntity insertUserEntity = new IcResiUserEntity(); |
|
|
|
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(icResiCollectEntity.getAgencyId()); |
|
|
|
if (null == agencyInfoCache) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所属组织查询异常,agencyId:" + icResiCollectEntity.getAgencyId(), "所属组织查询异常"); |
|
|
|
} |
|
|
|
// 组织的pids 含agencyId本身
|
|
|
|
// userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身 !!!
|
|
|
|
userEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); |
|
|
|
userEntity.setAgencyId(icResiCollectEntity.getAgencyId()); |
|
|
|
userEntity.setGridId(icResiCollectEntity.getGridId()); |
|
|
|
userEntity.setVillageId(icResiCollectEntity.getVillageId()); |
|
|
|
userEntity.setBuildId(icResiCollectEntity.getBuildId()); |
|
|
|
userEntity.setUnitId(icResiCollectEntity.getUnitId()); |
|
|
|
userEntity.setHomeId(icResiCollectEntity.getHomeId()); |
|
|
|
userEntity.setName(icResiCollectMemDetailDTO.getName()); |
|
|
|
userEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); |
|
|
|
userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); |
|
|
|
userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); |
|
|
|
userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); |
|
|
|
userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); |
|
|
|
userEntity.setCustomerId(icResiCollectMemDetailDTO.getCustomerId()); |
|
|
|
userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); |
|
|
|
icResiUserDao.insert(userEntity); |
|
|
|
insertUserEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); |
|
|
|
// 网格所属组织id
|
|
|
|
insertUserEntity.setAgencyId(icResiCollectEntity.getAgencyId()); |
|
|
|
// 网格id
|
|
|
|
insertUserEntity.setGridId(icResiCollectEntity.getGridId()); |
|
|
|
// 小区id
|
|
|
|
insertUserEntity.setVillageId(icResiCollectEntity.getVillageId()); |
|
|
|
// 楼栋id
|
|
|
|
insertUserEntity.setBuildId(icResiCollectEntity.getBuildId()); |
|
|
|
//单元id
|
|
|
|
insertUserEntity.setUnitId(icResiCollectEntity.getUnitId()); |
|
|
|
//房屋id
|
|
|
|
insertUserEntity.setHomeId(icResiCollectEntity.getHomeId()); |
|
|
|
//姓名
|
|
|
|
insertUserEntity.setName(icResiCollectMemDetailDTO.getName()); |
|
|
|
//手机号
|
|
|
|
insertUserEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); |
|
|
|
insertUserEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); |
|
|
|
//与户主关系
|
|
|
|
insertUserEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); |
|
|
|
//工作单位
|
|
|
|
insertUserEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); |
|
|
|
// 备注
|
|
|
|
insertUserEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); |
|
|
|
insertUserEntity.setCustomerId(icResiCollectMemDetailDTO.getCustomerId()); |
|
|
|
// 户籍所在地
|
|
|
|
insertUserEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); |
|
|
|
icResiUserDao.insert(insertUserEntity); |
|
|
|
|
|
|
|
//变更记录表
|
|
|
|
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); |
|
|
|
changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId()); |
|
|
|
changeRecordEntity.setOperatorId(formDTO.getUserId()); |
|
|
|
changeRecordEntity.setIcUserId(userEntity.getId()); |
|
|
|
changeRecordEntity.setIcUserId(insertUserEntity.getId()); |
|
|
|
changeRecordEntity.setOperatorName(formDTO.getRealName()); |
|
|
|
changeRecordEntity.setIcUserName(userEntity.getName()); |
|
|
|
changeRecordEntity.setIcUserName(insertUserEntity.getName()); |
|
|
|
changeRecordEntity.setType("add"); |
|
|
|
changeRecordEntity.setTypeName("新增"); |
|
|
|
changeRecordEntity.setBeforeChangeName("-"); |
|
|
|
changeRecordEntity.setAfterChangeName("-"); |
|
|
|
changeRecordEntity.setReason("来源于信息采集"); |
|
|
|
changeRecordEntity.setChangeTime(new java.util.Date()); |
|
|
|
icUserChangeRecordService.insert(changeRecordEntity); |
|
|
|
|
|
|
@ -602,11 +666,21 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
IcResiUserEntity originUser = icResiUserDao.selectOne(query); |
|
|
|
return originUser; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 放回当前房屋内住的所有居民 |
|
|
|
* @param homeId |
|
|
|
* @param customerId |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private Map<String, IcResiUserEntity> queryOriginUserByHomeId(String homeId,String customerId) { |
|
|
|
LambdaQueryWrapper<IcResiUserEntity> query = new LambdaQueryWrapper<>(); |
|
|
|
query.eq(IcResiUserEntity::getHomeId, homeId); |
|
|
|
query.eq(IcResiUserEntity::getCustomerId, customerId); |
|
|
|
List<IcResiUserEntity> originUserList = icResiUserDao.selectList(query); |
|
|
|
if(CollectionUtils.isEmpty(originUserList)){ |
|
|
|
return new HashMap<>(); |
|
|
|
} |
|
|
|
Map<String, IcResiUserEntity> memMap = originUserList.stream().collect(Collectors.toMap(IcResiUserEntity::getIdCard, Function.identity())); |
|
|
|
return memMap; |
|
|
|
} |
|
|
|