cjl
2024-08-09 a022ae9804d0c2f402711b6b5202319d853919cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.moral.api.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import com.moral.api.pojo.dto.dataDisplay.HeatMapDTO;
import com.moral.api.service.DataDisplayService;
import com.moral.api.utils.HeatMapTimeUtils;
import com.moral.api.vo.HeatMapVo;
import com.moral.constant.ResultMessage;
 
/**
 * Description //todo
 *
 * @author swb
 * @ClassName HeatMapController
 * @date 2023.12.11 15:20
 */
@Slf4j
@Api(tags = {"区域热力图"})
@RestController
@RequestMapping("/heatMap")
public class HeatMapController {
 
 
    @Autowired
    private DataDisplayService dataDisplayService;
 
 
     @GetMapping("query")
     @ApiOperation("热力图显示")
     public ResultMessage  getHeatMap(@RequestParam @ApiParam(value = "organizationId",name = "组织id") Integer id,
                                      @RequestParam @ApiParam(value = "startTime",name = "开始时间") String startTime,
                                      @RequestParam @ApiParam(value = "type",name= "因子类型") String type,
                                      @RequestParam @ApiParam(value = "form",name= "时间类型") String form,
                                      @RequestParam @ApiParam(value = "monitorId",name= "站点id") Integer monitorId){
         List<HeatMapDTO> heatMapData = dataDisplayService.getHeatMapDataV2(id, startTime, type, form,monitorId);
         return ResultMessage.ok(ObjectUtils.isEmpty(heatMapData)?"0":heatMapData);
     }
    @GetMapping("queryTime")
    @ApiOperation("查询时间")
    public ResultMessage  getHeatMap(@RequestParam @ApiParam(value = "startTime",name = "开始时间") String startTime,
                                     @RequestParam @ApiParam(value = "endTime",name= "结束类型") String endTime,
                                     @RequestParam @ApiParam(value = "type",name= "时间类型") String type){
        List<HeatMapVo> heatMapVos = HeatMapTimeUtils.getTime(startTime, endTime, type);
        return ResultMessage.ok(ObjectUtils.isEmpty(heatMapVos)?"0":heatMapVos);
    }
 
}