| package com.zy.asrs.wcs.core.model.enums; | 
|   | 
| import com.zy.asrs.wcs.core.entity.BasConveyorSta; | 
| import com.zy.asrs.wcs.rcs.model.protocol.StaProtocol; | 
|   | 
| /** | 
|  * 站点状态枚举 | 
|  */ | 
| public enum SiteStatusType { | 
|   | 
|     // 自动 | 
|     SITE_AUTO, | 
|     // 非自动 | 
|     SITE_UNAUTO, | 
|     // 自动+有物+ID | 
|     SITE_AUTO_RUN_ID, | 
|     // 自动+有物 | 
|     SITE_AUTO_RUN, | 
|     // 自动+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; | 
|     } | 
|   | 
|     public static SiteStatusType process(BasConveyorSta basConveyorSta){ | 
|         if (basConveyorSta == null) { | 
|             return SITE_UNAUTO; | 
|         } | 
|         if (basConveyorSta.getAutoing() == null || basConveyorSta.getLoading() == null || basConveyorSta.getTaskNo() == null) { | 
|             return SITE_UNAUTO; | 
|         } | 
|         if (basConveyorSta.getAutoing().equals("Y") && basConveyorSta.getLoading().equals("Y") && basConveyorSta.getTaskNo() > 0) { | 
|             return SITE_AUTO_RUN_ID; | 
|         } | 
|         if (basConveyorSta.getAutoing().equals("Y") && basConveyorSta.getLoading().equals("Y")) { | 
|             return SITE_AUTO_RUN; | 
|         } | 
|         if (basConveyorSta.getAutoing().equals("Y") && basConveyorSta.getTaskNo() > 0) { | 
|             return SITE_AUTO_ID; | 
|         } | 
|         if (basConveyorSta.getAutoing().equals("Y")) { | 
|             return SITE_AUTO; | 
|         } | 
|         if (!basConveyorSta.getAutoing().equals("Y")) { | 
|             return SITE_UNAUTO; | 
|         } | 
|         return SITE_UNAUTO; | 
|     } | 
|   | 
| } |