Ver código fonte

opc增加位置宽度和高度

hfxc226 2 anos atrás
pai
commit
17cb2aae83

+ 16 - 1
platform-dao/src/main/java/com/platform/dao/dto/remote/RemoteOpcDTO.java

@@ -21,7 +21,22 @@ import java.time.LocalDateTime;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class RemoteOpcDTO extends BaseDTO implements Serializable {
-
+    /**
+     * x轴位置
+     */
+    private Integer xPosition;
+    /**
+     * y轴位置
+     */
+    private Integer yPosition;
+    /**
+     * 位置宽度
+     */
+    private Integer width;
+    /**
+     * 位置高度
+     */
+    private Integer height;
     /**
      * 是否模拟量:0否1是
      */

+ 16 - 1
platform-dao/src/main/java/com/platform/dao/entity/remote/RemoteOpc.java

@@ -21,7 +21,22 @@ import java.time.LocalDateTime;
 @Accessors(chain = true)
 @Table(name = "t_remote_opc")
 public class RemoteOpc implements Serializable {
-
+    /**
+     * x轴位置
+     */
+    private Integer xPosition;
+    /**
+     * y轴位置
+     */
+    private Integer yPosition;
+    /**
+     * 位置宽度
+     */
+    private Integer width;
+    /**
+     * 位置高度
+     */
+    private Integer height;
     /**
      * 是否模拟量:0否1是
      */

+ 31 - 2
platform-dao/src/main/java/com/platform/dao/vo/export/remote/ExportRemoteOpcVO.java

@@ -51,7 +51,7 @@ public class ExportRemoteOpcVO implements Serializable {
     /**
      * 类型
      */
-    @Excel(name = "类型", dicCode="REMOTE_MEASURE")
+    @Excel(name = "类型", dicCode="REMOTE_OPC")
     private Integer type;
 
     /**
@@ -77,7 +77,36 @@ public class ExportRemoteOpcVO implements Serializable {
      */
     @Excel(name = "单位")
     private String unit;
-
+    /**
+     * 是否模拟量:0否1是
+     */
+    @Excel(name = "是否模拟量", dicCode="YES_NO")
+    private Integer avFlag;
+    /**
+     * opc服务器上是否已经创建:0否1是
+     */
+    @Excel(name = "opc服务器上是否已经创建", dicCode="YES_NO")
+    private Integer createdFlag;
+    /**
+     * x轴位置
+     */
+    @Excel(name = "x轴位置")
+    private Integer xPosition;
+    /**
+     * y轴位置
+     */
+    @Excel(name = "y轴位置")
+    private Integer yPosition;
+    /**
+     * 位置宽度
+     */
+    @Excel(name = "位置宽度")
+    private Integer width;
+    /**
+     * 位置高度
+     */
+    @Excel(name = "位置高度")
+    private Integer height;
     /**
      * 备注
      */

+ 16 - 1
platform-dao/src/main/java/com/platform/dao/vo/query/remote/RemoteOpcVO.java

@@ -19,7 +19,22 @@ import java.time.LocalDateTime;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class RemoteOpcVO extends BaseVO implements Serializable {
-
+    /**
+     * x轴位置
+     */
+    private Integer xPosition;
+    /**
+     * y轴位置
+     */
+    private Integer yPosition;
+    /**
+     * 位置宽度
+     */
+    private Integer width;
+    /**
+     * 位置高度
+     */
+    private Integer height;
     /**
      * 是否模拟量:0否1是
      */

+ 8 - 0
platform-dao/src/main/resources/mapper/remote/RemoteOpcMapper.xml

@@ -15,6 +15,10 @@
                                      opc.result,
                                      opc.av_flag,
                                      opc.created_flag,
+                                     opc.x_position,
+                                     opc.y_position,
+                                     opc.width,
+                                     opc.height,
                                      opc.ratio,
                                      opc.unit,
                                      opc.info,
@@ -35,6 +39,10 @@
                                      opc.result,
                                      opc.av_flag,
                                      opc.created_flag,
+                                     opc.x_position,
+                                     opc.y_position,
+                                     opc.width,
+                                     opc.height,
                                      opc.ratio,
                                      opc.unit,
                                      opc.remark,

+ 4 - 1
platform-opc/src/main/java/com/platform/opc/servie/OpcTaskService.java

@@ -34,7 +34,7 @@ public class OpcTaskService {
      *  a:保存到redis,前端页面实时从数据库获取数据,2秒刷新一次
      */
     @Async
-    @Scheduled(fixedDelay = 5000)  //间隔2
+    @Scheduled(fixedDelay = 5000)  //间隔5
     public void getValue(){
         log.info("开始定时任务");
         List<OpcResult> resultList = OpcDAClient.getItemValuesList();
@@ -47,6 +47,9 @@ public class OpcTaskService {
     /**
      * 1: 保存获取的数据
      *  b: 开启新线程,队列写入数据库,每一分钟启动一次
+     *  c: 每个点位,每条数据保存一天的
+     *      1)循环查询点位在当天是否存在记录,如果存在,则追加
+     *      2)批量写入数据库
      */
     @Async
     @Scheduled(fixedDelay = 60000)  //间隔60秒