diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql new file mode 100644 index 0000000000..52b0043f7f --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql @@ -0,0 +1,7 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355574648180737', 'ic_user_change_type', '人员变动类型', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 17, 0, 0, '1', '2022-01-18 16:28:23', '1', '2022-01-18 16:28:42'); + + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355968996642817', 1483355574648180737, '迁出', 'out', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 4, 0, 0, '1', '2022-01-18 16:29:57', '1', '2022-01-18 16:29:57'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355899824181249', 1483355574648180737, '迁入', 'in', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 3, 0, 0, '1', '2022-01-18 16:29:41', '1', '2022-01-18 16:29:41'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355832321052673', 1483355574648180737, '类别', 'category', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 2, 0, 0, '1', '2022-01-18 16:29:25', '1', '2022-01-18 16:29:25'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355752541196290', 1483355574648180737, '新增', 'add', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 1, 0, 0, '1', '2022-01-18 16:29:05', '1', '2022-01-18 16:29:05'); \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java index 2220f907f5..cc4ed1a405 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcUserChangeDetailedDTO.java +++ b/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 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java index 35608feae9..f60a5d1e36 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcUserChangeDetailedEntity.java +++ b/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 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 988a5c6eb0..28036d3a59 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/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 houseInfos = houseInfosResult.getData(); - userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName()))); + userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getAllName()))); result.setList(userList); return result; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index 1d994dd30c..1e61c9cf54 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/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 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