潘志宝
9 天以前 6b13839488edcd06046e26a41fe897358176689c
采集质量
已修改7个文件
39 ■■■■ 文件已修改
iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dto/DaPointDTO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/entity/DaPointCollectStatusEntity.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/resources/application.yaml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
@@ -402,10 +402,10 @@
CREATE TABLE t_da_point_collect_status(
                           `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
                           `point_id` VARCHAR(36) NOT NULL   COMMENT '测点ID',
                           `collect_value` VARCHAR(36)   COMMENT '采集值',
                           `collect_quality` VARCHAR(36)   COMMENT '采集质量',
                           `point_no` VARCHAR(36) NOT NULL   COMMENT '测点编码',
                           `collect_value` VARCHAR(24)   COMMENT '采集值',
                           `collect_quality` VARCHAR(5)   COMMENT '采集质量',
                           `collect_time` DATETIME   COMMENT '采集时间' ,
                           PRIMARY KEY (id) USING BTREE,
                           UNIQUE KEY `uk_point_id` (`point_id`) USING BTREE
                           UNIQUE KEY `uk_point_no` (`point_no`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT = '测点采集状态表';
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dto/DaPointDTO.java
@@ -1,5 +1,6 @@
package com.iailab.module.data.point.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.iailab.framework.common.validation.group.AddGroup;
import com.iailab.framework.common.validation.group.UpdateGroup;
import com.iailab.framework.excel.core.annotations.DictFormat;
@@ -127,4 +128,15 @@
    @Schema(description = "累计点")
    private DaCumulatePointDTO cumulatePoint;
    @Schema(description = "采集值")
    private String collectValue;
    @Schema(description = "采集质量")
    private String collectQuality;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "采集时间")
    private Date collectTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/entity/DaPointCollectStatusEntity.java
@@ -25,9 +25,9 @@
    private String id;
    /**
     * 测点ID
     * 测点编码
     */
    private String pointId;
    private String pointNo;
    /**
     * 采集值
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointCollectStatusService.java
@@ -14,5 +14,5 @@
public interface DaPointCollectStatusService extends BaseService<DaPointCollectStatusEntity> {
    @Async
    void recordStatus(String pointId, String collectValue, Date collectTime);
    void recordStatus(String pointNo, String collectValue, Date collectTime);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointCollectStatusServiceImpl.java
@@ -20,14 +20,14 @@
public class DaPointCollectStatusServiceImpl extends BaseServiceImpl<DaPointCollectStatusDao, DaPointCollectStatusEntity>
        implements DaPointCollectStatusService {
    public void recordStatus(String pointId, String collectValue, Date collectTime) {
    public void recordStatus(String pointNo, String collectValue, Date collectTime) {
        QueryWrapper<DaPointCollectStatusEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("point_id", pointId);
        queryWrapper.eq("point_no", pointNo);
        DaPointCollectStatusEntity entity = baseDao.selectOne(queryWrapper);
        if (entity == null) {
            entity = new DaPointCollectStatusEntity();
            entity.setId(UUID.randomUUID().toString());
            entity.setPointId(pointId);
            entity.setPointNo(pointNo);
            entity.setCollectValue(collectValue);
            entity.setCollectQuality(DataQualityEnum.getEumByValue(collectValue).getCode());
            entity.setCollectTime(collectTime);
iailab-module-data/iailab-module-data-biz/src/main/resources/application.yaml
@@ -184,6 +184,7 @@
      - t_plan_item_category
      - t_plan_item
      - t_da_cumulate_point
      - t_da_point_collect_status
  app:
    app-key: data
    app-secret: 85b0df7edc3df3611913df34ed695011
iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml
@@ -26,9 +26,13 @@
      t3.source_name,
      t2.tag_no,
      t2.dimension,
      t2.value_type
      t2.value_type,
      t6.collect_value,
      t6.collect_quality,
      t6.collect_time
      from t_da_point t1
      left join t_da_measure_point t2 on t2.point_id = t1.id
      left join t_da_point_collect_status t6 on t6.point_no = t1.point_no
      left join (
        select id source_id,server_name source_name
        from t_channel_opcua_device