| | |
| | | |
| | | 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 = '测点采集状态表'; |
| | |
| | | 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; |
| | |
| | | |
| | | @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; |
| | | |
| | | } |
| | |
| | | private String id; |
| | | |
| | | /** |
| | | * 测点ID |
| | | * 测点编码 |
| | | */ |
| | | private String pointId; |
| | | private String pointNo; |
| | | |
| | | /** |
| | | * 采集值 |
| | |
| | | public interface DaPointCollectStatusService extends BaseService<DaPointCollectStatusEntity> { |
| | | |
| | | @Async |
| | | void recordStatus(String pointId, String collectValue, Date collectTime); |
| | | void recordStatus(String pointNo, String collectValue, Date collectTime); |
| | | } |
| | |
| | | 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); |
| | |
| | | - t_plan_item_category |
| | | - t_plan_item |
| | | - t_da_cumulate_point |
| | | - t_da_point_collect_status |
| | | app: |
| | | app-key: data |
| | | app-secret: 85b0df7edc3df3611913df34ed695011 |
| | |
| | | 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 |