河流站点基本信息管理接口
This commit is contained in:
@ -0,0 +1,122 @@
|
||||
package com.fastbee.data.controller.gis;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.ggroup.domain.GRiverInfo;
|
||||
import com.fastbee.ggroup.service.IGRiverInfoService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 河流基础信息Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/gis/river/info")
|
||||
@Api(tags = "河流基础信息")
|
||||
public class GRiverInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGRiverInfoService gRiverInfoService;
|
||||
|
||||
/**
|
||||
* 查询河流基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询河流基础信息列表")
|
||||
public TableDataInfo list(GRiverInfo gRiverInfo)
|
||||
{
|
||||
startPage();
|
||||
List<GRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gRiverInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 根据站点id获取河流基本信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:list')")
|
||||
@GetMapping("/byStationId/{stationId}")
|
||||
@ApiOperation("根据站点id获取河流基本信息")
|
||||
public AjaxResult listByStationId(@PathVariable("stationId") Long stationId){
|
||||
GRiverInfo gRiverInfo = new GRiverInfo();
|
||||
gRiverInfo.setSiteId(stationId);
|
||||
List<GRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gRiverInfo);
|
||||
return success(!list.isEmpty()?list.get(0):null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出河流基础信息列表
|
||||
*/
|
||||
@ApiOperation("导出河流基础信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GRiverInfo gRiverInfo)
|
||||
{
|
||||
List<GRiverInfo> list = gRiverInfoService.selectGRiverInfoList(gRiverInfo);
|
||||
ExcelUtil<GRiverInfo> util = new ExcelUtil<GRiverInfo>(GRiverInfo.class);
|
||||
util.exportExcel(response, list, "河流基础信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 河流基础信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取河流基础信息详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gRiverInfoService.selectGRiverInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增河流基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增河流基础信息")
|
||||
public AjaxResult add(@RequestBody GRiverInfo gRiverInfo)
|
||||
{
|
||||
return toAjax(gRiverInfoService.insertGRiverInfo(gRiverInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改河流基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改河流基础信息")
|
||||
public AjaxResult edit(@RequestBody GRiverInfo gRiverInfo)
|
||||
{
|
||||
return toAjax(gRiverInfoService.updateGRiverInfo(gRiverInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除河流基础信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:info:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除河流基础信息")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gRiverInfoService.deleteGRiverInfoByIds(ids));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user