from sqlalchemy import (Column, Integer, BigInteger, Numeric, SmallInteger, Float, String, DateTime, ForeignKey,UniqueConstraint,TEXT) from sqlalchemy.types import LargeBinary from dash.core.backends.sql import models as dash_models from django.utils.translation import ugettext_lazy from dash.core.types import enum import datetime from django.db import models #每个加油站属于下面大集团公司的一种 UserCardType = enum( #中石油 CNPC=(1,ugettext_lazy(u"中石油")), #中石化 SINOPEC=(2,ugettext_lazy(u"中石化")), #中海油 CNOOC=(3,ugettext_lazy(u"中海油")), #壳牌 SHELL=(4,ugettext_lazy(u"壳牌")), #中化 SINOCHEM=(5,ugettext_lazy(u"中化")) ) PromotionModelType = enum( # 以改善油站的 设备运营效率为目的(结合用户的属性让某些用户在效率低的时候来加油) IMPROVE_EFFICT=(0,ugettext_lazy(u"改善运营效率")), # """ # 监测到你经常于高峰期时段加油,为了节约你的加油时间,请于(非高峰期时间段)来加油。 # """ # 以增加非忠诚 用户回头率为目的(用户的加油时间间隔太长) # 以改善加油用 户流失率为目的(用户一段时间后不来了,要发短信给其油品的优惠)
import json from django.utils.translation import ugettext_lazy # 缓存中统计分布的维度 all_type_args={ 'pump_daily_avg_report':['location'], 'gun_pump_avg_report':['barcode','location'], 'non_fuel_sales_avg_report':['location'], 'non_fuel_sales_scale_report':['location'], 'top10_non_fuel_sales_avg_report':['location'], 'pump_hourly_avg_report':['location'], 'pump_monthly_avg_report':['location'], 'trans_count_avg_report':['barcode','location'] } PumpType=enum(FILLOUT=(0,ugettext_lazy(u'加满')),FILLMONEY=(1,ugettext_lazy(u"定额"))) TransType = enum(FUEL=(0, ugettext_lazy(u'油品')), NON_FUEL=(1, ugettext_lazy(u'非油品'))) PaymentType = enum(ALL=(0, ugettext_lazy(u'任意')), UNION_PAY=(1, ugettext_lazy(u'银联卡')), VIP=(2, ugettext_lazy(u'加油卡')), CREDIT=(3, ugettext_lazy(u'信用卡')), CASH=(1000, ugettext_lazy(u'现金'))) CardType = enum(ALL=(0, ugettext_lazy(u'任意')), UNION_PAY=(1, ugettext_lazy(u'银联卡')), VIP=(2, ugettext_lazy(u'加油卡')), CREDIT=(3, ugettext_lazy(u'信用卡'))) DayPeriod = enum(ALL=(0, ugettext_lazy(u'全部')), MORNING=(1, ugettext_lazy(u'早')), NOON=(2, ugettext_lazy(u'中')), NIGHT=(3, ugettext_lazy(u'晚'))) HealthStatus = enum(BOTTLENECK=(0,ugettext_lazy(u'瓶颈')),LOYALTY=(1,ugettext_lazy(u'重复客户')),CUSTOMER=(2,ugettext_lazy(u'客单值')),AVG92=(3,ugettext_lazy(u'92/93#平均单车加油量')), AVG95=(4,ugettext_lazy(u'95/97#平均单车加油量')),CRESTPERCENT=(5,ugettext_lazy(u'高峰期油枪效率')),FILLOUT92=(6,ugettext_lazy(u'92/93#加满率')), FILLOUT95=(7,ugettext_lazy(u'95/97#加满率')),FILLOUT0=(8,ugettext_lazy(u'柴油加满率')),NOMALPERCENT=(9,ugettext_lazy(u'日常油非转化率')), CRESTNONEANDFUELPERCENT=(10,ugettext_lazy(u'高峰期油非转化率')),NONE_ASSOC=(11,ugettext_lazy(u'非油品相关性')),FUEL_NONE_ASSOC=(12,ugettext_lazy(u'油品与非油品相关性'))) class FuelType(dash_models.Base, star.FactMixin) : """ 汽油类型 FUEL_92=(300585, u'92号油'), """ __tablename__ = 'fuel_type'