From 8e4c9120d41111234071064c121c868ffc31d330 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 15 Jun 2021 17:27:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=B7=BB=E5=8A=A0=20?= =?UTF-8?q?=EF=BC=8C=20=E7=BC=96=E8=BE=91=E6=97=B6=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CustomerStaffServiceImpl.java | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index e52b9441ae..07c8e2b306 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -51,6 +51,7 @@ import com.epmet.feign.AuthFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.CustomerStaffRedis; +import com.epmet.redis.StaffRoleRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -66,10 +67,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -104,6 +102,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -327,6 +327,18 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(userEntity.getId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(),r.getRoleName()); + }); + dto.setRoles(m.toString()); + staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); } @@ -388,6 +400,18 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(fromDTO.getStaffId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(),r.getRoleName()); + }); + dto.setRoles(m.toString()); + staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); return new Result(); }