mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
未排单,排单,打包模块接口入参类型检查完善,异常信息补全
This commit is contained in:
-1
@@ -9,7 +9,6 @@ import lombok.Getter;
|
||||
public enum OrderPackageStatusEnum {
|
||||
|
||||
UNPACKED(0,"未封包/未打包"),
|
||||
PACKAGING(1, "封包中/打包中"),
|
||||
PACKAGED(1, "已封包/已打包");
|
||||
|
||||
private Integer status;
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PlanTypeEnum {
|
||||
|
||||
MIXEDORDERPLAN(1, "混单排单"),
|
||||
|
||||
ORDERPLAN(2, "生产单排单");
|
||||
|
||||
private Integer type;
|
||||
private String scheduling;
|
||||
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.type .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(PlanTypeEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.type .equals(this.getType()) ;
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 板材排孔类型枚举类
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PlatePlaceHoleEnum {
|
||||
|
||||
|
||||
FRONT(0, "正面"),
|
||||
BACK(1, "反面"),
|
||||
RANDOMFACE(2, "随意面");
|
||||
|
||||
private final Integer placeHole;
|
||||
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.placeHole.equals(status) ;
|
||||
}
|
||||
|
||||
|
||||
public boolean equals(PlatePlaceHoleEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.placeHole .equals(this.getPlaceHole()) ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PlateTextureEnum {
|
||||
|
||||
|
||||
POSITIVEPATTERN(0, "正纹"),
|
||||
ROTATABLE(1, "可翻转"),
|
||||
REVERSEPATTERN(2, "反纹");
|
||||
|
||||
private final Integer texture;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.texture.equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(PlateTextureEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.texture .equals(this.getTexture()) ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -36,6 +36,7 @@ public class GlobalErrorCodeConstants {
|
||||
// ES文档删除失败
|
||||
public static final ErrorCode ES_ERROR_DELETE = new ErrorCode(504, "数据异常,请勿点击过快,请稍等再试");
|
||||
public static final ErrorCode DATA_EXCEPTION_ERROR = new ErrorCode(505, "数据异常,请联系客服处理");
|
||||
public static final ErrorCode DATA_DATA_ERROR = new ErrorCode(506, "文档数据异常,请稍后重试或联系客服处理");
|
||||
|
||||
// ========== 自定义错误段 ==========
|
||||
public static final ErrorCode REPEATED_REQUESTS = new ErrorCode(900, "重复请求,请稍后重试"); // 重复请求
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ import java.text.DecimalFormat;
|
||||
public class NumberValidator implements ConstraintValidator<NumberValid, Number> {
|
||||
private static final String ZERO = "0";
|
||||
|
||||
private static final String GREATER_THAN_ZERO_NOTIFICATION = "%s必须大于等于0";
|
||||
private static final String GREATER_THAN_ZERO_NOTIFICATION = "%s必须大于0";
|
||||
|
||||
private static final String FLOAT_NUMBER_LENGTH_ERROR_NOTIFICATION = "%s长度不合法,总长度不超过8位,小数点后不超过3位";
|
||||
|
||||
@@ -92,7 +92,7 @@ public class NumberValidator implements ConstraintValidator<NumberValid, Number>
|
||||
* @return
|
||||
*/
|
||||
private String handleDouble(Double value) {
|
||||
if (value <= Double.parseDouble(ZERO)) {
|
||||
if (value < Double.parseDouble(ZERO)) {
|
||||
return String.format(GREATER_THAN_ZERO_NOTIFICATION, name);
|
||||
}
|
||||
// 处理科学计数法,保留小数点后四位
|
||||
@@ -122,7 +122,7 @@ public class NumberValidator implements ConstraintValidator<NumberValid, Number>
|
||||
* @return
|
||||
*/
|
||||
private String handleBigDecimal(BigDecimal value) {
|
||||
if (value.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
if (value.compareTo(BigDecimal.ZERO) < 0) {
|
||||
return String.format(GREATER_THAN_ZERO_NOTIFICATION, name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user