diff --git a/pom.xml b/pom.xml
index 0128c24..e93fa24 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,6 +119,17 @@
jna
${jna.version}
+
+
+ org.bytedeco
+ javacv-platform
+ 1.5.9
+
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
diff --git a/src/main/java/com/netsdk/utils/ProvincialPlatformDataPushScheduled.java b/src/main/java/com/netsdk/utils/ProvincialPlatformDataPushScheduled.java
index 91956ed..1a78fcf 100644
--- a/src/main/java/com/netsdk/utils/ProvincialPlatformDataPushScheduled.java
+++ b/src/main/java/com/netsdk/utils/ProvincialPlatformDataPushScheduled.java
@@ -3,7 +3,10 @@ package com.netsdk.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.netsdk.entity.PageData;
-import org.springframework.http.*;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@@ -11,7 +14,10 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* 将Redis中存储的MES平台数据推送至省平台。
@@ -30,6 +36,15 @@ public class ProvincialPlatformDataPushScheduled {
@Scheduled(cron = "*/5 * * * * ?")
public void scheduled() throws Exception {
+ // 推送实时数据
+ pushRealTimeData();
+
+ // 推送报警数据
+ pushAlarmData();
+
+ }
+
+ void pushRealTimeData() {
// 先填写基础报文 数据上报报文格式如下: appId、serviceId、dataId、data
// 实时数据和报警数据的报文格式、appId、serviceId等信息不同。
HashMap baseMap = new HashMap<>();
@@ -40,7 +55,7 @@ public class ProvincialPlatformDataPushScheduled {
baseMap.put("dataId", dataId);
// 接下来定义data,也就是需要向省平台推送的数据
- Map dataMap = new HashMap();
+ HashMap dataMap = new HashMap();
dataMap.put("dataId", dataId);
dataMap.put("areaCode", "14"); //企业所属省份的行政区划
dataMap.put("enterpriseId", "GT1407810001"); //企业数据接入标识
@@ -53,27 +68,99 @@ public class ProvincialPlatformDataPushScheduled {
// 格式化时间
String collectTime = now.format(formatter);
dataMap.put("collectTime", collectTime); //时间戳,格式YYYYMMDDHHmmss
- dataMap.put("isConnectDataSource", false); //数据源连通性
+ dataMap.put("isConnectDataSource", true); //数据源连通性
dataMap.put("reportType", "report"); //报文类型,report表示实时报文
-
//定义datas指标数据集合
List