|
|
|
@ -3,10 +3,11 @@ package com.shxy.xymanager_admin.controller;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.shxy.xymanager_common.annotation.Log;
|
|
|
|
|
import com.shxy.xymanager_common.base.BaseController;
|
|
|
|
|
import com.shxy.xymanager_common.base.ResponseReult;
|
|
|
|
|
import com.shxy.xymanager_common.entity.*;
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.util.*;
|
|
|
|
|
import com.shxy.xymanager_common.zhiping.*;
|
|
|
|
|
import com.shxy.xymanager_common.entity.LeadPulls;
|
|
|
|
|
import com.shxy.xymanager_common.entity.Weathers;
|
|
|
|
|
import com.shxy.xymanager_service.service.HenanService;
|
|
|
|
|
import com.shxy.xymanager_service.service.LeadPullsService;
|
|
|
|
|
import com.shxy.xymanager_service.service.WeatherService;
|
|
|
|
@ -15,9 +16,11 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -39,6 +42,54 @@ public class ZhipingController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
HenanService henanService;
|
|
|
|
|
|
|
|
|
|
@PostMapping("addWeather")
|
|
|
|
|
@ApiOperation("新增天气装置")
|
|
|
|
|
public ResponseReult<String> addWeather(@RequestBody TerminalWeather item) throws Exception {
|
|
|
|
|
henanService.addWeather(item);
|
|
|
|
|
return ResponseReult.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("addPoint")
|
|
|
|
|
@ApiOperation("新增拉力装置")
|
|
|
|
|
public ResponseReult<String> addPoint(@RequestBody TerminalPoint item) throws Exception {
|
|
|
|
|
henanService.addPoint(item);
|
|
|
|
|
return ResponseReult.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("delWeather")
|
|
|
|
|
@ApiOperation("删除天气装置")
|
|
|
|
|
public ResponseReult<String> delWeather(@Validated @NotNull(message = "id不能为空!") Integer id) throws Exception {
|
|
|
|
|
if (id == null) {
|
|
|
|
|
throw new ApiException("id不能为空!");
|
|
|
|
|
}
|
|
|
|
|
henanService.delWeather(id);
|
|
|
|
|
return ResponseReult.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("delPoint")
|
|
|
|
|
@ApiOperation("删除拉力装置")
|
|
|
|
|
public ResponseReult<String> delPoint(@Validated @NotNull(message = "id不能为空!") Integer id) throws Exception {
|
|
|
|
|
if (id == null) {
|
|
|
|
|
throw new ApiException("id不能为空!");
|
|
|
|
|
}
|
|
|
|
|
henanService.delPoint(id);
|
|
|
|
|
return ResponseReult.success("OK");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("getWeatherList")
|
|
|
|
|
@ApiOperation("查询天气装置列表")
|
|
|
|
|
public ResponseReult<List<TerminalWeather>> getWeatherList() {
|
|
|
|
|
List<TerminalWeather> result = henanService.getWeatherList();
|
|
|
|
|
return ResponseReult.success(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("getPointList")
|
|
|
|
|
@ApiOperation("查询拉力装置点表")
|
|
|
|
|
public ResponseReult<List<TerminalPoint>> getPointList() {
|
|
|
|
|
List<TerminalPoint> result = henanService.getPointList();
|
|
|
|
|
return ResponseReult.success(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("query")
|
|
|
|
|
@ApiOperation("查询")
|
|
|
|
|
@Log(title = "微气象监测数据同步查询", type = "查询")
|
|
|
|
|