package com.ruoyi.mill.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.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.mill.domain.MesRollStandby; import com.ruoyi.mill.service.IMesRollStandbyService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 下批轧辊(待换上)Controller * * @author ruoyi * @date 2026-06-09 */ @RestController @RequestMapping("/mill/standby") public class MesRollStandbyController extends BaseController { @Autowired private IMesRollStandbyService mesRollStandbyService; /** * 查询下批轧辊(待换上)列表 */ @PreAuthorize("@ss.hasPermi('mill:standby:list')") @GetMapping("/list") public TableDataInfo list(MesRollStandby mesRollStandby) { startPage(); List list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby); return getDataTable(list); } /** * 导出下批轧辊(待换上)列表 */ @PreAuthorize("@ss.hasPermi('mill:standby:export')") @Log(title = "下批轧辊(待换上)", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, MesRollStandby mesRollStandby) { List list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby); ExcelUtil util = new ExcelUtil(MesRollStandby.class); util.exportExcel(response, list, "下批轧辊(待换上)数据"); } /** * 获取下批轧辊(待换上)详细信息 */ @PreAuthorize("@ss.hasPermi('mill:standby:query')") @GetMapping(value = "/{standbyId}") public AjaxResult getInfo(@PathVariable("standbyId") Long standbyId) { return success(mesRollStandbyService.selectMesRollStandbyByStandbyId(standbyId)); } /** * 新增下批轧辊(待换上) */ @PreAuthorize("@ss.hasPermi('mill:standby:add')") @Log(title = "下批轧辊(待换上)", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MesRollStandby mesRollStandby) { return toAjax(mesRollStandbyService.insertMesRollStandby(mesRollStandby)); } /** * 修改下批轧辊(待换上) */ @PreAuthorize("@ss.hasPermi('mill:standby:edit')") @Log(title = "下批轧辊(待换上)", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MesRollStandby mesRollStandby) { return toAjax(mesRollStandbyService.updateMesRollStandby(mesRollStandby)); } /** * 删除下批轧辊(待换上) */ @PreAuthorize("@ss.hasPermi('mill:standby:remove')") @Log(title = "下批轧辊(待换上)", businessType = BusinessType.DELETE) @DeleteMapping("/{standbyIds}") public AjaxResult remove(@PathVariable Long[] standbyIds) { return toAjax(mesRollStandbyService.deleteMesRollStandbyByStandbyIds(standbyIds)); } /** * 清空指定产线+机架的全部下批轧辊 * DELETE /mill/standby/clear?lineId=xxx&standNo=1%23 */ @Log(title = "下批轧辊", businessType = BusinessType.DELETE) @DeleteMapping("/clear") public AjaxResult clear(Long lineId, @RequestParam String standNo) { return toAjax(mesRollStandbyService.clearByStand(lineId, standNo)); } }