package com.odcc.cpzidc.web.controller.bis; import java.util.List; import javax.servlet.http.HttpServletResponse; 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.odcc.cpzidc.common.annotation.Log; import com.odcc.cpzidc.common.core.controller.BaseController; import com.odcc.cpzidc.common.core.domain.AjaxResult; import com.odcc.cpzidc.common.enums.BusinessType; import com.odcc.cpzidc.bis.domain.IdcUseTransport; import com.odcc.cpzidc.bis.service.IIdcUseTransportService; import com.odcc.cpzidc.common.utils.poi.ExcelUtil; import com.odcc.cpzidc.common.core.page.TableDataInfo; /** * 运力指标信息Controller * * @author ruoyi * @date 2024-10-10 */ @RestController @RequestMapping("/bis/useTransport") public class IdcUseTransportController extends BaseController { @Autowired private IIdcUseTransportService idcUseTransportService; /** * 查询运力指标信息列表 */ @PreAuthorize("@ss.hasPermi('bis:useTransport:list')") @GetMapping("/list") public TableDataInfo list(IdcUseTransport idcUseTransport) { startPage(); List list = idcUseTransportService.selectIdcUseTransportList(idcUseTransport); return getDataTable(list); } /** * 导出运力指标信息列表 */ @PreAuthorize("@ss.hasPermi('bis:useTransport:export')") @Log(title = "运力指标信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IdcUseTransport idcUseTransport) { List list = idcUseTransportService.selectIdcUseTransportList(idcUseTransport); ExcelUtil util = new ExcelUtil(IdcUseTransport.class); util.exportExcel(response, list, "运力指标信息数据"); } /** * 获取运力指标信息详细信息 */ @PreAuthorize("@ss.hasPermi('bis:useTransport:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(idcUseTransportService.selectIdcUseTransportById(id)); } /** * 新增运力指标信息 */ @PreAuthorize("@ss.hasPermi('bis:useTransport:add')") @Log(title = "运力指标信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IdcUseTransport idcUseTransport) { return toAjax(idcUseTransportService.insertIdcUseTransport(idcUseTransport)); } /** * 修改运力指标信息 */ @PreAuthorize("@ss.hasPermi('bis:useTransport:edit')") @Log(title = "运力指标信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IdcUseTransport idcUseTransport) { return toAjax(idcUseTransportService.updateIdcUseTransport(idcUseTransport)); } /** * 删除运力指标信息 */ @PreAuthorize("@ss.hasPermi('bis:useTransport:remove')") @Log(title = "运力指标信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(idcUseTransportService.deleteIdcUseTransportByIds(ids)); } }