|
|
@ -256,8 +256,10 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
} |
|
|
|
for (IcResiCategoryStatsConfigDTO cf : configList) { |
|
|
|
if ("1".equals(map.get(cf.getColumnName()))) { |
|
|
|
//迁出
|
|
|
|
if (IcResiUserConstant.CHANGE.equals(origin) || IcResiUserConstant.OUT.equals(origin) || IcResiUserConstant.DIED.equals(origin)) { |
|
|
|
//本社区的居民,状态正常,在迁入登记界面,变更了房屋信息,旧的房屋-1
|
|
|
|
//迁出登记时居民当前所属的房屋,-1
|
|
|
|
//死忙登记时居民当前所属的房屋,-1
|
|
|
|
outEntity = new IcUserChangeDetailedEntity(); |
|
|
|
outEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
outEntity.setIcUserChangeRecordId(icUserChangeRecordId); |
|
|
@ -281,7 +283,8 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
list.add(outEntity); |
|
|
|
} |
|
|
|
//原来的变动,并且是迁入到同客户内走下面的流程
|
|
|
|
if ("in".equals(formDTO.getType()) && IcResiUserConstant.CHANGE.equals(origin)) {//todo
|
|
|
|
if ("in".equals(formDTO.getType()) && IcResiUserConstant.CHANGE.equals(origin)) { |
|
|
|
//本社区的居民,状态正常,在迁入登记界面,变更了房屋信息,新的房屋+1
|
|
|
|
inEntity = new IcUserChangeDetailedEntity(); |
|
|
|
inEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
inEntity.setIcUserChangeRecordId(icUserChangeRecordId); |
|
|
@ -299,8 +302,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
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); |
|
|
@ -338,13 +340,13 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
IcResiUserDTO resiUserDTO = getIcResiUserDTO(formDTO.getCustomerId(), formDTO.getIcUserId()); |
|
|
|
//2.查询人员调动前的组织、网格、小区、楼栋、单元、房屋信息
|
|
|
|
IcResiUserOrgMsgResultDTO icResiUserOrgMsgResultDTO = getIcResiUserOrgMsgResultDTO(resiUserDTO); |
|
|
|
//3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息;(只有moveType=out迁出时result2才有值)
|
|
|
|
//3.查询人员调动后的组织、网格、小区、楼栋、单元、房屋信息;
|
|
|
|
Result<IcResiUserOrgMsgResultDTO> result2 = getNewHouseInfo(formDTO); |
|
|
|
|
|
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); |
|
|
|
IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); |
|
|
|
//5.生成调动记录: 只有迁出,或者房屋变更的才生成居民调动记录表ic_user_transfer_record记录
|
|
|
|
if (IcResiUserConstant.OUT.equals(formDTO.getOrigin()) || IcResiUserConstant.CHANGE.equals(formDTO.getOrigin())) { |
|
|
|
//5.生成调动记录: 只有迁入,或者房屋变更(变动)的才生成居民调动记录表ic_user_transfer_record记录
|
|
|
|
if (IcResiUserConstant.IN.equals(formDTO.getOrigin()) || IcResiUserConstant.CHANGE.equals(formDTO.getOrigin())) { |
|
|
|
IcUserTransferRecordEntity recordEntity = saveTransferRecord(staffInfoCache, formDTO, resiUserDTO, icResiUserOrgMsgResultDTO, result2.getData()); |
|
|
|
insert(recordEntity); |
|
|
|
changeRecordEntity.setIcUserTransferRecordId(recordEntity.getId()); |
|
|
@ -357,22 +359,23 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
changeRecordEntity.setIcUserId(formDTO.getIcUserId()); |
|
|
|
changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); |
|
|
|
changeRecordEntity.setIcUserName(resiUserDTO.getName()); |
|
|
|
//迁出存调动,死亡存注销
|
|
|
|
if (IcResiUserConstant.OUT.equals(formDTO.getOrigin())||IcResiUserConstant.CHANGE.equals(formDTO.getOrigin())) { |
|
|
|
if (IcResiUserConstant.OUT.equals(formDTO.getOrigin()) |
|
|
|
|| IcResiUserConstant.CHANGE.equals(formDTO.getOrigin()) |
|
|
|
|| IcResiUserConstant.IN.equals(formDTO.getOrigin())) { |
|
|
|
//迁出管理、迁出都属于调动
|
|
|
|
changeRecordEntity.setType("transfer"); |
|
|
|
changeRecordEntity.setTypeName("调动"); |
|
|
|
} else if (IcResiUserConstant.DIED.equals(formDTO.getOrigin())) { |
|
|
|
changeRecordEntity.setType("logout"); |
|
|
|
changeRecordEntity.setTypeName("注销"); |
|
|
|
} else if (IcResiUserConstant.IN.equals(formDTO.getOrigin())) { |
|
|
|
changeRecordEntity.setType("add"); |
|
|
|
changeRecordEntity.setTypeName("新增"); |
|
|
|
}else if(IcResiUserConstant.ADD.equals(formDTO.getOrigin())){ |
|
|
|
} else if (IcResiUserConstant.ADD.equals(formDTO.getOrigin())) { |
|
|
|
changeRecordEntity.setType("add"); |
|
|
|
changeRecordEntity.setTypeName("新增"); |
|
|
|
} |
|
|
|
//只有迁出、变动才会赋值变更前,变更后这两句话
|
|
|
|
if (IcResiUserConstant.OUT.equals(formDTO.getOrigin()) || IcResiUserConstant.CHANGE.equals(formDTO.getOrigin())) { |
|
|
|
//迁入、迁出、变更
|
|
|
|
if (IcResiUserConstant.OUT.equals(formDTO.getOrigin()) |
|
|
|
|| IcResiUserConstant.CHANGE.equals(formDTO.getOrigin()) |
|
|
|
|| IcResiUserConstant.IN.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("-") |
|
|
@ -384,7 +387,11 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
.append(result2.getData().getNeighborHoodDTO().getNeighborHoodName()).append("-").append(result2.getData().getBuildingDTO().getBuildingName()).append("-") |
|
|
|
.append(result2.getData().getBuildingUnitDTO().getUnitName()).append("-").append(result2.getData().getHouseDTO().getDoorName()); |
|
|
|
} |
|
|
|
changeRecordEntity.setAfterChangeName(StringUtils.isEmpty(afterName.toString()) ? "-" : afterName.toString()); |
|
|
|
if (IcResiUserConstant.OUT.equals(formDTO.getOrigin())) { |
|
|
|
changeRecordEntity.setAfterChangeName(StringUtils.isEmpty(afterName.toString()) ? "-" : "拟迁入:".concat(afterName.toString())); |
|
|
|
} else { |
|
|
|
changeRecordEntity.setAfterChangeName(StringUtils.isEmpty(afterName.toString()) ? "-" : afterName.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
changeRecordEntity.setChangeTime(formDTO.getTransferTime()); |
|
|
@ -448,26 +455,10 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
*/ |
|
|
|
private Result<IcResiUserOrgMsgResultDTO> getNewHouseInfo(IcResiUserTransferFormDTO formDTO) { |
|
|
|
Result<IcResiUserOrgMsgResultDTO> result2 = new Result<>(); |
|
|
|
if ((IcResiUserConstant.OUT.equals(formDTO.getOrigin()) || IcResiUserConstant.CHANGE.equals(formDTO.getOrigin())) |
|
|
|
if ((IcResiUserConstant.IN.equals(formDTO.getOrigin()) || IcResiUserConstant.CHANGE.equals(formDTO.getOrigin())) |
|
|
|
&& "in".equals(formDTO.getType())) { |
|
|
|
//迁出/变动且类型为 迁出到本客户内的,才会查询新的房屋信息;迁出到其他的不查询
|
|
|
|
IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO(); |
|
|
|
orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId()); |
|
|
|
orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId()); |
|
|
|
orgMsgFormDTO2.setGridId(formDTO.getNewGridId()); |
|
|
|
orgMsgFormDTO2.setNeighborHoodId(formDTO.getNewNeighborHoodId()); |
|
|
|
orgMsgFormDTO2.setBuildingId(formDTO.getNewBuildingId()); |
|
|
|
orgMsgFormDTO2.setBuildingUnitId(formDTO.getNewBuildingUnitId()); |
|
|
|
orgMsgFormDTO2.setHouseId(formDTO.getNewHouseId()); |
|
|
|
result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2); |
|
|
|
if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO() |
|
|
|
|| null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查找迁入后的组织、网格、小区、楼栋、单元、房屋信息失败", "迁出至的房屋信息异常"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (IcResiUserConstant.IN.equals(formDTO.getOrigin())) { |
|
|
|
//|| IcResiUserConstant.BIRTH.equals(formDTO.getOrigin())
|
|
|
|
//出生管理、迁入管理的查询当前选择的房屋信息
|
|
|
|
//迁入管理-迁入登记
|
|
|
|
//变更
|
|
|
|
IcResiUserOrgMsgFormDTO orgMsgFormDTO2 = new IcResiUserOrgMsgFormDTO(); |
|
|
|
orgMsgFormDTO2.setCustomerId(formDTO.getCustomerId()); |
|
|
|
orgMsgFormDTO2.setAgencyId(formDTO.getNewAgencyId()); |
|
|
@ -479,7 +470,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans |
|
|
|
result2 = govOrgOpenFeignClient.icResiUserOrgMsg(orgMsgFormDTO2); |
|
|
|
if (!result2.success() || null == result2.getData().getAgencyDTO() || null == result2.getData().getGridDTO() || null == result2.getData().getNeighborHoodDTO() |
|
|
|
|| null == result2.getData().getBuildingDTO() || null == result2.getData().getBuildingUnitDTO() || null == result2.getData().getHouseDTO()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "迁入/出生管理:查找迁入后的组织、网格、小区、楼栋、单元、房屋信息失败", "所属房屋信息异常"); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查找迁入后的组织、网格、小区、楼栋、单元、房屋信息失败", "所属房屋信息异常"); |
|
|
|
} |
|
|
|
} |
|
|
|
return result2; |
|
|
|