|
@@ -9,6 +9,7 @@ import com.gyee.common.model.PointData;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import com.gyee.generation.model.auto.ProBasicEquipmentPoint;
|
|
|
import com.gyee.generation.model.auto.ProBasicWppoint;
|
|
|
+import com.gyee.generation.model.vo.RealTimeParameterVo;
|
|
|
import com.gyee.generation.util.realtimesource.timeseries.ErrorRequest;
|
|
|
import com.gyee.generation.util.realtimesource.timeseries.JsonObjectHelper;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -1312,5 +1313,36 @@ public class EdosUtil implements IEdosUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void sendMultiRealTimeParamete(List<RealTimeParameterVo> pointls) throws Exception {
|
|
|
+
|
|
|
+ String url = baseURL + "/latest/batch";
|
|
|
+ List<JSONObject> writeList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (RealTimeParameterVo entity : pointls) {
|
|
|
+ writeList.add(convertRealTimeParamete(entity));
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ String result = restTemplate.postForObject(url, writeList, String.class);
|
|
|
+ } catch (HttpClientErrorException exception) {
|
|
|
+ if (exception.getStatusCode() == HttpStatus.NOT_FOUND) {
|
|
|
+ System.out.println("404请求错误");
|
|
|
+ } else {
|
|
|
+ throw exception;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private JSONObject convertRealTimeParamete(RealTimeParameterVo pd) {
|
|
|
+ JSONObject jo = new JSONObject();
|
|
|
+ jo.put("tagName", pd.getPoint());
|
|
|
+ JSONObject joo = new JSONObject();
|
|
|
+ joo.put("ts", pd.getTime().getTime());
|
|
|
+ joo.put("status", 0);
|
|
|
+ joo.put("doubleValue", pd.getInsertValue());
|
|
|
+ jo.put("tsData", joo);
|
|
|
+ return jo;
|
|
|
+ }
|
|
|
|
|
|
}
|