From 160254675848b4946e62c9836c8930d891b058e7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Jun 2021 14:03:20 +0800 Subject: [PATCH] =?UTF-8?q?roles=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java | 3 ++- .../com/epmet/service/impl/CustomerStaffServiceImpl.java | 4 ++-- .../java/com/epmet/service/impl/StaffRoleServiceImpl.java | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java index 562b5644a2..7ee6e68b2f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerAgencyUserRoleDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto; import lombok.Data; import java.io.Serializable; +import java.util.Map; /** * @Author zxc @@ -30,6 +31,6 @@ public class CustomerAgencyUserRoleDTO implements Serializable { /** * 角色 */ - private String roles; + private Map roles; } 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 07c8e2b306..8d5f22aa64 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 @@ -337,7 +337,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl { m.put(r.getRoleKey(),r.getRoleName()); }); - dto.setRoles(m.toString()); + dto.setRoles(m); staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); } @@ -410,7 +410,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl { m.put(r.getRoleKey(),r.getRoleName()); }); - dto.setRoles(m.toString()); + dto.setRoles(m); staffRoleRedis.setRole(dto.getCustomerId(), dto.getStaffId(),dto); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 0404a5ff0a..51f5e189b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -17,6 +17,8 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; @@ -228,7 +230,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl { map.put(l.getRoleKey(), l.getRoleName()); }); - dto.setRoles(map.toString()); + dto.setRoles(map); staffRoleRedis.setRole(customerId, staffId, dto); return dto; } @@ -259,7 +261,7 @@ public class StaffRoleServiceImpl extends BaseServiceImpl { map.put(l.getRoleKey(), l.getRoleName()); }); - dto.setRoles(map.toString()); + dto.setRoles(map); staffRoleRedis.setRole(customerId, userId, dto); }); }