diff --git a/pom.xml b/pom.xml
index 4ae64de..01afa40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,6 +40,22 @@
pom
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
+
org.springframework.boot
diff --git a/src/main/java/com/shxy/i2/bean/IErrorCode.java b/src/main/java/com/shxy/i2/bean/IErrorCode.java
new file mode 100644
index 0000000..ca94c4b
--- /dev/null
+++ b/src/main/java/com/shxy/i2/bean/IErrorCode.java
@@ -0,0 +1,17 @@
+package com.shxy.i2.bean;
+
+/**
+ * 常用API返回对象接口
+ *
+ */
+public interface IErrorCode {
+ /**
+ * 返回码
+ */
+ int getCode();
+
+ /**
+ * 返回信息
+ */
+ String getMessage();
+}
diff --git a/src/main/java/com/shxy/i2/bean/ListModel.java b/src/main/java/com/shxy/i2/bean/ListModel.java
new file mode 100644
index 0000000..ff9a8b8
--- /dev/null
+++ b/src/main/java/com/shxy/i2/bean/ListModel.java
@@ -0,0 +1,34 @@
+package com.shxy.i2.bean;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 电压线路树状图列表
+ */
+@Data
+public class ListModel implements Serializable {
+
+ private List list = new ArrayList<>();
+
+ @Data
+ public static class Beans {
+
+ private String name;
+
+ private BigInteger history;//历史数据量
+
+ private BigInteger uploadnum;//已上传数据量
+
+ private BigInteger nownum;//今日数据量
+
+ private BigInteger nowuploadnum;//今日上传数据量
+ }
+
+
+
+}
diff --git a/src/main/java/com/shxy/i2/bean/ResponseReult.java b/src/main/java/com/shxy/i2/bean/ResponseReult.java
new file mode 100644
index 0000000..a232db6
--- /dev/null
+++ b/src/main/java/com/shxy/i2/bean/ResponseReult.java
@@ -0,0 +1,121 @@
+package com.shxy.i2.bean;
+
+
+import cn.hutool.http.HttpStatus;
+
+import java.io.Serializable;
+
+public class ResponseReult implements Serializable {
+ /**
+ * 返回对象
+ */
+ private T data;
+ /**
+ * 返回状态码
+ */
+ private int code;
+ /**
+ * 返回描述
+ */
+ private String msg;
+
+
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public void setCode(int code, String msg) {
+ this.code = code;
+ this.msg = msg;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ /**
+ * 返回成功消息
+ *
+ * @return 成功消息
+ */
+ public static ResponseReult success(T obj) {
+ ResponseReult success = ResponseReult.success();
+ if (obj != null) {
+ success.setData(obj);
+ }
+ return success;
+ }
+
+ /**
+ * 返回成功消息
+ *
+ * @return 成功消息
+ */
+ public static ResponseReult success() {
+ ResponseReult response = new ResponseReult<>();
+ response.setCode(HttpStatus.HTTP_OK, "操作成功");
+ return response;
+ }
+
+
+ /**
+ * 失败返回结果
+ *
+ * @param message 错误信息
+ */
+ public static ResponseReult fail(String message) {
+ return ResponseReult.error(HttpStatus.HTTP_BAD_REQUEST, message);
+ }
+
+ public static ResponseReult fail(int code, String msg) {
+ ResponseReult response = new ResponseReult<>();
+ response.setCode(code, msg);
+ return response;
+ }
+ /**
+ * 返回失败消息
+ *
+ * @return 失败消息
+ */
+ public static ResponseReult error(int code, String msg) {
+ ResponseReult response = new ResponseReult<>();
+ response.setCode(code, msg);
+ return response;
+ }
+
+ /**
+ * 失败返回结果
+ *
+ * @param errorCode 错误码
+ */
+ public static ResponseReult error(IErrorCode errorCode) {
+ return ResponseReult.error(errorCode.getCode(), errorCode.getMessage());
+ }
+
+ /**
+ * 失败返回结果
+ *
+ * @param message 错误信息
+ */
+ public static ResponseReult error(String message) {
+ return ResponseReult.error(HttpStatus.HTTP_INTERNAL_ERROR, message);
+ }
+
+}
diff --git a/src/main/java/com/shxy/i2/bean/ServiceBody.java b/src/main/java/com/shxy/i2/bean/ServiceBody.java
new file mode 100644
index 0000000..f7cf011
--- /dev/null
+++ b/src/main/java/com/shxy/i2/bean/ServiceBody.java
@@ -0,0 +1,25 @@
+package com.shxy.i2.bean;
+
+import lombok.Data;
+
+/**
+ * service服务请求返回
+ *
+ * @author 晶晶
+ */
+@Data
+public class ServiceBody {
+
+ /**
+ * 返回体
+ */
+ private T data;
+ /**
+ * 返回状态码
+ */
+ private int code;
+ /**
+ * 错误描述
+ */
+ private String msg;
+}
diff --git a/src/main/java/com/shxy/i2/bean/ServiceStatus.java b/src/main/java/com/shxy/i2/bean/ServiceStatus.java
new file mode 100644
index 0000000..5953d8c
--- /dev/null
+++ b/src/main/java/com/shxy/i2/bean/ServiceStatus.java
@@ -0,0 +1,17 @@
+package com.shxy.i2.bean;
+
+/**
+ * 返回状态码
+ *
+ * @author xzg
+ */
+public class ServiceStatus {
+ /**
+ * 操作成功
+ */
+ public static final int SUCCESS = 200;
+ /**
+ * 操作失败
+ */
+ public static final int ERROR = 400;
+}
diff --git a/src/main/java/com/shxy/i2/controller/CheckController.java b/src/main/java/com/shxy/i2/controller/CheckController.java
new file mode 100644
index 0000000..aefe9fe
--- /dev/null
+++ b/src/main/java/com/shxy/i2/controller/CheckController.java
@@ -0,0 +1,32 @@
+package com.shxy.i2.controller;
+
+import com.shxy.i2.bean.ListModel;
+import com.shxy.i2.bean.ResponseReult;
+import com.shxy.i2.bean.ServiceBody;
+import com.shxy.i2.bean.ServiceStatus;
+import com.shxy.i2.service.XydlI2Service;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@Slf4j
+public class CheckController {
+
+ @Autowired
+ XydlI2Service xydlI2Service;
+
+ @RequestMapping("/list")
+ public ResponseReult list() {
+ ServiceBody serviceBody = xydlI2Service.list();
+ if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
+ return ResponseReult.success(serviceBody.getData());
+ } else {
+ return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
+ }
+ }
+
+}
diff --git a/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java b/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java
index ee8db62..a21a24d 100644
--- a/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_Byq_JbfdDao.java
@@ -15,6 +15,10 @@ public interface Data_Byq_JbfdDao {
List selectUpload(@Param("isupload") Integer isupload);
+ Data_Byq_Jbfd selectMaxId();
+
+ Data_Byq_Jbfd selectNowId(@Param("date") Date date);
+
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_CnjDao.java b/src/main/java/com/shxy/i2/dao/Data_CnjDao.java
index 5a62b91..46e015f 100644
--- a/src/main/java/com/shxy/i2/dao/Data_CnjDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_CnjDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Byq_Jbfd;
import com.shxy.i2.entity.Data_Cnj;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_CnjDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Cnj selectMaxId();
+
+ Data_Cnj selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_DcywDao.java b/src/main/java/com/shxy/i2/dao/Data_DcywDao.java
index a857c8d..02ea35d 100644
--- a/src/main/java/com/shxy/i2/dao/Data_DcywDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_DcywDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Cnj;
import com.shxy.i2.entity.Data_Dcyw;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_DcywDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Dcyw selectMaxId();
+
+ Data_Dcyw selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java b/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java
index 3d056b5..0530aa1 100644
--- a/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_Dlq_JbfdDao.java
@@ -1,6 +1,7 @@
package com.shxy.i2.dao;
import com.shxy.i2.bean.SendDataBean;
+import com.shxy.i2.entity.Data_Dcyw;
import com.shxy.i2.entity.Data_Dlq_Jbfd;
import org.apache.ibatis.annotations.Param;
@@ -13,6 +14,10 @@ public interface Data_Dlq_JbfdDao {
List selectUpload(@Param("isupload") Integer isupload);
+ Data_Dlq_Jbfd selectMaxId();
+
+ Data_Dlq_Jbfd selectNowId(@Param("date") Date date);
+
List selectUploadById(@Param("maxid") BigInteger maxid);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java b/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java
index 8c0ab69..aa6f55e 100644
--- a/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_Dr_JyjcDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Dlq_Jbfd;
import com.shxy.i2.entity.Data_Dr_Jyjc;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_Dr_JyjcDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Dr_Jyjc selectMaxId();
+
+ Data_Dr_Jyjc selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java b/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java
index ad41867..4185154 100644
--- a/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_FhdlbxDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Dr_Jyjc;
import com.shxy.i2.entity.Data_Fhdlbx;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,11 @@ public interface Data_FhdlbxDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Fhdlbx selectMaxId();
+
+ Data_Fhdlbx selectNowId(@Param("date") Date date);
+
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java b/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java
index 76c2cad..aae6c10 100644
--- a/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_FhzxqDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Fhdlbx;
import com.shxy.i2.entity.Data_Fhzxq;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_FhzxqDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Fhzxq selectMaxId();
+
+ Data_Fhzxq selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java b/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java
index d337a97..9462244 100644
--- a/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_Jsyhw_JyjcDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Fhzxq;
import com.shxy.i2.entity.Data_Jsyhw_Jyjc;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_Jsyhw_JyjcDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Jsyhw_Jyjc selectMaxId();
+
+ Data_Jsyhw_Jyjc selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java b/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java
index 89b4401..5543033 100644
--- a/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_MicroclimateDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Jsyhw_Jyjc;
import com.shxy.i2.entity.Data_Microclimate;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_MicroclimateDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Microclimate selectMaxId();
+
+ Data_Microclimate selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java b/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java
index d50d2e8..4fa1191 100644
--- a/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_SF6_QtsfDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Microclimate;
import com.shxy.i2.entity.Data_SF6_Qtsf;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_SF6_QtsfDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_SF6_Qtsf selectMaxId();
+
+ Data_SF6_Qtsf selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java b/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java
index 54d9f19..f2cc4b2 100644
--- a/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_SF6_QtylDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_SF6_Qtsf;
import com.shxy.i2.entity.Data_SF6_Qtyl;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,11 @@ public interface Data_SF6_QtylDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_SF6_Qtyl selectMaxId();
+
+ Data_SF6_Qtyl selectNowId(@Param("date") Date date);
+
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_TxDao.java b/src/main/java/com/shxy/i2/dao/Data_TxDao.java
index 6440e80..b092408 100644
--- a/src/main/java/com/shxy/i2/dao/Data_TxDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_TxDao.java
@@ -1,6 +1,8 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_SF6_Qtyl;
import com.shxy.i2.entity.Data_Tx;
+import com.shxy.i2.entity.Data_Ysp;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
@@ -11,6 +13,10 @@ public interface Data_TxDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Tx selectMaxId();
+
+ Data_Tx selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
@@ -18,4 +24,5 @@ public interface Data_TxDao {
int updateList(@Param("isupload") Integer isupload, @Param("idlist") List id, @Param("updateTime") Date updateTime);
int deleteData(@Param("time") Date time);
+
}
\ No newline at end of file
diff --git a/src/main/java/com/shxy/i2/dao/Data_WsDao.java b/src/main/java/com/shxy/i2/dao/Data_WsDao.java
index 64ffd9e..93c9c75 100644
--- a/src/main/java/com/shxy/i2/dao/Data_WsDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_WsDao.java
@@ -1,5 +1,6 @@
package com.shxy.i2.dao;
+import com.shxy.i2.entity.Data_Tx;
import com.shxy.i2.entity.Data_Ws;
import org.apache.ibatis.annotations.Param;
@@ -11,6 +12,10 @@ public interface Data_WsDao {
List selectUploadById(@Param("maxid") BigInteger maxid);
+ Data_Ws selectMaxId();
+
+ Data_Ws selectNowId(@Param("date") Date date);
+
List selectUpload(@Param("isupload") Integer isupload);
int updateByPrimaryKey(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") List id, @Param("updateTime") Date updateTime);
diff --git a/src/main/java/com/shxy/i2/dao/Data_YspDao.java b/src/main/java/com/shxy/i2/dao/Data_YspDao.java
index b42be2e..69581b9 100644
--- a/src/main/java/com/shxy/i2/dao/Data_YspDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_YspDao.java
@@ -1,6 +1,8 @@
package com.shxy.i2.dao;
+import cn.hutool.core.date.DateTime;
import com.shxy.i2.bean.SendDataBean;
+import com.shxy.i2.entity.Data_Byq_Jbfd;
import com.shxy.i2.entity.Data_Ysp;
import org.apache.ibatis.annotations.Param;
@@ -24,4 +26,8 @@ public interface Data_YspDao {
int updateDataList2(@Param("isupload") Integer isupload, @Param("maxid") BigInteger maxid, @Param("idlist") ArrayList id, @Param("updateTime") Date updateTime);
int deleteData(@Param("time") Date time);
+
+ Data_Ysp selectMaxId();
+
+ Data_Ysp selectNowId(@Param("date") Date time);
}
\ No newline at end of file
diff --git a/src/main/java/com/shxy/i2/dao/Data_YxDao.java b/src/main/java/com/shxy/i2/dao/Data_YxDao.java
index e15a95f..c3fbc76 100644
--- a/src/main/java/com/shxy/i2/dao/Data_YxDao.java
+++ b/src/main/java/com/shxy/i2/dao/Data_YxDao.java
@@ -1,6 +1,7 @@
package com.shxy.i2.dao;
import com.shxy.i2.dto.Data_YxlDto;
+import com.shxy.i2.entity.Data_Ws;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
@@ -11,5 +12,9 @@ public interface Data_YxDao {
List selectByPrimaryKey(@Param("maxid") BigInteger maxid);
+ Data_YxlDto selectMaxId();
+
+ Data_YxlDto selectNowId(@Param("date") Date date);
+
int deleteData(@Param("time") Date time);
}
\ No newline at end of file
diff --git a/src/main/java/com/shxy/i2/dao/Upload_checkDao.java b/src/main/java/com/shxy/i2/dao/Upload_checkDao.java
index c1bcca3..04c1eb6 100644
--- a/src/main/java/com/shxy/i2/dao/Upload_checkDao.java
+++ b/src/main/java/com/shxy/i2/dao/Upload_checkDao.java
@@ -5,11 +5,14 @@ import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.Date;
+import java.util.List;
public interface Upload_checkDao {
Upload_check selectByPrimaryKey(String checkType);
+ List selectAll();
+
int updateByPrimaryKey(@Param("checkType") String checkType, @Param("value") BigInteger value, @Param("updateTime") Date updateTime);
}
\ No newline at end of file
diff --git a/src/main/java/com/shxy/i2/dto/Data_YxlDto.java b/src/main/java/com/shxy/i2/dto/Data_YxlDto.java
index 7e435d3..f56612e 100644
--- a/src/main/java/com/shxy/i2/dto/Data_YxlDto.java
+++ b/src/main/java/com/shxy/i2/dto/Data_YxlDto.java
@@ -10,6 +10,8 @@ import java.util.List;
public class Data_YxlDto {
BigInteger id;
+ BigInteger maxid;
+ BigInteger minid;
Integer sadr;
Date dtime;
Integer ival;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java b/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java
index faa6736..5079376 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Byq_Jbfd.java
@@ -9,6 +9,8 @@ import java.util.Date;
@Data
public class Data_Byq_Jbfd implements Serializable {
private BigInteger id;
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Cnj.java b/src/main/java/com/shxy/i2/entity/Data_Cnj.java
index dc1faf3..08391b9 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Cnj.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Cnj.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Cnj implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Dcyw.java b/src/main/java/com/shxy/i2/entity/Data_Dcyw.java
index e272096..24c284d 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Dcyw.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Dcyw.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Dcyw implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java b/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java
index bb6f598..06fc516 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Dlq_Jbfd.java
@@ -8,7 +8,8 @@ import java.util.Date;
@Data
public class Data_Dlq_Jbfd implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java b/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java
index dd4ff0f..916c7c8 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Dr_Jyjc.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Dr_Jyjc implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java b/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java
index 5b5c1af..500ddbc 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Fhdlbx.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Fhdlbx implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java b/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java
index 55d2fcc..48bb263 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Fhzxq.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Fhzxq implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java b/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java
index 7c703a3..5e93d7e 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Jsyhw_Jyjc.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Jsyhw_Jyjc implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Microclimate.java b/src/main/java/com/shxy/i2/entity/Data_Microclimate.java
index d42f97a..09cb473 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Microclimate.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Microclimate.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_Microclimate implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java
index dc8526e..ee74bf4 100644
--- a/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java
+++ b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtsf.java
@@ -9,7 +9,8 @@ import java.util.Date;
@Data
public class Data_SF6_Qtsf implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java
index 29dcdbf..92313bb 100644
--- a/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java
+++ b/src/main/java/com/shxy/i2/entity/Data_SF6_Qtyl.java
@@ -10,7 +10,8 @@ import java.util.Date;
public class Data_SF6_Qtyl implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Tx.java b/src/main/java/com/shxy/i2/entity/Data_Tx.java
index 625f0a5..5491a97 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Tx.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Tx.java
@@ -9,6 +9,8 @@ import java.util.Date;
@Data
public class Data_Tx implements Serializable {
private BigInteger id;
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Ws.java b/src/main/java/com/shxy/i2/entity/Data_Ws.java
index b795866..c296754 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Ws.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Ws.java
@@ -8,7 +8,8 @@ import java.util.Date;
@Data
public class Data_Ws implements Serializable {
private BigInteger id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
private Date acquisitiontime;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Ysp.java b/src/main/java/com/shxy/i2/entity/Data_Ysp.java
index 6038233..2216bf1 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Ysp.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Ysp.java
@@ -9,6 +9,8 @@ import java.util.Date;
@Data
public class Data_Ysp implements Serializable {
private BigInteger id;
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer eqmid;
diff --git a/src/main/java/com/shxy/i2/entity/Data_Yx.java b/src/main/java/com/shxy/i2/entity/Data_Yx.java
index 4459f63..aa377e0 100644
--- a/src/main/java/com/shxy/i2/entity/Data_Yx.java
+++ b/src/main/java/com/shxy/i2/entity/Data_Yx.java
@@ -3,12 +3,14 @@ package com.shxy.i2.entity;
import lombok.Data;
import java.io.Serializable;
+import java.math.BigInteger;
import java.util.Date;
@Data
public class Data_Yx implements Serializable {
private Long id;
-
+ private BigInteger maxid;
+ private BigInteger minid;
private Integer sadr;
private Date dTime;
diff --git a/src/main/java/com/shxy/i2/service/XydlI2Service.java b/src/main/java/com/shxy/i2/service/XydlI2Service.java
index 3ede48b..ec5eb80 100644
--- a/src/main/java/com/shxy/i2/service/XydlI2Service.java
+++ b/src/main/java/com/shxy/i2/service/XydlI2Service.java
@@ -1,5 +1,7 @@
package com.shxy.i2.service;
+import com.shxy.i2.bean.ListModel;
+import com.shxy.i2.bean.ServiceBody;
import com.shxy.i2.entity.Niec_Sensors;
import org.apache.cxf.endpoint.Client;
@@ -38,4 +40,6 @@ public interface XydlI2Service {
void upload_yx(Client client);
void clear_history();
+
+ ServiceBody list();
}
diff --git a/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java b/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java
index 951c9e3..675e442 100644
--- a/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java
+++ b/src/main/java/com/shxy/i2/serviceimpl/WebServiceImpl.java
@@ -6,13 +6,8 @@ import com.shxy.i2.entity.*;
import com.shxy.i2.service.Webservcies;
import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
-import org.apache.cxf.transport.http.HTTPConduit;
-import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
import java.util.HashMap;
diff --git a/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java b/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java
index 96f81bf..a67c42d 100644
--- a/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java
+++ b/src/main/java/com/shxy/i2/serviceimpl/XydlI2ServiceImpl.java
@@ -3,14 +3,13 @@ package com.shxy.i2.serviceimpl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import com.shxy.i2.Tool.AsyncMethod;
import com.shxy.i2.Tool.GenerateI2Xml;
-import com.shxy.i2.bean.AttrBean;
-import com.shxy.i2.bean.SendDataBean;
-import com.shxy.i2.bean.YxAttrBean;
+import com.shxy.i2.bean.*;
import com.shxy.i2.constant.Constant;
import com.shxy.i2.dao.*;
import com.shxy.i2.dto.Data_YxlDto;
@@ -19,9 +18,8 @@ import com.shxy.i2.service.XydlI2Service;
import lombok.extern.slf4j.Slf4j;
import org.apache.cxf.endpoint.Client;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
+import org.springframework.util.Assert;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -105,1458 +103,1356 @@ public class XydlI2ServiceImpl implements XydlI2Service {
value = BigInteger.valueOf(0);
}
}
-// Boolean iscontiue = true;
-// while (iscontiue) {
- List data_byq_jbfdlist = data_byq_jbfdDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(data_byq_jbfdlist)) {
- log.info("查询byq_jbfd的数据量:" + data_byq_jbfdlist.size());
- log.info("查询byq_jbfd的数据量 sendlimit :" + sendlimit);
-// if (data_byq_jbfdlist.size() < 1000) {
-// iscontiue = false;
-// }
-// BigDecimal add = NumberUtil.add(value, data_byq_jbfdlist.size());
-// value = add.toBigInteger();
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
+ List data_byq_jbfdlist = data_byq_jbfdDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(data_byq_jbfdlist)) {
+ log.info("查询byq_jbfd的数据量:" + data_byq_jbfdlist.size());
+ log.info("查询byq_jbfd的数据量 sendlimit :" + sendlimit);
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
- for (int index = 0; index < data_byq_jbfdlist.size(); index++) {
- Data_Byq_Jbfd item = data_byq_jbfdlist.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ for (int index = 0; index < data_byq_jbfdlist.size(); index++) {
+ Data_Byq_Jbfd item = data_byq_jbfdlist.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float dischargecapacity = item.getDischargecapacity();
- if (dischargecapacity != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("DischargeCapacity");
- attr.setValue(dischargecapacity);
- attrlist.add(attr);
- }
- Float dischargeposition = item.getDischargeposition();
- if (dischargeposition != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("DischargePosition");
- attr.setValue(dischargeposition);
- attrlist.add(attr);
- }
- Float pulsecount = item.getPulsecount();
- if (pulsecount != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("PulseCount");
- attr.setValue(pulsecount);
- attrlist.add(attr);
- }
- byte[] dischargewaveform = item.getDischargewaveform();
- if (dischargewaveform != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("DischargeWaveform");
- attr.setValue(dischargewaveform);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.BYQ_JBFD, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- BigInteger id = item.getId();
- SendDataBean sendDataBean = new SendDataBean();
- sendDataBean.setEqmid(item.getEqmid());
- sendDataBean.setMaxid(id);
- if ((index != 0 && index % sendlimit == 0) || index == (data_byq_jbfdlist.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float dischargecapacity = item.getDischargecapacity();
+ if (dischargecapacity != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("DischargeCapacity");
+ attr.setValue(dischargecapacity);
+ attrlist.add(attr);
+ }
+ Float dischargeposition = item.getDischargeposition();
+ if (dischargeposition != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("DischargePosition");
+ attr.setValue(dischargeposition);
+ attrlist.add(attr);
+ }
+ Float pulsecount = item.getPulsecount();
+ if (pulsecount != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("PulseCount");
+ attr.setValue(pulsecount);
+ attrlist.add(attr);
+ }
+ byte[] dischargewaveform = item.getDischargewaveform();
+ if (dischargewaveform != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("DischargeWaveform");
+ attr.setValue(dischargewaveform);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.BYQ_JBFD, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ BigInteger id = item.getId();
+ SendDataBean sendDataBean = new SendDataBean();
+ sendDataBean.setEqmid(item.getEqmid());
+ sendDataBean.setMaxid(id);
+ if ((index != 0 && index % sendlimit == 0) || index == (data_byq_jbfdlist.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
}
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.BYQJBFDID);
- } else {
-// iscontiue = false;
- log.info("没有查询byq_jbfd的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.BYQJBFDID);
+ } else {
+ log.info("没有查询byq_jbfd的数据量");
+ }
}
@Override
public void upload_cnj(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_cnjDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询cnj的数据量:" + list.size());
- log.info("查询cnj的数据量 sendlimit :" + sendlimit);
-// if (list.size() < 1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Cnj item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_cnjDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询cnj的数据量:" + list.size());
+ log.info("查询cnj的数据量 sendlimit :" + sendlimit);
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Cnj item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float chargetime = item.getChargetime();
- if (chargetime != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("ChargeTime");
- attr.setValue(chargetime);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.CNJ, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float chargetime = item.getChargetime();
+ if (chargetime != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("ChargeTime");
+ attr.setValue(chargetime);
+ attrlist.add(attr);
}
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.CNJ, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.CNJID);
- } else {
-// iscontiue = false;
- log.info("没有查询cnj的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.CNJID);
+ } else {
+ log.info("没有查询cnj的数据量");
+ }
}
@Override
public void upload_dcyw(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_dcywDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询dcyw的数据量:" + list.size());
-// if (list.size() < 1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Dcyw item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_dcywDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询dcyw的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Dcyw item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float oiltemperature = item.getOiltemperature();
- if (oiltemperature != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("OilTemperature");
- attr.setValue(oiltemperature);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.DCYW, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
}
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float oiltemperature = item.getOiltemperature();
+ if (oiltemperature != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("OilTemperature");
+ attr.setValue(oiltemperature);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.DCYW, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.DCYWID);
- } else {
-// iscontiue = false;
- log.info("没有查询dcyw的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.DCYWID);
+ } else {
+ log.info("没有查询dcyw的数据量");
+ }
}
@Override
public void upload_dlq_jbfd(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_dlq_jbfdDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询dlq_jbfd的数据量:" + list.size());
- log.info("查询dlq_jbfd的数据量 sendlimit :" + sendlimit);
-// if (list.size() < 1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Dlq_Jbfd item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_dlq_jbfdDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询dlq_jbfd的数据量:" + list.size());
+ log.info("查询dlq_jbfd的数据量 sendlimit :" + sendlimit);
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Dlq_Jbfd item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float dischargecapacity = item.getDischargecapacity();
- if (dischargecapacity != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("DischargeCapacity");
- attr.setValue(dischargecapacity);
- attrlist.add(attr);
- }
- Float dischargeposition = item.getDischargeposition();
- if (dischargeposition != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("DischargePosition");
- attr.setValue(dischargeposition);
- attrlist.add(attr);
- }
- Float pulsecount = item.getPulsecount();
- if (pulsecount != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("PulseCount");
- attr.setValue(pulsecount);
- attrlist.add(attr);
- }
- byte[] dischargewaveform = item.getDischargewaveform();
- if (dischargewaveform != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("DischargeWaveform");
- attr.setValue(dischargewaveform);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float dischargecapacity = item.getDischargecapacity();
+ if (dischargecapacity != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("DischargeCapacity");
+ attr.setValue(dischargecapacity);
+ attrlist.add(attr);
+ }
+ Float dischargeposition = item.getDischargeposition();
+ if (dischargeposition != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("DischargePosition");
+ attr.setValue(dischargeposition);
+ attrlist.add(attr);
+ }
+ Float pulsecount = item.getPulsecount();
+ if (pulsecount != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("PulseCount");
+ attr.setValue(pulsecount);
+ attrlist.add(attr);
+ }
+ byte[] dischargewaveform = item.getDischargewaveform();
+ if (dischargewaveform != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("DischargeWaveform");
+ attr.setValue(dischargewaveform);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
}
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.DLQJBFDID);
- } else {
-// iscontiue = false;
- log.info("没有查询到dlq的数据");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.DLQJBFDID);
+ } else {
+ log.info("没有查询到dlq的数据");
+ }
}
@Override
public void upload_dr_jyjc(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_dr_jyjcDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询dr_jyjc的数据量:" + list.size());
-// if (list.size() < 1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
+ }
+ List list = data_dr_jyjcDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询dr_jyjc的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Dr_Jyjc item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
+ for (int index = 0; index < list.size(); index++) {
+ Data_Dr_Jyjc item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
- }
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float capacitance = item.getCapacitance();
- if (capacitance != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Capacitance");
- attr.setValue(capacitance);
- attrlist.add(attr);
- }
- Float lossfactor = item.getLossfactor();
- if (lossfactor != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("LossFactor");
- attr.setValue(lossfactor);
- attrlist.add(attr);
- }
- Float unbalancecurrent = item.getUnbalancecurrent();
- if (unbalancecurrent != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("UnbalanceCurrent");
- attr.setValue(unbalancecurrent);
- attrlist.add(attr);
- }
- Float unbalancevoltage = item.getUnbalancevoltage();
- if (unbalancevoltage != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("UnbalanceVoltage");
- attr.setValue(unbalancevoltage);
- attrlist.add(attr);
- }
- Float totalcurrent = item.getTotalcurrent();
- if (totalcurrent != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("TotalCurrent");
- attr.setValue(totalcurrent);
- attrlist.add(attr);
- }
- Float systemvoltage = item.getSystemvoltage();
- if (systemvoltage != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("SystemVoltage");
- attr.setValue(systemvoltage);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.DRJYJC, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float capacitance = item.getCapacitance();
+ if (capacitance != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Capacitance");
+ attr.setValue(capacitance);
+ attrlist.add(attr);
+ }
+ Float lossfactor = item.getLossfactor();
+ if (lossfactor != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("LossFactor");
+ attr.setValue(lossfactor);
+ attrlist.add(attr);
+ }
+ Float unbalancecurrent = item.getUnbalancecurrent();
+ if (unbalancecurrent != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("UnbalanceCurrent");
+ attr.setValue(unbalancecurrent);
+ attrlist.add(attr);
+ }
+ Float unbalancevoltage = item.getUnbalancevoltage();
+ if (unbalancevoltage != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("UnbalanceVoltage");
+ attr.setValue(unbalancevoltage);
+ attrlist.add(attr);
}
+ Float totalcurrent = item.getTotalcurrent();
+ if (totalcurrent != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("TotalCurrent");
+ attr.setValue(totalcurrent);
+ attrlist.add(attr);
+ }
+ Float systemvoltage = item.getSystemvoltage();
+ if (systemvoltage != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("SystemVoltage");
+ attr.setValue(systemvoltage);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.DRJYJC, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.DRJYJCID);
- } else {
-// iscontiue = false;
- log.info("没有查询dr_jyjc的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.DRJYJCID);
+ } else {
+ log.info("没有查询dr_jyjc的数据量");
+ }
}
@Override
public void upload_fhdlbx(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_fhdlbxDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询fhdlbx的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Fhdlbx item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_fhdlbxDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询fhdlbx的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Fhdlbx item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Integer action = item.getAction();
- if (action != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Action");
- attr.setValue(action);
- attrlist.add(attr);
- }
- byte[] loadwaveform = item.getLoadwaveform();
- if (loadwaveform != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("LoadWaveform");
- attr.setValue(loadwaveform);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.FHDLBX, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Integer action = item.getAction();
+ if (action != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Action");
+ attr.setValue(action);
+ attrlist.add(attr);
}
+ byte[] loadwaveform = item.getLoadwaveform();
+ if (loadwaveform != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("LoadWaveform");
+ attr.setValue(loadwaveform);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.FHDLBX, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.FHDLBXID);
- } else {
-// iscontiue = false;
- log.info("没有查询fhdlbx的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.FHDLBXID);
+ } else {
+ log.info("没有查询fhdlbx的数据量");
+ }
}
@Override
public void upload_fhzxq(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_fhzxqDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询fhzxq的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Fhzxq item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_fhzxqDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询fhzxq的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Fhzxq item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Integer action = item.getAction();
- if (action != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Action");
- attr.setValue(action);
- attrlist.add(attr);
- }
- byte[] coilwaveform = item.getCoilwaveform();
- if (coilwaveform != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("CoilWaveform");
- attr.setValue(coilwaveform);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.FHZXQ, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Integer action = item.getAction();
+ if (action != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Action");
+ attr.setValue(action);
+ attrlist.add(attr);
}
+ byte[] coilwaveform = item.getCoilwaveform();
+ if (coilwaveform != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("CoilWaveform");
+ attr.setValue(coilwaveform);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.FHZXQ, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.FHZXQID);
- } else {
-// iscontiue = false;
- log.info("没有查询fhzxq的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.FHZXQID);
+ } else {
+ log.info("没有查询fhzxq的数据量");
+ }
}
@Override
public void upload_jsyhw_jyjc(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_jsyhw_jyjcDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询jsyhw_jyjc的数据量:" + list.size());
- log.info("查询jsyhw_jyjc的数据量 sendlimit :" + sendlimit);
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Jsyhw_Jyjc item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_jsyhw_jyjcDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询jsyhw_jyjc的数据量:" + list.size());
+ log.info("查询jsyhw_jyjc的数据量 sendlimit :" + sendlimit);
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Jsyhw_Jyjc item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float systemvoltage = item.getSystemvoltage();
- if (systemvoltage != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("SystemVoltage");
- attr.setValue(systemvoltage);
- attrlist.add(attr);
- }
- Float totalcurrent = item.getTotalcurrent();
- if (totalcurrent != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("TotalCurrent");
- attr.setValue(totalcurrent);
- attrlist.add(attr);
- }
- Float resistivecurrent = item.getResistivecurrent();
- if (resistivecurrent != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("ResistiveCurrent");
- attr.setValue(resistivecurrent);
- attrlist.add(attr);
- }
- Float actioncount = item.getActioncount();
- if (actioncount != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("ActionCount");
- attr.setValue(actioncount);
- attrlist.add(attr);
- }
- Date lastactiontime = item.getLastactiontime();
- if (lastactiontime != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("LastActionTime");
- attr.setValue(DateUtil.format(lastactiontime, DatePattern.NORM_DATETIME_PATTERN));
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.JSYHW, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float systemvoltage = item.getSystemvoltage();
+ if (systemvoltage != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("SystemVoltage");
+ attr.setValue(systemvoltage);
+ attrlist.add(attr);
}
+ Float totalcurrent = item.getTotalcurrent();
+ if (totalcurrent != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("TotalCurrent");
+ attr.setValue(totalcurrent);
+ attrlist.add(attr);
+ }
+ Float resistivecurrent = item.getResistivecurrent();
+ if (resistivecurrent != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("ResistiveCurrent");
+ attr.setValue(resistivecurrent);
+ attrlist.add(attr);
+ }
+ Float actioncount = item.getActioncount();
+ if (actioncount != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("ActionCount");
+ attr.setValue(actioncount);
+ attrlist.add(attr);
+ }
+ Date lastactiontime = item.getLastactiontime();
+ if (lastactiontime != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("LastActionTime");
+ attr.setValue(DateUtil.format(lastactiontime, DatePattern.NORM_DATETIME_PATTERN));
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.JSYHW, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.JSYHWJYJCID);
- } else {
-// iscontiue = false;
- log.info("没有查询jsyhw_jyjc的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.JSYHWJYJCID);
+ } else {
+ log.info("没有查询jsyhw_jyjc的数据量");
+ }
}
@Override
public void upload_sf6_qtsf(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_sf6_qtsfDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询sf6_qtsf的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_SF6_Qtsf item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_sf6_qtsfDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询sf6_qtsf的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_SF6_Qtsf item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float temperature = item.getTemperature();
- if (temperature != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Temperature");
- attr.setValue(temperature);
- attrlist.add(attr);
- }
- Float moisture = item.getMoisture();
- if (moisture != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Moisture");
- attr.setValue(moisture);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTSF, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float temperature = item.getTemperature();
+ if (temperature != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Temperature");
+ attr.setValue(temperature);
+ attrlist.add(attr);
+ }
+ Float moisture = item.getMoisture();
+ if (moisture != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Moisture");
+ attr.setValue(moisture);
+ attrlist.add(attr);
}
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTSF, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.SF6QTSFID);
- } else {
-// iscontiue = false;
- log.info("没有查询sf6_qtsf的数据量");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.SF6QTSFID);
+ } else {
+ log.info("没有查询sf6_qtsf的数据量");
+ }
}
@Override
public void upload_sf6_qtyl(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- }else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_sf6_qtylDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询sf6_qtyl的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_SF6_Qtyl item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_sf6_qtylDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询sf6_qtyl的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_SF6_Qtyl item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float temperature = item.getTemperature();
- if (temperature != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Temperature");
- attr.setValue(temperature);
- attrlist.add(attr);
- }
- Float absolutepressure = item.getAbsolutepressure();
- if (absolutepressure != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("AbsolutePressure");
- attr.setValue(absolutepressure);
- attrlist.add(attr);
- }
- Float density = item.getDensity();
- if (density != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Density");
- attr.setValue(density);
- attrlist.add(attr);
- }
- Float pressure20c = item.getPressure20c();
- if (pressure20c != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Pressure20C");
- attr.setValue(pressure20c);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- log.info("开始传输");
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
}
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float temperature = item.getTemperature();
+ if (temperature != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Temperature");
+ attr.setValue(temperature);
+ attrlist.add(attr);
+ }
+ Float absolutepressure = item.getAbsolutepressure();
+ if (absolutepressure != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("AbsolutePressure");
+ attr.setValue(absolutepressure);
+ attrlist.add(attr);
+ }
+ Float density = item.getDensity();
+ if (density != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Density");
+ attr.setValue(density);
+ attrlist.add(attr);
+ }
+ Float pressure20c = item.getPressure20c();
+ if (pressure20c != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Pressure20C");
+ attr.setValue(pressure20c);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.SF6_QTYL, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ log.info("开始传输");
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID);
- } else {
-// iscontiue = false;
- log.info("没有查询到sf6_qtyl的数据");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID);
+ } else {
+ log.info("没有查询到sf6_qtyl的数据");
+ }
}
@Override
public void upload_tx(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_txDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询tx的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Tx item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_txDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询tx的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Tx item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float totalcorecurrent = item.getTotalcorecurrent();
- if (totalcorecurrent != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("TotalCoreCurrent");
- attr.setValue(totalcorecurrent);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.TX, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float totalcorecurrent = item.getTotalcorecurrent();
+ if (totalcorecurrent != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("TotalCoreCurrent");
+ attr.setValue(totalcorecurrent);
+ attrlist.add(attr);
+ }
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.TX, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
}
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.TXID);
- } else {
-// iscontiue = false;
- log.info("没有查询到tx的数据");
}
+ asyncMethod.updateRecordId(maxid, Constant.TXID);
+ } else {
+// iscontiue = false;
+ log.info("没有查询到tx的数据");
+ }
// }
}
@Override
public void upload_ws(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID);
- BigInteger value = null;
- if (upload_check == null) {
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_wsDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询ws的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Ws item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_wsDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询ws的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Ws item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float moisture = item.getMoisture();
- if (moisture != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Moisture");
- attr.setValue(moisture);
- attrlist.add(attr);
- }
- String cacdata = GenerateI2Xml.generateCacXml(Constant.WS, sensorid, equipmentid, timestamp, attrlist);
- cacdatalist.add(cacdata);
- if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
- String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
- asyncMethod.sendData2(client, xml);
- cacdatalist = new ArrayList<>();
- }
- } catch (Exception e) {
- log.error("抛出了异常:{}" + e.getMessage());
+ }
+ Niec_Sensors sensors = equipMap.get(item.getEqmid());
+ if (sensors == null) {
+ continue;
+ }
+ String sensorid = sensors.getSensorCode();
+ String equipmentid = sensors.getEquipmentId();
+ String phase = sensors.getPhase();
+ if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
+ ArrayList attrlist = new ArrayList<>();
+ try {
+ String timestamp = "";
+ Date acquisitiontime = item.getAcquisitiontime();
+ if (acquisitiontime != null) {
+ timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
+ }
+ if (phase != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Phase");
+ attr.setValue(phase);
+ attrlist.add(attr);
+ }
+ Float moisture = item.getMoisture();
+ if (moisture != null) {
+ AttrBean attr = new AttrBean<>();
+ attr.setKey("Moisture");
+ attr.setValue(moisture);
+ attrlist.add(attr);
}
+ String cacdata = GenerateI2Xml.generateCacXml(Constant.WS, sensorid, equipmentid, timestamp, attrlist);
+ cacdatalist.add(cacdata);
+ if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
+ String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
+ asyncMethod.sendData2(client, xml);
+ cacdatalist = new ArrayList<>();
+ }
+ } catch (Exception e) {
+ log.error("抛出了异常:{}" + e.getMessage());
}
}
- asyncMethod.updateRecordId(maxid, Constant.WSID);
- } else {
-// iscontiue = false;
- log.info("没有查询到ws的数据");
}
-// }
+ asyncMethod.updateRecordId(maxid, Constant.WSID);
+ } else {
+ log.info("没有查询到ws的数据");
+ }
}
@Override
public void upload_ysp(Client client, HashMap equipMap) {
-// Boolean iscontiue = true;
-// while (iscontiue) {
- //查询目前上传的油色谱的id 记录油色谱上传的id大小
- Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID);
- BigInteger value = null;
- if (upload_check == null) {
+ //查询目前上传的油色谱的id 记录油色谱上传的id大小
+ Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID);
+ BigInteger value = null;
+ if (upload_check == null) {
+ value = BigInteger.valueOf(0);
+ } else {
+ value = upload_check.getValue();
+ if (value == null) {
value = BigInteger.valueOf(0);
- } else {
- value = upload_check.getValue();
- if (value == null) {
- value = BigInteger.valueOf(0);
- }
}
- List list = data_yspDao.selectUploadById(value);
- if (CollectionUtil.isNotEmpty(list)) {
- log.info("查询ysp的数据量:" + list.size());
-// if (list.size()<1000) {
-// iscontiue = false;
-// }
- ArrayList cacdatalist = new ArrayList<>();
- BigInteger maxid = value;
- for (int index = 0; index < list.size(); index++) {
- Data_Ysp item = list.get(index);
- BigInteger ids = item.getId();
- if (ids != null) {
- int i = ids.compareTo(maxid);
- if (i == 1) {
- maxid = ids;
- }
- }
- Niec_Sensors sensors = equipMap.get(item.getEqmid());
- if (sensors == null) {
- continue;
+ }
+ List list = data_yspDao.selectUploadById(value);
+ if (CollectionUtil.isNotEmpty(list)) {
+ log.info("查询ysp的数据量:" + list.size());
+ ArrayList cacdatalist = new ArrayList<>();
+ BigInteger maxid = value;
+ for (int index = 0; index < list.size(); index++) {
+ Data_Ysp item = list.get(index);
+ BigInteger ids = item.getId();
+ if (ids != null) {
+ int i = ids.compareTo(maxid);
+ if (i == 1) {
+ maxid = ids;
}
- String sensorid = sensors.getSensorCode();
- String equipmentid = sensors.getEquipmentId();
- String phase = sensors.getPhase();
- if (StrUtil.isNotEmpty(sensorid) && StrUtil.isNotEmpty(equipmentid)) {
- ArrayList attrlist = new ArrayList<>();
- try {
- String timestamp = "";
- Date acquisitiontime = item.getAcquisitiontime();
- if (acquisitiontime != null) {
- timestamp = DateUtil.format(acquisitiontime, DatePattern.NORM_DATETIME_PATTERN);
- }
- if (phase != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("Phase");
- attr.setValue(phase);
- attrlist.add(attr);
- }
- Float h2 = item.getH2();
- if (h2 != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("H2");
- attr.setValue(h2);
- attrlist.add(attr);
- }
- Float ch4 = item.getCh4();
- if (ch4 != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("CH4");
- attr.setValue(ch4);
- attrlist.add(attr);
- }
- Float c2h6 = item.getC2h6();
- if (c2h6 != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("C2H6");
- attr.setValue(c2h6);
- attrlist.add(attr);
- }
- Float c2h4 = item.getC2h4();
- if (c2h4 != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("C2H4");
- attr.setValue(c2h4);
- attrlist.add(attr);
- }
- Float c2h2 = item.getC2h2();
- if (c2h2 != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("C2H2");
- attr.setValue(c2h2);
- attrlist.add(attr);
- }
- Float co = item.getCo();
- if (co != null) {
- AttrBean attr = new AttrBean<>();
- attr.setKey("CO");
- attr.setValue(co);
- attrlist.add(attr);
- }
- Float co2 = item.getCo2();
- if (co2 != null) {
- AttrBean