Browse Source

人员变更明细表增加pids字段

master
sunyuchao 4 years ago
parent
commit
1319a1d65b
  1. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java
  2. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java
  3. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  4. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java
  5. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java

@ -49,6 +49,11 @@ public class IcUserChangeDetailedDTO implements Serializable {
*/
private String icUserChangeRecordId;
/**
* 组织的所有上级Id
*/
private String pids;
/**
* 组织Id
*/

5
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java

@ -46,6 +46,11 @@ public class IcUserChangeDetailedEntity extends BaseEpmetEntity {
*/
private String icUserChangeRecordId;
/**
* 组织的所有上级Id
*/
private String pids;
/**
* 组织Id
*/

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
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.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -254,6 +255,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (!resultList.success()) {
throw new RuntimeException("人员新增,获取客户居民类别预警配置表数据失败");
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(map.get("AGENCY_ID"));
if (null == agencyInfo) {
throw new EpmetException(String.format("查询组织信息失败%s", map.get("AGENCY_ID")));
}
IcUserChangeDetailedEntity outEntity = null;
for (IcResiCategoryWarnConfigDTO cf : resultList.getData()) {
if (map.containsKey(cf.getColumnName()) && "1".equals(map.get(cf.getColumnName()))) {
@ -261,6 +266,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
outEntity = new IcUserChangeDetailedEntity();
outEntity.setCustomerId(tokenDto.getCustomerId());
outEntity.setIcUserChangeRecordId(icUserChangeRecordId);
outEntity.setPids(agencyInfo.getPids());
outEntity.setAgencyId(map.get("AGENCY_ID"));
outEntity.setGridId(map.get("GRID_ID"));
outEntity.setNeighborHoodId(map.get("VILLAGE_ID"));
@ -399,6 +405,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
//变更明细里边存修改后的新值,是就存1否就存-1
categoryEntity = new IcUserChangeDetailedEntity();
categoryEntity.setCustomerId(tokenDto.getCustomerId());
categoryEntity.setPids(entity.getPids());
categoryEntity.setAgencyId(entity.getAgencyId());
categoryEntity.setGridId(map.containsKey("GRID_ID") ? map.get("GRID_ID") : entity.getGridId());
categoryEntity.setNeighborHoodId(map.containsKey("VILLAGE_ID") ? map.get("VILLAGE_ID") : entity.getVillageId());

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java

@ -19,8 +19,11 @@ package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
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.utils.Result;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcUserTransferRecordDao;
@ -231,12 +234,24 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
List<IcUserChangeDetailedEntity> list = new ArrayList<>();
IcUserChangeDetailedEntity outEntity = null;
IcUserChangeDetailedEntity inEntity = null;
AgencyInfoCache oldAgencyInfo = CustomerOrgRedis.getAgencyInfo(resiUserDTO.getAgencyId());
if (null == oldAgencyInfo) {
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()));
}
}
for (IcResiCategoryWarnConfigDTO 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());
@ -254,6 +269,7 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl<IcUserTrans
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());

3
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql

@ -0,0 +1,3 @@
ALTER TABLE `ic_user_change_detailed`
ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ''Id'' AFTER `IC_USER_CHANGE_RECORD_ID`;
Loading…
Cancel
Save