package com.billion.main.bs.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.bs.domain.BsLocationInfo; import com.billion.main.bs.service.IBsLocationInfoService; import com.billion.common.utils.poi.ExcelUtil; import com.billion.common.core.page.TableDataInfo; /** * 工位信息Controller * * @author Billion-Yi * @date 2024-11-26 */ @RestController @RequestMapping("/bs/locationInfo") public class BsLocationInfoController extends BaseController { @Autowired private IBsLocationInfoService bsLocationInfoService; /** * 查询工位信息列表 */ @PreAuthorize("@ss.hasPermi('bs:locationInfo:list')") @GetMapping("/list") public TableDataInfo list(BsLocationInfo bsLocationInfo) { startPage(); List list = bsLocationInfoService.selectBsLocationInfoList(bsLocationInfo); return getDataTable(list); } /** * 导出工位信息列表 */ @PreAuthorize("@ss.hasPermi('bs:locationInfo:export')") @Log(title = "工位信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, BsLocationInfo bsLocationInfo) { List list = bsLocationInfoService.selectBsLocationInfoList(bsLocationInfo); ExcelUtil util = new ExcelUtil(BsLocationInfo.class); util.exportExcel(response, list, "工位信息数据"); } /** * 获取工位信息详细信息 */ @PreAuthorize("@ss.hasPermi('bs:locationInfo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bsLocationInfoService.selectBsLocationInfoById(id)); } /** * 新增工位信息 */ @PreAuthorize("@ss.hasPermi('bs:locationInfo:add')") @Log(title = "工位信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BsLocationInfo bsLocationInfo) { return toAjax(bsLocationInfoService.insertBsLocationInfo(bsLocationInfo)); } /** * 修改工位信息 */ @PreAuthorize("@ss.hasPermi('bs:locationInfo:edit')") @Log(title = "工位信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody BsLocationInfo bsLocationInfo) { return toAjax(bsLocationInfoService.updateBsLocationInfo(bsLocationInfo)); } /** * 删除工位信息 */ @PreAuthorize("@ss.hasPermi('bs:locationInfo:remove')") @Log(title = "工位信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bsLocationInfoService.deleteBsLocationInfoByIds(ids)); } }