From 804574090f75703357673244300c1f82c2be1e05 Mon Sep 17 00:00:00 2001 From: "jhforever.wang@estsh.com" Date: Fri, 27 Sep 2019 10:52:30 +0800 Subject: [PATCH] =?UTF-8?q?pcn=E7=94=9F=E4=BA=A7=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i3plus/pojo/base/enumutil/MesPcnEnumUtil.java | 478 ++++++++++++++++++++- .../i3plus/pojo/mes/pcn/bean/MesPartCategory.java | 42 ++ .../i3plus/pojo/mes/pcn/bean/MesWorkOrder.java | 4 + .../pcn/repository/MesPartCategoryRepository.java | 16 + .../i3plus/pojo/mes/pcn/sqlpack/MesHqlPack.java | 65 +++ .../estsh/i3plus/pojo/mes/bean/MesWorkOrder.java | 4 + 6 files changed, 602 insertions(+), 7 deletions(-) create mode 100644 modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPartCategory.java create mode 100644 modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPartCategoryRepository.java 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 f9dbb36..a93ebf4 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 @@ -350,14 +350,16 @@ public class MesPcnEnumUtil { @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum WORK_CENTER_RUNNING_STATUS { - RUNNING(1, "开线"), - STOPPED(2, "停线"); + RUNNING(1, "start", "开线"), + STOPPED(2, "stop", "停线"); private int value; + private String code; private String description; - WORK_CENTER_RUNNING_STATUS(int value, String description) { + WORK_CENTER_RUNNING_STATUS(int value, String code, String description) { this.value = value; + this.code = code; this.description = description; } @@ -365,6 +367,10 @@ public class MesPcnEnumUtil { return value; } + public String getCode() { + return code; + } + public String getDescription() { return description; } @@ -378,6 +384,16 @@ public class MesPcnEnumUtil { } return tmp; } + + public static String valueOfCode(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].code; + } + } + return tmp; + } } /** @@ -386,10 +402,10 @@ public class MesPcnEnumUtil { @JsonFormat(shape = JsonFormat.Shape.OBJECT) public enum WC_CHECK_TYPE { - PERSON(10, "person", "人"), - EQUIPMENT(20, "equipment", "机"), - MATERIAL(30, "material", "料"), - ROUTE(40, "route", "法"), + PERSON(10, "people", "人"), + EQUIPMENT(20, "equipments", "设备"), + MATERIAL(30, "materials", "物料"), + ROUTE(40, "routes", "工艺"), ONLINE_SIGNAL(50, "onlineSignal", "开线信号"); private int value; @@ -423,6 +439,16 @@ public class MesPcnEnumUtil { } return tmp; } + + public static String valueOfCode(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].code; + } + } + return tmp; + } } /** @@ -498,4 +524,442 @@ public class MesPcnEnumUtil { } + /** + * 设备连接类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum EQP_CONNECT_TYPE { + + PLC(10, "PLC"), + DB(20, "DB"), + OTHER(30,"OTHER"); + + private int value; + private String description; + + EQP_CONNECT_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; + } + } + + /** + * MesPlanOrder实体对应的status值 计划状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PLAN_ORDER_STATUS { + + CREATE(10, "CREATED", "创建"), + DE_COMPOSE_ING(20, "DE_COMPOSE_ING", "分解中"), + DE_COMPOSE_ED(30, "DE_COMPOSE_ED", "分解完成"), + CLOSE(40, "CLOSE", "关闭"); + + private int value; + private String code; + private String description; + + PLAN_ORDER_STATUS(int value, String code, String description) { + this.value = value; + this.code = code; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getCode() { + return code; + } + + 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; + } + } + + /** + * MesWorkOrder实体对应的workOrderStatus值 工单状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum WORK_ORDER_STATUS { + + CREATE(10, "创建"), + LANDED(20, "下达"), + OPEN(30, "启动"), + PAUSE(40, "暂停"), + CANCEL(50, "取消"), + CLOSE(60, "关闭"); + + private int value; + private String description; + + WORK_ORDER_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; + } + } + + /** + * MesWorkOrder实体对应的workOrderType值 工单类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum WORK_ORDER_TYPE { + + STANDARD_ORDER(10, "标准工单"), + BTS_ORDER(20, "BTS工单"), + ATTEMPT_ORDER(30, "试制工单"); + + private int value; + private String description; + + WORK_ORDER_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; + } + } + + /** + * MesPlanOrder实体对应的planType值 计划类型 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PLAN_ORDER_TYPE { + + STANDARD_ORDER(10, "标准"); + + private int value; + private String description; + + PLAN_ORDER_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; + } + } + + /** + * MesPlanOrder实体对应的source值 计划来源 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PALN_ORDER_SOURCE { + + MES("MES", "来源于MES"), + SAP("SAP", "来源于SAP"); + + private String value; + private String description; + + PALN_ORDER_SOURCE(String value, String description) { + this.value = value; + this.description = description; + } + + public String 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.equals(val)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * MesWorkOrder实体对应的source值 计划来源 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum WORK_ORDER_SOURCE { + + MES("MES", "来源于MES"), + AMES("AMES", "来源于AMES"), + SAP("SAP", "来源于SAP"), + CREATE("CREATE", "手工新增"), + RESOLVE("RESOLVE", "计划分解"); + + private String value; + private String description; + + WORK_ORDER_SOURCE(String value, String description) { + this.value = value; + this.description = description; + } + + public String 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.equals(val)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * MesQueueOrder实体对应的status值 队列主表状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum QUEUE_ORDER_STATUS { + + NORMAL(10, "正常"), + ONLINE(20, "已上线"), + OFFLINE(30, "已下线"), + CLOSE(40, "已关闭"), + ; + + private int value; + private String description; + + QUEUE_ORDER_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; + } + } + + /** + * MesQueueOrderDetail实体对应的status值 队列详情状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum QUEUE_ORDER_DETAIL_STATUS { + + NORMAL(10, "正常"), + CLOSE(20, "关闭"); + + private int value; + private String description; + + QUEUE_ORDER_DETAIL_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; + } + } + + /** + * MesPartCategory实体对应的categoryType值 条码表条码质量状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum PART_CATEGORY_TYPE { + + CATEGORY_ONE("Category1", "类型1"), + CATEGORY_TWO("Category2", "类型2"), + CATEGORY_THREE("Category3", "类型3"); + + private String value; + private String description; + + PART_CATEGORY_TYPE(String value, String description) { + this.value = value; + this.description = description; + } + + public String 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 (val.equals(values()[i].value)) { + tmp = values()[i].description; + } + } + return tmp; + } + } + + /** + * MesWorkOrder实体对应的approvalStatus值 审批状态 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum WORK_ORDER_APPROVAL_STATUS { + + WAIT_APPROVAL(10, "待审批"), + COMPLETE_APPROVAL(20, "已审批"), + REJECT_APPROVAL(30, "驳回"); + + private int value; + private String description; + + WORK_ORDER_APPROVAL_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; + } + + public static String valueOfDescription2(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description.equals("已审批") ? "审批" : values()[i].description; + } + } + return tmp; + } + } + + } diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPartCategory.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPartCategory.java new file mode 100644 index 0000000..77e74cb --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesPartCategory.java @@ -0,0 +1,42 @@ +package cn.estsh.i3plus.pojo.mes.pcn.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; + +/** + * @Description :零件种类 + * @Reference : + * @Author : jack.jia + * @CreateDate : 2019-04-02 + * @Modify: + **/ +@Data +@Entity +@DynamicInsert +@DynamicUpdate +@EqualsAndHashCode(callSuper = true) +@Table(name="MES_PART_CATEGORY") +@Api("零件种类") +public class MesPartCategory extends BaseBean { + @Column(name="CATEGORY_CODE") + @ApiParam("分类代码") + private String categoryCode; + + @Column(name="CATEGORY_NAME") + @ApiParam("分类名称") + private String categoryName; + + @Column(name="CATEGORY_TYPE") + @ApiParam("分类类型") + private String categoryType; +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesWorkOrder.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesWorkOrder.java index 9ff0258..ea9de66 100644 --- a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesWorkOrder.java +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/bean/MesWorkOrder.java @@ -163,6 +163,10 @@ public class MesWorkOrder extends BaseBean { public String prodCfgName; @Transient + @ApiParam("区域代码名称") + private String areaCodeName; + + @Transient // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiParam(value="计划开始日期查询用,查询开始日期",example = "2018-12-31 23:59:59") public String startTimeStart; diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPartCategoryRepository.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPartCategoryRepository.java new file mode 100644 index 0000000..eb12a69 --- /dev/null +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/repository/MesPartCategoryRepository.java @@ -0,0 +1,16 @@ +package cn.estsh.i3plus.pojo.mes.pcn.repository; + +import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository; +import cn.estsh.i3plus.pojo.mes.pcn.bean.MesPartCategory; +import org.springframework.stereotype.Repository; + +/** + * @Description : + * @Reference : + * @Author : jack.jia + * @CreateDate : 2019-04-02 + * @Modify: + **/ +@Repository +public interface MesPartCategoryRepository extends BaseRepository { +} diff --git a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/sqlpack/MesHqlPack.java b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/sqlpack/MesHqlPack.java index 4e0281a..61e57f3 100644 --- a/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/sqlpack/MesHqlPack.java +++ b/modules/i3plus-pojo-mes-pcn/src/main/java/cn/estsh/i3plus/pojo/mes/pcn/sqlpack/MesHqlPack.java @@ -33,6 +33,20 @@ public class MesHqlPack { } /** + * 通用查询条件 + * + * @param organizeCode + * @return + */ + public static DdlPackBean getAllBaseDataByNormalPro(BaseBean baseBean, String organizeCode) { + DdlPackBean packBean = new DdlPackBean(); + DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean); + DdlPreparedPack.getNumEqualPack(baseBean.getIsValid(), "isValid", packBean); + DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_DEAL.NO.getValue(), "isDeleted", packBean); + return packBean; + } + + /** * MES PCN系统配置信息条件查询 * * @param mesConfig @@ -153,4 +167,55 @@ public class MesHqlPack { return packBean; } + /** + * 物料信息查询条件封装 + * + * @param mesPart + * @return + */ + public static DdlPackBean getPartCondition(MesPart mesPart, String organizeCode) { + DdlPackBean packBean = new DdlPackBean(); + DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean); + DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean); + DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_DEAL.NO.getValue(), "isDeleted", packBean); + + if (StringUtils.isNotEmpty(mesPart.getPartNo())) { + DdlPreparedPack.getStringLikerPack(mesPart.getPartNo(), "partNo", packBean); + } + if (StringUtils.isNotEmpty(mesPart.getPartName())) { + DdlPreparedPack.getStringLikerPack(mesPart.getPartName(), "partName", packBean); + } + if (StringUtils.isNotEmpty(mesPart.getCategoryCode1())) { + DdlPreparedPack.getStringEqualPack(mesPart.getCategoryCode1(), "categoryCode1", packBean); + } + if (StringUtils.isNotEmpty(mesPart.getCategoryCode2())) { + DdlPreparedPack.getStringEqualPack(mesPart.getCategoryCode2(), "categoryCode2", packBean); + } + if (StringUtils.isNotEmpty(mesPart.getCategoryCode3())) { + DdlPreparedPack.getStringEqualPack(mesPart.getCategoryCode3(), "categoryCode3", packBean); + } + + DdlPreparedPack.getOrderDefault(mesPart); + DdlPreparedPack.getOrderByPack(new Object[]{"2"}, new String[]{mesPart.getOrderByParam()}, packBean); + return packBean; + } + + /** + * MES 客户信息查询条件封装 + * + * @param customer + * @return + */ + public static DdlPackBean getMesCustomer(MesCustomer customer, String organizeCode) { + DdlPackBean packBean = getAllBaseDataByNormalPro(customer, organizeCode); + if (StringUtils.isNotEmpty(customer.getCustomerCode())) { + DdlPreparedPack.getStringLikerPack(customer.getCustomerCode(), "customerCode", packBean); + } + if (StringUtils.isNotEmpty(customer.getCustomerName())) { + DdlPreparedPack.getStringLikerPack(customer.getCustomerName(), "customerName", packBean); + } + + return packBean; + } + } diff --git a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesWorkOrder.java b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesWorkOrder.java index b22729f..8c0735a 100644 --- a/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesWorkOrder.java +++ b/modules/i3plus-pojo-mes/src/main/java/cn/estsh/i3plus/pojo/mes/bean/MesWorkOrder.java @@ -163,6 +163,10 @@ public class MesWorkOrder extends BaseBean { public String prodCfgName; @Transient + @ApiParam("区域代码名称") + private String areaCodeName; + + @Transient // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @ApiParam(value="计划开始日期查询用,查询开始日期",example = "2018-12-31 23:59:59") public String startTimeStart;