Browse Source

摄像头状态同步,设备ip正则验证

develop
wangsixiang 4 months ago
parent
commit
42830fb5be
  1. 24
      zc-business/src/main/java/com/zc/business/controller/VideoController.java
  2. 1
      zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java

24
zc-business/src/main/java/com/zc/business/controller/VideoController.java

@ -249,8 +249,8 @@ public class VideoController extends BaseController {
JSONObject children = data.getJSONObject(0);
JSONArray jsonObject = children.getJSONArray("children");
JSONObject jsonObjectValue = jsonObject.getJSONObject(0);//济菏+德幸
JSONArray array = jsonObjectValue.getJSONArray("children");
JSONObject object = array.getJSONObject(0);//收费站
JSONArray array = jsonObjectValue.getJSONArray("children");//济菏全部摄像头,0:旧+1:道路和摄像头+2:桥下
JSONObject object = array.getJSONObject(1);//道路+收费站
JSONArray jsonArray = object.getJSONArray("children");
JSONArray objects = new JSONArray();
jsonArray.forEach(item->{
@ -263,17 +263,21 @@ public class VideoController extends BaseController {
}
}
});
JSONObject arrayJSONObject = array.getJSONObject(1);//扩建
JSONObject arrayJSONObject = array.getJSONObject(2);//桥下球机
JSONArray jiHeYunGuanG35 = arrayJSONObject.getJSONArray("children");
for (int i = 0; i < objects.size(); i++) {
jiHeYunGuanG35.add(objects.get(i));
for (int i = 0; i < jiHeYunGuanG35.size(); i++) {
JSONObject jiHeG35Value = jiHeYunGuanG35.getJSONObject(i);
if (jiHeG35Value.getJSONArray("children")!=null){
JSONArray jiHeG35= jiHeG35Value.getJSONArray("children");
for (int j=0;j<jiHeG35.size();j++){
objects.add(jiHeG35.get(j));
}
}else {
continue;
}
}
JSONObject bridgeCamera = array.getJSONObject(2);//桥下球机
JSONArray bridgeCameraList = bridgeCamera.getJSONArray("children");
jiHeYunGuanG35.addAll(bridgeCameraList);
List<DcDevice> list = new ArrayList<>();
for (Object json : jiHeYunGuanG35) {
for (Object json : objects) {
JSONObject item = JSONObject.parseObject(json.toString());
DcDevice device = new DcDevice();
if (item.get("status").equals(UniversalEnum.ZERO.getValue())) {

1
zc-business/src/main/java/com/zc/business/service/impl/DcSwitchServiceImpl.java

@ -179,6 +179,7 @@ public class DcSwitchServiceImpl extends ServiceImpl<DcSwitchMapper, DcSwitch> i
@Override
public AjaxResult deviceDiagnostics(DcDeviceOfflineRecord device) throws Exception {
String deviceIp = device.getDeviceIp();
deviceIp = deviceIp.replaceAll("[\\r\\n]+", "");
String deviceType = device.getDeviceType();
RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
String cacheObject = redisCache.getCacheObject(DEVICEDIAGNOSTICS+deviceIp);//获取缓存是否存在诊断结果

Loading…
Cancel
Save