xieb
2023-06-19 af4bdbc3902742d1399d85881e425c31ac883ed8
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
package cn.gistack.sm.sjztmd.controller;
 
import cn.gistack.sm.sjztmd.entity.AttAdBase;
import cn.gistack.sm.sjztmd.entity.AttStBase;
import cn.gistack.sm.sjztmd.service.IAttStBaseService;
import cn.gistack.sm.sjztmd.vo.AttAdBaseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
@Slf4j
@Api(tags = "中台监测站点信息")
@RestController
@RequestMapping("/sjztmd/attStBase")
@AllArgsConstructor
public class AttStBaseController extends BladeController {
    private IAttStBaseService attStBaseService;
 
    @ApiOperation(value = "中台监测站点信息-添加", notes = "中台监测站点信息-添加")
    @PostMapping(value = "/save")
    public R add(AttStBase attStBase) {
        return R.data(attStBaseService.save(attStBase));
    }
 
    @ApiOperation(value = "中台监测站点信息-修改", notes = "中台监测站点信息-修改")
    @PostMapping(value = "/edit")
    public R edit(AttStBase attStBase) {
        return R.data(attStBaseService.updateById(attStBase));
    }
 
    @ApiOperation(value = "中台监测站点信息-添加修改", notes = "中台监测站点信息-添加修改")
    @PostMapping(value = "/submit")
    public R submit(AttStBase attStBase) {
        return R.data(attStBaseService.saveOrUpdate(attStBase));
    }
 
    @ApiOperation(value = "中台监测站点信息-删除", notes = "中台监测站点信息-删除")
    @GetMapping(value = "/remove")
    public R edit(String guid) {
        return R.data(attStBaseService.removeById(guid));
    }
 
    @ApiOperation(value = "中台监测站点信息-获取测站信息", notes = "中台监测站点信息-获取测站信息")
    @GetMapping(value = "/getStation")
    public R getStation(AttStBase attStBase){
        List<AttStBase> list = attStBaseService.list(Condition.getQueryWrapper(attStBase));
        return R.data(list);
    }
 
    @ApiOperation(value = "范围查询监测站点", notes = "范围查询监测站点")
    @GetMapping(value = "/selectAttStBaseRadius")
    public R selectAttStBaseRadius(AttStBase attStBase){
        if (StringUtil.isBlank(attStBase.getStationLongitude())) {
            return R.fail("stationLongitude参数不能为空");
        } else if (StringUtil.isBlank(attStBase.getStationLatitude())) {
            return R.fail("stationLatitude参数不能为空");
        } else if (StringUtil.isBlank(attStBase.getRadius()) ) {
            return R.fail("radius参数不能为空");
        }
        List<AttStBase> list = attStBaseService.selectAttStBaseRadius(attStBase);
        return R.data(list);
    }
 
 
 
}