| 
						
						
							
								
							
						
						
					 | 
					@ -21,6 +21,7 @@ import cn.hutool.core.bean.BeanUtil; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import cn.hutool.core.collection.CollUtil; | 
					 | 
					 | 
					import cn.hutool.core.collection.CollUtil; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.toolkit.IdWorker; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.bean.ResiExportBaseInfoData; | 
					 | 
					 | 
					import com.epmet.bean.ResiExportBaseInfoData; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
					 | 
					 | 
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.*; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.*; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -56,12 +57,12 @@ import com.epmet.dto.form.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; | 
					 | 
					 | 
					import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.result.*; | 
					 | 
					 | 
					import com.epmet.dto.result.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.result.demand.IcResiDemandDictDTO; | 
					 | 
					 | 
					import com.epmet.dto.result.demand.IcResiDemandDictDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.dto.result.demand.OptionDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.*; | 
					 | 
					 | 
					import com.epmet.entity.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.excel.support.ExportResiUserItemDTO; | 
					 | 
					 | 
					import com.epmet.excel.support.ExportResiUserItemDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.feign.*; | 
					 | 
					 | 
					import com.epmet.feign.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; | 
					 | 
					 | 
					import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.*; | 
					 | 
					 | 
					import com.epmet.service.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.result.demand.OptionDTO; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.github.pagehelper.Page; | 
					 | 
					 | 
					import com.github.pagehelper.Page; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.github.pagehelper.PageHelper; | 
					 | 
					 | 
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.github.pagehelper.PageInfo; | 
					 | 
					 | 
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -204,7 +205,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //1.先往主表新增数据
 | 
					 | 
					 | 
					        //1.先往主表新增数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //主表Id
 | 
					 | 
					 | 
					        //主表Id
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        String resiUserId = UUID.randomUUID().toString().replaceAll("-", ""); | 
					 | 
					 | 
					        String resiUserId = IdWorker.getIdStr(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        String name = ""; | 
					 | 
					 | 
					        String name = ""; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        LinkedHashMap<String, String> map = new LinkedHashMap<>(); | 
					 | 
					 | 
					        LinkedHashMap<String, String> map = new LinkedHashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); | 
					 | 
					 | 
					        com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -231,6 +232,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (!map.containsKey("AGENCY_ID")) { | 
					 | 
					 | 
					                if (!map.containsKey("AGENCY_ID")) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    throw new RenException("新增居民信息--入参AGENCY_ID为空"); | 
					 | 
					 | 
					                    throw new RenException("新增居民信息--入参AGENCY_ID为空"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (!map.containsKey(UserConstant.GRID_ID)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    throw new RenException("新增居民信息--入参GRID_ID为空"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                //2021.11.25 新增需求 客户下身份证号唯一  start
 | 
					 | 
					 | 
					                //2021.11.25 新增需求 客户下身份证号唯一  start
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (map.containsKey("ID_CARD")) { | 
					 | 
					 | 
					                if (map.containsKey("ID_CARD")) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(map.get("ID_CARD"), tokenDto.getCustomerId()); | 
					 | 
					 | 
					                    IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(map.get("ID_CARD"), tokenDto.getCustomerId()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -257,7 +261,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                String agencyId = map.get("AGENCY_ID"); | 
					 | 
					 | 
					                String agencyId = map.get("AGENCY_ID"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                Result<CustomerAgencyDTO> result = govOrgOpenFeignClient.getAgencyById(agencyId); | 
					 | 
					 | 
					                Result<CustomerAgencyDTO> result = govOrgOpenFeignClient.getAgencyById(agencyId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (result.success() && null != result.getData()) { | 
					 | 
					 | 
					                if (result.success() && null != result.getData()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    map.put("pids", result.getData().getPids()); | 
					 | 
					 | 
					                    //pids拼上 agencyId
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    String pids = result.getData().getPids(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if (StringUtils.isBlank(pids)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        pids = agencyId; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } else  if (!pids.contains(agencyId)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        pids = pids + StrConstant.COLON + agencyId; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    map.put("pids", pids); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } else { | 
					 | 
					 | 
					                } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    throw new RenException(String.format("新增居民信息-根据agencyId查询组织信息失败,agencyId->%s", agencyId)); | 
					 | 
					 | 
					                    throw new RenException(String.format("新增居民信息-根据agencyId查询组织信息失败,agencyId->%s", agencyId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -1999,6 +2010,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); | 
					 | 
					 | 
					            IcResiUserEntity entity = ConvertUtils.sourceToTarget(formDTO.getUser(), IcResiUserEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            entity.setIsTenant(NumConstant.ONE_STR); | 
					 | 
					 | 
					            entity.setIsTenant(NumConstant.ONE_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            entity.setIsFloating(NumConstant.ONE_STR); | 
					 | 
					 | 
					            entity.setIsFloating(NumConstant.ONE_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            //pids 改为 拼接上自身
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            this.setIcResiUserPids(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            insert(entity); | 
					 | 
					 | 
					            insert(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            resiUserId = entity.getId(); | 
					 | 
					 | 
					            resiUserId = entity.getId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            // 变更记录表和变更记录明细表新增数据
 | 
					 | 
					 | 
					            // 变更记录表和变更记录明细表新增数据
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -2350,6 +2363,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        dto.setHomeId(user.getHomeId()); | 
					 | 
					 | 
					        dto.setHomeId(user.getHomeId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); | 
					 | 
					 | 
					        IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        this.setIcResiUserPids(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        insert(entity); | 
					 | 
					 | 
					        insert(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return new Result().ok("新增成功"); | 
					 | 
					 | 
					        return new Result().ok("新增成功"); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -2381,6 +2395,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); | 
					 | 
					 | 
					        IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        this.setIcResiUserPids(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        entity.setId(dto.getIcResiUserId()); | 
					 | 
					 | 
					        entity.setId(dto.getIcResiUserId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        updateById(entity); | 
					 | 
					 | 
					        updateById(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return new Result().ok("修改成功"); | 
					 | 
					 | 
					        return new Result().ok("修改成功"); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -2427,6 +2442,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); | 
					 | 
					 | 
					        IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        this.setIcResiUserPids(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        insert(entity); | 
					 | 
					 | 
					        insert(entity); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return new Result().ok("新增成功"); | 
					 | 
					 | 
					        return new Result().ok("新增成功"); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -2631,4 +2647,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public List<String> getAllUserIds(String idCard, String customerId) { | 
					 | 
					 | 
					    public List<String> getAllUserIds(String idCard, String customerId) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return baseDao.getAllUserIds(idCard, customerId); | 
					 | 
					 | 
					        return baseDao.getAllUserIds(idCard, customerId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * desc:设置居民的pids pids为agencyId的pids+agencyId 即包含组织本身 如果pids 为空则pids 为agencyId | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param entity | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public void setIcResiUserPids(IcResiUserEntity entity) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        String agencyPath = entity.getPids(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isBlank(agencyPath)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            agencyPath = entity.getAgencyId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } else if (!agencyPath.contains(entity.getAgencyId())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            agencyPath = agencyPath + StrConstant.COLON + entity.getAgencyId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        entity.setPids(agencyPath); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					
  |