Bladeren bron

'数据中心-门禁人员进出实时信息列表展示数据倒序排序和设备管理-监控系统、门禁系统、梯控系统、机房系统设备信息同步接口'

james 1 jaar geleden
bovenliggende
commit
9e30c73b42

+ 63 - 0
service-park/service-park-biz/src/main/java/com/usky/park/controller/web/DeviceHttpController.java

@@ -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;
+    }
 }

+ 2 - 0
service-park/service-park-biz/src/main/java/com/usky/park/service/impl/EventEgServiceImpl.java

@@ -12,6 +12,7 @@ import com.usky.park.mapper.EventEgMapper;
 import com.usky.park.service.DmpDeviceService;
 import com.usky.park.service.EventEgService;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import java.util.Comparator;
 import com.usky.park.service.vo.EventEgStatisticVO;
 import org.bouncycastle.util.StringList;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -88,6 +89,7 @@ public class EventEgServiceImpl extends AbstractCrudService<EventEgMapper, Event
         }
 
         objectList = list.stream().skip(current).limit(pageSize).collect(Collectors.toList());
+        objectList = objectList.stream().sorted(Comparator.comparing(EventEg::getEventTime).reversed()).collect(Collectors.toList());
 
 
         return new CommonPage<>(objectList,total,pageNum,pageSize);