From dc36a0336a380e577eb76f2b5401373d498a0179 Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Tue, 9 Jun 2026 16:11:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(mill):=20=E6=B7=BB=E5=8A=A0=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E5=AE=9A=E6=9C=BA=E6=9E=B6=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=A4=87=E8=BE=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 MesRollStandbyController 中新增 clearByStand 接口 - 添加 DELETE /mill/standby/clear 路径用于清空指定机架备辊 - 实现同时回退轧辊状态的业务逻辑 - 添加权限校验 @PreAuthorize("@ss.hasPermi('mill:standby:remove')") - 集成操作日志记录功能 - 更新 MesRollChangeServiceImpl 中的代码风格,统一 if 语句的大括号格式 --- .../controller/MesRollStandbyController.java | 13 ++++++++++++ .../impl/MesRollChangeServiceImpl.java | 20 ++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MesRollStandbyController.java b/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MesRollStandbyController.java index 5da9ceb8..dd6a75a3 100644 --- a/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MesRollStandbyController.java +++ b/ruoyi-mill/src/main/java/com/ruoyi/mill/controller/MesRollStandbyController.java @@ -11,6 +11,7 @@ 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; @@ -101,4 +102,16 @@ public class MesRollStandbyController extends BaseController { return toAjax(mesRollStandbyService.deleteMesRollStandbyByStandbyIds(standbyIds)); } + + /** + * 清空指定机架所有备辊,同时回退轧辊状态 + * DELETE /mill/standby/clear?lineId=xxx&standNo=1%23 + */ + @PreAuthorize("@ss.hasPermi('mill:standby:remove')") + @Log(title = "下批轧辊(待换上)", businessType = BusinessType.DELETE) + @DeleteMapping("/clear") + public AjaxResult clearByStand(@RequestParam Long lineId, @RequestParam String standNo) + { + return toAjax(mesRollStandbyService.clearByStand(lineId, standNo)); + } } diff --git a/ruoyi-mill/src/main/java/com/ruoyi/mill/service/impl/MesRollChangeServiceImpl.java b/ruoyi-mill/src/main/java/com/ruoyi/mill/service/impl/MesRollChangeServiceImpl.java index 586ef066..49a5bb0c 100644 --- a/ruoyi-mill/src/main/java/com/ruoyi/mill/service/impl/MesRollChangeServiceImpl.java +++ b/ruoyi-mill/src/main/java/com/ruoyi/mill/service/impl/MesRollChangeServiceImpl.java @@ -115,7 +115,9 @@ public class MesRollChangeServiceImpl implements IMesRollChangeService public MesRollChangeVo queryCurrentByStand(Long lineId, String standNo) { // 组合各辊位最新状态,转换为 VO Map state = mesRollChangeMapper.selectCurrentStateByStand(lineId, standNo); - if (state == null) return null; + if (state == null) { + return null; + } MesRollChangeVo vo = new MesRollChangeVo(); vo.setLineId(lineId); vo.setStandNo(standNo); @@ -170,9 +172,15 @@ public class MesRollChangeServiceImpl implements IMesRollChangeService /** 安全转 BigDecimal */ private BigDecimal decimal(Object v) { - if (v == null) return null; - if (v instanceof BigDecimal) return (BigDecimal) v; - if (v instanceof Number) return BigDecimal.valueOf(((Number) v).doubleValue()); + if (v == null) { + return null; + } + if (v instanceof BigDecimal) { + return (BigDecimal) v; + } + if (v instanceof Number) { + return BigDecimal.valueOf(((Number) v).doubleValue()); + } return new BigDecimal(v.toString()); } @@ -189,7 +197,9 @@ public class MesRollChangeServiceImpl implements IMesRollChangeService /** 将统计结果 Map 填充到 VO */ private void fillStatsToVo(MesRollChangeVo vo, Map stats) { - if (stats == null) return; + if (stats == null) { + return; + } vo.setWorkLength(decimal(stats.get("workLength"))); vo.setCoilCount(stats.get("coilCount") == null ? 0 : ((Number) stats.get("coilCount")).intValue()); vo.setTotalWeight(decimal(stats.get("totalWeight")));