123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- package com.jiayue.ipfcst.console.controller;
- import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
- import com.jiayue.ipfcst.console.service.WindTowerStatusDataService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.Date;
- import java.util.Map;
- /**
- * 测风塔数据restful接口
- *
- * @author yh
- * @version 1.0
- * @since 2019/8/7 10:12
- */
- @RestController
- @Slf4j
- public class WindTowerStatusDataController {
- private final WindTowerStatusDataService windTowerStatusDataService;
- @Autowired
- public WindTowerStatusDataController(WindTowerStatusDataService windTowerStatusDataService) {
- this.windTowerStatusDataService = windTowerStatusDataService;
- }
- // /**
- // * 分页查询 测风塔数据
- // * @param startTime 开始时间
- // * @param endTime 结束时间
- // * @param page 页码
- // * @param size 条数
- // * @param sortOrder 排序
- // * @return
- // */
- // @GetMapping(value = "/windTowerStatusData/{startTime}/{endTime}/{page}/{size}/{no}")
- // public ResponseVO findByTimeBetweenForPaging(@PathVariable("startTime") Long startTime,
- // @PathVariable("endTime") Long endTime,
- // @PathVariable("page") Integer page,
- // @PathVariable("size") Integer size,
- // @PathVariable("no") Integer no,
- // String sortOrder){
- // Map<String,Object> map = new HashMap<>();
- // try{
- // map = windTowerStatusDataService.findByTimeBetweenForPaging(new Date(startTime),new Date(endTime),page,size,no,sortOrder);
- // return ResponseVO.success(map);
- // }catch(Exception e){
- // e.printStackTrace();
- // log.error("测风塔数据分页查询错误");
- // return ResponseVO.fail(e.toString());
- // }
- // }
- @GetMapping(value = "/windTowerStatusData/{stationCode}/{startTime}/{endTime}/{page}/{size}/{no}")
- public ResponseVO findByTimeBetweenAndNoAndTimeStep(@PathVariable("stationCode") String stationCode, @PathVariable("startTime") Long startTime,
- @PathVariable("endTime") Long endTime,
- @PathVariable("page") Integer page,
- @PathVariable("size") Integer size,
- @PathVariable("no") String no) {
- Map<String, Object> map;
- try {
- map = windTowerStatusDataService.findByTimeBetweenAndNoAndTimeStep(stationCode, new Date(startTime), new Date(endTime), page, size, no);
- return ResponseVO.success(map);
- } catch (Exception e) {
- e.printStackTrace();
- log.error("测风数据分页查询错误");
- return ResponseVO.fail(e.toString());
- }
- }
- }
|