From 22530cdbdb2b635a963bc9e22d4e46bc9cc4c359 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 24 Aug 2021 14:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=AE=AF=E5=BD=95=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmetmessage/impl/EpmetMessageServiceImpl.java | 11 +++++++---- .../service/epmetuser/impl/EpmetUserServiceImpl.java | 5 ++++- .../mapper/govorg/CustomerStaffAgencyDao.xml | 2 +- .../java/com/epmet/service/impl/StaffServiceImpl.java | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java index 21c7fa9589..4f7c8b3117 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java @@ -79,10 +79,13 @@ public class EpmetMessageServiceImpl implements EpmetMessageService { dto.setStaffId(item.getStaffId()); dto.setReadFlag(item.getReadFlag()); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId()); - dto.setStaffName(staffInfoCache.getRealName()); - dto.setGender(staffInfoCache.getGender()); - dto.setHeadPhoto(staffInfoCache.getHeadPhoto()); - dto.setOrgName(staffInfoCache.getTwoOrgName()); + if (null != staffInfoCache) { + dto.setStaffName(staffInfoCache.getRealName()); + dto.setGender(staffInfoCache.getGender()); + dto.setHeadPhoto(staffInfoCache.getHeadPhoto()); + dto.setOrgName(staffInfoCache.getTwoOrgName()); + } + return dto; }).collect(Collectors.toList()); result.setDataList(dataList); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 8806232b47..84cc6ea127 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -483,9 +483,12 @@ public class EpmetUserServiceImpl implements EpmetUserService { } return staffRoleList.stream().map(item -> { RoleUsersResultDTO dto = new RoleUsersResultDTO(); - dto.setStaffId(item.getStaffId()); //从redis获取用户信息 CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId()); + if (null == staffInfoCache) { + return null; + } + dto.setStaffId(item.getStaffId()); dto.setGender(staffInfoCache.getGender()); dto.setHeadPhoto(staffInfoCache.getHeadPhoto()); dto.setName(staffInfoCache.getRealName()); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index 29da78941d..e41789ecf6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -100,7 +100,7 @@ customer_agency ca LEFT JOIN ( SELECT - a.PIDS, + CONCAT( a.PIDS,':',a.ID) AS PIDS, b.USER_ID FROM customer_agency a diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index b6dd8c9de8..043694e0f7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -426,7 +426,7 @@ public class StaffServiceImpl implements StaffService { String key = RedisKeys.getCpUserKey("gov", "wxmp", fromDTO.getStaffId()); redisUtils.delete(key); //10 清除工作人员缓存 - customerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(), fromDTO.getStaffId()); + CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(), fromDTO.getStaffId()); } /**