Files
double-rack/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MesRollStandbyController.java
Joshi 6acb7b4b40 refactor(mill): 优化轧辊备用管理的数据查询和状态更新逻辑
- 修改 MesRollInfoMapper 中条件更新状态方法的参数命名,提升可读性
- 更新 MesRollStandbyMapper 查询接口返回类型为 MesRollStandbyVo
- 重构 MesRollStandbyMapper XML 映射文件中的查询语句,增加位置标签字段
- 将清空操作从物理删除改为逻辑删除,保留数据记录
- 在 MesRollStandbyVo 中新增 positionLabel、remark 和 createTime 字段
- 调整控制器注解配置,移除权限校验并简化接口定义
2026-06-12 10:26:47 +08:00

116 lines
4.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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<MesRollStandby> 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<MesRollStandby> list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby);
ExcelUtil<MesRollStandby> util = new ExcelUtil<MesRollStandby>(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));
}
}