From 37f7e92d53749d556f81fed53eec069cd9136815 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Tue, 15 Oct 2019 09:35:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?mes=E5=AE=9E=E4=BD=93=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/MesEnumUtil.java | 97 ++++++++++++++++++++++ .../i3plus/pojo/base/enumutil/MesPcnEnumUtil.java | 77 ++++++++++++++++- .../i3plus/pojo/mes/bean/MesEquTaskStandard.java | 64 ++++++++++++++ .../pojo/mes/model/MesEquTaskStandardModel.java | 77 +++++++++++++++++ .../i3plus/pojo/mes/model/MesEquipmentModel.java | 34 ++++---- .../repository/MesEquTaskStandardRepository.java | 16 ++++ 6 files changed, 347 insertions(+), 18 deletions(-) create mode 100644 modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesEquTaskStandard.java create mode 100644 modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquTaskStandardModel.java create mode 100644 modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesEquTaskStandardRepository.java 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 b6e1b2c..3c7e1fa 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 @@ -11,6 +11,103 @@ import com.fasterxml.jackson.annotation.JsonFormat; **/ public class MesEnumUtil { + + /** + * mes设备作业要求-作业类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MES_INSERT_EXCEL { + + MES_PLAN_ORDER(10, "生产计划"), + MES_EQUIPMENT(20, "设备台账"), + MES_EQU_TASK_STANDARD(30, "设备作业要求"); + + private int value; + private String description; + + MES_INSERT_EXCEL(int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + // 根据value返回枚举类型,主要在switch中使用 + public static MES_INSERT_EXCEL getByValue(int value) { + for (MES_INSERT_EXCEL mesInsertExcel : values()) { + if (mesInsertExcel.getValue() == value) { + return mesInsertExcel; + } + } + return null; + } + + + 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; + } + + } + + /** + * mes设备作业要求-作业类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MES_EQU_TASK_STANDARD_TASK_TYPE { + + CHECK(10, "点检"), + MAINTAIN(20, "保养"), + REPAIR(30, "维修"); + + private int value; + private String description; + + MES_EQU_TASK_STANDARD_TASK_TYPE(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; + } + + public static Integer descriptionOfValue(String description) { + Integer tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].description.equals(description)) { + tmp = values()[i].value; + } + } + return tmp; + } + } + /** * mes设备类型 */ diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java index c21185e..19ca8a0 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java @@ -817,7 +817,8 @@ public class MesPcnEnumUtil { OPEN(30, "启动"), PAUSE(40, "暂停"), CANCEL(50, "取消"), - CLOSE(60, "关闭"); + CLOSE(60, "关闭"), + COMPLETE(70, "完成"); private int value; private String description; @@ -1163,6 +1164,80 @@ public class MesPcnEnumUtil { } /** + * 条码生成业务类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum COMPANY_TYPE { + RULECODE("ruleCode", "规则编码"), + PREFIX("prefix", "前缀"), + PART_NO("partNo", "物料号"), + CUST_PART_NO("custPartNo", "客户物料号"), + CUST_CODE("custCode", "客户代码"), + PROD_LOCATION("prodLocation", "产地"), + YEAR("year", "年"), + MOTH("month", "月"), + DAY("day", "日"), + HOUR("hour", "小时"), + MINUTE("minute", "分钟"), + SECOND("second", "秒"), + SERIAL("serialNo", "序列号"); + + private String value; + private String description; + + COMPANY_TYPE(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + } + + + /** + * mes工步类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MES_STEP_TYPE { + + AUTO_RUN(10, "自动执行"), + SCAN_RUN(20, "扫描执行"); + + + private Integer value; + private String description; + + MES_STEP_TYPE(Integer value, String description) { + this.value = value; + this.description = description; + } + + public Integer getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static String valueOfDescription(String val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value.equals(val)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** * MesRoute 流程的类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesEquTaskStandard.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesEquTaskStandard.java new file mode 100644 index 0000000..51d7fb3 --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesEquTaskStandard.java @@ -0,0 +1,64 @@ +package cn.estsh.i3plus.pojo.mes.bean; + + +import cn.estsh.i3plus.pojo.base.bean.BaseBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.persistence.Transient; + +/** + * @Description :设备作业要求 + * @Reference : + * @Author : wangjie + * @CreateDate : 2019-10-11 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_EQU_TASK_STANDARD") +@Api("设备作业要求") +public class MesEquTaskStandard extends BaseBean { + @Column(name="EQUIPMENT_CODE") + @ApiParam("设备代码") + private String equipmentCode; + + @Column(name="EQUIPMENT_NAME") + @ApiParam("设备名称") + private String equipmentName; + + @Column(name="TASK_TYPE") + @ApiParam("作业类型") + private Integer taskType; + + @Column(name="ACTION_ITEM") + @ApiParam("操作项") + private String actionItem; + + @Column(name="ACTION_STANDARD") + @ApiParam("操作标准") + private String actionStandard; + + @Column(name="ACTION_GUIDE") + @ApiParam("操作指导") + private String actionGuide; + + @Transient + @ApiParam(value="生产线") + private String workCenterCode; + + @Transient + @ApiParam(value="设备类别") + private String equipmentCategory; + +} diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquTaskStandardModel.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquTaskStandardModel.java new file mode 100644 index 0000000..58d977b --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquTaskStandardModel.java @@ -0,0 +1,77 @@ +package cn.estsh.i3plus.pojo.mes.model; + +import io.swagger.annotations.ApiParam; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MesEquTaskStandardModel implements Serializable { + @ApiParam("id") + private Long id; + + @ApiParam("设备代码") + private String equipmentCode; + + @ApiParam("设备名称") + private String equipmentName; + + @ApiParam("作业类型") + private Integer taskType; + + @ApiParam("操作项") + private Integer actionItem; + + @ApiParam("操作标准") + private String actionStandard; + + @ApiParam("操作指导") + private String actionGuide; + + @ApiParam("生产线") + private String workCenterCode; + + @ApiParam(value ="组织代码") + public String organizeCode; + + @ApiParam(value = "有效性") + public Integer isValid; + + @ApiParam(value = "是否已删除") + public Integer isDeleted; + + @ApiParam(value = "创建用户") + public String createUser; + + @ApiParam(value = "创建日期") + public String createDatetime; + + @ApiParam(value = "修改人") + public String modifyUser; + + @ApiParam(value = "修改日期") + public String modifyDatetime; + + + public MesEquTaskStandardModel() { + + } + + public MesEquTaskStandardModel(Long id, String equipmentCode, String equipmentName, Integer taskType, Integer actionItem, String actionStandard, String actionGuide, String workCenterCode, String organizeCode, Integer isValid, Integer isDeleted, String createUser, String createDatetime, String modifyUser, String modifyDatetime) { + this.id = id; + this.equipmentCode = equipmentCode; + this.equipmentName = equipmentName; + this.taskType = taskType; + this.actionItem = actionItem; + this.actionStandard = actionStandard; + this.actionGuide = actionGuide; + this.workCenterCode = workCenterCode; + this.organizeCode = organizeCode; + this.isValid = isValid; + this.isDeleted = isDeleted; + this.createUser = createUser; + this.createDatetime = createDatetime; + this.modifyUser = modifyUser; + this.modifyDatetime = modifyDatetime; + } +} diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java index cfa042c..63cad36 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/model/MesEquipmentModel.java @@ -7,7 +7,7 @@ import java.io.Serializable; @Data public class MesEquipmentModel implements Serializable { - @ApiParam(value ="id") + @ApiParam("id") private Long id; @ApiParam("设备代码") @@ -19,34 +19,34 @@ public class MesEquipmentModel implements Serializable { @ApiParam("设备状态") private Integer status; - @ApiParam(value ="生产线") + @ApiParam("生产线") private String workCenterCode; - @ApiParam(value ="工位") + @ApiParam("工位") private String workCellCode; - @ApiParam(value ="区域") + @ApiParam("区域") private String areaCode; - @ApiParam(value ="设备工位关联ID") + @ApiParam("设备工位关联ID") private Long wcId; - @ApiParam(value ="设备&工位") + @ApiParam("设备&工位") private String equipmentNameAndworkCellName; @ApiParam("设备类型") private Integer equipmentType; - @ApiParam(value ="设备类别") + @ApiParam("设备类别") private String equipmentCategory; - @ApiParam(value ="备注") + @ApiParam("备注") private String memo; - @ApiParam(value ="设备型号") + @ApiParam("设备型号") private String equipmentModel; - @ApiParam(value ="设备规格") + @ApiParam("设备规格") private String equipmentSpec; @ApiParam("制造商") @@ -64,25 +64,25 @@ public class MesEquipmentModel implements Serializable { @ApiParam("连接类型") private Integer connectType; - @ApiParam(value ="组织代码") + @ApiParam("组织代码") public String organizeCode; - @ApiParam(value = "有效性") + @ApiParam( "有效性") public Integer isValid; - @ApiParam(value = "是否已删除") + @ApiParam( "是否已删除") public Integer isDeleted; - @ApiParam(value = "创建用户") + @ApiParam( "创建用户") public String createUser; - @ApiParam(value = "创建日期") + @ApiParam( "创建日期") public String createDatetime; - @ApiParam(value = "修改人") + @ApiParam( "修改人") public String modifyUser; - @ApiParam(value = "修改日期") + @ApiParam( "修改日期") public String modifyDatetime; diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesEquTaskStandardRepository.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesEquTaskStandardRepository.java new file mode 100644 index 0000000..49e83b9 --- /dev/null +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/repository/MesEquTaskStandardRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.mes.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.mes.bean.MesEquTaskStandard; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : 王杰 + * @CreateDate : 2019-10-11 + * @Modify: + **/ +@Repository +public interface MesEquTaskStandardRepository extends BaseRepository { +} From a79769d229e9df3e51627e0374ab4a00ec6751a9 Mon Sep 17 00:00:00 2001 From: jokelone Date: Tue, 15 Oct 2019 10:52:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?mes-pcn=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/MesEnumUtil.java | 47 +++++++++++++ .../i3plus/pojo/base/enumutil/MesPcnEnumUtil.java | 77 +++++++++++++++++++++- 2 files changed, 123 insertions(+), 1 deletion(-) 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 b6e1b2c..70e549b 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 @@ -12,6 +12,53 @@ import com.fasterxml.jackson.annotation.JsonFormat; public class MesEnumUtil { /** + * mes过程质量检测类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MES_QC_CHECK_TYPE { + + FIRST_CHECK(10, "首检"), + ON_SITE_CHECK(20, "巡检"), + END_CHECK(30, "尾检"); + + private int value; + private String description; + + MES_QC_CHECK_TYPE(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; + } + + public static Integer descriptionOfValue(String description) { + Integer tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].description.equals(description)) { + tmp = values()[i].value; + } + } + return tmp; + } + } + + /** * mes设备类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java index c21185e..19ca8a0 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/MesPcnEnumUtil.java @@ -817,7 +817,8 @@ public class MesPcnEnumUtil { OPEN(30, "启动"), PAUSE(40, "暂停"), CANCEL(50, "取消"), - CLOSE(60, "关闭"); + CLOSE(60, "关闭"), + COMPLETE(70, "完成"); private int value; private String description; @@ -1163,6 +1164,80 @@ public class MesPcnEnumUtil { } /** + * 条码生成业务类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum COMPANY_TYPE { + RULECODE("ruleCode", "规则编码"), + PREFIX("prefix", "前缀"), + PART_NO("partNo", "物料号"), + CUST_PART_NO("custPartNo", "客户物料号"), + CUST_CODE("custCode", "客户代码"), + PROD_LOCATION("prodLocation", "产地"), + YEAR("year", "年"), + MOTH("month", "月"), + DAY("day", "日"), + HOUR("hour", "小时"), + MINUTE("minute", "分钟"), + SECOND("second", "秒"), + SERIAL("serialNo", "序列号"); + + private String value; + private String description; + + COMPANY_TYPE(String value, String description) { + this.value = value; + this.description = description; + } + + public String getValue() { + return value; + } + + public String getDescription() { + return description; + } + } + + + /** + * mes工步类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum MES_STEP_TYPE { + + AUTO_RUN(10, "自动执行"), + SCAN_RUN(20, "扫描执行"); + + + private Integer value; + private String description; + + MES_STEP_TYPE(Integer value, String description) { + this.value = value; + this.description = description; + } + + public Integer getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static String valueOfDescription(String val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value.equals(val)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** * MesRoute 流程的类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT)