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.
128 lines
4.3 KiB
128 lines
4.3 KiB
package com.zc.business.controller;
|
|
|
|
import java.util.List;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import com.zc.business.domain.DcEventVehicleAccident;
|
|
import com.zc.business.service.IDcEventVehicleAccidentService;
|
|
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-12
|
|
*
|
|
*/
|
|
@Api(tags = "车辆事故事件")
|
|
@RestController
|
|
@RequestMapping("/system/vehicle/accident")
|
|
public class DcEventVehicleAccidentController extends BaseController
|
|
{
|
|
@Autowired
|
|
private IDcEventVehicleAccidentService dcEventVehicleAccidentService;
|
|
|
|
/**
|
|
* 查询车辆事故事件
|
|
列表
|
|
*/
|
|
//@PreAuthorize("@ss.hasPermi('system:accident:list')")
|
|
@ApiOperation("查询车辆事故事件")
|
|
|
|
@GetMapping("/list")
|
|
public TableDataInfo list(DcEventVehicleAccident dcEventVehicleAccident)
|
|
{
|
|
startPage();
|
|
List<DcEventVehicleAccident> list = dcEventVehicleAccidentService.selectDcEventVehicleAccidentList(dcEventVehicleAccident);
|
|
return getDataTable(list);
|
|
}
|
|
|
|
/**
|
|
* 导出车辆事故事件
|
|
列表
|
|
*/
|
|
|
|
//@PreAuthorize("@ss.hasPermi('system:accident:export')")
|
|
@Log(title = "车辆事故事件 ", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(HttpServletResponse response, DcEventVehicleAccident dcEventVehicleAccident)
|
|
{
|
|
List<DcEventVehicleAccident> list = dcEventVehicleAccidentService.selectDcEventVehicleAccidentList(dcEventVehicleAccident);
|
|
ExcelUtil<DcEventVehicleAccident> util = new ExcelUtil<>(DcEventVehicleAccident.class);
|
|
util.exportExcel(response, list, "车辆事故事件数据");
|
|
}
|
|
|
|
/**
|
|
* 获取车辆事故事件
|
|
详细信息
|
|
*/
|
|
@ApiOperation("获取车辆事故事件")
|
|
|
|
// @PreAuthorize("@ss.hasPermi('system:accident:query')")
|
|
@GetMapping(value = "/{id}")
|
|
public AjaxResult getInfo(@PathVariable("id") String id)
|
|
{
|
|
return AjaxResult.success(dcEventVehicleAccidentService.selectDcEventVehicleAccidentById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增车辆事故事件
|
|
|
|
*/
|
|
@ApiOperation("新增车辆事故事件")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('system:accident:add')")
|
|
@Log(title = "车辆事故事件 ", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
public AjaxResult add(@RequestBody DcEventVehicleAccident dcEventVehicleAccident)
|
|
{
|
|
return toAjax(dcEventVehicleAccidentService.insertDcEventVehicleAccident(dcEventVehicleAccident));
|
|
}
|
|
|
|
/**
|
|
* 修改车辆事故事件
|
|
|
|
*/
|
|
@ApiOperation("修改车辆事故事件")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('system:accident:edit')")
|
|
@Log(title = "车辆事故事件", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
public AjaxResult edit(@RequestBody DcEventVehicleAccident dcEventVehicleAccident)
|
|
{
|
|
return toAjax(dcEventVehicleAccidentService.updateDcEventVehicleAccident(dcEventVehicleAccident));
|
|
}
|
|
|
|
/**
|
|
* 删除车辆事故事件
|
|
|
|
*/
|
|
@ApiOperation("删除车辆事故事件")
|
|
|
|
//@PreAuthorize("@ss.hasPermi('system:accident:remove')")
|
|
@Log(title = "车辆事故事件 ", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public AjaxResult remove(@PathVariable String[] ids)
|
|
{
|
|
return toAjax(dcEventVehicleAccidentService.deleteDcEventVehicleAccidentByIds(ids));
|
|
}
|
|
}
|
|
|