From f38a47cc6856ef84a86cc2e49d0f94526779c5bc Mon Sep 17 00:00:00 2001 From: "joke.wang" Date: Wed, 29 Apr 2020 23:03:50 +0800 Subject: [PATCH] =?UTF-8?q?[oee=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/MesEnumUtil.java | 143 ++++++++++++++++++--- .../java/cn/estsh/i3plus/pojo/mes/bean/MesOee.java | 14 ++ .../i3plus/pojo/mes/bean/MesOffLineRecord.java | 31 +++++ .../pojo/mes/bean/MesOperateObjectAttribute.java | 9 ++ 4 files changed, 176 insertions(+), 21 deletions(-) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java index 37a9a56..1eda477 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesEnumUtil.java @@ -5320,20 +5320,20 @@ public class MesEnumUtil { */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum VALUE_TYPE { - MANUAL_ASSIGNMENT(10, "手工赋值"), - SPEL_EXPRESSION(20, "spel表达式"), - FUNCTION_ASSIGNMENT(30, "函数赋值"), - JOB_ASSIGNMENT(40, "job赋值"); + MANUAL_ASSIGNMENT("10", "手工赋值"), + SPEL_EXPRESSION("20", "spel表达式"), + FUNCTION_ASSIGNMENT("30", "函数赋值"), + JOB_ASSIGNMENT("40", "job赋值"); - private int value; + private String value; private String description; - VALUE_TYPE(int value, String description) { + VALUE_TYPE(String value, String description) { this.value = value; this.description = description; } - public int getValue() { + public String getValue() { return value; } @@ -5341,10 +5341,19 @@ public class MesEnumUtil { return description; } - public static String valueOfDescription(int val) { + public static VALUE_TYPE getByValue(String value) { + for (VALUE_TYPE valueType : values()) { + if (valueType.getValue().equals(value)) { + return valueType; + } + } + return null; + } + + public static String valueOfDescription(String val) { String tmp = null; for (int i = 0; i < values().length; i++) { - if (values()[i].value == val) { + if (values()[i].value.equals(val)) { tmp = values()[i].description; } } @@ -5353,24 +5362,24 @@ public class MesEnumUtil { } /** - * 运算对象 运算类型 + * 运算对象 对象代码 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum OBJECT_CODE { - ORGANIZE_OEE(10, "工厂OEE"), - WORK_CENTER_OEE(20, "产线OEE"), - WORK_CELL_CEE(30, "工位OEE"), - EQU_OEE(40, "设备OEE"); + ORGANIZE_OEE("10", "工厂OEE"), + WORK_CENTER_OEE("20", "产线OEE"), + WORK_CELL_CEE("30", "工位OEE"), + EQU_OEE("40", "设备OEE"); - private int value; + private String value; private String description; - OBJECT_CODE(int value, String description) { + OBJECT_CODE(String value, String description) { this.value = value; this.description = description; } - public int getValue() { + public String getValue() { return value; } @@ -5378,10 +5387,19 @@ public class MesEnumUtil { return description; } + public static OBJECT_CODE getByValue(String value) { + for (OBJECT_CODE objectCode : values()) { + if (objectCode.getValue().equals(value)) { + return objectCode; + } + } + return null; + } + public static String valueOfDescription(int val) { String tmp = null; for (int i = 0; i < values().length; i++) { - if (values()[i].value == val) { + if (values()[i].value.equals(val)) { tmp = values()[i].description; } } @@ -5394,9 +5412,9 @@ public class MesEnumUtil { */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum SCRIPT_TYPE { - ORGANIZE_OEE(10, "组件"), - WORK_CENTER_OEE(20, "表单"), - WORK_CELL_CEE(30, "报表"), + ASSEMBLY(10, "组件"), + FORM(20, "表单"), + REPORT_FORM(30, "报表"), JOB(40, "JOB"), OTHER(50, "其他"); @@ -5465,4 +5483,87 @@ public class MesEnumUtil { } } + + + /** + * 运算对象代码 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum OPERATE_OBJECT_CODE { + ORGANIZE_OEE_HOUR("ORGANIZE_OEE_HOUR", "工厂OEE(小时)"), + ORGANIZE_OEE_DAY("ORGANIZE_OEE_DAY", "工厂OEE(天)"), + WORK_CENTER_OEE_DAY("WORK_CENTER_OEE_DAY", "产线OEE(天)"), + EQU_OEE_DAY("EQU_OEE_Day", "设备OEE(天)"); + + private String value; + private String description; + + OPERATE_OBJECT_CODE(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static OPERATE_OBJECT_CODE getByValue(String value) { + for (OPERATE_OBJECT_CODE objectCode : values()) { + if (objectCode.getValue().equals(value)) { + return objectCode; + } + } + return null; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value.equals(val)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * oee 运算状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum OEE_STATUS { + STAY_OPERATE(10, "待运算"), + ALREADY_OPERATE(20, "已运算"); + + private int value; + private String description; + + OEE_STATUS(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + } + } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOee.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOee.java index 81b3951..2a3b94c 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOee.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOee.java @@ -11,7 +11,9 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; +import javax.persistence.Transient; import java.io.Serializable; +import java.util.List; /** * @Description: @@ -109,4 +111,16 @@ public class MesOee extends BaseBean implements Serializable { @Column(name = "BUSI_DATA") @ApiParam("自定义数据") private String busiData; + + @Transient + @ApiParam("开始日期") + private String oeeDateStart; + + @Transient + @ApiParam("结束日期") + private String oeeDateEnd; + + @Transient + @ApiParam("自定义数据map") + private List operateObjectAttributes; } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOffLineRecord.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOffLineRecord.java index 46fe2ed..6c668db 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOffLineRecord.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOffLineRecord.java @@ -11,6 +11,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; +import javax.persistence.Transient; import java.io.Serializable; /** @@ -65,4 +66,34 @@ public class MesOffLineRecord extends BaseBean implements Serializable { @Column(name = "OFF_LINE_TIME") @ApiParam("下线时间") private String offLineTime; + + /*************冗余字段****************/ + + @Transient + @ApiParam("设备代码") + private String equCode; + + @Transient + @ApiParam("运算对象代码") + private String objectCode; + + @Transient + @ApiParam("日期") + private String oeeDate; + + @Transient + @ApiParam("开始时段") + private String startTime; + + @Transient + @ApiParam("结束时段") + private String endTime; + + @Transient + @ApiParam("一次合格数") + private Integer qualifiedQty; + + @Transient + @ApiParam("总生产数") + private Integer totalQty; } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOperateObjectAttribute.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOperateObjectAttribute.java index 56649b6..e05a54e 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOperateObjectAttribute.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesOperateObjectAttribute.java @@ -11,6 +11,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; +import javax.persistence.Transient; import java.io.Serializable; /** @@ -45,4 +46,12 @@ public class MesOperateObjectAttribute extends BaseBean implements Serializable @Column(name = "OPERATE_TYPE") @ApiParam("运算类型") private Integer operateType; + + @Transient + @ApiParam("属性值") + private String attributeValue; + + @Transient + @ApiParam("是否自定义属性") + private boolean customAttribute = false; }