济菏高速数据中心代码
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.
 
 
 
 
 

129 lines
4.3 KiB

package com.zc.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zc.business.domain.DcDispatch;
import com.zc.business.service.IDcDispatchService;
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.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.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 调度信息记录Controller
*
* @author ruoyi
* @date 2024-01-15
*/
@RestController
@RequestMapping("/dc/system/dispatch")
@Api(tags = "调度信息记录")
public class DcDispatchController extends BaseController
{
@Autowired
private IDcDispatchService dcDispatchService;
/**
* 查询调度信息记录列表
*/
@ApiOperation("查询调度信息记录列表")
//@PreAuthorize("@ss.hasPermi('system:dispatch:list')")
@GetMapping("/list")
public TableDataInfo list(DcDispatch dcDispatch)
{
startPage();
List<DcDispatch> list = dcDispatchService.selectDcDispatchList(dcDispatch);
return getDataTable(list);
}
/**
* 导出调度信息记录列表
*/
// @ApiOperation("查询调度信息记录列表")
// @PreAuthorize("@ss.hasPermi('system:dispatch:export')")
@Log(title = "调度信息记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcDispatch dcDispatch)
{
List<DcDispatch> list = dcDispatchService.selectDcDispatchList(dcDispatch);
ExcelUtil<DcDispatch> util = new ExcelUtil<>(DcDispatch.class);
util.exportExcel(response, list, "调度信息记录数据");
}
/**
* 获取调度信息记录详细信息
*/
@ApiOperation("获取调度信息记录详细信息( 暂时不用)")
// @PreAuthorize("@ss.hasPermi('system:dispatch:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(dcDispatchService.selectDcDispatchById(id));
}
/**
* 根据事件id获取调度信息记录详细信息
*/
@ApiOperation("根据事件id获取调度信息记录详细信息")
// @PreAuthorize("@ss.hasPermi('system:dispatch:query')")
@GetMapping(value = "/EventId/{id}")
public TableDataInfo getEventId(@PathVariable("id") String id)
{
return getDataTable(dcDispatchService.selectDcDispatchByEventId(id));
}
/**
* 新增调度信息记录
*/
@ApiOperation("新增调度信息记录")
//@PreAuthorize("@ss.hasPermi('system:dispatch:add')")
@Log(title = "调度信息记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcDispatch dcDispatch)
{
return toAjax(dcDispatchService.insertDcDispatch(dcDispatch));
}
/**
* 修改调度信息记录
*/
@ApiOperation("修改调度信息记录")
// @PreAuthorize("@ss.hasPermi('system:dispatch:edit')")
@Log(title = "调度信息记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcDispatch dcDispatch)
{
return toAjax(dcDispatchService.updateDcDispatch(dcDispatch));
}
/**
* 删除调度信息记录
*/
@ApiOperation("删除调度信息记录")
//@PreAuthorize("@ss.hasPermi('system:dispatch:remove')")
@Log(title = "调度信息记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcDispatchService.deleteDcDispatchByIds(ids));
}
}