| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -18,7 +18,6 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.epmet.service.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -29,6 +28,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.validator.ValidatorUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.IcResiUserConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.IcResiUserDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.IcUserTransferRecordDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcResiCategoryStatsConfigDTO; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -171,7 +171,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> map = icResiUserDao.getCategoryListMap(columns, formDTO.getIcUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(categoryListResult.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO, NumConstant.ONE_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(categoryListResult.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO, IcResiUserConstant.CHANGE); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        icUserChangeDetailedService.insertBatch(changeDetailedEntityList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -222,6 +222,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param  origin 1:变动;2:迁出;3:死亡 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param  origin:变动:change; 迁出:out;    死亡:died; 出生birth; 迁入:in | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @Author sun | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @Description 变更明细 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     **/ | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -239,38 +240,43 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(String.format("查询组织信息失败%s", resiUserDTO.getAgencyId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        AgencyInfoCache newAgencyInfo = new AgencyInfoCache(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if ("in".equals(formDTO.getType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            newAgencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getNewAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (null == newAgencyInfo) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                throw new EpmetException(String.format("查询组织信息失败%s", formDTO.getNewAgencyId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (IcResiUserConstant.CHANGE.equals(origin) || IcResiUserConstant.OUT.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //变动和迁出才会校验新组织
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if ("in".equals(formDTO.getType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                newAgencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getNewAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (null == newAgencyInfo) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    throw new EpmetException(String.format("查询组织信息失败%s", formDTO.getNewAgencyId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (IcResiCategoryStatsConfigDTO cf : configList) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if ("1".equals(map.get(cf.getColumnName()))) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //迁出
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity = new IcUserChangeDetailedEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setIcUserChangeRecordId(icUserChangeRecordId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setPids(oldAgencyInfo.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setAgencyId(resiUserDTO.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setGridId(resiUserDTO.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setNeighborHoodId(resiUserDTO.getVillageId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setBuildingId(resiUserDTO.getBuildId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setBuildingUnitId(resiUserDTO.getUnitId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setHouseId(resiUserDTO.getHomeId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setIcUserId(formDTO.getIcUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (NumConstant.ONE_STR.equals(origin) || NumConstant.TWO_STR.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setType("out"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setTypeName("迁出"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else if( NumConstant.THREE_STR.equals(origin)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setType("die"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setTypeName("死亡"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (IcResiUserConstant.CHANGE.equals(origin) || IcResiUserConstant.OUT.equals(origin) || IcResiUserConstant.DIED.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity = new IcUserChangeDetailedEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setIcUserChangeRecordId(icUserChangeRecordId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setPids(oldAgencyInfo.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setAgencyId(resiUserDTO.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setGridId(resiUserDTO.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setNeighborHoodId(resiUserDTO.getVillageId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setBuildingId(resiUserDTO.getBuildId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setBuildingUnitId(resiUserDTO.getUnitId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setHouseId(resiUserDTO.getHomeId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setIcUserId(formDTO.getIcUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (IcResiUserConstant.CHANGE.equals(origin) || IcResiUserConstant.OUT.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        outEntity.setType("out"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        outEntity.setTypeName("迁出"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } else if (IcResiUserConstant.DIED.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        outEntity.setType("die"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        outEntity.setTypeName("死亡"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setFieldName(cf.getColumnName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    outEntity.setValue(-1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    list.add(outEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setFieldName(cf.getColumnName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                outEntity.setValue(-1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                list.add(outEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                //原来的变动,并且是迁入到同客户内走下面的流程
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if ("in".equals(formDTO.getType()) && NumConstant.ONE_STR.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if ("in".equals(formDTO.getType()) && IcResiUserConstant.CHANGE.equals(origin)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity = new IcUserChangeDetailedEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setIcUserChangeRecordId(icUserChangeRecordId); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -287,6 +293,25 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setFieldName(cf.getColumnName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setValue(1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    list.add(inEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else if(IcResiUserConstant.IN.equals(origin)||IcResiUserConstant.BIRTH.equals(origin)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    //    迁入和出生的
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity = new IcUserChangeDetailedEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setIcUserChangeRecordId(icUserChangeRecordId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setPids(newAgencyInfo.getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setAgencyId(formDTO.getNewAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setGridId(formDTO.getNewGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setNeighborHoodId(formDTO.getNewNeighborHoodId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setBuildingId(formDTO.getNewBuildingId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setBuildingUnitId(formDTO.getNewBuildingUnitId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setHouseId(formDTO.getNewHouseId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setIcUserId(formDTO.getIcUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    //出生和迁入 =》迁入
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setType("in"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setTypeName("迁入"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setFieldName(cf.getColumnName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    inEntity.setValue(1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    list.add(inEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -307,13 +332,13 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcResiUserDTO resiUserDTO = getIcResiUserDTO(formDTO.getCustomerId(), formDTO.getIcUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //2.查询人员调动前的组织、网格、小区、楼栋、单元、房屋信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcResiUserOrgMsgResultDTO icResiUserOrgMsgResultDTO = getIcResiUserOrgMsgResultDTO(resiUserDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息;(只有moveType=out迁出时result2才有值)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<IcResiUserOrgMsgResultDTO> result2 = getNewHouseInfo(formDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //5.生成调动记录:  只有迁出的才生成
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if("out".equals(formDTO.getMoveType())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(IcResiUserConstant.OUT.equals(formDTO.getOrigin())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IcUserTransferRecordEntity recordEntity = saveTransferRecord(staffInfoCache, formDTO, resiUserDTO, icResiUserOrgMsgResultDTO, result2.getData()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            insert(recordEntity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setIcUserTransferRecordId(recordEntity.getId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -327,25 +352,33 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setIcUserName(resiUserDTO.getName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //迁出存调动,死亡存注销
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if ("out".equals(formDTO.getMoveType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (IcResiUserConstant.OUT.equals(formDTO.getOrigin())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setType("transfer"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setTypeName("调动"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else if ("died".equals(formDTO.getMoveType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else if (IcResiUserConstant.DIED.equals(formDTO.getOrigin())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setType("logout"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setTypeName("注销"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else if (IcResiUserConstant.IN.equals(formDTO.getOrigin()) || IcResiUserConstant.BIRTH.equals(formDTO.getOrigin())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //迁入和出生都是新增???
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setType("add"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setTypeName("新增"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        StringBuffer beforeName = new StringBuffer(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        beforeName.append(icResiUserOrgMsgResultDTO.getAgencyDTO().getOrganizationName()).append("-").append(icResiUserOrgMsgResultDTO.getGridDTO().getGridName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .append(icResiUserOrgMsgResultDTO.getNeighborHoodDTO().getNeighborHoodName()).append("-").append(icResiUserOrgMsgResultDTO.getBuildingDTO().getBuildingName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .append(icResiUserOrgMsgResultDTO.getBuildingUnitDTO().getUnitName()).append("-").append(icResiUserOrgMsgResultDTO.getHouseDTO().getHouseName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setBeforeChangeName(beforeName.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        StringBuffer afterName = new StringBuffer(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if ("in".equals(formDTO.getType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            afterName.append(result2.getData().getAgencyDTO().getOrganizationName()).append("-").append(result2.getData().getGridDTO().getGridName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    .append(result2.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result2.getData().getBuildingDTO().getBuildingName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    .append(result2.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result2.getData().getHouseDTO().getHouseName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //只有迁出才会赋值变更前,变更后这两句话
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (IcResiUserConstant.OUT.equals(formDTO.getOrigin())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            StringBuffer beforeName = new StringBuffer(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            beforeName.append(icResiUserOrgMsgResultDTO.getAgencyDTO().getOrganizationName()).append("-").append(icResiUserOrgMsgResultDTO.getGridDTO().getGridName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    .append(icResiUserOrgMsgResultDTO.getNeighborHoodDTO().getNeighborHoodName()).append("-").append(icResiUserOrgMsgResultDTO.getBuildingDTO().getBuildingName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    .append(icResiUserOrgMsgResultDTO.getBuildingUnitDTO().getUnitName()).append("-").append(icResiUserOrgMsgResultDTO.getHouseDTO().getHouseName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setBeforeChangeName(beforeName.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            StringBuffer afterName = new StringBuffer(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if ("in".equals(formDTO.getType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                afterName.append(result2.getData().getAgencyDTO().getOrganizationName()).append("-").append(result2.getData().getGridDTO().getGridName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        .append(result2.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result2.getData().getBuildingDTO().getBuildingName()).append("-") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        .append(result2.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result2.getData().getHouseDTO().getHouseName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            changeRecordEntity.setAfterChangeName(StringUtils.isEmpty(afterName.toString()) ? "-" : afterName.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setAfterChangeName(StringUtils.isEmpty(afterName.toString()) ? "-" : afterName.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setChangeTime(formDTO.getTransferTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setReason(formDTO.getReason()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        changeRecordEntity.setRemark(formDTO.getRemark()); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -359,7 +392,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<String> columns = categoryListResult.getData().stream().map(IcResiCategoryStatsConfigDTO::getColumnName).collect(Collectors.toList()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> map = icResiUserDao.getCategoryListMap(columns, formDTO.getIcUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(categoryListResult.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO, NumConstant.TWO_STR); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcUserChangeDetailedEntity> changeDetailedEntityList = saveChangeDetailed(categoryListResult.getData(), map, changeRecordEntity.getId(), formDTO, resiUserDTO, formDTO.getOrigin()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        icUserChangeDetailedService.insertBatch(changeDetailedEntityList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -408,7 +441,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private Result<IcResiUserOrgMsgResultDTO> getNewHouseInfo(IcResiUserTransferFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<IcResiUserOrgMsgResultDTO> result2 = new Result<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if ("out".equals(formDTO.getMoveType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (IcResiUserConstant.OUT.equals(formDTO.getOrigin())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |