Commit d9411beac4b4676b99b0cd9fae3793cad94bcc21

Authored by baishou
1 parent f80d013f
Exists in master

楼宇对接部分接口

springboot/src/main/java/com/sincre/springboot/controller/Yinshi/DeviceControl.java
@@ -40,10 +40,38 @@ public class DeviceControl { @@ -40,10 +40,38 @@ public class DeviceControl {
40 return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); 40 return ResultUtils.getInstance().returnResultYingshi(yinShiResResult);
41 } 41 }
42 42
  43 + @ApiOperation(value = "该接口用于楼宇可视对讲设备远程开锁")
  44 + @ApiImplicitParams({
  45 + @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true),
  46 + @ApiImplicitParam(name = "type",value = "开锁类型,1-监视开锁;2-通话开锁",required = true),
  47 + @ApiImplicitParam(name = "channel",value = "监视通道,1-主门口机,2-1号从门口机,3-2号从门口机,不能为1-9之外的数字",required = true),
  48 + @ApiImplicitParam(name = "lockId",value = "锁ID,0本地锁,1外接锁")
  49 + })
  50 + @GetMapping("deviceUnlock")
  51 + public ServerResponse deviceUnlock(@RequestParam String deviceSerial,@RequestParam Integer type,@RequestParam Integer channel,@RequestParam(defaultValue = "-1") Integer lockId) {
  52 +
  53 + String url = YinShiServiceConfig.HostUrl + "lapp/building/device/unlock";
  54 + Map<String, Object> map = new HashMap<>();
  55 + map.put("accessToken", YinShiServiceConfig.AccessToken);
  56 + map.put("deviceSerial", deviceSerial);
  57 + map.put("type",type);
  58 + map.put("channel",channel);
  59 +
  60 + System.out.println(lockId);
  61 + if(lockId==-1) {
  62 + map.put("lockId", lockId);
  63 + }
  64 + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map);
  65 +
  66 + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class);
  67 +
  68 + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult);
  69 + }
  70 +
43 @ApiOperation(value = "该接口用于楼宇可视对讲设备通话操作") 71 @ApiOperation(value = "该接口用于楼宇可视对讲设备通话操作")
44 @ApiImplicitParams({ 72 @ApiImplicitParams({
45 @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true), 73 @ApiImplicitParam(name = "deviceSerial", value = "设备序列号", required = true),
46 - @ApiImplicitParam(name = "type",value = "操作类型:2-接听,3-拒接, 4-响铃超时,5-挂断,6-被叫正在通话中",dataType = "Integer",required = true) 74 + @ApiImplicitParam(name = "type",value = "操作类型:2-接听,3-拒接, 4-响铃超时,5-挂断,6-被叫正在通话中",required = true)
47 }) 75 })
48 @GetMapping("setDeviceCall") 76 @GetMapping("setDeviceCall")
49 public ServerResponse setDeviceCall(@RequestParam String deviceSerial,@RequestParam Integer type) { 77 public ServerResponse setDeviceCall(@RequestParam String deviceSerial,@RequestParam Integer type) {
@@ -59,4 +87,35 @@ public class DeviceControl { @@ -59,4 +87,35 @@ public class DeviceControl {
59 87
60 return ResultUtils.getInstance().returnResultYingshi(yinShiResResult); 88 return ResultUtils.getInstance().returnResultYingshi(yinShiResResult);
61 } 89 }
  90 +
  91 + @ApiOperation(value = "该接口用于获取楼宇可视对讲设备主叫信息。")
  92 + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true)
  93 + @GetMapping("getDeviceCallInfo")
  94 + public ServerResponse getDeviceCallInfo(@RequestParam String deviceSerial) {
  95 +
  96 + String url = YinShiServiceConfig.HostUrl + "lapp/building/device/dialing/get";
  97 + Map<String, Object> map = new HashMap<>();
  98 + map.put("accessToken", YinShiServiceConfig.AccessToken);
  99 + map.put("deviceSerial", deviceSerial);
  100 + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map);
  101 +
  102 + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class);
  103 +
  104 + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult);
  105 + }
  106 + @ApiOperation(value = "该接口用于获取楼宇可视对讲设备门口机列表。")
  107 + @ApiImplicitParam(name="deviceSerial",value = "设备序列号",required = true)
  108 + @GetMapping("getDeviceCallList")
  109 + public ServerResponse getDeviceCallList(@RequestParam String deviceSerial) {
  110 +
  111 + String url = YinShiServiceConfig.HostUrl + "lapp/building/device/list";
  112 + Map<String, Object> map = new HashMap<>();
  113 + map.put("accessToken", YinShiServiceConfig.AccessToken);
  114 + map.put("deviceSerial", deviceSerial);
  115 + String result = ApiHelper.doPost(url, new HashMap<String, String>(), map);
  116 +
  117 + YinShiResResult yinShiResResult = JSON.parseObject(result,YinShiResResult.class);
  118 +
  119 + return ResultUtils.getInstance().returnResultYingshi(yinShiResResult);
  120 + }
62 } 121 }