package com.billion.main.da.controller; import com.billion.common.annotation.Log; import com.billion.common.core.controller.BaseController; import com.billion.common.core.domain.AjaxResult; import com.billion.common.core.page.TableDataInfo; import com.billion.common.enums.BusinessType; import com.billion.common.utils.poi.ExcelUtil; import com.billion.main.da.domain.DaStationCollection; import com.billion.main.da.service.IDaStationCollectionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 过站采集Controller * * @author HDY * @date 2025-02-12 */ @RestController @RequestMapping("/da/stationCollection") public class DaStationCollectionController extends BaseController { @Autowired private IDaStationCollectionService daStationCollectionService; /** * 查询过站采集列表 */ @PreAuthorize("@ss.hasPermi('da:stationCollection:list')") @GetMapping("/list") public TableDataInfo list(DaStationCollection daStationCollection) { startPage(); List list = daStationCollectionService.selectDaStationCollectionList(daStationCollection); return getDataTable(list); } /** * 导出过站采集列表 */ @PreAuthorize("@ss.hasPermi('da:stationCollection:export')") @Log(title = "过站采集", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DaStationCollection daStationCollection) { List list = daStationCollectionService.selectDaStationCollectionList(daStationCollection); ExcelUtil util = new ExcelUtil(DaStationCollection.class); util.exportExcel(response, list, "过站采集数据"); } /** * 获取过站采集详细信息 */ @PreAuthorize("@ss.hasPermi('da:stationCollection:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(daStationCollectionService.selectDaStationCollectionById(id)); } /** * 新增过站采集 */ @PreAuthorize("@ss.hasPermi('da:stationCollection:add')") @Log(title = "过站采集", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DaStationCollection daStationCollection) { return toAjax(daStationCollectionService.insertDaStationCollection(daStationCollection)); } /** * 修改过站采集 */ @PreAuthorize("@ss.hasPermi('da:stationCollection:edit')") @Log(title = "过站采集", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DaStationCollection daStationCollection) { return toAjax(daStationCollectionService.updateDaStationCollection(daStationCollection)); } /** * 删除过站采集 */ @PreAuthorize("@ss.hasPermi('da:stationCollection:remove')") @Log(title = "过站采集", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(daStationCollectionService.deleteDaStationCollectionByIds(ids)); } }