|
|
@@ -76,23 +76,24 @@ public class RoleButtonServiceImpl implements RoleButtonService {
|
|
76
|
76
|
public List<RoleButton> queryByUser(UserInfo userInfo) {
|
|
77
|
77
|
UserRoleExample example = new UserRoleExample();
|
|
78
|
78
|
example.createCriteria().andUserIdEqualTo(userInfo.getUserId());
|
|
79
|
|
- List<UserRole> urList = userRoleMapper.selectByExample(example);
|
|
80
|
|
- List<Integer> roleIds = new ArrayList<>();
|
|
81
|
|
- if(urList!=null){
|
|
82
|
|
- urList.forEach(ur -> roleIds.add(ur.getRoleId()));
|
|
83
|
|
- }
|
|
84
|
|
-// RoleButtonExample rbExample = new RoleButtonExample();
|
|
85
|
|
-// rbExample.createCriteria().andRoleIdIn(roleIds);
|
|
86
|
|
- Map<String, Object> param = new HashMap<String, Object>();
|
|
87
|
|
- Gson gson=new Gson();
|
|
88
|
|
- String jsonids = gson.toJson(roleIds);
|
|
89
|
|
- jsonids = jsonids.replace("[", "(");
|
|
90
|
|
- jsonids = jsonids.replace("]", ")");
|
|
|
79
|
+ List<UserRole> urList = userRoleMapper.selectByExample(example);
|
|
|
80
|
+ List<Integer> roleIds = new ArrayList<>();
|
|
|
81
|
+ if(urList!=null){
|
|
|
82
|
+ urList.forEach(ur -> roleIds.add(ur.getRoleId()));
|
|
|
83
|
+ }
|
|
|
84
|
+ Map<String, Object> param = new HashMap<String, Object>();
|
|
|
85
|
+ Gson gson=new Gson();
|
|
|
86
|
+ String jsonids = gson.toJson(roleIds);
|
|
|
87
|
+ jsonids = jsonids.replace("[", "(");
|
|
|
88
|
+ jsonids = jsonids.replace("]", ")");
|
|
|
89
|
+ List<RoleButton> rbList = new ArrayList<RoleButton>();
|
|
|
90
|
+ if(jsonids != null && jsonids.length() > 2) {
|
|
91
|
91
|
param.put("roleIds", jsonids);
|
|
92
|
|
- List<RoleButton> rbList = roleButtonMapper.selectByExampleNew(param);
|
|
93
|
|
- String json = gson.toJson(rbList);
|
|
94
|
|
- redisUtil.set("permissionList", json);
|
|
95
|
|
- return rbList;
|
|
|
92
|
+ rbList = roleButtonMapper.selectByExampleNew(param);
|
|
|
93
|
+ }
|
|
|
94
|
+ String json = gson.toJson(rbList);
|
|
|
95
|
+ redisUtil.set("permissionList", json);
|
|
|
96
|
+ return rbList;
|
|
96
|
97
|
}
|
|
97
|
98
|
|
|
98
|
99
|
@Override
|