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.BsRouteInfo; import com.billion.main.bs.service.IBsRouteInfoService; import com.billion.common.utils.poi.ExcelUtil; import com.billion.common.core.page.TableDataInfo; /** * 工艺路线Controller * * @author Billion-Yi * @date 2024-11-23 */ @RestController @RequestMapping("/bs/routeInfo") public class BsRouteInfoController extends BaseController { @Autowired private IBsRouteInfoService bsRouteInfoService; /** * 查询工艺路线列表 */ @PreAuthorize("@ss.hasPermi('bs:routeInfo:list')") @GetMapping("/list") public TableDataInfo list(BsRouteInfo bsRouteInfo) { startPage(); List list = bsRouteInfoService.selectBsRouteInfoList(bsRouteInfo); return getDataTable(list); } /** * 导出工艺路线列表 */ @PreAuthorize("@ss.hasPermi('bs:routeInfo:export')") @Log(title = "工艺路线", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, BsRouteInfo bsRouteInfo) { List list = bsRouteInfoService.selectBsRouteInfoList(bsRouteInfo); ExcelUtil util = new ExcelUtil(BsRouteInfo.class); util.exportExcel(response, list, "工艺路线数据"); } /** * 获取工艺路线详细信息 */ @PreAuthorize("@ss.hasPermi('bs:routeInfo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bsRouteInfoService.selectBsRouteInfoById(id)); } /** * 新增工艺路线 */ @PreAuthorize("@ss.hasPermi('bs:routeInfo:add')") @Log(title = "工艺路线", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BsRouteInfo bsRouteInfo) { return toAjax(bsRouteInfoService.insertBsRouteInfo(bsRouteInfo)); } /** * 修改工艺路线 */ @PreAuthorize("@ss.hasPermi('bs:routeInfo:edit')") @Log(title = "工艺路线", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody BsRouteInfo bsRouteInfo) { return toAjax(bsRouteInfoService.updateBsRouteInfo(bsRouteInfo)); } /** * 删除工艺路线 */ @PreAuthorize("@ss.hasPermi('bs:routeInfo:remove')") @Log(title = "工艺路线", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bsRouteInfoService.deleteBsRouteInfoByIds(ids)); } }