|
@@ -13,6 +13,7 @@ import java.io.IOException;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author zyj
|
|
@@ -27,6 +28,10 @@ public class DeviceHttpController {
|
|
|
public static final String video_url = "http://172.17.35.51:15225";
|
|
|
public static final String video1_url = "http://172.17.35.51:15226";
|
|
|
public static final String guard_url = "http://172.17.35.51:15227";
|
|
|
+ public static final String video_devinfo = "http://172.17.35.51:15228";
|
|
|
+ public static final String guard_devinfo = "http://172.17.35.51:15229";
|
|
|
+ public static final String elevator_devinfo = "http://172.17.35.51:15230";
|
|
|
+ public static final String generator_devinfo = "http://172.17.35.51:15231";
|
|
|
|
|
|
/**
|
|
|
* 设备管理-照明开关状态控制
|
|
@@ -150,4 +155,62 @@ public class DeviceHttpController {
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备管理-监控系统、门禁系统、梯控系统设备信息同步
|
|
|
+ *
|
|
|
+ * @param deviceType 设备类型(501、监控系统 502、门禁系统 503、梯控系统 )
|
|
|
+ * @param regionIndexCodes 所在区域
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("DeviceInfo")
|
|
|
+ public static String DeviceInfo(@RequestParam(value = "deviceType") Integer deviceType,
|
|
|
+ @RequestParam(value = "regionIndexCodes") List<String> regionIndexCodes){
|
|
|
+ String result = "";
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("jsonrpc","2.0");
|
|
|
+ map.put("method","DeviceInfo");
|
|
|
+ Map<String,Object> map1 = new HashMap<>();
|
|
|
+ map1.put("regionIndexCodes","["+regionIndexCodes+"]");
|
|
|
+ map.put("params",map1);
|
|
|
+ map.put("id",3);
|
|
|
+ try {
|
|
|
+ if(deviceType == 501){
|
|
|
+ result = HttpUtils.postJson(video_devinfo,map,null);
|
|
|
+ }else if(deviceType == 502){
|
|
|
+ result = HttpUtils.postJson(guard_devinfo,map,null);
|
|
|
+ }else if(deviceType == 503){
|
|
|
+ result = HttpUtils.postJson(elevator_devinfo,map,null);
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new BusinessException("设备管理-监控系统、门禁系统、梯控系统设备信息同步http调用异常"+e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设备管理-机房系统设备信息同步
|
|
|
+ *
|
|
|
+ * @param sceneId 项目ID
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("GeneratorDevInfo")
|
|
|
+ public static String GeneratorDevInfo(@RequestParam(value = "sceneId") String sceneId){
|
|
|
+ String result = "";
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("jsonrpc","2.0");
|
|
|
+ map.put("method","GeneratorDevInfo");
|
|
|
+ Map<String,Object> map1 = new HashMap<>();
|
|
|
+ map1.put("scene_id",sceneId);
|
|
|
+ map.put("params",map1);
|
|
|
+ map.put("id",3);
|
|
|
+ try {
|
|
|
+ result = HttpUtils.postJson(generator_devinfo,map,null);
|
|
|
+
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new BusinessException("设备管理-机房系统设备信息同步http调用异常"+e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|