feat(warning): 更新钢卷告警检查功能支持动态阈值配置
- 在 WmsMaterialCoilBo 中新增 specThickness 字段用于存储规格厚度 - 修改 checkAndInsertWarnings 方法签名以传递 BO 对象 - 将长度和厚度告警阈值改为从系统配置表动态读取 - 长度告警阈值配置键为 material.warning.length,默认值 0.1 - 厚度告警阈值配置键为 material.warning.thickness,默认值 -0.01 - 厚度检查逻辑改为理论厚度与规格厚度对比 - 钢卷创建和更新流程中传递 BO 对象到告警检查方法 - 优化告警消息内容以反映阈值检查而非固定比例 - 移除原有的实测厚度检查规则,统一使用规格厚度作为参考标准
This commit is contained in:
@@ -1117,6 +1117,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
BigDecimal width = new BigDecimal(specWidth);
|
||||
BigDecimal volume = weight.multiply(new BigDecimal("1000")).divide(new BigDecimal("7.85"), 10, RoundingMode.HALF_UP);
|
||||
|
||||
bo.setSpecThickness(thickness);
|
||||
// 计算理论厚度(需要实测长度)
|
||||
if (bo.getTheoreticalThickness() == null && bo.getActualLength() != null) {
|
||||
BigDecimal length = new BigDecimal(bo.getActualLength());
|
||||
@@ -1523,7 +1524,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
}
|
||||
|
||||
// 检查长度/厚度偏差并插入告警
|
||||
materialWarningService.checkAndInsertWarnings(add);
|
||||
materialWarningService.checkAndInsertWarnings(add, bo);
|
||||
|
||||
// 设置返回用的ID并更新二维码内容中的coilId
|
||||
bo.setCoilId(add.getCoilId());
|
||||
@@ -1738,7 +1739,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
}
|
||||
|
||||
// 检查长度/厚度偏差并插入告警
|
||||
materialWarningService.checkAndInsertWarnings(updateCoil);
|
||||
materialWarningService.checkAndInsertWarnings(updateCoil, bo);
|
||||
|
||||
// 如果实际库区id为-1或状态为1,则清空钢卷上的实际库区绑定
|
||||
if ((bo.getActualWarehouseId() != null && bo.getActualWarehouseId().equals(-1L))
|
||||
@@ -1848,7 +1849,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
}
|
||||
|
||||
// 检查长度/厚度偏差并插入告警
|
||||
materialWarningService.checkAndInsertWarnings(newCoil);
|
||||
materialWarningService.checkAndInsertWarnings(newCoil, bo);
|
||||
|
||||
// 如果实际库区id为-1,则清空钢卷上的实际库区绑定
|
||||
if (bo.getActualWarehouseId() != null && bo.getActualWarehouseId().equals(-1L)) {
|
||||
@@ -2109,7 +2110,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
baseMapper.insert(newCoil);
|
||||
|
||||
// 检查长度/厚度偏差并插入告警
|
||||
materialWarningService.checkAndInsertWarnings(newCoil);
|
||||
materialWarningService.checkAndInsertWarnings(newCoil, newCoilBo);
|
||||
|
||||
newCoils.add(newCoil);
|
||||
|
||||
@@ -2251,7 +2252,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
baseMapper.insert(newCoil);
|
||||
|
||||
// 检查长度/厚度偏差并插入告警
|
||||
materialWarningService.checkAndInsertWarnings(newCoil);
|
||||
materialWarningService.checkAndInsertWarnings(newCoil, bo);
|
||||
|
||||
newCoils.add(newCoil);
|
||||
|
||||
@@ -5105,7 +5106,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
baseMapper.insert(childCoil);
|
||||
|
||||
// 检查长度/厚度偏差并插入告警
|
||||
materialWarningService.checkAndInsertWarnings(childCoil);
|
||||
materialWarningService.checkAndInsertWarnings(childCoil, childCoilBo);
|
||||
|
||||
// 插入子钢卷的异常信息
|
||||
if (childCoilBo.getAbnormals() != null && !childCoilBo.getAbnormals().isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user