package com.ard.web.controller.work.wayline;
|
|
import com.ard.work.domain.dto.wayline.ArdWaylineDTO;
|
import com.ard.work.domain.entity.UavWayline;
|
import com.ard.work.service.IUavWaylineService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import java.util.List;
|
import javax.annotation.Resource;
|
import javax.servlet.http.HttpServletResponse;
|
import com.ard.common.annotation.Log;
|
import com.ard.common.core.controller.BaseController;
|
import com.ard.common.core.domain.AjaxResult;
|
import com.ard.common.enums.BusinessType;
|
import com.ard.common.utils.poi.ExcelUtil;
|
import com.ard.common.core.page.TableDataInfo;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* 航线Controller
|
*
|
* @author ruoyi
|
* @date 2025-06-27
|
*/
|
@Api(tags = "无人机航线管理接口")
|
@RestController
|
@RequestMapping("/uav/manage/wayline")
|
public class UavWaylineController extends BaseController
|
{
|
@Resource
|
private IUavWaylineService uavWaylineService;
|
|
/**
|
* 查询航线列表
|
*/
|
@ApiOperation("查询航线列表")
|
@PreAuthorize("@ss.hasPermi('uav:wayline:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(UavWayline uavWayline)
|
{
|
startPage();
|
List<UavWayline> list = uavWaylineService.selectUavWaylineList(uavWayline);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出航线列表
|
*/
|
@PreAuthorize("@ss.hasPermi('uav:wayline:export')")
|
@Log(title = "航线", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, UavWayline uavWayline)
|
{
|
List<UavWayline> list = uavWaylineService.selectUavWaylineList(uavWayline);
|
ExcelUtil<UavWayline> util = new ExcelUtil<UavWayline>(UavWayline.class);
|
util.exportExcel(response, list, "航线数据");
|
}
|
|
/**
|
* 获取航线详细信息
|
*/
|
@ApiOperation("获取航线详细信息")
|
@PreAuthorize("@ss.hasPermi('uav:wayline:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
{
|
return success(uavWaylineService.selectUavWaylineById(id));
|
}
|
|
/**
|
* 新增航线
|
*/
|
@ApiOperation("新增航线")
|
@PreAuthorize("@ss.hasPermi('uav:wayline:add')")
|
@Log(title = "航线", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody ArdWaylineDTO ardWaylineDTO)
|
{
|
if (!uavWaylineService.checkWaylineNameUnique(ardWaylineDTO))
|
{
|
return error("新增航线'" + ardWaylineDTO.getWaylineName() + "'失败,航线已存在");
|
}
|
return toAjax(uavWaylineService.insertUavWayline(ardWaylineDTO));
|
}
|
|
/**
|
* 修改航线
|
*/
|
@ApiOperation("修改航线")
|
@PreAuthorize("@ss.hasPermi('uav:wayline:edit')")
|
@Log(title = "航线", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody ArdWaylineDTO ardWaylineDTO)
|
{
|
if (!uavWaylineService.checkWaylineNameUnique(ardWaylineDTO))
|
{
|
return error("修改航线'" + ardWaylineDTO.getWaylineName() + "'失败,航线已存在");
|
}
|
return toAjax(uavWaylineService.updateUavWayline(ardWaylineDTO));
|
}
|
|
/**
|
* 删除航线
|
*/
|
@ApiOperation("删除航线")
|
@PreAuthorize("@ss.hasPermi('uav:wayline:remove')")
|
@Log(title = "航线", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable String[] ids)
|
{
|
return toAjax(uavWaylineService.deleteUavWaylineByIds(ids));
|
}
|
}
|