dingxin 6 years ago
parent
commit
43a74f22e7

+ 6
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaFaceMapper.java View File

@@ -24,4 +24,10 @@ public interface TaFaceMapper{
24 24
      */
25 25
     TaFace getByUserId(@Param("userid") Integer userid);
26 26
 
27
+    /**
28
+     * 查看当前信息
29
+     * @param id
30
+     * @return
31
+     */
32
+    TaFace getById(@Param("id")Integer id);
27 33
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserMapper.java View File

@@ -56,4 +56,12 @@ public interface TaUserMapper {
56 56
      * @return
57 57
      */
58 58
     TaUser selectTaFaceParentId(@Param("id") Integer userId, @Param("otherUserID")Integer otherUserID);
59
+
60
+    /**
61
+     * 查询此电话在小区是否存在
62
+     * @param communityId
63
+     * @param phone
64
+     * @return
65
+     */
66
+    TaUser getByLoginName(@Param("communityId")Integer communityId, @Param("phone")String phone);
59 67
 }

+ 0
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java View File

@@ -130,7 +130,6 @@ public class FaceServicelimpl implements FaceServiceI {
130 130
                 }
131 131
                 taFaceMapper.insertSelective(taFace);
132 132
                 responseBean.addSuccess("操作成功");
133
-
134 133
                 HKOpenApi.downloadFaceAndFingerInfos(String.valueOf(user.getHkUserId()));
135 134
             } else if (isA == false){
136 135
                     if (null == data) {

+ 12
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java View File

@@ -236,7 +236,17 @@ public class TaUserServiceImpl implements ITaUserService {
236 236
         String  codes= (String) AppkeyCache.getCache(phone);
237 237
         //用户电话
238 238
             /*String  phones=user.getLoginName();*/
239
-        if(codes.equals(code)){
239
+        if (!AccountValidatorUtil.isPhone(phone)){
240
+            response.addError("请输入正确的手机号!");
241
+            return response;
242
+        }
243
+        //当前小区下的电话校验
244
+        TaUser loginName=taUserMapper.getByLoginName(user.getCommunityId(),phone);
245
+        if (null!=loginName)  {
246
+            response.addError("号码重复");
247
+            return response;
248
+        }
249
+        if(null!=codes && codes.equals(code)){
240 250
             TaUser taUser=new TaUser();
241 251
             taUser.setLoginName(phone);
242 252
             taUser.setId(user.getId());
@@ -245,7 +255,7 @@ public class TaUserServiceImpl implements ITaUserService {
245 255
             AppkeyCache.setCache(user.getLoginName(),"null");
246 256
             return response;
247 257
         }else {
248
-            response.addError("验证码错误");
258
+            response.addError("验证码错误或电话号码错误");
249 259
             return response;
250 260
         }
251 261
 

+ 8
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaFaceMapper.xml View File

@@ -117,4 +117,12 @@
117 117
         from ta_face
118 118
         where ta_user_id = #{userid,jdbcType=INTEGER}
119 119
     </select>
120
+
121
+    <select id="getById" resultMap="BaseResultMap"  parameterType="java.lang.Integer" >
122
+        select
123
+        <include refid="Base_Column_List" />
124
+        from ta_face
125
+        where id = #{id,jdbcType=INTEGER}
126
+    </select>
127
+
120 128
 </mapper>

+ 9
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml View File

@@ -319,4 +319,13 @@
319 319
     </if>
320 320
 
321 321
   </select>
322
+
323
+  <select id="getByLoginName" parameterType="com.community.huiju.model.TaUser" resultMap="BaseResultMap" >
324
+    select
325
+    <include refid="Base_Column_List" />
326
+    from ta_user
327
+    where community_id = #{communityId,jdbcType=INTEGER}
328
+      and login_name = #{phone ,jdbcType=VARCHAR}
329
+  </select>
330
+
322 331
 </mapper>