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.DcVehicles; import com.zc.business.enums.UniversalEnum; import com.zc.business.service.IDcVehiclesService; 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-03-05 */ @RestController @RequestMapping("/business/vehicles") public class DcVehiclesController extends BaseController { @Autowired private IDcVehiclesService dcVehiclesService; /** * 查询车辆信息列表 */ //@PreAuthorize("@ss.hasPermi('business:vehicles:list')") @GetMapping("/list") public TableDataInfo list(DcVehicles dcVehicles) { startPage(); List list = dcVehiclesService.selectDcVehiclesList(dcVehicles); return getDataTable(list); } /** * 导出车辆信息列表 */ //@PreAuthorize("@ss.hasPermi('business:vehicles:export')") @Log(title = "车辆信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response,@RequestBody DcVehicles dcVehicles) { List list = dcVehiclesService.selectDcVehiclesList(dcVehicles); ExcelUtil util = new ExcelUtil<>(DcVehicles.class); util.exportExcel(response, list, UniversalEnum.VEHICLE_INFORMATION_DATA.getValue()); } /** * 获取车辆信息详细信息 */ // @PreAuthorize("@ss.hasPermi('business:vehicles:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(dcVehiclesService.selectDcVehiclesById(id)); } /** * 新增车辆信息 */ // @PreAuthorize("@ss.hasPermi('business:vehicles:add')") @Log(title = "车辆信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcVehicles dcVehicles) { return toAjax(dcVehiclesService.insertDcVehicles(dcVehicles)); } /** * 修改车辆信息 */ // @PreAuthorize("@ss.hasPermi('business:vehicles:edit')") @Log(title = "车辆信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcVehicles dcVehicles) { return toAjax(dcVehiclesService.updateDcVehicles(dcVehicles)); } /** * 删除车辆信息 */ // @PreAuthorize("@ss.hasPermi('business:vehicles:remove')") @Log(title = "车辆信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(dcVehiclesService.deleteDcVehiclesByIds(ids)); } }