package com.jcdm.main.da.passingStationCollection.controller; import com.jcdm.common.annotation.Log; import com.jcdm.common.core.controller.BaseController; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.core.domain.R; import com.jcdm.common.core.page.TableDataInfo; import com.jcdm.common.enums.BusinessType; import com.jcdm.common.utils.DateUtils; import com.jcdm.common.utils.poi.ExcelUtil; import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; 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 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:list')") @GetMapping("/noPageList") public TableDataInfo noPageList(DaPassingStationCollection daPassingStationCollection) { List list = daPassingStationCollectionService.selectDaPassingStationCollectionList(daPassingStationCollection); return getDataTable(list); } // @PreAuthorize("@ss.hasPermi('da:passingStationCollection:list')") // @GetMapping("/getProduceNumToday") // public R getProduceNumToday(String fieldName) // { // Integer num = daPassingStationCollectionService.getProduceNumToday(fieldName); // return R.ok(num); // } /** * 查询产品过站采集列表 */ @GetMapping("/insertRepairRecordByIds") public AjaxResult insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection) { daPassingStationCollectionService.insertRepairRecordByIds(daPassingStationCollection); return AjaxResult.success(); } /** * 导出产品过站采集列表 */ @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)); } }