济菏高速数据中心代码

115 lines
3.6 KiB

package com.zc.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zc.business.domain.DcEventServiceArea;
import com.zc.business.service.IDcEventServiceAreaService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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-12
*/
@RestController
@RequestMapping("/system/area")
public class DcEventServiceAreaController extends BaseController
{
@Autowired
private IDcEventServiceAreaService dcEventServiceAreaService;
/**
* 查询服务区异常事件
"异常分类"为事件事件子类列表
*/
@PreAuthorize("@ss.hasPermi('system:area:list')")
@GetMapping("/list")
public TableDataInfo list(DcEventServiceArea dcEventServiceArea)
{
startPage();
List<DcEventServiceArea> list = dcEventServiceAreaService.selectDcEventServiceAreaList(dcEventServiceArea);
return getDataTable(list);
}
/**
* 导出服务区异常事件
"异常分类"为事件事件子类列表
*/
@PreAuthorize("@ss.hasPermi('system:area:export')")
@Log(title = "服务区异常事异常分类", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcEventServiceArea dcEventServiceArea)
{
List<DcEventServiceArea> list = dcEventServiceAreaService.selectDcEventServiceAreaList(dcEventServiceArea);
ExcelUtil<DcEventServiceArea> util = new ExcelUtil<>(DcEventServiceArea.class);
util.exportExcel(response, list, "服务区异常事件");
}
/**
* 获取服务区异常事件
"异常分类"为事件事件子类详细信息
*/
@PreAuthorize("@ss.hasPermi('system:area:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return AjaxResult.success(dcEventServiceAreaService.selectDcEventServiceAreaById(id));
}
/**
* 新增服务区异常事件
"异常分类"为事件事件子类
*/
@PreAuthorize("@ss.hasPermi('system:area:add')")
@Log(title = "服务区异常事件 ", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcEventServiceArea dcEventServiceArea)
{
return toAjax(dcEventServiceAreaService.insertDcEventServiceArea(dcEventServiceArea));
}
/**
* 修改服务区异常事件
"异常分类"为事件事件子类
*/
@PreAuthorize("@ss.hasPermi('system:area:edit')")
@Log(title = "服务区异常事件", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcEventServiceArea dcEventServiceArea)
{
return toAjax(dcEventServiceAreaService.updateDcEventServiceArea(dcEventServiceArea));
}
/**
* 删除服务区异常事件
"异常分类"为事件事件子类
*/
@PreAuthorize("@ss.hasPermi('system:area:remove')")
@Log(title = "服务区异常事件 ", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(dcEventServiceAreaService.deleteDcEventServiceAreaByIds(ids));
}
}