You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.7 KiB

package com.ruoyi.web.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.RouteWaypoints;
import com.ruoyi.system.service.IRouteWaypointsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 航线具体航点明细Controller
*
* @author ruoyi
* @date 2026-01-21
*/
@RestController
@RequestMapping("/system/waypoints")
public class RouteWaypointsController extends BaseController
{
@Autowired
private IRouteWaypointsService routeWaypointsService;
/**
* 查询航线具体航点明细列表
*/
@PreAuthorize("@ss.hasPermi('system:routes:list')")
@GetMapping("/list")
public TableDataInfo list(RouteWaypoints routeWaypoints)
{
startPage();
List<RouteWaypoints> list = routeWaypointsService.selectRouteWaypointsList(routeWaypoints);
return getDataTable(list);
}
/**
* 导出航线具体航点明细列表
*/
@PreAuthorize("@ss.hasPermi('system:routes:export')")
@Log(title = "航线具体航点明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RouteWaypoints routeWaypoints)
{
List<RouteWaypoints> list = routeWaypointsService.selectRouteWaypointsList(routeWaypoints);
ExcelUtil<RouteWaypoints> util = new ExcelUtil<RouteWaypoints>(RouteWaypoints.class);
util.exportExcel(response, list, "航线具体航点明细数据");
}
/**
* 获取航线具体航点明细详细信息
*/
@PreAuthorize("@ss.hasPermi('system:routes:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(routeWaypointsService.selectRouteWaypointsById(id));
}
/**
* 新增航线具体航点明细
*/
@PreAuthorize("@ss.hasPermi('system:routes:add')")
@Log(title = "航线具体航点明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RouteWaypoints routeWaypoints)
{
return toAjax(routeWaypointsService.insertRouteWaypoints(routeWaypoints));
}
/**
* 修改航线具体航点明细复用航线编辑权限航点属于航线的一部分
*/
@PreAuthorize("@ss.hasPermi('system:routes:edit')")
@Log(title = "航线具体航点明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RouteWaypoints routeWaypoints)
{
return toAjax(routeWaypointsService.updateRouteWaypoints(routeWaypoints));
}
/**
* 删除航线具体航点明细
*/
@PreAuthorize("@ss.hasPermi('system:routes:remove')")
@Log(title = "航线具体航点明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(routeWaypointsService.deleteRouteWaypointsByIds(ids));
}
}