zoukankan      html  css  js  c++  java
  • enum StatCode

    public enum StatCode {
        NORMAL(0,"正常"),
        FLAME_OUT(1,"熄火"),
        NOT_INSTALL(2,"未安装"),
        NOT_LOCATE(3,"未定位"),
        POWER_CUT(4,"断电"),
        NOT_ONLINE1(11,"离线I"),
        NOT_ONLINE2(12,"离线II"),
        NOT_ONLINE3(13,"离线III"),
        NOT_ONLINE4(14,"离线IV"),
        NOT_ONLINE5(15,"离线V");
    
        private int code;
        private String statString;
    
        private StatCode(int _code,String _statString) {
            this.code = _code;
            this.statString = _statString;
        }
    
        public int getCode() {
            return code;
        }
    
        public String getStatString() {
            return statString;
        }
    }
    import com.yd.lbs.gps.tools.jt808.bodyPartImpl.JT808MsgBody_0x0200;
    import com.yd.lbs.gps.tools.tanway.entity.VehPackUnit;
    import com.yd.lbs.gps.tools.util.StatCode;
    
    public class VehStatusUtil {
         
        public static String getStatus(VehPackUnit vpu) {
    
            if (vpu == null)
                return "";
            //断电
            if (VpuUtil.validatePowerCut(vpu))
                return String.valueOf(StatCode.POWER_CUT.getCode());
            //未安装
            if (VpuUtil.validateNotInstall(vpu))
                return String.valueOf(StatCode.NOT_INSTALL.getCode());
            //未定位
            if (VpuUtil.validateNotLocate(vpu)) 
                return String.valueOf(StatCode.NOT_LOCATE.getCode());
            //熄火
            if (VpuUtil.validateFlameout(vpu))
                return String.valueOf(StatCode.FLAME_OUT.getCode());        
            //正常
            return String.valueOf(StatCode.NORMAL.getCode());
        }
    
        public static String getStatus(JT808MsgBody_0x0200 position)  {
    
            if (position == null)
                return "";
            //断电
            if (JT808MsgBody0200Util.validatePowerCut(position))
                return String.valueOf(StatCode.POWER_CUT.getCode());
            //未安装
            if (JT808MsgBody0200Util.validateNotInstall(position))
                return String.valueOf(StatCode.NOT_INSTALL.getCode());
            //未定位
            if (JT808MsgBody0200Util.validateNotLocate(position)) 
                return String.valueOf(StatCode.NOT_LOCATE.getCode());    
            //熄火
            if (JT808MsgBody0200Util.validateFlameout(position))
                return String.valueOf(StatCode.FLAME_OUT.getCode());
            //正常
            return String.valueOf(StatCode.NORMAL.getCode());
        }
    
    }
  • 相关阅读:
    sentinel集群刚开始好的,过几分钟就崩了
    redis主从文件权限问题
    centos7下解决keepalived双机都为master问题
    windows局域网共享文件夹
    最近JS的一些问题
    总结下html、css的一些东西
    Less、一些选择器
    常见布局、媒体查询
    audio标签、HOVER效果、rgba和opacity、隐藏场景
    护工列表页
  • 原文地址:https://www.cnblogs.com/tonggc1668/p/7525183.html
Copyright © 2011-2022 走看看