8481 基础数据-库位-导入。导出报错,提示cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil$LOCATE_TYPE.descriptionOfValue(java.lang.String)

yun-zuoyi
puxiao.liao 5 years ago
parent 8d6ffbb012
commit e8dd3ab12f

@ -2212,6 +2212,16 @@ public class CommonEnumUtil {
return tmp; return tmp;
} }
public static int descriptionOfValue(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
public static FIELD_TYPE codeOf(Integer value) { public static FIELD_TYPE codeOf(Integer value) {
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
if (values()[i].value == value) { if (values()[i].value == value) {
@ -2325,7 +2335,7 @@ public class CommonEnumUtil {
return tmp; return tmp;
} }
public static Integer valueOfDescription(String desc) { public static Integer descriptionOfValue(String desc) {
Integer tmp = 1; Integer tmp = 1;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) { if (values()[i].description.equals(desc)) {
@ -2391,7 +2401,7 @@ public class CommonEnumUtil {
} }
public static Integer valueOfDescription(String desc) { public static Integer descriptionOfValue(String desc) {
Integer tmp = null; Integer tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) { if (values()[i].description.equals(desc)) {

@ -538,6 +538,14 @@ public class WmsEnumUtil {
return code; return code;
} }
public static String valueOfDescription(int val) {
return valueOf(val);
}
public static int descriptionOfValue(String desc) {
return descOf(desc);
}
public static String valueOf(int val) { public static String valueOf(int val) {
String tmp = null; String tmp = null;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
@ -1085,6 +1093,10 @@ public class WmsEnumUtil {
return valueOf(val); return valueOf(val);
} }
public static Integer descriptionOfValue(String desc) {
return descOf(desc);
}
public static int descOf(String desc) { public static int descOf(String desc) {
int tmp = 1; int tmp = 1;
for (int i = 0; i < values().length; i++) { for (int i = 0; i < values().length; i++) {
@ -1250,6 +1262,9 @@ public class WmsEnumUtil {
return tmp; return tmp;
} }
public static Integer descriptionOfValue(String desc) {
return descOf(desc);
}
public static String valueOfDescription(int val) { public static String valueOfDescription(int val) {
return valueOf(val); return valueOf(val);
} }
@ -3325,6 +3340,17 @@ public class WmsEnumUtil {
} }
return tmp; return tmp;
} }
public static String descriptionOfValue(String desc) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
} }
/** /**
@ -4801,6 +4827,17 @@ public class WmsEnumUtil {
} }
return tmp; return tmp;
} }
public static int descriptionOfValue(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
} }
/** /**
@ -6574,4 +6611,148 @@ public class WmsEnumUtil {
return valueOf(val); return valueOf(val);
} }
} }
/**
* BH RepairOrPick
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BH_TEST_RESULT_TYPE {
PICK(10, "NORMAL", "挑选"), REPAIR(20, "ABNORMAL", "返修");
private int value;
private String code;
private String description;
BH_TEST_RESULT_TYPE(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getCode() {
return code;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static String valueOfDescription(int val) {
return valueOf(val);
}
public static int descriptionOfValue(String desc) {
return descOf(desc);
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
public static BH_TEST_RESULT_TYPE codeOf(Integer value) {
if (value == null) {
return null;
} else {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == value) {
return values()[i];
}
}
}
return null;
}
}
/**
* BH
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BH_TEST_RESULT_STATUS {
NORMAL(10, "NORMAL", "合格"), ABNORMAL(20, "ABNORMAL", "不合格");
private int value;
private String code;
private String description;
BH_TEST_RESULT_STATUS(int value, String code, String description) {
this.value = value;
this.code = code;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public String getCode() {
return code;
}
public static String valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static String valueOfDescription(int val) {
return valueOf(val);
}
public static int descriptionOfValue(String desc) {
return descOf(desc);
}
public static int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
public static BH_TEST_RESULT_STATUS codeOf(Integer value) {
if (value == null) {
return null;
} else {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == value) {
return values()[i];
}
}
}
return null;
}
}
} }

@ -2,7 +2,7 @@ package cn.estsh.i3plus.pojo.wms.bean;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn; import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.Data; import lombok.Data;
@ -89,7 +89,7 @@ public class WmsStockInitialize extends BaseBean {
@Column(name = "QC_STATUS") @Column(name = "QC_STATUS")
@ApiParam(value = "质检状态", example = "0") @ApiParam(value = "质检状态", example = "0")
@ColumnDefault("10") @ColumnDefault("10")
@AnnoOutputColumn(refClass = CommonEnumUtil.STOCK_SN_QC_STATUS.class, refForeignKey = "value", value = "description", required = false) @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_QC_STATUS.class, refForeignKey = "value", value = "description", required = false)
private Integer qcStatus; private Integer qcStatus;
/** /**
@ -98,7 +98,7 @@ public class WmsStockInitialize extends BaseBean {
@Column(name = "SN_STATUS") @Column(name = "SN_STATUS")
@ApiParam(value = "条码状态", example = "0") @ApiParam(value = "条码状态", example = "0")
@ColumnDefault("30") @ColumnDefault("30")
@AnnoOutputColumn(refClass = CommonEnumUtil.STOCK_SN_STATUS.class, refForeignKey = "value", value = "description", required = false) @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_STATUS.class, refForeignKey = "value", value = "description", required = false)
private Integer snStatus; private Integer snStatus;
@Column(name = "USE_COUNT", nullable = true) @Column(name = "USE_COUNT", nullable = true)

@ -14,7 +14,11 @@ import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*; import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -212,6 +216,18 @@ public class WmsStockSn extends BaseBean {
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "WMS_STOCK_TYPE") @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "WMS_STOCK_TYPE")
private Integer snType = 10; private Integer snType = 10;
@Column(name = "USE_COUNT")
@ApiParam(value = "领用次数", example = "0")
@ColumnDefault("0")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
private Integer useCount;
@Column(name = "SEQ_NO")
@ApiParam(value = "序号", example = "0")
@ColumnDefault("0")
@DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
private Integer seqNo;
@ApiParam(value = "仓库名称") @ApiParam(value = "仓库名称")
@Transient @Transient
public String whNameRdd; public String whNameRdd;

@ -65,6 +65,7 @@ public class WmsTestResultSummary extends BaseBean {
@Column(name = "REWORK_RESULT") @Column(name = "REWORK_RESULT")
@ApiParam("返修结果") @ApiParam("返修结果")
@AnnoOutputColumn(refClass = WmsEnumUtil.BH_TEST_RESULT_STATUS.class, refForeignKey = "value", value = "description")
public Integer reworkResult; public Integer reworkResult;
@Column(name = "PICK_STATUS") @Column(name = "PICK_STATUS")
@ -74,6 +75,7 @@ public class WmsTestResultSummary extends BaseBean {
@Column(name = "PICK_RESULT") @Column(name = "PICK_RESULT")
@ApiParam("挑选结果") @ApiParam("挑选结果")
@AnnoOutputColumn(refClass = WmsEnumUtil.BH_TEST_RESULT_STATUS.class, refForeignKey = "value", value = "description")
public Integer pickResult; public Integer pickResult;
} }

Loading…
Cancel
Save