提交 c2c0f1ae authored 作者: jiangwujie's avatar jiangwujie

feature(电子围栏): 调整枚举

上级 f0047e00
...@@ -199,6 +199,10 @@ public enum OrderChildEnum { ...@@ -199,6 +199,10 @@ public enum OrderChildEnum {
public static Optional<OperateRecordType> getByCode(int code) { public static Optional<OperateRecordType> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst(); return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
} }
public static String getMsgByCode(int code) {
return getByCode(code).map(OperateRecordType::getMsg).orElse(null);
}
} }
} }
...@@ -48,7 +48,7 @@ public class OrderChildOperateRecordVO { ...@@ -48,7 +48,7 @@ public class OrderChildOperateRecordVO {
@ApiModelProperty(value = "操作类型 取消运单 解除装车限制", example = "取消运单") @ApiModelProperty(value = "操作类型 取消运单 解除装车限制", example = "取消运单")
public String getTypeMsg() { public String getTypeMsg() {
return OrderChildEnum.OperateRecordType.getByCode(type).get().getMsg(); return OrderChildEnum.OperateRecordType.getMsgByCode(type);
} }
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论