燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2023-07-18 557fbb344991bf5dd7246bbefd90400ded843357
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
package com.yssh.controller;
 
import com.yssh.entity.*;
import com.yssh.service.CommonService;
import com.yssh.service.VocValsService;
import com.yssh.utils.DateUtils;
import com.yssh.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
 
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
 
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yssh.service.SuYuanService;
import com.yssh.utils.Result;
 
import javax.annotation.Resource;
 
/**
 * @author lishijia
 * @ClassName Yssh2dreliController
 * @Description Yssh2dreliController
 * @date 2022/12/3 21:21
 * @Version 1.0
 */
@Api(tags="溯源信息")
@RestController
@RequestMapping("/suYuan")
@SuppressWarnings("rawtypes")
public class SuYuanController {
    @Resource
    private CommonService commonService;
 
    @Resource
    private SuYuanService suYuanService;
 
    @Resource
    private VocValsService vocValsService;
 
    private final static SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHH");
 
    @ApiOperation(value = "查询2d热力图数据", notes = "根据时间查询2d热力图数据")
    @ApiOperationSupport(order = 1)
    @GetMapping("/get2d")
    public Result get2d(
            @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        List<SuYuan2d> list = suYuanService.selectSuYuan2d(date);
        return Result.OK(list);
    }
 
    @ApiOperation(value = "查询3d热力图数据", notes = "根据时间查询3d热力图数据")
    @ApiOperationSupport(order = 2)
    @GetMapping("/get3d")
    public Result get3d(
            @RequestParam(value = "name", required = true) String name,
            @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        List<SuYuan3d> list = suYuanService.selectSuYuan3d(name, date);
        return Result.OK(list);
    }
 
    @ApiOperation(value = "查询溯源100热力图数据", notes = "根据时间查询溯源100热力图数据,result返回值中data对应值为热力图数据,feedbackId为反馈主键编号,在进行反馈中需要传递")
    @ApiOperationSupport(order = 3)
    @GetMapping("/get100")
    public Result get100(
            @RequestParam(value = "name", required = true) String name,
            @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date
    ) {
        return Result.OK(suYuanService.selectSuYuan100(name, date));
    }
 
    @ApiOperation(value = "查询溯源200热力图数据", notes = "根据时间查询溯源200热力图数据,result返回值中data对应值为热力图数据,feedbackId为反馈主键编号,在进行反馈中需要传递")
    @ApiOperationSupport(order = 4)
    @GetMapping("/get200")
    public Result get200(
            @RequestParam(value = "name", required = true) String name,
            @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date
    ) {
        return Result.OK(suYuanService.selectSuYuan200(name, date));
    }
 
    @ApiOperation(value = "查询溯源300热力图数据", notes = "根据时间查询溯源300热力图数据,result返回值中data对应值为热力图数据,feedbackId为反馈主键编号,在进行反馈中需要传递")
    @ApiOperationSupport(order = 5)
    @GetMapping("/get300")
    public Result get300(
            @RequestParam(value = "name", required = true) String name,
            @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date
    ) {
        return Result.OK(suYuanService.selectSuYuan300(name, date));
    }
 
    @ApiOperation(value = "查询溯源500热力图数据", notes = "根据时间查询溯源500热力图数据,result返回值中data对应值为热力图数据,feedbackId为反馈主键编号,在进行反馈中需要传递")
    @ApiOperationSupport(order = 6)
    @GetMapping("/get500")
    public Result get500(
            @RequestParam(value = "name", required = true) String name,
            @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date
    ) {
        return Result.OK(suYuanService.selectSuYuan500(name, date));
    }
 
    @ApiOperation(value = "获取所有监测数据", notes = "获取所有监测数据")
    @ApiOperationSupport(order = 7)
    @GetMapping("/query/{name}")
    public Result getMonitorData(@PathVariable("name") String name) {
        List<SuYuanMonitorData> list = suYuanService.getMonitorData(name);
        return Result.OK(list);
    }
 
    @ApiOperation(value = "更新Vocs名称", notes = "更新Vocs名称")
    @ApiOperationSupport(order = 8)
    @GetMapping("/updateVocsName")
    public Result updateVocsName(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date,
                                 @RequestParam(value = "id", required = true) String id,
                                 @RequestParam(value = "vocsName", required = true) String vocsName
    ) {
        return Result.OK(suYuanService.updateVocsName(date, id, vocsName));
    }
 
    @ApiOperation(value = "根据名称获取坐标值", notes = "根据名称获取坐标值")
    @ApiOperationSupport(order = 9)
    @GetMapping("/getCoordByName/{name}")
    public Result getCoordByName(@PathVariable("name") String name) {
        MonitorPointPosition point = StringUtils.isEmpty(name) ? null : commonService.select3dCheckPointByName(name);
 
        return Result.OK(point);
    }
 
    @ApiOperation(value = "根据Qxsh值", notes = "根据Qxsh值")
    @ApiOperationSupport(order = 10)
    @GetMapping("/queryQxsh")
    public Result queryQxsh(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        List<Qxsh> list = suYuanService.queryQxsh(date);
 
        return Result.OK(list);
    }
 
    @ApiOperation(value = "根据时间查询Voc值", notes = "根据时间查询Voc值")
    @ApiOperationSupport(order = 11)
    @GetMapping("/selectVocByTime")
    public Result selectVocByTime(@RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        String time = DateUtils.getYyyyMmDdHhMmSs(date);
        List<VocVals> list = vocValsService.selectByTime(time);
 
        return Result.OK(list);
    }
 
    @ApiOperation(value = "根据ID和日期查询溯源46表", notes = "根据ID和日期查询溯源46表")
    @ApiOperationSupport(order = 12)
    @GetMapping("/selectSuYuan46ById")
    public Result selectSuYuan46ById(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        return Result.OK(suYuanService.selectSuYuan46ById(id, date));
    }
 
    @ApiOperation(value = "根据ID和日期查询溯源700表", notes = "根据ID和日期查询溯源700表")
    @ApiOperationSupport(order = 13)
    @GetMapping("/selectSuYuan700ById")
    public Result selectSuYuan700ById(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "date", required = true) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
        return Result.OK(suYuanService.selectSuYuan700ById(id, date));
    }
 
    @ApiOperation(value = "根据X,Y值查询地址", notes = "根据X,Y值查询地址")
    @ApiOperationSupport(order = 14)
    @GetMapping("/selectCoords")
    public Result selectCoords(@RequestParam(value = "x") Integer x, @RequestParam(value = "y") Integer y,  @RequestParam(value = "isSuYuan") Integer isSuYuan) {
        if (isSuYuan < 1) {
            x = x / 10;
            y = y / 10;
        }
 
        return Result.OK(vocValsService.selectCoords(x, y));
    }
 
    @ApiOperation(value = "根据经纬度查询地名", notes = "根据经纬度查询地名")
    @ApiOperationSupport(order = 15)
    @GetMapping("/selectAddrByXY")
    public Result selectAddrByXY(@RequestParam(value = "x", required = true) double x, @RequestParam(value = "y", required = true) double y) {
        return Result.OK(suYuanService.selectAddrByXY(x, y));
    }
 
    @ApiOperation(value = "根据X、Y值查询矩形框", notes = "根据X、Y值查询矩形框")
    @ApiOperationSupport(order = 16)
    @GetMapping("/selectRects")
    public Result selectRects(@RequestParam(value = "x[]", required = true) Double[] x, @RequestParam(value = "y[]", required = true) Double[] y) {
        if (null == x || null == y || x.length == 0 || x.length != y.length) return Result.OK(null);
 
        return Result.OK(suYuanService.selectRects(x, y));
    }
}