|
@@ -1,6 +1,9 @@
|
|
package org.springblade.business.controller;
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -29,6 +32,7 @@ import java.util.Map;
|
|
@RestController
|
|
@RestController
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
@RequestMapping(value = "weather")
|
|
@RequestMapping(value = "weather")
|
|
|
|
+@Api(value = "", tags = "天气台账接口")
|
|
public class WeatherController {
|
|
public class WeatherController {
|
|
|
|
|
|
private WeatherInfoService weatherInfoService;
|
|
private WeatherInfoService weatherInfoService;
|
|
@@ -39,7 +43,8 @@ public class WeatherController {
|
|
* @return 删除结果
|
|
* @return 删除结果
|
|
*/
|
|
*/
|
|
@PostMapping(value = "removeWeatherByIds")
|
|
@PostMapping(value = "removeWeatherByIds")
|
|
- public R<Boolean> removeWeatherByIds(@RequestParam String ids){
|
|
|
|
|
|
+ @ApiOperation(value = "删除(批量或单个)", notes = "传入ids")
|
|
|
|
+ public R<Boolean> removeWeatherByIds(@ApiParam(value = "主键集合", required = true) @RequestParam String ids){
|
|
return R.status(this.weatherInfoService.removeBatchByIds(Func.toLongList(ids)));
|
|
return R.status(this.weatherInfoService.removeBatchByIds(Func.toLongList(ids)));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -49,6 +54,7 @@ public class WeatherController {
|
|
* @return 修改结果
|
|
* @return 修改结果
|
|
*/
|
|
*/
|
|
@PostMapping(value = "updateWeatherById")
|
|
@PostMapping(value = "updateWeatherById")
|
|
|
|
+ @ApiOperation(value = "修改", notes = "传入WeatherInfo")
|
|
public R<Boolean> updateWeatherById(@RequestBody WeatherInfo weatherInfo){
|
|
public R<Boolean> updateWeatherById(@RequestBody WeatherInfo weatherInfo){
|
|
//记录修改时间及修改人
|
|
//记录修改时间及修改人
|
|
setUserData(weatherInfo, true);
|
|
setUserData(weatherInfo, true);
|
|
@@ -72,7 +78,8 @@ public class WeatherController {
|
|
* @param query 分页条件
|
|
* @param query 分页条件
|
|
* @return 查询结果
|
|
* @return 查询结果
|
|
*/
|
|
*/
|
|
- @RequestMapping(value = "queryWeatherPage")
|
|
|
|
|
|
+ @GetMapping(value = "queryWeatherPage")
|
|
|
|
+ @ApiOperation(value = "天气台账列表分页", notes = "传入WeatherInfo")
|
|
public R<IPage<WeatherInfo>> queryWeatherPage(WeatherInfoVo vo,Query query){
|
|
public R<IPage<WeatherInfo>> queryWeatherPage(WeatherInfoVo vo,Query query){
|
|
Map<String,Object> weatherMap = new HashMap<>();
|
|
Map<String,Object> weatherMap = new HashMap<>();
|
|
if(StringUtils.isNotEmpty(vo.getRecordTime())){
|
|
if(StringUtils.isNotEmpty(vo.getRecordTime())){
|
|
@@ -103,7 +110,8 @@ public class WeatherController {
|
|
* @param id 数据Id
|
|
* @param id 数据Id
|
|
* @return 数据
|
|
* @return 数据
|
|
*/
|
|
*/
|
|
- @RequestMapping(value = "queryWeatherById")
|
|
|
|
|
|
+ @PostMapping(value = "queryWeatherById")
|
|
|
|
+ @ApiOperation(value = "详情", notes = "传入WeatherInfo")
|
|
public R<WeatherInfo> queryWeatherById(@RequestParam String id){
|
|
public R<WeatherInfo> queryWeatherById(@RequestParam String id){
|
|
try{
|
|
try{
|
|
return R.data(this.weatherInfoService.getById(id));
|
|
return R.data(this.weatherInfoService.getById(id));
|
|
@@ -119,6 +127,7 @@ public class WeatherController {
|
|
* @return 新增结果
|
|
* @return 新增结果
|
|
*/
|
|
*/
|
|
@PostMapping(value = "saveWeatherInfo")
|
|
@PostMapping(value = "saveWeatherInfo")
|
|
|
|
+ @ApiOperation(value = "新增", notes = "传入WeatherInfo")
|
|
public R<Boolean> saveWeatherInfo(@RequestBody WeatherInfoVo weatherInfoVo){
|
|
public R<Boolean> saveWeatherInfo(@RequestBody WeatherInfoVo weatherInfoVo){
|
|
try{
|
|
try{
|
|
//todo 目前缺少合同段所在区域的地图编号及ID,所以暂时写死区域数据ID,之后修改为接口获取
|
|
//todo 目前缺少合同段所在区域的地图编号及ID,所以暂时写死区域数据ID,之后修改为接口获取
|