|
|
@@ -32,6 +32,7 @@ import com.xunmei.mediator.websocket.enums.ProductEnums;
|
|
|
import com.xunmei.mediator.websocket.enums.TopicTypeEnums;
|
|
|
import com.xunmei.mediator.websocket.holder.WebSocketSessionHolder;
|
|
|
import com.xunmei.mediator.websocket.service.RouterService;
|
|
|
+import com.xunmei.mediator.websocket.utils.IotServerUtils;
|
|
|
import com.xunmei.system.api.RemoteOrgService;
|
|
|
import com.xunmei.system.api.domain.SysOrg;
|
|
|
import com.xunmei.system.api.domain.iot.IotDeviceInfo;
|
|
|
@@ -110,37 +111,13 @@ public class VideoIntegrityCheckServiceImpl extends ServiceImpl<VideoIntegrityCh
|
|
|
return;
|
|
|
}
|
|
|
for (IotDeviceInfo iotDeviceInfo : deviceInfoList) {
|
|
|
- WebsocketResult iotWebsocketResult = new WebsocketResult();
|
|
|
- iotWebsocketResult.setTopic(TopicTypeEnums.formatUrl(TopicTypeEnums.PRODUCT_SERVICE_INVOKE, WebSocketConstants.IOT_SERVER,WebSocketConstants.IOT_SERVER_DEVICE));
|
|
|
- iotWebsocketResult.setId(UUID.randomUUID().toString());
|
|
|
- iotWebsocketResult.setTimestamp(new Date());
|
|
|
- JSONObject iotHeaderObj = new JSONObject();
|
|
|
- iotHeaderObj.put(WebSocketConstants.PRODUCT_NAME,WebSocketConstants.IOT_SERVER);
|
|
|
- iotHeaderObj.put(WebSocketConstants.DEVICE_NAME, WebSocketConstants.IOT_SERVER_DEVICE);
|
|
|
- iotWebsocketResult.setHeaders(iotHeaderObj);
|
|
|
- JSONObject iotPayloadObj = new JSONObject();
|
|
|
- iotWebsocketResult.setPayload(iotPayloadObj);
|
|
|
- iotPayloadObj.put(WebSocketConstants.SERVICE, WebSocketConstants.DOWN_LINK_SERVICE_PASS_THROUGH);
|
|
|
-
|
|
|
- WebsocketResult hostData = new WebsocketResult();
|
|
|
- iotPayloadObj.put(WebSocketConstants.ARGS,hostData );
|
|
|
- hostData.setId(UUID.randomUUID().toString());
|
|
|
- hostData.setTopic(TopicTypeEnums.formatUrl(TopicTypeEnums.PRODUCT_SERVICE_INVOKE, iotDeviceInfo.getDeviceProduct(),iotDeviceInfo.getDeviceCode()));
|
|
|
- JSONObject hostHeaderObj = new JSONObject();
|
|
|
- hostHeaderObj.put(WebSocketConstants.PRODUCT_NAME,iotDeviceInfo.getDeviceProduct());
|
|
|
- hostHeaderObj.put(WebSocketConstants.DEVICE_NAME, iotDeviceInfo.getDeviceCode());
|
|
|
- hostData.setHeaders(hostHeaderObj);
|
|
|
-
|
|
|
- JSONObject hostPayloadObj = new JSONObject();
|
|
|
- hostPayloadObj.put(WebSocketConstants.SERVICE, WebSocketConstants.GET_RECORD_INFOS_SERVICES);
|
|
|
JSONObject object = new JSONObject();
|
|
|
- hostPayloadObj.put(WebSocketConstants.ARGS, object);
|
|
|
object.put("dvsCode", iotDeviceInfo.getHostCode());
|
|
|
object.put("index", iotDeviceInfo.getDeviceCode());
|
|
|
- object.put("recordDate", Arrays.asList(DateUtil.format(DateUtil.offsetDay(new Date(),-1),Constants.DAILY_FORMAT)));
|
|
|
- hostData.setPayload(hostPayloadObj);
|
|
|
- log.info("发送录像机录像信息请求:{}", JacksonUtils.toJSONString(iotWebsocketResult));
|
|
|
- WebSocketSessionHolder.sendAll(JacksonUtils.toJSONString(iotWebsocketResult));
|
|
|
+ object.put("recordDate", Arrays.asList(DateUtil.format(DateUtil.offsetDay(new Date(),-1), Constants.DAILY_FORMAT)));
|
|
|
+ WebsocketResult websocketResult = IotServerUtils.invokeDownLinkServer(TopicTypeEnums.PRODUCT_SERVICE_INVOKE, iotDeviceInfo.getDeviceProduct(), iotDeviceInfo.getDeviceCode(), WebSocketConstants.GET_RECORD_INFOS_SERVICES, object);
|
|
|
+ log.info("调用录像机获取录像信息:{}", JacksonUtils.toJSONString(websocketResult));
|
|
|
+ WebSocketSessionHolder.sendAll(JacksonUtils.toJSONString(websocketResult));
|
|
|
}
|
|
|
|
|
|
}
|