package com.zc.business.controller; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.zc.business.domain.DcEventTrafficControl; import com.zc.business.enums.UniversalEnum; import com.zc.business.service.IDcEventTrafficControlService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 交通管制事件 "管制设施"为事件“事件子类”Controller * * @author ruoyi * @date 2024-01-12 */ @Api(tags = "交通管制事件") @RestController @RequestMapping("/system/control") public class DcEventTrafficControlController extends BaseController { @Autowired private IDcEventTrafficControlService dcEventTrafficControlService; /** * 查询交通管制事件 "管制设施"为事件“事件子类”列表 */ @ApiOperation("查询交通管制事件") //@PreAuthorize("@ss.hasPermi('system:control:list')") @GetMapping("/list") public TableDataInfo list(DcEventTrafficControl dcEventTrafficControl) { startPage(); List list = dcEventTrafficControlService.selectDcEventTrafficControlList(dcEventTrafficControl); return getDataTable(list); } /** * 导出交通管制事件 "管制设施"为事件“事件子类”列表 */ // @PreAuthorize("@ss.hasPermi('system:control:export')") @Log(title = "交通管制事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcEventTrafficControl dcEventTrafficControl) { List list = dcEventTrafficControlService.selectDcEventTrafficControlList(dcEventTrafficControl); ExcelUtil util = new ExcelUtil<>(DcEventTrafficControl.class); util.exportExcel(response, list, UniversalEnum.TRAFFIC_CONTROL_INCIDENT.getValue()); } /** * 获取交通管制事件 "管制设施"为事件“事件子类”详细信息 */ @ApiOperation("获取交通管制事件") // @PreAuthorize("@ss.hasPermi('system:control:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return AjaxResult.success(dcEventTrafficControlService.selectDcEventTrafficControlById(id)); } /** * 新增交通管制事件 "管制设施"为事件“事件子类” */ @ApiOperation("新增交通管制事件") // @PreAuthorize("@ss.hasPermi('system:control:add')") @Log(title = "交通管制事件", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcEventTrafficControl dcEventTrafficControl) { return toAjax(dcEventTrafficControlService.insertDcEventTrafficControl(dcEventTrafficControl)); } /** * 修改交通管制事件 "管制设施"为事件“事件子类” */ @ApiOperation("修改交通管制事件") //@PreAuthorize("@ss.hasPermi('system:control:edit')") @Log(title = "交通管制事件", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcEventTrafficControl dcEventTrafficControl) { return toAjax(dcEventTrafficControlService.updateDcEventTrafficControl(dcEventTrafficControl)); } /** * 删除交通管制事件 "管制设施"为事件“事件子类” */ @ApiOperation("删除交通管制事件") //@PreAuthorize("@ss.hasPermi('system:control:remove')") @Log(title = "交通管制事件", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(dcEventTrafficControlService.deleteDcEventTrafficControlByIds(ids)); } }