|
@@ -1,5 +1,6 @@
|
|
|
package com.example.opc_da.task;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.example.opc_common.entity.DataSource;
|
|
|
import com.example.opc_common.entity.RawData;
|
|
@@ -155,5 +156,13 @@ public class OpcAsyncTask {
|
|
|
*/
|
|
|
public void eventTable(Integer tableReportId, BigDecimal value,String currentDate) {
|
|
|
ReportTable reportTable = reportTableDao.getReportTableById(tableReportId);
|
|
|
+ String reportTableData = reportTable.getReportTableData();
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(reportTableData);
|
|
|
+ JSONArray objects = jsonObject.getJSONArray("tables");
|
|
|
+ if (Blank.isNotEmpty(objects)){
|
|
|
+ JSONObject jsonObject1 = objects.getJSONObject(0);
|
|
|
+ //将新数据加到与那里的data里面,并更新
|
|
|
+ reportTableDao.updateReportTable(reportTable);
|
|
|
+ }
|
|
|
}
|
|
|
}
|