package com.ruoyi.system.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.WaylineJob;
|
import com.ruoyi.system.service.IWaylineJobService;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
/**
|
* 航线Controller
|
*
|
* @author ruoyi
|
* @date 2024-07-31
|
*/
|
@RestController
|
@RequestMapping("/system/job")
|
public class WaylineJobController extends BaseController
|
{
|
@Autowired
|
private IWaylineJobService waylineJobService;
|
|
/**
|
* 查询航线列表
|
*/
|
@PreAuthorize("@ss.hasPermi('system:job:list')")
|
@GetMapping("/list")
|
public TableDataInfo list(WaylineJob waylineJob)
|
{
|
// startPage();
|
List<WaylineJob> list = waylineJobService.selectWaylineJobList(waylineJob);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出航线列表
|
*/
|
@PreAuthorize("@ss.hasPermi('system:job:export')")
|
@Log(title = "航线", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, WaylineJob waylineJob)
|
{
|
List<WaylineJob> list = waylineJobService.selectWaylineJobList(waylineJob);
|
ExcelUtil<WaylineJob> util = new ExcelUtil<WaylineJob>(WaylineJob.class);
|
util.exportExcel(response, list, "航线数据");
|
}
|
|
/**
|
* 获取航线详细信息
|
*/
|
@PreAuthorize("@ss.hasPermi('system:job:query')")
|
@GetMapping(value = "/{id}")
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
{
|
return success(waylineJobService.selectWaylineJobById(id));
|
}
|
|
/**
|
* 新增航线
|
*/
|
@PreAuthorize("@ss.hasPermi('system:job:add')")
|
@Log(title = "航线", businessType = BusinessType.INSERT)
|
@PostMapping
|
public AjaxResult add(@RequestBody WaylineJob waylineJob)
|
{
|
return toAjax(waylineJobService.insertWaylineJob(waylineJob));
|
}
|
|
/**
|
* 修改航线
|
*/
|
@PreAuthorize("@ss.hasPermi('system:job:edit')")
|
@Log(title = "航线", businessType = BusinessType.UPDATE)
|
@PutMapping
|
public AjaxResult edit(@RequestBody WaylineJob waylineJob)
|
{
|
return toAjax(waylineJobService.updateWaylineJob(waylineJob));
|
}
|
|
/**
|
* 删除航线
|
*/
|
@PreAuthorize("@ss.hasPermi('system:job:remove')")
|
@Log(title = "航线", businessType = BusinessType.DELETE)
|
@DeleteMapping("/{ids}")
|
public AjaxResult remove(@PathVariable Long[] ids)
|
{
|
return toAjax(waylineJobService.deleteWaylineJobByIds(ids));
|
}
|
}
|