From 5888b17cd8861baf80d2d0c8358a10b75de6bdc7 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 15 Oct 2021 16:59:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9B=E8=BD=A6=E9=97=B4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/estsh/i3plus/pojo/aps/bean/Material.java | 2 +- .../i3plus/pojo/base/enumutil/ApsEnumUtil.java | 311 ++++++--------------- 2 files changed, 84 insertions(+), 229 deletions(-) diff --git a/modules/i3plus-pojo-aps/src/main/java/cn/estsh/i3plus/pojo/aps/bean/Material.java b/modules/i3plus-pojo-aps/src/main/java/cn/estsh/i3plus/pojo/aps/bean/Material.java index cb1c5e3..bb8c32d 100644 --- a/modules/i3plus-pojo-aps/src/main/java/cn/estsh/i3plus/pojo/aps/bean/Material.java +++ b/modules/i3plus-pojo-aps/src/main/java/cn/estsh/i3plus/pojo/aps/bean/Material.java @@ -206,7 +206,7 @@ public class Material extends BaseAPS { public WorkShop getWorkShop() { return BeanRelation.get(this, EMaterial.WorkShop); } public void setWorkShop(WorkShop workShop) { - this.workShopId = workShop != null ? workShop.getId() : 0l; + this.workShopId = workShop != null ? workShop.getId() : 0; BeanRelation.set(this, EMaterial.WorkShop, workShop); } } diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ApsEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ApsEnumUtil.java index 2dabd59..5d911a9 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ApsEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/ApsEnumUtil.java @@ -4,11 +4,8 @@ package cn.estsh.i3plus.pojo.base.enumutil; import com.fasterxml.jackson.annotation.JsonFormat; /** - * @Description : - * @Reference : * @Author : jason.niu * @CreateDate : 2019-11-11 - * @Modify: **/ public class ApsEnumUtil { @@ -25,8 +22,8 @@ public class ApsEnumUtil { SATURDAY(32, "星期六"), SUNDAY(64, "星期天"); - private int value; - private String description; + private final int value; + private final String description; CALENDAR_WEEK(int value, String description) { this.value = value; @@ -63,8 +60,8 @@ public class ApsEnumUtil { INNER_PRODUCT("INNER_PRODUCT", "中间品"), VIRTUAL("VIRTUAL", "虚拟件"); - private String value; - private String description; + private final String value; + private final String description; MATERIAL_TYPE(String value, String description) { this.value = value; @@ -81,31 +78,6 @@ public class ApsEnumUtil { } /** - * 物料类型 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum ORDER_VALID_TYPE { - VALID("VALID", "有效"), - INVALID("INVALID", "无效"); - - private String value; - private String description; - - ORDER_VALID_TYPE(String value, String description) { - this.value = value; - this.description = description; - } - - public String getValue() { - return value; - } - - public String getDescription() { - return description; - } - } - - /** * 物料报表统计类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -114,8 +86,8 @@ public class ApsEnumUtil { PRODUCE("PRODUCE", "生产"), INVENTORY("INVENTORY", "库存"); - private String value; - private String description; + private final String value; + private final String description; MATERIAL_REPORT_TYPE(String value, String description) { this.value = value; @@ -143,8 +115,8 @@ public class ApsEnumUtil { ONE_WEEK("ONE_WEEK", "一周"), ONE_MONTH("ONE_MONTH", "一月"); - private String value; - private String description; + private final String value; + private final String description; REPORT_TIME_SPAN(String value, String description) { this.value = value; @@ -169,8 +141,8 @@ public class ApsEnumUtil { SELF_MAKE("SELF_MAKE", "自制"), // 自制 PURCHASE("PURCHASE", "采购"); // 采购 - private String value; - private String description; + private final String value; + private final String description; PREPARE_TYPE(String value, String description) { this.value = value; @@ -195,8 +167,8 @@ public class ApsEnumUtil { BATCH("BATCH", "批量补充"), ONEBYONE("ONEBYONE", "一对一补充"); - private String value; - private String description; + private final String value; + private final String description; REPLENISHMENT_TYPE(String value, String description) { this.value = value; @@ -222,8 +194,8 @@ public class ApsEnumUtil { PURCHASE(2, "采购制约"), PRODUCT(4, "生产制约"); - private int value; - private String description; + private final int value; + private final String description; MATERIAL_ASSIGN_LIMIT(int value, String description) { this.value = value; @@ -257,8 +229,8 @@ public class ApsEnumUtil { POSITIVE("POSITIVE", "正向"), REVERSE("REVERSE", "逆向"); - private String value; - private String description; + private final String value; + private final String description; DIRECTION(String value, String description) { this.value = value; @@ -275,32 +247,6 @@ public class ApsEnumUtil { } /** - * 尾数处理方式 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum TAIL_DEAL { - NODEAL("NODEAL", "不处理"), - CEILING("CEILING", "向下"), - PUSHFRONT("PUSHFRONT", "向上"); - - private String value; - private String description; - - TAIL_DEAL(String value, String description) { - this.value = value; - this.description = description; - } - - public String getValue() { - return value; - } - - public String getDescription() { - return description; - } - } - - /** * 则管理中规则的类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -311,8 +257,8 @@ public class ApsEnumUtil { FIELD_SET("FIELD_SET", "字段赋值"), FLUSH_PLAN("FLUSH_PLAN", "刷新计划"); - private String value; - private String description; + private final String value; + private final String description; RULE_TYPE(String value, String description) { this.value = value; @@ -337,8 +283,8 @@ public class ApsEnumUtil { SINGLE("SINGLE", "单资源"), BATCH("BATCH", "炉资源"); - private String value; - private String description; + private final String value; + private final String description; RESOURCE_CLASS(String value, String description) { this.value = value; @@ -355,32 +301,6 @@ public class ApsEnumUtil { } /** - * 锁定时间的取值方式 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum RESOURCE_LOCK_TYPE { - NONE("NONE", "不锁定"), - PRODUCE_BEGIN("PRODUCE_BEGIN", "后工序生产开始时刻"), - PRODUCE_END("PRODUCE_END", "后工序生产结束时刻"); - - private String value; - private String description; - - RESOURCE_LOCK_TYPE(String value, String description) { - this.value = value; - this.description = description; - } - - public String getValue() { - return value; - } - - public String getDescription() { - return description; - } - } - - /** * 资源类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -388,8 +308,8 @@ public class ApsEnumUtil { MAIN("MAIN", "主资源"), ASS("ASS", "副资源"); - private String value; - private String description; + private final String value; + private final String description; RESOURCE_TYPE(String value, String description) { this.value = value; @@ -414,8 +334,8 @@ public class ApsEnumUtil { PRODUCE(2, "生产"), // 生产 POST_SET(4, "后设置"); // 后设置 - private int value; - private String description; + private final int value; + private final String description; EFFICIENCY_EFFECT(int value, String description){ this.value = value; @@ -455,8 +375,8 @@ public class ApsEnumUtil { RESOURCE_USEAGE("RESOURCE_USEAGE", "资源使用率"), CUST_EXPRESSION("CUST_EXPRESSION", "自定义表达式"); - private String value; - private String description; + private final String value; + private final String description; RESOURCE_CHOISE_RULE(String value, String description) { this.value = value; @@ -485,8 +405,8 @@ public class ApsEnumUtil { NO_POR("NO_POR", "指示完毕"), NO_PPRS("NO_PPRS", "已确认"); - private String value; - private String description; + private final String value; + private final String description; ORDER_DEL_LIMIT(String value, String description) { this.value = value; @@ -515,8 +435,8 @@ public class ApsEnumUtil { MIN_ALL_RESOURCE("MIN_ALL_RESOURCE", "主副资源最小值"), AVG_ALL_RESOURCE("AVG_ALL_RESOURCE", "主副资源平均值"); - private String value; - private String description; + private final String value; + private final String description; RES_COMB_TIME_TYPE(String value, String description) { this.value = value; @@ -533,32 +453,6 @@ public class ApsEnumUtil { } /** - * 时间圆整方式 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum TIME_ROUND_TYPE { - UP("UP", "向上"), - DOWN("DOWN", "向下"), - ROUNDING("ROUNDING", "四舍五入"); - - private String value; - private String description; - - TIME_ROUND_TYPE(String value, String description) { - this.value = value; - this.description = description; - } - - public String getValue() { - return value; - } - - public String getDescription() { - return description; - } - } - - /** * 工艺路径有效性判断类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -567,8 +461,8 @@ public class ApsEnumUtil { CALC_LET_LT("CALC_LET_LT", "与最晚结束时刻计算值-提前期做比较"), BASE_TIME("BASE_TIME", "与基准时刻做比较"); - private String value; - private String description; + private final String value; + private final String description; ROUTING_VALID_TYPE(String value, String description) { this.value = value; @@ -597,8 +491,8 @@ public class ApsEnumUtil { FIFTH_ASS("FIFTH_ASS", "第五套副资源"), SIXTH_ASS("SIXTH_ASS", "第六套副资源"); - private String value; - private String description; + private final String value; + private final String description; USE_TYPE(String value, String description) { this.value = value; @@ -623,8 +517,8 @@ public class ApsEnumUtil { ASS_PLAN("ASS_PLAN", "副资源计划"), BATCH_PLAN("BATCH_PLAN", "炉资源计划"); - private String value; - private String description; + private final String value; + private final String description; WORK_PLAN_TYPE(String value, String description) { this.value = value; @@ -648,8 +542,8 @@ public class ApsEnumUtil { INNER("INNER", "订单内关联"), OUTER("OUTER", "订单间关联"); - private String value; - private String description; + private final String value; + private final String description; WORK_RELATION_TYPE(String value, String description) { this.value = value; @@ -691,8 +585,8 @@ public class ApsEnumUtil { TOP_ORDER_PRIORITY("TOP_ORDER_PRIORITY", "顶层订单优先级"), CUST_EXPRESSION("CUST_EXPRESSION", "自定义表达式"); - private String value; - private String description; + private final String value; + private final String description; WORK_SORT_RULE(String value, String description) { this.value = value; @@ -719,8 +613,8 @@ public class ApsEnumUtil { BATCH("BATCH", "按批量分割"), REMAINDER("REMAINDER", "按余数分割"); - private String value; - private String description; + private final String value; + private final String description; WORK_SPLIT_TYPE(String value, String description) { this.value = value; @@ -748,8 +642,8 @@ public class ApsEnumUtil { STARTPRODUCT("STARTPRODUCT", "生产中"), FINISH("FINISH", "完成"); - private String value; - private String description; + private final String value; + private final String description; WORK_STATUS(String value, String description) { this.value = value; @@ -777,8 +671,8 @@ public class ApsEnumUtil { // 此工作参与排程 NORMAL("NORMAL", "普通工作"); - private String value; - private String description; + private final String value; + private final String description; WORK_TYPE(String value, String description) { this.value = value; @@ -803,8 +697,8 @@ public class ApsEnumUtil { POST_SET("POST_SET", "只对后设置影响"), ALL("ALL", "对前后设置都产生影响"); - private String value; - private String description; + private final String value; + private final String description; DYNAMIC_SET_TYPE(String value, String description) { this.value = value; @@ -829,8 +723,8 @@ public class ApsEnumUtil { MAX("MAX", "取最大值"), SUM("SUM", "求和"); - private String value; - private String description; + private final String value; + private final String description; DYNAMIC_SET_CALC(String value, String description) { this.value = value; @@ -856,8 +750,8 @@ public class ApsEnumUtil { EE("EE", "前工序结束,后工序结束"), SSEE("SSEE", "前后工序同时开始或同时结束"); - private String value; - private String description; + private final String value; + private final String description; CONSTRAINT_TYPE(String value, String description) { this.value = value; @@ -881,8 +775,8 @@ public class ApsEnumUtil { ENABLE("ENABLE", "加班"), DISABLE("DISABLE", "下班"); - private String value; - private String description; + private final String value; + private final String description; CALENDAR_TYPE(String value, String description) { this.value = value; @@ -906,8 +800,8 @@ public class ApsEnumUtil { REPLACE("REPLACE", "替代导入"), DIFF("DIFF", "差分导入"); - private String value; - private String description; + private final String value; + private final String description; IMPORT_DETAIL_TYPE(String value, String description) { this.value = value; @@ -924,45 +818,6 @@ public class ApsEnumUtil { } /** - * 字段赋值对象 - */ - @JsonFormat(shape = JsonFormat.Shape.OBJECT) - public enum FIELD_SET_BEAN { - Material("Material", "物料"), - ProductRouting("ProductRouting", "工艺路线"), - Operation("Operation", "工序"), - OperInput("OperInput", "工序输入"), - OperOutput("OperOutput", "工序输出"), - OperResource("OperResource", "工序资源"), - StandOperation("StandOperation", "标准工序"), - SalesOrder("SalesOrder", "销售订单"), - ProductOrder("ProductOrder", "生产订单"), - PurchaseOrder("PurchaseOrder", "采购订单"), - Inventory("Inventory", "库存"), - Work("Work", "工作"), - WorkInput("WorkInput", "工作输入"), - WorkOutput("WorkOutput", "工作输出"), - WorkResource("WorkResource", "工作资源"), - WorkRelation("WorkRelation", "工作关联"); - - private String value; - private String description; - - FIELD_SET_BEAN(String value, String description) { - this.value = value; - this.description = description; - } - - public String getValue() { - return value; - } - - public String getDescription() { - return description; - } - } - - /** * 计划类型 */ @JsonFormat(shape = JsonFormat.Shape.OBJECT) @@ -971,8 +826,8 @@ public class ApsEnumUtil { PRODUCE("", "生产"), POST_SET("", "后设置"); - private String value; - private String description; + private final String value; + private final String description; PLAN_TYPE(String value, String description) { this.value = value; @@ -998,8 +853,8 @@ public class ApsEnumUtil { ORACLE("ORACLE", "Oracle"), SQLSERVER("SQLSERVER", "SqlServer"); - private String value; - private String description; + private final String value; + private final String description; DATA_LINK_TYPE(String value, String description) { this.value = value; @@ -1040,8 +895,8 @@ public class ApsEnumUtil { QUERY_LIST("QUERY_LIST", "通过接口获取下拉选项"), COLOR_PICKER("COLOR_PICKER", "颜色选择框"); - private String value; - private String description; + private final String value; + private final String description; EDIT_TYPE(String value, String description) { this.value = value; @@ -1079,8 +934,8 @@ public class ApsEnumUtil { OBJECT("OBJECT", "关联对象,下来选择关联对象的Code值"), LIST("LIST", "对象集合,不可编辑。"); - private String value; - private String description; + private final String value; + private final String description; FIELD_TYPE(String value, String description) { this.value = value; @@ -1110,8 +965,8 @@ public class ApsEnumUtil { ONE_WEEK("ONE_WEEK", "1周"), ONE_MONTH("ONE_MONTH", "1月"); - private String value; - private String description; + private final String value; + private final String description; RESOURCE_LOAD_SPAN(String value, String description) { this.value = value; @@ -1139,8 +994,8 @@ public class ApsEnumUtil { STARTPRODUCT("STARTPRODUCT", "开始生产"), FINISH("FINISH", "完成"); - private String value; - private String description; + private final String value; + private final String description; ORDER_STATUS(String value, String description) { this.value = value; @@ -1165,8 +1020,8 @@ public class ApsEnumUtil { CHANGE("CHANGE", "改带"), COMMIT("COMMIT", "确认"); - private String value; - private String description; + private final String value; + private final String description; SALES_ORDER_STATUS(String value, String description) { this.value = value; @@ -1191,8 +1046,8 @@ public class ApsEnumUtil { SPLIT_MAIN("SPLIT_MAIN", "拆分下发(主)"), SPLIT_CHILD("SPLIT_CHILD", "拆分下发(子)"); - private String value; - private String description; + private final String value; + private final String description; SALES_ORDER_SPLIT_STATUS(String value, String description) { this.value = value; @@ -1216,8 +1071,8 @@ public class ApsEnumUtil { UNCOMMIT("UNCOMMIT", "待处理"), COMMIT("COMMIT", "确认"); - private String value; - private String description; + private final String value; + private final String description; SAFE_STOCK_ORDER_STATUS(String value, String description) { this.value = value; @@ -1241,8 +1096,8 @@ public class ApsEnumUtil { UNCOMMIT("UNCOMMIT", "待处理"), COMMIT("COMMIT", "确认"); - private String value; - private String description; + private final String value; + private final String description; INSERTED_ORDER_STATUS(String value, String description) { this.value = value; @@ -1266,8 +1121,8 @@ public class ApsEnumUtil { UNCOMMIT("UNCOMMIT", "未提交"), COMMIT("COMMIT", "提交"); - private String value; - private String description; + private final String value; + private final String description; FEED_BACK_STATUS(String value, String description) { this.value = value; @@ -1295,9 +1150,9 @@ public class ApsEnumUtil { SAFE_STOCK_ORDER("SAFE_STOCK_ORDER", "Q", "安全库存订单"), INSERTED_ORDER("INSERTED_ORDER", "I", "插单"); - private String value; - private String prefix; - private String description; + private final String value; + private final String prefix; + private final String description; APS_ORDER_TYPE(String value, String prefix, String description) { this.value = value; @@ -1332,8 +1187,8 @@ public class ApsEnumUtil { TWO_WRAPPING("TWO_WRAPPING", "二车间包布"), TWO_TRAINBEARER("TWO_TRAINBEARER", "二车间牵纱"); - private String value; - private String description; + private final String value; + private final String description; SANLUX_OPERATION_TYPE(String value, String description) { this.value = value;