dingxin il y a 6 ans
Parent
révision
34cfa90ac8

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKOpenApi.java Voir le fichier

@@ -642,7 +642,7 @@ public class HKOpenApi {
642 642
      * @param phoneNo 电话
643 643
      * @return
644 644
      */
645
-    public static String HKpersonPhone(Integer personId,Integer personNo,String personName,String phoneNo) {
645
+    public static String HKpersonPhone(Integer personId,Long personNo,String personName,String phoneNo) {
646 646
 
647 647
         String url = HKConstant.OPENAPI_IP_PORT_HTTP + HKConstant.ITF_UPDATE_USER;
648 648
         Map<String, Object> map = new HashMap<String, Object>();

+ 7
- 10
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Voir le fichier

@@ -292,16 +292,13 @@ public class TaUserServiceImpl implements ITaUserService {
292 292
             response.addError("号码已占用");
293 293
             return response;
294 294
         }
295
-        String data=HKOpenApi.HKpersonPhone(user.getHkUserId(),user.getId(),user.getUserName(),phone);
296
-       try {
297
-             if (null == data) {
298
-            throw new RuntimeException("海康人脸推送失敗!");
299
-        }
300
-       }catch (Exception e){
301
-           e.printStackTrace();
302
-           log.error("海康修改电话失敗! {}",e);
303
-           throw new RuntimeException("海康修改电话失敗!");
304
-       }
295
+        String data=HKOpenApi.HKpersonPhone(user.getHkUserId(),user.getHkPersonNo(),user.getUserName(),phone);
296
+        JSONObject jsonobject = JSONObject.parseObject(data);
297
+        int errorCode = jsonobject.getInteger("errorCode");
298
+        if (errorCode!=0){
299
+            response.addError("海康电话已存在,推送海康电话修改失败");
300
+            return response;
301
+        }
305 302
         if(null!=codes && codes.equals(code)){;
306 303
             TaUser taUser=new TaUser();
307 304
             taUser.setLoginName(phone);