傅行帆 6 gadus atpakaļ
vecāks
revīzija
442a62aac5

+ 4
- 4
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/ToCommunitiesMapper.java Parādīt failu

@@ -19,11 +19,11 @@ import java.util.List;
19 19
 public interface ToCommunitiesMapper extends BaseMapper<ToCommunities> {
20 20
 
21 21
     /**
22
-     * 根据 用户Id 查询出
23
-     * @param userId
22
+     * 根据 电话号码 查询出
23
+     * @param phone
24 24
      * @return
25 25
      */
26
-    @Select("SELECT tc.* FROM tp_user_community tuc LEFT JOIN to_communities tc on tuc.community_id = tc.id WHERE tuc.tp_user_id=#{userId}")
27
-    List<ToCommunities> selectUserById(Integer userId);
26
+    @Select("SELECT tc.* FROM tp_user tu LEFT JOIN to_communities tc ON tu.community_id = tc.id WHERE tu.login_name = #{phone}")
27
+    List<ToCommunities> selectUserById(String phone);
28 28
 
29 29
 }

+ 4
- 22
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/UserServiceImpl.java Parādīt failu

@@ -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
 

+ 5
- 3
文档/MYSQL/smartCommunity.pdb Parādīt failu

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1546498194" Name="smartCommunity" Objects="713" Symbols="81" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
2
+<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1546501440" Name="smartCommunity" Objects="713" Symbols="81" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
3 3
 <!-- do not edit this file -->
4 4
 
5 5
 <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@@ -6020,9 +6020,10 @@ LABL 0 新宋体,8,N</a:FontList>
6020 6020
 </o:TableSymbol>
6021 6021
 <o:TableSymbol Id="o165">
6022 6022
 <a:CreationDate>1546498159</a:CreationDate>
6023
-<a:ModificationDate>1546498194</a:ModificationDate>
6023
+<a:ModificationDate>1546501440</a:ModificationDate>
6024 6024
 <a:IconMode>-1</a:IconMode>
6025
-<a:Rect>((94054,8344), (98853,12343))</a:Rect>
6025
+<a:Rect>((90981,1211), (104097,16647))</a:Rect>
6026
+<a:AutoAdjustToText>0</a:AutoAdjustToText>
6026 6027
 <a:LineColor>12615680</a:LineColor>
6027 6028
 <a:FillColor>16570034</a:FillColor>
6028 6029
 <a:ShadowColor>12632256</a:ShadowColor>
@@ -6039,6 +6040,7 @@ LABL 0 新宋体,8,N</a:FontList>
6039 6040
 <a:BrushStyle>6</a:BrushStyle>
6040 6041
 <a:GradientFillMode>65</a:GradientFillMode>
6041 6042
 <a:GradientEndColor>16777215</a:GradientEndColor>
6043
+<a:ManuallyResized>1</a:ManuallyResized>
6042 6044
 <c:Object>
6043 6045
 <o:Table Ref="o166"/>
6044 6046
 </c:Object>

+ 5
- 3
文档/MYSQL/smartCommunity.pdm Parādīt failu

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1546498194" Name="smartCommunity" Objects="713" Symbols="81" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
2
+<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1546501440" Name="smartCommunity" Objects="713" Symbols="81" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
3 3
 <!-- do not edit this file -->
4 4
 
5 5
 <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@@ -6020,9 +6020,10 @@ LABL 0 新宋体,8,N</a:FontList>
6020 6020
 </o:TableSymbol>
6021 6021
 <o:TableSymbol Id="o165">
6022 6022
 <a:CreationDate>1546498159</a:CreationDate>
6023
-<a:ModificationDate>1546498194</a:ModificationDate>
6023
+<a:ModificationDate>1546501440</a:ModificationDate>
6024 6024
 <a:IconMode>-1</a:IconMode>
6025
-<a:Rect>((94054,8344), (98853,12343))</a:Rect>
6025
+<a:Rect>((90981,1211), (104097,16647))</a:Rect>
6026
+<a:AutoAdjustToText>0</a:AutoAdjustToText>
6026 6027
 <a:LineColor>12615680</a:LineColor>
6027 6028
 <a:FillColor>16570034</a:FillColor>
6028 6029
 <a:ShadowColor>12632256</a:ShadowColor>
@@ -6039,6 +6040,7 @@ LABL 0 新宋体,8,N</a:FontList>
6039 6040
 <a:BrushStyle>6</a:BrushStyle>
6040 6041
 <a:GradientFillMode>65</a:GradientFillMode>
6041 6042
 <a:GradientEndColor>16777215</a:GradientEndColor>
6043
+<a:ManuallyResized>1</a:ManuallyResized>
6042 6044
 <c:Object>
6043 6045
 <o:Table Ref="o166"/>
6044 6046
 </c:Object>