dingxin 6 years ago
parent
commit
6a973fcaa1

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKConstant.java View File

34
    //public static final String OPENAPI_IP_PORT_HTTP = "http://192.168.0.122";
34
    //public static final String OPENAPI_IP_PORT_HTTP = "http://192.168.0.122";
35
     //  public static final String OPENAPI_IP_PORT_HTTPS = "http://192.168.0.122";
35
     //  public static final String OPENAPI_IP_PORT_HTTPS = "http://192.168.0.122";
36
     //public static final String OPENAPI_IP_PORT_HTTP = "http://huiju.ngrok.xiaomiqiu.cn";
36
     //public static final String OPENAPI_IP_PORT_HTTP = "http://huiju.ngrok.xiaomiqiu.cn";
37
-    public static final String OPENAPI_IP_PORT_HTTP = "http://huifang.ngrok.xiaomiqiu.cn";
37
+    public static final String OPENAPI_IP_PORT_HTTP = "http://huifang.vipgz1.idcfengye.com";
38
 
38
 
39
     /**
39
     /**
40
      * <p>操作用户UUID,即用户UUID,首次使用操作用户UUID可以通过接口 [获取默认用户UUID]来获取</p>
40
      * <p>操作用户UUID,即用户UUID,首次使用操作用户UUID可以通过接口 [获取默认用户UUID]来获取</p>

+ 22
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKOpenApi.java View File

47
         } catch (Exception e) {
47
         } catch (Exception e) {
48
             e.printStackTrace();
48
             e.printStackTrace();
49
             log.error("获取监控列表失败!",e);
49
             log.error("获取监控列表失败!",e);
50
+            throw new RuntimeException("获取监控列表失败!");
50
         }
51
         }
51
 
52
 
52
         return data;
53
         return data;
78
         } catch (Exception e) {
79
         } catch (Exception e) {
79
             e.printStackTrace();
80
             e.printStackTrace();
80
             log.error("根据部门名称分页获取部门失败!",e);
81
             log.error("根据部门名称分页获取部门失败!",e);
82
+            throw new RuntimeException("根据部门名称分页获取部门失败!");
81
         }
83
         }
82
 
84
 
83
         return data;
85
         return data;
112
         } catch (Exception e) {
114
         } catch (Exception e) {
113
             e.printStackTrace();
115
             e.printStackTrace();
114
             log.error("添加人员失败!",e);
116
             log.error("添加人员失败!",e);
117
+            throw new RuntimeException("添加人员失败!");
115
         }
118
         }
116
 
119
 
117
         return data;
120
         return data;
144
         } catch (Exception e) {
147
         } catch (Exception e) {
145
             e.printStackTrace();
148
             e.printStackTrace();
146
             log.error("批量开卡失败!",e);
149
             log.error("批量开卡失败!",e);
150
+            throw new RuntimeException("批量开卡失败!");
147
         }
151
         }
148
 
152
 
149
         return data;
153
         return data;
174
         } catch (Exception e) {
178
         } catch (Exception e) {
175
             e.printStackTrace();
179
             e.printStackTrace();
176
             log.error("获取失败!",e);
180
             log.error("获取失败!",e);
181
+            throw new RuntimeException("获取失败!");
177
         }
182
         }
178
 
183
 
179
         return data;
184
         return data;
203
         } catch (Exception e) {
208
         } catch (Exception e) {
204
             e.printStackTrace();
209
             e.printStackTrace();
205
             log.error("获取失败!",e);
210
             log.error("获取失败!",e);
211
+            throw new RuntimeException("获取失败!");
206
         }
212
         }
207
 
213
 
208
         return data;
214
         return data;
232
             log.info("获取控制中心信息 请求返回结果:{}",data);
238
             log.info("获取控制中心信息 请求返回结果:{}",data);
233
         } catch (Exception e) {
239
         } catch (Exception e) {
234
             e.printStackTrace();
240
             e.printStackTrace();
235
-            log.error("获取失败!",e);
241
+            log.error("获取控制中心信息失败!",e);
242
+            throw new RuntimeException("获取控制中心信息失败!");
236
         }
243
         }
237
 
244
 
238
         return data;
245
         return data;
262
             log.info("根据中心UUID分页获取下级区域 请求返回结果:{}",data);
269
             log.info("根据中心UUID分页获取下级区域 请求返回结果:{}",data);
263
         } catch (Exception e) {
270
         } catch (Exception e) {
264
             e.printStackTrace();
271
             e.printStackTrace();
265
-            log.error("获取失败!",e);
272
+            log.error("根据中心UUID分页获取下级区域获取失败!",e);
273
+            throw new RuntimeException("根据中心UUID分页获取下级区域获取失败!");
266
         }
274
         }
267
 
275
 
268
         return data;
276
         return data;
289
             log.info("根据区域UUID集获取门禁点 请求返回结果:{}",data);
297
             log.info("根据区域UUID集获取门禁点 请求返回结果:{}",data);
290
         } catch (Exception e) {
298
         } catch (Exception e) {
291
             e.printStackTrace();
299
             e.printStackTrace();
292
-            log.error("获取失败!",e);
300
+            log.error("根据区域UUID集获取门禁点获取失败!",e);
301
+            throw new RuntimeException("根据区域UUID集获取门禁点获取失败!");
293
         }
302
         }
294
 
303
 
295
         return data;
304
         return data;
318
             log.info("根据人员ID集添加权限 请求返回结果:{}",data);
327
             log.info("根据人员ID集添加权限 请求返回结果:{}",data);
319
         } catch (Exception e) {
328
         } catch (Exception e) {
320
             e.printStackTrace();
329
             e.printStackTrace();
321
-            log.error("获取失败!",e);
330
+            log.error("根据人员ID集添加权限!",e);
331
+            throw new RuntimeException("根据人员ID集添加权限!");
322
         }
332
         }
323
 
333
 
324
         return data;
334
         return data;
345
             log.info("根据设备UUID集异动下载门禁权限 请求返回结果:{}",data);
355
             log.info("根据设备UUID集异动下载门禁权限 请求返回结果:{}",data);
346
         } catch (Exception e) {
356
         } catch (Exception e) {
347
             e.printStackTrace();
357
             e.printStackTrace();
348
-            log.error("获取失败!",e);
358
+            log.error("根据设备UUID集异动下载门禁权限获取失败!",e);
359
+            throw new RuntimeException("根据设备UUID集异动下载门禁权限获取失败!");
349
         }
360
         }
350
 
361
 
351
         return data;
362
         return data;
374
             log.info("指定人员人脸/指纹权限下载 请求返回结果:{}",data);
385
             log.info("指定人员人脸/指纹权限下载 请求返回结果:{}",data);
375
         } catch (Exception e) {
386
         } catch (Exception e) {
376
             e.printStackTrace();
387
             e.printStackTrace();
377
-            log.error("获取失败!",e);
388
+            log.error("指定人员人脸/指纹权限下载获取失败!",e);
389
+            throw new RuntimeException("指定人员人脸/指纹权限下载获取失败!");
378
         }
390
         }
379
 
391
 
380
         return data;
392
         return data;
401
             data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
413
             data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
402
         } catch (Exception e) {
414
         } catch (Exception e) {
403
             e.printStackTrace();
415
             e.printStackTrace();
416
+            throw new RuntimeException("添加人脸失败!");
404
         }
417
         }
405
         return data;
418
         return data;
406
     }
419
     }
442
             data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
455
             data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
443
         } catch (Exception e) {
456
         } catch (Exception e) {
444
             e.printStackTrace();
457
             e.printStackTrace();
458
+            throw new RuntimeException("修改人脸失败!");
445
         }
459
         }
446
         return data;
460
         return data;
447
     }
461
     }
474
         } catch (Exception e) {
488
         } catch (Exception e) {
475
             e.printStackTrace();
489
             e.printStackTrace();
476
             log.error("修改加人员失败!",e);
490
             log.error("修改加人员失败!",e);
491
+            throw new RuntimeException("修改加人员失败!");
477
         }
492
         }
478
         return data;
493
         return data;
479
     }
494
     }
516
         } catch (Exception e) {
531
         } catch (Exception e) {
517
             e.printStackTrace();
532
             e.printStackTrace();
518
             log.error("获取失败!",e);
533
             log.error("获取失败!",e);
534
+            throw new RuntimeException("获取失败!");
519
         }
535
         }
520
     
536
     
521
         return data;
537
         return data;

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java View File

148
     @ApiOperation(value = "添加 报修/投诉/联系单", notes = "添加 报修/投诉/联系单")
148
     @ApiOperation(value = "添加 报修/投诉/联系单", notes = "添加 报修/投诉/联系单")
149
     @ApiImplicitParams({
149
     @ApiImplicitParams({
150
             @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
150
             @ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value =
151
-                    "ticketTitle:工单内容,ticketContent:小区标题,type: 0 代表 报修  1 代表 投诉  2代表 联系单 , repairType:0:公共区域  1: 房屋质量  2:户内设施, imageUrl:图片地址 "),
151
+                    "ticketTitle:工单标题,ticketContent:工单内容,type: 0 代表 报修  1 代表 投诉  2代表 联系单 , repairType:0:公共区域  1: 房屋质量  2:户内设施, imageUrl:图片地址 "),
152
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
152
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
153
     })
153
     })
154
     @RequestMapping(value = "/addtpTicket", method = RequestMethod.POST)
154
     @RequestMapping(value = "/addtpTicket", method = RequestMethod.POST)

+ 7
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java View File

1
 package com.community.huiju.controller;
1
 package com.community.huiju.controller;
2
 
2
 
3
+import com.alibaba.fastjson.JSONObject;
3
 import com.community.commom.constant.Constant;
4
 import com.community.commom.constant.Constant;
4
 import com.community.commom.mode.ResponseBean;
5
 import com.community.commom.mode.ResponseBean;
5
 import com.community.commom.session.UserElement;
6
 import com.community.commom.session.UserElement;
33
 
34
 
34
     @RequestMapping(value = "/vistorDetail/{communityId}", method = RequestMethod.POST)
35
     @RequestMapping(value = "/vistorDetail/{communityId}", method = RequestMethod.POST)
35
     @ApiOperation(value = "创建访客", notes = "创建访客")
36
     @ApiOperation(value = "创建访客", notes = "创建访客")
36
-    @ApiImplicitParams({@ApiImplicitParam(name = "taVisitor", value = "访客", required = true, dataType = "TaVisitor"),
37
+    @ApiImplicitParams({
37
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
38
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
38
-            @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id")})
39
-    public ResponseBean findVistorDetail(@PathVariable("communityId")Integer communityId, @RequestBody TaVisitor taVisitor, HttpSession session) {
39
+            @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
40
+            @ApiImplicitParam(paramType = "body", dataType = "String", name = "parameter", value = "carLicense:车牌(数组),drivingStatus:0 是不开车 1是开车," +
41
+                    "visitorName:访问人姓名,visitorNum:访问人数,visitorTel:访问人电话,visitorStatrtTime:访问人电话,visitorEndTime:访问人结束时间")})
42
+    public ResponseBean findVistorDetail(@PathVariable("communityId")Integer communityId, @RequestBody String parameter, HttpSession session) {
40
         ResponseBean responseBean = new ResponseBean();
43
         ResponseBean responseBean = new ResponseBean();
41
 
44
 
42
         if (!check(communityId)) {
45
         if (!check(communityId)) {
46
 
49
 
47
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
50
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
48
         Integer userId = userElement.getId();
51
         Integer userId = userElement.getId();
52
+        TaVisitor taVisitor = JSONObject.parseObject(parameter,TaVisitor.class);
49
         responseBean = vistorServiceI.insertTaVistor(taVisitor, communityId, userId);
53
         responseBean = vistorServiceI.insertTaVistor(taVisitor, communityId, userId);
50
         return  responseBean;
54
         return  responseBean;
51
     }
55
     }

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

95
     }
95
     }
96
 
96
 
97
     @Override
97
     @Override
98
+    @Transactional(rollbackFor = Exception.class)
98
     public ResponseBean login(String loginName,String communityId,String code) {
99
     public ResponseBean login(String loginName,String communityId,String code) {
99
         ResponseBean response = new ResponseBean();
100
         ResponseBean response = new ResponseBean();
100
         String phoneCode = (String) AppkeyCache.getCache(loginName);
101
         String phoneCode = (String) AppkeyCache.getCache(loginName);
101
         if ("1234".equals(code)) {
102
         if ("1234".equals(code)) {
102
 
103
 
103
-        }else if (!phoneCode.equals(code)) {
104
+        }else if (StringUtils.isBlank(phoneCode) || !phoneCode.equals(code)) {
104
             response.addError("验证码错误!");
105
             response.addError("验证码错误!");
105
             return response;
106
             return response;
106
         }
107
         }