示例#1
0
class LoginType:
    """
        9.2登录类型
        login_type
    """
    Login               = ValueEntry(0, u'登进')
    Exit                = ValueEntry(1, u'登出')
示例#2
0
class UserSource:
    """
        1.2 用户注册来源
        source
    """
    BackgroundRegistration  = ValueEntry(0, u'后台注册')
    DriverSide              = ValueEntry(1, u'司机端')
示例#3
0
class TransNumberReturnType:
    """
        6.3是否一车往返
        is_link
    """
    Notreturn           = ValueEntry(0, u'不往返')
    Return              = ValueEntry(1, u'往返')
示例#4
0
class CommitsCollectType:
    """
        4.2是否收藏
        star
    """
    Uncollected         = ValueEntry(0, u'未收藏')
    Collected           = ValueEntry(1, u'已收藏')
示例#5
0
class TruckTrailerType:
    """
        2.6车辆表的车辆是否为挂车
        trailers
    """
    Nottrailer          = ValueEntry(0, u'非挂车')
    Trailer             = ValueEntry(1, u'挂车')
示例#6
0
class LineType:
    """
        10.2线路类型
        line_status
    """
    Normal              = ValueEntry(2, u'正式')
    Temporary           = ValueEntry(4, u'临时')
示例#7
0
class TriggerType:
    """
        3.1触发记录表的触发类型
        trigger_type
    """
    Enter               = ValueEntry(1, u'进')
    Come                = ValueEntry(2, u'出')
示例#8
0
class TruckFrequencyType:
    """
        6.2是否加班车
        is_overtime
    """
    NormalFrequency     = ValueEntry(0, u'正班频次')
    AbnormalFrequency   = ValueEntry(1, u'加班频次或者临时线路')
示例#9
0
class UserActive:
    """
        1.3 用户激活状态
        active
    """
    Inactive            = ValueEntry(0, u'未激活')
    Activated           = ValueEntry(1, u'已激活')
示例#10
0
class CarrierUserRole:
    """
        1.2用户来源
        role
    """
    OrdinaryUser        = ValueEntry(0, u'普通用户')
    InternalUser        = ValueEntry(1, u'圆通内部用户')
示例#11
0
class TruckDisableType:
    """
        2.4车辆表的车辆是否禁用
        if_valid
    """
    Disabled            = ValueEntry(0, u'不可用')
    Available           = ValueEntry(1, u'可用')
示例#12
0
class TruckSettleType:
    """
        2.3车辆表的是否为可结算车型
        is_forbidden
    """
    DoNotSettle         = ValueEntry(0, u'不可结算')
    CanBeSettled        = ValueEntry(1, u'可结算')
示例#13
0
class LineFrequencyType:
    """
        10.3频次类型
        fre_status
    """
    Valid               = ValueEntry(u'vaid', u'有效')
    Invalid             = ValueEntry(u'invalid', u'无效')
示例#14
0
class TruckStatus:
    """
        5.3车辆状态
        truck_status
    """
    Normal              = ValueEntry(1, u'正常')
    Cancellation        = ValueEntry(2, u'注销')
示例#15
0
class DataCategory(TypeBase):
    LOC = ValueEntry(1 << 0, u'位置信息')
    EMS = ValueEntry(1 << 1, u'发送机数据')
    ETC = ValueEntry(1 << 2, u'ETC数据')

    def __init__(self, type_, version=1, provider=TypeBase.UNKNOWN.value):
        self.type = type_
        self.version = version  # 版本
        self.provider = provider  #供应商
        self.sys_time = 0  #系统时间

    def unique(self):
        return 0

    def dict(self):
        return self.hash_object()

    def json(self):
        return json.dumps(self.dict())

    def hash_object(self):
        obj = self
        attrs = [s for s in dir(obj) if not s.startswith('__')]
        kvs = {}
        for k in attrs:
            attr = getattr(obj, k)
            if not callable(attr) and not isinstance(attr, ValueEntry):
                kvs[k] = attr
        return kvs

    def toEnvelope(self):
        env = DataEnvelope(self.provider)
        env.add(self)
        return env
示例#16
0
class ScanType:
    """
        14.调度扫描记录表(Dispatcher_scan_record)
        14.1到发车扫描
        scan_type
    """
    EndScanning         = ValueEntry(1, u'到车扫描')
    StartScanning       = ValueEntry(2, u'发车扫描')
示例#17
0
class FenceStatus:
    """
        12.围栏表(Fence)
        12.1围栏状态
        status
    """
    Create              = ValueEntry(1, u'创建')
    Trigger             = ValueEntry(2, u'触发')
示例#18
0
class LineUseType:
    """
        10.路线表(Line)
        10.1线路使用状态
        status
    """
    Unused              = ValueEntry(0, u'未使用')
    Used                = ValueEntry(1, u'已使用')
示例#19
0
class TruckAuditType:
    """
        9.车辆表(Trucks)
        9.1车辆审核通过值
        commit_status
    """
    NotThrough          = ValueEntry(0, u'未通过')
    Through             = ValueEntry(1, u'通过')
示例#20
0
class TruckRunState:
    """
        2.5车辆表的车辆是否在途
        is_onway
        关联:运单表(Transport_protocol)运单最终状态is_onway
    """
    Transit             = ValueEntry(1,u'在途')
    Arrive              = ValueEntry(2, u'到达')
示例#21
0
class TruckType:
    """
        5.2车辆类别
        truck_type
        关联:车辆表(Trucks)车辆状态truck_type
    """
    GeneralFreight      = ValueEntry(1, u'一般货车')
    Hangcar             = ValueEntry(2, u'挂车头')
    HangCompartments    = ValueEntry(2, u'挂厢')
示例#22
0
class FenceTriggerType:
    """
        11.围栏记录表(Fence_record)
        11.1触发方式
        trigger_type
    """
    CloudFence          = ValueEntry(0, u'云围栏')
    OfflineFence        = ValueEntry(1, u'离线围栏')
    ManuallRefresh      = ValueEntry(2, u'手动刷新')
示例#23
0
class CarrierUserType:
    """
        Carrier数据库
        1.用户表(Users)
        1.1用户类型
        com_type
    """
    Company             = ValueEntry(0, u'公司')
    Personal            = ValueEntry(1, u'个人')
示例#24
0
class TruckRunType:
    """
        2.2车辆运行方式
        run_mode
        关联:运单表(Transport_protocol)车辆运行方式run_mode
        关联:路线表(Line)车辆运行方式run_mode
    """
    OneWay              = ValueEntry(0, u'单边车')
    BothWay             = ValueEntry(1, u'双边车')
示例#25
0
class ProjectStatus:
    """
        7.3项目状态
        status
    """
    NotRelease          = ValueEntry(1, u'未发布')
    Release             = ValueEntry(2, u'发布')
    Bidding             = ValueEntry(3, u'招标中')
    EndBiding           = ValueEntry(3, u'报价结束')
示例#26
0
class MajorTruckType:
    """
        7.2主力车型
        major_truck
    """
    T1                  = ValueEntry(1, u'0')
    T2                  = ValueEntry(2, u'9.6')
    T3                  = ValueEntry(3, u'14.7')
    T4                  = ValueEntry(3, u'17.5')
示例#27
0
class RunMode:
    """
        7.项目表(Project)
        7.1行驶方式
        run_mode
    """
    Vehicle             = ValueEntry(1, u'整车')
    LCL                 = ValueEntry(2, u'零担')
    VehicleWithLCL      = ValueEntry(3, u'整车加零担')
示例#28
0
class TruckTempState:
    """
        2.车辆表(Truck)
        2.1车辆是否为临时车
        is_temp_truck
        关联:运单表(Transport_protocol)是否临时车is_temp_truck
    """
    NormalCar           = ValueEntry(0, u'正班车')
    TemporaryCar        = ValueEntry(1, u'临时车')
示例#29
0
class SubmitType:
    """
        3.2触发记录表的提交围栏类型
        comt_type
    """
    CloudFence          = ValueEntry(0, u'云围栏')
    OfflineFence        = ValueEntry(1, u'离线围栏')
    DropDown            = ValueEntry(2, u'下拉获取云围栏触发记录上报')
    Carsign             = ValueEntry(3, u'车签')
示例#30
0
class CarriageType:
    """
        5.车辆表(Camel_truck)
        5.1车厢类型
        carriage_type
        关联:车辆表(Trucks)车辆状态carriage_type
    """
    Van                 = ValueEntry(1, u'厢式')
    Gaolan              = ValueEntry(2, u'高栏')