From 719b403d34aa250380a9645fc6e4175888a74d8d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Jan 2022 16:37:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=B1=BB=E5=88=AB=E5=AD=97=E5=85=B8=E8=A1=A8?= =?UTF-8?q?=EF=BC=9A=E8=BF=81=E5=85=A5=EF=BC=8C=E8=BF=81=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=EF=BC=8C=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.10__add_icuserchangetype_dict.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql 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 From 415863852bbcb9cecc16dbfefd34e50c1086afe3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Jan 2022 16:51:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcResiUserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..fdd4137135 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 @@ -1127,7 +1127,7 @@ 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; } From 1319a1d65bd91d319aa66364d90d886c5d28dc3b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Jan 2022 17:27:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E5=A2=9E=E5=8A=A0pids=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/IcUserChangeDetailedDTO.java | 5 +++++ .../epmet/entity/IcUserChangeDetailedEntity.java | 5 +++++ .../service/impl/IcResiUserServiceImpl.java | 7 +++++++ .../impl/IcUserTransferRecordServiceImpl.java | 16 ++++++++++++++++ .../migration/V0.0.24__alter_change_detailed.sql | 3 +++ 5 files changed, 36 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql 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 fdd4137135..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 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