From 84cffa40e13a64d8b91e393fd44e09c973d7ee99 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 14 八月 2020 15:53:03 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/domain/enums/SiteStatusType.java |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/asrs/domain/enums/SiteStatusType.java b/src/main/java/com/zy/asrs/domain/enums/SiteStatusType.java
index bc00e16..b3adb37 100644
--- a/src/main/java/com/zy/asrs/domain/enums/SiteStatusType.java
+++ b/src/main/java/com/zy/asrs/domain/enums/SiteStatusType.java
@@ -1,6 +1,8 @@
 package com.zy.asrs.domain.enums;
 
 
+import com.zy.core.model.protocol.StaProtocol;
+
 /**
  * 绔欑偣鐘舵�佹灇涓�
  */
@@ -8,15 +10,37 @@
 
     // 鑷姩
     SITE_AUTO,
-    // 闈炶嚜鍔�/鏀跺埌
+    // 闈炶嚜鍔�
     SITE_UNAUTO,
     // 鑷姩+鏈夌墿+ID
     SITE_AUTO_RUN_ID,
     // 鑷姩+鏈夌墿
     SITE_AUTO_RUN,
-    // 鑷姩+鏈夌墿+ID
+    // 鑷姩+ID
     SITE_AUTO_ID,
 
     ;
 
+    public static SiteStatusType process(StaProtocol staProtocol){
+        if (staProtocol == null) {
+            return null;
+        }
+        if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0) {
+            return SITE_AUTO_RUN_ID;
+        }
+        if (staProtocol.isAutoing() && staProtocol.isLoading()) {
+            return SITE_AUTO_RUN;
+        }
+        if (staProtocol.isAutoing() && staProtocol.getWorkNo() > 0) {
+            return SITE_AUTO_ID;
+        }
+        if (staProtocol.isAutoing()) {
+            return SITE_AUTO;
+        }
+        if (!staProtocol.isAutoing()) {
+            return SITE_UNAUTO;
+        }
+        return null;
+    }
+
 }

--
Gitblit v1.9.1