package com.billion.main.da.controller; 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.billion.common.annotation.Log; import com.billion.common.core.controller.BaseController; import com.billion.common.core.domain.AjaxResult; import com.billion.common.enums.BusinessType; import com.billion.main.da.domain.DaTightenCollection; import com.billion.main.da.service.IDaTightenCollectionService; import com.billion.common.utils.poi.ExcelUtil; import com.billion.common.core.page.TableDataInfo; /** * 拧紧采集Controller * * @author Billion-Yi * @date 2024-11-22 */ @RestController @RequestMapping("/da/tightenCollection") public class DaTightenCollectionController extends BaseController { @Autowired private IDaTightenCollectionService daTightenCollectionService; /** * 查询拧紧采集列表 */ @PreAuthorize("@ss.hasPermi('da:tightenCollection:list')") @GetMapping("/list") public TableDataInfo list(DaTightenCollection daTightenCollection) { startPage(); List list = daTightenCollectionService.selectDaTightenCollectionList(daTightenCollection); return getDataTable(list); } /** * 导出拧紧采集列表 */ @PreAuthorize("@ss.hasPermi('da:tightenCollection:export')") @Log(title = "拧紧采集", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DaTightenCollection daTightenCollection) { List list = daTightenCollectionService.selectDaTightenCollectionList(daTightenCollection); ExcelUtil util = new ExcelUtil(DaTightenCollection.class); util.exportExcel(response, list, "拧紧采集数据"); } /** * 获取拧紧采集详细信息 */ @PreAuthorize("@ss.hasPermi('da:tightenCollection:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(daTightenCollectionService.selectDaTightenCollectionById(id)); } /** * 新增拧紧采集 */ @PreAuthorize("@ss.hasPermi('da:tightenCollection:add')") @Log(title = "拧紧采集", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DaTightenCollection daTightenCollection) { return toAjax(daTightenCollectionService.insertDaTightenCollection(daTightenCollection)); } /** * 修改拧紧采集 */ @PreAuthorize("@ss.hasPermi('da:tightenCollection:edit')") @Log(title = "拧紧采集", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DaTightenCollection daTightenCollection) { return toAjax(daTightenCollectionService.updateDaTightenCollection(daTightenCollection)); } /** * 删除拧紧采集 */ @PreAuthorize("@ss.hasPermi('da:tightenCollection:remove')") @Log(title = "拧紧采集", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(daTightenCollectionService.deleteDaTightenCollectionByIds(ids)); } }