瀏覽代碼

初始化代码

guoyong 4 年之前
父節點
當前提交
bf488d2823

+ 0 - 30
src/main/java/com/aoyang/tms/common/TmsOrderStatus.java

@@ -1,30 +0,0 @@
-package com.aoyang.tms.common;
-
-/**
- * @Description: TMS运单作业状态常量类
- */
-public class TmsOrderStatus {
-
-    //已取消
-    public static final int CONCELED = -1;
-
-    //待执行
-    public static final int TODO = 0;
-
-    //前往装卸车点
-    public static final int ON_WAY = 1;
-
-    //装卸车等待
-    public static final int QUEUE = 2;
-
-    //成果报备中
-    public static final int SUBMIT = 3;
-
-    //已完成
-    public static final int COMPLETED = 4;
-
-    //已关闭
-    public static final int CLOSED = 5;
-
-
-}

+ 60 - 0
src/main/java/com/aoyang/tms/common/WorkOrderEnum.java

@@ -0,0 +1,60 @@
+package com.aoyang.tms.common;
+
+/**
+ * @Description: 作业状态枚举类
+ * @Author guoyong
+ * @Date 2022/4/20 17:05
+ * @Version 1.0
+ */
+public enum WorkOrderEnum {
+    //待执行
+    TODO(0, "待执行"),
+
+    //前往装卸车点
+    GOTO_WORK_SPOT(10, "前往装卸车点"),
+
+    //装卸车等待
+    WORK_WAIT(20, "装卸车等待"),
+
+    //成果报备中
+    RESULT_SUBMIT(30, "成果报备中"),
+
+    //已完成
+    COMPLETED(40, "已完成"),
+
+    //已关闭
+    CLOSED(50, "已关闭"),
+
+    //已取消
+    CONCELED(10, "已取消");
+
+
+    private Integer orderStatus;
+    private String orderStatusName;
+
+    WorkOrderEnum(Integer orderStatus, String orderStatusName) {
+        this.orderStatus = orderStatus;
+        this.orderStatusName = orderStatusName;
+    }
+
+    public static String getOrderStatusName(Integer orderStatus) {
+        if (orderStatus == null) {
+            return "";
+        }
+        WorkOrderEnum[] workOrderEnum = values();
+        for (WorkOrderEnum typenum : workOrderEnum) {
+            if (typenum.orderStatus().equals(orderStatus)) {
+                return typenum.orderStatusName();
+            }
+        }
+        return null;
+    }
+
+    public Integer orderStatus() {
+        return this.orderStatus;
+    }
+
+    public String orderStatusName() {
+        return this.orderStatusName;
+    }
+}