|
@@ -67,27 +67,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
67
|
67
|
// 查询用户
|
68
|
68
|
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
69
|
69
|
queryWrapper.eq("login_name", phone);
|
|
70
|
+ queryWrapper.eq("community_id", communityId);
|
70
|
71
|
User user = userMapper.selectOne(queryWrapper) ;
|
71
|
72
|
if (null == user) {
|
72
|
73
|
responseBean.addError("当前手机号不存在, 请联系运营人员!");
|
73
|
74
|
return responseBean;
|
74
|
75
|
}
|
75
|
76
|
|
76
|
|
- // 查询这个用户是否有这个小区的管理
|
77
|
|
- QueryWrapper<TpUserCommunity> userCommunityQueryWrapper = new QueryWrapper<>();
|
78
|
|
- userCommunityQueryWrapper.eq("tp_user_id", user.getId());
|
79
|
|
- userCommunityQueryWrapper.eq("community_id", communityId);
|
80
|
|
- TpUserCommunity tpUserCommunity = tpUserCommunityMapper.selectOne(userCommunityQueryWrapper);
|
81
|
|
- if (null == tpUserCommunity) {
|
82
|
|
- responseBean.addError("当前手机号未绑定该社区");
|
83
|
|
- return responseBean;
|
84
|
|
- }
|
85
|
|
-
|
86
|
77
|
UserVO userVO = new UserVO();
|
87
|
|
-
|
88
|
|
- // 设置为当前小区Id
|
89
|
|
- user.setCommunityId(tpUserCommunity.getCommunityId());
|
90
|
|
-
|
91
|
78
|
// 查询该用户的权限
|
92
|
79
|
// 获取用户权限
|
93
|
80
|
getUserRole(user,userVO);
|
|
@@ -104,18 +91,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
104
|
91
|
checkPhoneAndCode(phone, code);
|
105
|
92
|
|
106
|
93
|
// 获取这个用户所管理的小区
|
107
|
|
- // 查询用户
|
108
|
|
- QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
109
|
|
- queryWrapper.eq("login_name", phone);
|
110
|
|
- User user = userMapper.selectOne(queryWrapper);
|
111
|
|
- if (null == user) {
|
|
94
|
+ List<ToCommunities> toCommunities = toCommunitiesMapper.selectUserById(phone);
|
|
95
|
+ if (toCommunities.size() < 1) {
|
112
|
96
|
responseBean.addError("当前手机号不存在, 请联系运营人员!");
|
113
|
97
|
return responseBean;
|
114
|
98
|
}
|
115
|
|
-
|
116
|
|
- List<ToCommunities> toCommunities = toCommunitiesMapper.selectUserById(user.getId());
|
|
99
|
+
|
117
|
100
|
responseBean.addSuccess(toCommunities);
|
118
|
|
-
|
119
|
101
|
return responseBean;
|
120
|
102
|
}
|
121
|
103
|
|