package com.jcdm.main.da.passingStationCollection.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.jcdm.common.utils.DateUtils; import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; 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.jcdm.common.annotation.Log; import com.jcdm.common.core.controller.BaseController; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.enums.BusinessType; import com.jcdm.common.utils.poi.ExcelUtil; import com.jcdm.common.core.page.TableDataInfo; /** * 产品过站采集Controller * * @author yyt * @date 2023-12-12 */ @RestController @RequestMapping("/da/passingStationCollection") public class DaPassingStationCollectionController extends BaseController { @Autowired private IDaPassingStationCollectionService daPassingStationCollectionService; /** * 查询产品过站采集列表 */ @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')") @GetMapping("/list") public TableDataInfo list(DaPassingStationCollection daPassingStationCollection) { startPage(); List list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection); return getDataTable(list); } /** * 导出产品过站采集列表 */ @PreAuthorize("@ss.hasPermi('da:passingStationCollection:export')") @Log(title = "产品过站采集", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DaPassingStationCollection daPassingStationCollection) { List list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection); ExcelUtil util = new ExcelUtil(DaPassingStationCollection.class); util.exportExcel(response, list, "产品过站采集数据"); } /** * 获取产品过站采集详细信息 */ @PreAuthorize("@ss.hasPermi('da:passingStationCollection:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(daPassingStationCollectionService.selectDaPassingStationCollectionById(id)); } /** * 新增产品过站采集 */ @PreAuthorize("@ss.hasPermi('da:passingStationCollection:add')") @Log(title = "产品过站采集", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DaPassingStationCollection daPassingStationCollection) { daPassingStationCollection.setCreateBy(getUsername()); daPassingStationCollection.setCreateTime(DateUtils.getNowDate()); return toAjax(daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection)); } /** * 修改产品过站采集 */ @PreAuthorize("@ss.hasPermi('da:passingStationCollection:edit')") @Log(title = "产品过站采集", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DaPassingStationCollection daPassingStationCollection) { daPassingStationCollection.setUpdateBy(getUsername()); daPassingStationCollection.setUpdateTime(DateUtils.getNowDate()); return toAjax(daPassingStationCollectionService.updateDaPassingStationCollection(daPassingStationCollection)); } /** * 删除产品过站采集 */ @PreAuthorize("@ss.hasPermi('da:passingStationCollection:remove')") @Log(title = "产品过站采集", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(daPassingStationCollectionService.deleteDaPassingStationCollectionByIds(ids)); } }