| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -58,7 +58,6 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.excel.support.ExportResiUserItemDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.dto.form.CaResidentDetailsFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.dto.form.GetResidentDetailByIdCardFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.opendata.feign.GuardarDatosFeignClient; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -82,9 +81,10 @@ import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import javax.annotation.Resource; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.math.BigDecimal; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.math.RoundingMode; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.sql.Date; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.sql.Timestamp; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.text.NumberFormat; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.text.SimpleDateFormat; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.ConcurrentHashMap; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.concurrent.TimeUnit; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -145,6 +145,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private GuardarDatosFeignClient feignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private GovOrgOpenFeignClient getGovOrgOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String id = (String) params.get(FieldConstant.ID_HUMP); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -2265,6 +2267,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 绑定房屋 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param form | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return void | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author LZN | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @date 2022/6/22 16:30 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void bindHome(BindHomeFormDTO form) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 根据idCard获取ca_redident表的数据
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -2289,33 +2299,51 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 将人的信息放入ic_resi_user对象中
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcResiUserEntity entity = new IcResiUserEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        entity.setCustomerId(form.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isBlank(residentDetailByIdCard.getIdCard()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(residentDetailByIdCard.getResidentName()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(residentDetailByIdCard.getTelephone()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(residentDetailByIdCard.getBirthday().toString())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 进行日期转换
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(residentDetailByIdCard.getBirthday() == null){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("出生日期为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Date d = new Date(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String birthday = sdf.format(residentDetailByIdCard.getBirthday()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(residentDetailByIdCard.getIdCard()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isNotBlank(residentDetailByIdCard.getResidentName()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isNotBlank(residentDetailByIdCard.getTelephone()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isNotBlank(birthday)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setIdCard(residentDetailByIdCard.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setName(residentDetailByIdCard.getResidentName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setMobile(residentDetailByIdCard.getTelephone()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setBirthday(residentDetailByIdCard.getBirthday().toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setBirthday(birthday); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("人信息不全"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 将房屋的信息放入ic_resi_user对象中
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isBlank(houseInfo.getHomeId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(houseInfo.getNeighborHoodId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(houseInfo.getBuildingId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isBlank(houseInfo.getBuildingUnitId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(houseInfo.getHomeId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isNotBlank(houseInfo.getNeighborHoodId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isNotBlank(houseInfo.getBuildingId()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                && StringUtils.isNotBlank(houseInfo.getBuildingUnitId())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setHomeId(houseInfo.getHomeId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setVillageId(houseInfo.getNeighborHoodId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setBuildId(houseInfo.getBuildingId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setUnitId(houseInfo.getBuildingUnitId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setAgencyId(houseInfo.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 根据homeId获取gridId和pids
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Result<HouseAgencyInfoResultDTO> resultDTOResult = getGovOrgOpenFeignClient.getHouseAgencyInfo(houseInfo.getHomeId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setGridId(resultDTOResult.getData().getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            entity.setPids(resultDTOResult.getData().getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RenException("房屋信息不全"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (baseDao.selectCountByIdCard(form.getIdCard(), form.getCustomerId()) > 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					           String id = baseDao.seletIdByIdCard(entity.getCustomerId(),entity.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					           baseDao.updateByIdCard(entity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            baseDao.insert(entity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String id = baseDao.seletIdByIdCard(entity.getCustomerId(),entity.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |