潘志宝
6 天以前 df99e46312fdd5ee830f1451e478f6658e09f9ed
导出测点数据 修改
已修改4个文件
24 ■■■■ 文件已修改
iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointExcelVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/db/mysql/tenant.sql
@@ -129,7 +129,7 @@
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='KIO测点表';
CREATE TABLE t_da_point(
                         `id` VARCHAR(255) NOT NULL  COMMENT 'ID' ,
                         `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
                         `point_no` VARCHAR(36)   COMMENT '测点编码' ,
                         `point_name` VARCHAR(36)   COMMENT '测点名称' ,
                         `point_type` VARCHAR(10)   COMMENT '测点类型' ,
@@ -169,7 +169,7 @@
CREATE TABLE t_da_math_point(
                              `id` VARCHAR(36) NOT NULL  COMMENT 'ID' ,
                              `point_id` VARCHAR(36)   COMMENT '测点ID' ,
                              `expression` VARCHAR(500)   COMMENT '计算公式' ,
                              `expression` VARCHAR(2000)   COMMENT '计算公式' ,
                              PRIMARY KEY (id) USING BTREE,
                              UNIQUE KEY `uk_point_id` (`point_id`) 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/controller/admin/DaPointController.java
@@ -138,16 +138,15 @@
    @ApiAccessLog(operateType = EXPORT)
    public void exportPointList(@Validated DaPointPageReqVO exportReqVO,
                                HttpServletResponse response) throws IOException {
        exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
        List<DaPointExcelVO> dataList = new ArrayList<>();
        List<DaPointDTO> measurePointList = daPointService.getMeasurePoint(exportReqVO);
        List<DaPointExcelVO> dataList = ConvertUtils.sourceToTarget(daPointService.getList(exportReqVO), DaPointExcelVO.class);
        /*List<DaPointDTO> measurePointList = daPointService.getMeasurePoint(exportReqVO);
        dataList.addAll(ConvertUtils.sourceToTarget(measurePointList, DaPointExcelVO.class));
        List<DaPointDTO> mathPointList = daPointService.getMathPoint(exportReqVO);
        dataList.addAll(ConvertUtils.sourceToTarget(mathPointList, DaPointExcelVO.class));
        List<DaPointDTO> constantPointList = daPointService.getConstantPoint(exportReqVO);
        dataList.addAll(ConvertUtils.sourceToTarget(constantPointList, DaPointExcelVO.class));
        List<DaPointDTO> cumulatePointList = daPointService.getCumulatePoint(exportReqVO);
        dataList.addAll(ConvertUtils.sourceToTarget(cumulatePointList, DaPointExcelVO.class));
        dataList.addAll(ConvertUtils.sourceToTarget(cumulatePointList, DaPointExcelVO.class));*/
        ExcelUtils.write(response, "测点列表.xls", "测点列表", DaPointExcelVO.class, dataList);
    }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointExcelVO.java
@@ -96,4 +96,8 @@
    @Schema(description = "除数")
    @ExcelProperty("除数")
    private Integer divisor;
    @Schema(description = "采集质量")
    @ExcelProperty("采集质量")
    private String collectQuality;
}
iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/point/DaPointDao.xml
@@ -98,9 +98,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
@@ -136,6 +140,9 @@
            <if test="isEnable != null ">
                and t1.is_enable = #{isEnable}
            </if>
            <if test="collectQuality != null and collectQuality != ''">
                and t6.collect_quality = #{collectQuality}
            </if>
        </where>
        order by t1.create_time desc, t1.point_no desc
    </select>