| | |
| | | |
| | | @PreAuthorize("@ss.hasPermission('data:point:query')") |
| | | @GetMapping("pointNo") |
| | | public CommonResult<List<DaPointDTO>> getpoint(@RequestParam Map<String, Object> params){ |
| | | public CommonResult<List<DaPointDTO>> getPoint(@RequestParam Map<String, Object> params) { |
| | | List<DaPointDTO> list = daPointService.list(params); |
| | | |
| | | return new CommonResult<List<DaPointDTO>>().setData(list); |
| | |
| | | public void exportPointList(@Validated DaPointPageReqVO exportReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | | exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| | | List<DaPointEntity> list = daPointService.queryExcelList(exportReqVO).getList(); |
| | | List<DaPointExcelVO> daPointExcelVOlist = ConvertUtils.sourceToTarget(list,DaPointExcelVO.class); |
| | | ExcelUtils.write(response, "测点列表.xls", "数据", DaPointExcelVO.class, daPointExcelVOlist); |
| | | List<DaPointExcelVO> dataList = new ArrayList<>(); |
| | | 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)); |
| | | ExcelUtils.write(response, "测点列表.xls", "测点列表", DaPointExcelVO.class, dataList); |
| | | } |
| | | |
| | | @GetMapping("/exportValue") |
| | |
| | | |
| | | IPage<DaPointDTO> getPageList(IPage<DaPointEntity> page, @Param("params") DaPointPageReqVO reqVO); |
| | | |
| | | List<DaPointDTO> getList(DaPointPageReqVO reqVO); |
| | | |
| | | List<DaPointDTO> getConstantPoint(Map<String, Object> params); |
| | | |
| | | List<DaPointDTO> getMeasurePoint(Map<String, Object> params); |
| | |
| | | |
| | | default IPage<DaPointDTO> selectPageList(DaPointPageReqVO reqVO) { |
| | | return getPageList(getPage(reqVO), reqVO); |
| | | }; |
| | | |
| | | default PageResult<DaPointEntity> selectExcelList(DaPointPageReqVO reqVO) { |
| | | return selectPage(reqVO,new QueryWrapper<>()); |
| | | } |
| | | |
| | | default DaPointEntity selectByPointName(String pointName){ |
| | | return selectOne("point_name", pointName); |
| | | }; |
| | | } |
| | | } |
| | |
| | | |
| | | PointImportRespVO importPointList(List<PointImportExcelVO> importPoints, boolean isUpdateSupport); |
| | | |
| | | PageResult<DaPointEntity> queryExcelList(DaPointPageReqVO exportReqVO); |
| | | List<DaPointDTO> getList(DaPointPageReqVO exportReqVO); |
| | | |
| | | List<DaPointDTO> getConstantPoint(DaPointPageReqVO reqVO); |
| | | |
| | | List<DaPointDTO> getMeasurePoint(DaPointPageReqVO reqVO); |
| | | |
| | | List<DaPointDTO> getMathPoint(DaPointPageReqVO reqVO); |
| | | } |
| | |
| | | if (params.get("pointNos") != null) { |
| | | pointNos = JSONArray.parseArray(JSONArray.toJSONString(params.get("pointNos")), String.class); |
| | | } |
| | | List<String> pointTypes = new ArrayList<>(); |
| | | if (params.get("pointTypes") != null) { |
| | | pointTypes = Arrays.asList(params.get("pointTypes").toString().split(",")); |
| | | } |
| | | |
| | | Object pointNoLike = params.get("pointNoLike"); |
| | | QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq(!ObjectUtils.isEmpty(pointType), "point_type", pointType); |
| | | queryWrapper.in(pointNos.size() != 0,"point_no", pointNos); |
| | | queryWrapper.like(!ObjectUtils.isEmpty(pointNoLike), "point_no", pointNoLike); |
| | | queryWrapper.in(pointTypes.size() != 0,"point_type", pointTypes); |
| | | List<DaPointEntity> list = daPointDao.selectList(queryWrapper); |
| | | return ConvertUtils.sourceToTarget(list, DaPointDTO.class); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<DaPointDTO> getConstantPoint(DaPointPageReqVO reqVO) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("pointType", PointTypeEnum.CONSTANT.getCode()); |
| | | params.put("pointNo", reqVO.getPointNo()); |
| | | params.put("pointName", reqVO.getPointName()); |
| | | return daPointDao.getConstantPoint(params); |
| | | } |
| | | |
| | | @Override |
| | | public List<DaPointDTO> getConstantPoint(String freq) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("pointType", PointTypeEnum.CONSTANT.getCode()); |
| | |
| | | params.put("isEnable", CommonConstant.IS_ENABLE); |
| | | params.put("pointNos", pointNos); |
| | | return daPointDao.getConstantPoint(params); |
| | | } |
| | | |
| | | @Override |
| | | public List<DaPointDTO> getMeasurePoint(DaPointPageReqVO reqVO) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode()); |
| | | params.put("pointNo", reqVO.getPointNo()); |
| | | params.put("pointName", reqVO.getPointName()); |
| | | params.put("sourceName", reqVO.getSourceName()); |
| | | return daPointDao.getMeasurePoint(params); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return null; |
| | | } |
| | | return list.get(0); |
| | | } |
| | | |
| | | @Override |
| | | public List<DaPointDTO> getMathPoint(DaPointPageReqVO reqVO) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("pointType", PointTypeEnum.CALCULATE_POINT.getCode()); |
| | | params.put("pointNo", reqVO.getPointNo()); |
| | | params.put("pointName", reqVO.getPointName()); |
| | | return daPointDao.getMathPoint(params); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<DaPointEntity> queryExcelList(DaPointPageReqVO exportReqVO) { |
| | | |
| | | return daPointDao.selectExcelList(exportReqVO); |
| | | |
| | | public List<DaPointDTO> getList(DaPointPageReqVO exportReqVO) { |
| | | return daPointDao.getList(exportReqVO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @ExcelProperty("数据源类型") |
| | | private String sourceType; |
| | | |
| | | @Schema(description = "数据源ID") |
| | | @ExcelProperty("数据源ID") |
| | | private String sourceId; |
| | | @Schema(description = "数据源名称") |
| | | @ExcelProperty("数据源名称") |
| | | private String sourceName; |
| | | |
| | | @Schema(description = "测点Tag") |
| | | @ExcelProperty("测点Tag") |
| | | private String tagNo; |
| | | |
| | | @Schema(description = "计算公式") |
| | | @ExcelProperty("计算公式") |
| | | private String expression; |
| | | } |
| | |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="getList" resultType="com.iailab.module.data.point.dto.DaPointDTO"> |
| | | select |
| | | t1.id, |
| | | t1.point_no, |
| | | t1.point_name, |
| | | t1.point_type , |
| | | t1.data_type, |
| | | t1.unit, |
| | | t1.unittransfactor, |
| | | t1.default_value, |
| | | t1.max_value, |
| | | t1.min_value, |
| | | t1.minfreqid, |
| | | t1.remark, |
| | | t1.is_enable, |
| | | t1.creator, |
| | | t1.create_time, |
| | | t1.updater, |
| | | t1.update_time, |
| | | t2.source_type, |
| | | t3.source_name, |
| | | t2.tag_no, |
| | | t2.dimension, |
| | | t2.value_type |
| | | from t_da_point t1 |
| | | left join t_da_measure_point t2 on t2.point_id = t1.id |
| | | left join ( |
| | | select id source_id,server_name source_name |
| | | from t_channel_opcua_device |
| | | union |
| | | select id source_id, name source_name |
| | | from t_channel_modbus_device |
| | | union |
| | | select id source_id, code source_name |
| | | from t_http_api |
| | | union |
| | | select id source_id, instance_name source_name |
| | | from t_channel_kio_device |
| | | ) t3 on t3.source_id = t2.source_id |
| | | <where> |
| | | <if test="pointNo != null and pointNo != ''"> |
| | | and t1.point_no like concat('%', #{pointNo}, '%') |
| | | </if> |
| | | <if test="pointName != null and pointName != ''"> |
| | | and t1.point_name like concat('%', #{pointName}, '%') |
| | | </if> |
| | | <if test="pointType != null and pointType != ''"> |
| | | and t1.point_type = #{pointType} |
| | | </if> |
| | | <if test="dataType != null and dataType != ''"> |
| | | and t1.data_type = #{dataType} |
| | | </if> |
| | | <if test="sourceName != null and sourceName != ''"> |
| | | and t3.source_name like concat('%', #{sourceName}, '%') |
| | | </if> |
| | | <if test="tagNo != null and tagNo != ''"> |
| | | and t2.tag_no like concat('%', #{tagNo}, '%') |
| | | </if> |
| | | <if test="isEnable != null "> |
| | | and t1.is_enable = #{isEnable} |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="getConstantPoint" resultType="com.iailab.module.data.point.dto.DaPointDTO"> |
| | | SELECT |
| | | t1.point_no, |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getMathPoint" resultType="com.iailab.module.data.point.dto.DaPointDTO"> |
| | | SELECT |
| | | t1.point_no, |