fix(feature/DM/nflg-bom): 修复通过值反查枚举的bug
This commit is contained in:
parent
e04e638f03
commit
83a94ead23
|
|
@ -20,4 +20,13 @@ public enum EBomStatusEnum implements ValueEnum<Integer> {
|
|||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
||||
public static EBomStatusEnum findByValue(Integer value) {
|
||||
for (EBomStatusEnum statusEnum : EBomStatusEnum.values()) {
|
||||
if (statusEnum.getValue().equals(value)) {
|
||||
return statusEnum;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("无效的值");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
|
@ -1489,7 +1488,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
//待复核和已退回才能删除
|
||||
VUtils.isTure(parentEntity.getStatus().equals(EBomStatusEnum.WAIT_CHECK.getValue())
|
||||
|| parentEntity.getStatus().equals(EBomStatusEnum.RETURNED.getValue()))
|
||||
.throwMessage(EnumUtil.fromString(EBomStatusEnum.class, parentEntity.getStatus().toString()).getDescription() + "状态不能删除");
|
||||
.throwMessage(EBomStatusEnum.findByValue(parentEntity.getStatus()).getDescription() + "状态不能删除");
|
||||
|
||||
EBomDel eBomDel = new EBomDel(bomRowId);
|
||||
eBomDel.classifyBom();
|
||||
|
|
|
|||
Loading…
Reference in New Issue