class LineLocations(BaseFunc, db.Model): """ 线路径停点表 """ __tablename__ = 'line_location' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) fk_line_code = db.Column('fk_line_code', db.String(256)) # 线路编码 origin_code = db.Column('origin_code', db.String(6)) # 始发地编码 destination_code = db.Column('destination_code', db.String(6)) # 目的地编码 location_code = db.Column('location_code', db.String(6)) # 转运网点编码 sequence = db.Column('sequence', db.Integer) # 径停点顺序 location_status = db.Column('location_status', db.Integer) # 转运中心属性 1 启用, 2 禁用 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, fk_line_code, origin_code, destination_code, location_code, sequence, location_status, fk_operator_id): BaseFunc.__init__(self) self.fk_line_code = fk_line_code self.origin_code = origin_code self.destination_code = destination_code self.location_code = location_code self.sequence = sequence self.location_status = location_status self.fk_operator_id = fk_operator_id
class VerifyingCode(BaseFunc, db.Model): """ 用户验证码 """ id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) telephone = db.Column('telephone', db.String(11)) # 用户手机号码 verifying_code = db.Column('verifying_code', db.String(6)) # 用户验证码 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, telephone, verifying_code): BaseFunc.__init__(self) self.telephone = telephone self.verifying_code = verifying_code
class LocationCount(BaseFunc, db.Model): """ 订单号生成表 """ __tablename__ = 'location_count' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) location_amount = db.Column('location_amount', db.Integer) # 总数 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, location_amount): BaseFunc.__init__(self) self.location_amount = location_amount
class User(BaseFunc, db.Model): """ 用户 """ id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) name = db.Column('name', db.String(32)) # 用户名 username = db.Column('username', db.String(11)) # 登录帐号 password = db.Column('password', db.String(256), nullable=False) # 登录密码 mobile = db.Column('mobile', db.String(11)) # 用户手机号码 role_type = db.Column('role_type', db.Integer) # 用户类型 fk_location_code = db.Column('fk_location_code', db.String(6)) # 用户所属转运网点 fk_plate = db.Column('fk_plate', db.String(11)) # 车牌 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, name, username, password, mobile, role_type, fk_location_code, fk_plate): BaseFunc.__init__(self) self.name = name self.username = username self.password = password self.mobile = mobile self.role_type = role_type self.fk_location_code = fk_location_code self.fk_plate = fk_plate
class LineVolume(BaseFunc, db.Model): """ 线路货物总数表 """ __tablename__ = 'line_volume' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) line_code = db.Column('line_code', db.String(256)) # 线路编码 pending_volume = db.Column('pending_volume', db.Integer) # 待处理货物方位 pending_weight = db.Column('pending_weight', db.Integer) # 待处理货物重量 processed_volume = db.Column('processed_volume', db.Integer) # 已处理货物方位 processed_weight = db.Column('processed_weight', db.Integer) # 已处理货物重量 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, line_code, pending_volume, pending_weight, fk_operator_id): BaseFunc.__init__(self) self.line_code = line_code self.pending_volume = pending_volume self.pending_weight = pending_weight self.fk_operator_id = fk_operator_id
class OrderOperationRecord(BaseFunc, db.Model): """ 订单操作人记录表 """ __tablename__ = 'order_operation_record' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) fk_order_number = db.Column('fk_order_number', db.String(24)) # 订单号 action = db.Column('action', db.Integer) # 操作类型 op_time = db.Column('op_time', db.TIMESTAMP) # 操作时间 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id remark = db.Column('remark', db.Text) # 备注 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, fk_order_number, action, op_time, fk_operator_id, remark): BaseFunc.__init__(self) self.fk_order_number = fk_order_number self.action = action self.op_time = op_time self.fk_operator_id = fk_operator_id self.remark = remark
class OrderFlow(BaseFunc, db.Model): """ 订单状态流表 """ __tablename__ = 'order_flow' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) fk_order_number = db.Column('fk_order_number', db.String(24)) # 订单号 order_status = db.Column('order_status', db.Integer) # 订单状态 status_time = db.Column('status_time', db.TIMESTAMP) # 状态时间 remark = db.Column('remark', db.Text) # 备注 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作者id create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, fk_order_number, order_status, status_time, remark, fk_operator_id): BaseFunc.__init__(self) self.fk_order_number = fk_order_number self.order_status = order_status self.status_time = status_time self.remark = remark self.fk_operator_id = fk_operator_id
class LocationContacts(BaseFunc, db.Model): """ 网点联系人信息 """ __tablename__ = 'location_contacts' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) fk_location_code = db.Column('fk_location_code', db.String(6)) # 网点编码 contacts_name = db.Column('contacts_name', db.String(256)) # 网点联系人 contacts_telephone = db.Column('contacts_telephone', db.String(11)) # 网点联系人号码 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, fk_location_code, contacts_name, contacts_telephone): BaseFunc.__init__(self) self.fk_location_code = fk_location_code self.contacts_name = contacts_name self.contacts_telephone = contacts_telephone
class OrderCount(BaseFunc, db.Model): """ 订单号生成表 """ __tablename__ = 'order_count' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) order_date = db.Column('order_date', db.Date) # 日期 order_amount = db.Column('order_amount', db.Integer) # 总数 order_type = db.Column('order_type', db.Integer) # 订单类型 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, order_date, order_amount, order_type): BaseFunc.__init__(self) self.order_date = order_date self.order_amount = order_amount self.order_type = order_type
class Waybill(BaseFunc, db.Model): """ 运单表 """ __tablename__ = 'waybill' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) waybill_number = db.Column('waybill_number', db.String(15)) # 运单号 waybill_type = db.Column('waybill_type', db.Integer) # 运单类型 1:正常,2:异常,3:废止 waybill_status = db.Column('waybill_status', db.Integer) # 运单状态 200:待装车,300:运输中,500:已完成 is_onway = db.Column('is_onway', db.Integer) # 是否在途 1:在途 2:到达 line_no = db.Column('line_no', db.String(100)) # 线路编号 fk_to_location_code = db.Column('fk_to_location_code', db.String(8)) # 出发地编码 fk_at_location_code = db.Column('fk_at_location_code', db.String(8)) # 到达地编码 plate = db.Column('plate', db.String(8)) # 车牌 start_time = db.Column('start_time', db.TIMESTAMP) # 车辆出发时间 end_time = db.Column('end_time', db.TIMESTAMP) # 车辆到达时间 driver_name = db.Column('driver_name', db.String(100)) # 司机姓名 driver_telephone = db.Column('driver_telephone', db.String(11)) # 司机号码 remarks = db.Column('remarks', db.Text) # 备注 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id create_date = db.Column('create_date', db.Date) # 创建日期 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, waybill_number, waybill_type, waybill_status, line_no, fk_to_location_code, fk_at_location_code, plate, start_time, end_time, driver_name, driver_telephone, remarks, fk_operator_id, create_data): BaseFunc.__init__(self) self.waybill_number = waybill_number self.waybill_type = waybill_type self.waybill_status = waybill_status self.line_no = line_no self.fk_to_location_code = fk_to_location_code self.fk_at_location_code = fk_at_location_code self.plate = plate self.start_time = start_time self.end_time = end_time self.driver_name = driver_name self.driver_telephone = driver_telephone self.remarks = remarks self.fk_operator_id = fk_operator_id self.create_date = create_data
class CargoOrder(BaseFunc, db.Model): """ 货物订单主表 """ __tablename__ = 'cargo_order' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) cargo_order_number = db.Column('cargo_order_number', db.String(24)) # 订单号 fk_waybill_number = db.Column('fk_waybill_number', db.String(15)) # 外键运单号 fk_line_code = db.Column('fk_line_code', db.String(25)) # 外键线路编号 origin_code = db.Column('origin_code', db.String(11)) # 始发地编码 destination_code = db.Column('destination_code', db.String(11)) # 目的地编码 order_status = db.Column('order_status', db.Integer) # 订单状态 order_type = db.Column('order_type', db.String(12)) # 订单类型 整车 零担 cargo_name = db.Column('cargo_name', db.String(128)) # 货物名称 cargo_volume = db.Column('cargo_volume', db.String(11)) # 货物体积 cargo_weight = db.Column('cargo_weight', db.String(8)) # 货物重量 specified_arrival_time = db.Column('specified_arrival_time', db.TIMESTAMP) # 规定到达时间 consignor_name = db.Column('consignor_name', db.String(24)) # 发货人姓名 consignor_telephone = db.Column('consignor_telephone', db.String(11)) # 发货人联系方式 consignee_name = db.Column('consignee_name', db.String(24)) # 收货人姓名 consignee_telephone = db.Column('consignee_telephone', db.String(11)) # 收货人联系方式 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id remark = db.Column('remark', db.Text) # 备注 create_date = db.Column('create_date', db.Date) # 创单日期 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, cargo_order_number, origin_code, destination_code, order_status, order_type, cargo_name, cargo_volume, cargo_weight, specified_arrival_time, consignor_name, consignor_telephone, consignee_name, consignee_telephone, fk_operator_id, remark, create_date): BaseFunc.__init__(self) self.cargo_order_number = cargo_order_number self.origin_code = origin_code self.destination_code = destination_code self.order_status = order_status self.order_type = order_type self.cargo_name = cargo_name self.cargo_volume = cargo_volume self.cargo_weight = cargo_weight self.specified_arrival_time = specified_arrival_time self.consignor_name = consignor_name self.consignor_telephone = consignor_telephone self.consignee_name = consignee_name self.consignee_telephone = consignee_telephone self.fk_operator_id = fk_operator_id self.remark = remark self.create_date = create_date
class Line(BaseFunc, db.Model): """ 线路表 """ __tablename__ = 'line' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) line_code = db.Column('line_code', db.String(256)) # 线路编码 line_name = db.Column('line_name', db.String(256)) # 线路名称 origin_code = db.Column('origin_code', db.String(6)) # 始发地编码 destination_code = db.Column('destination_code', db.String(6)) # 目的地编码 line_status = db.Column('line_status', db.Integer) # 线路状态 1 启用,2 禁用 line_type = db.Column('line_type', db.Integer) # 线路属性 1 临时, 2 正式 line_kilometre = db.Column('line_kilometre', db.Integer) # 线路运行公里数 line_runtime = db.Column('line_runtime', db.String(256)) # 线路运行时长 location_number = db.Column('location_number') # 径停点数量 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, line_code, line_name, origin_code, destination_code, line_status, line_type, line_kilometre, line_runtime, location_number, fk_operator_id): BaseFunc.__init__(self) self.line_code = line_code self.line_name = line_name self.origin_code = origin_code self.destination_code = destination_code self.line_status = line_status self.line_type = line_type self.line_kilometre = line_kilometre self.line_runtime = line_runtime self.location_number = location_number self.fk_operator_id = fk_operator_id
class Truck(BaseFunc, db.Model): """ 车辆表 """ __tablename__ = 'truck' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) plate = db.Column('plate', db.String(256)) # 车牌 status = db.Column('status', db.Integer) # 车辆状态 1启用,2禁用 container_type = db.Column('container_type', db.Integer) # 车厢类型 1箱式,2高栏 plate_type = db.Column('plate_type', db.Integer) # 车牌类型 1一般货车,2挂车,3车厢' vehicle_type = db.Column('vehicle_type', db.Integer) # 车辆类型 1临时,2正式 container_length = db.Column('container_length', db.String(10)) # 车厢长度 container_wide = db.Column('container_wide', db.String(10)) # 车厢宽度 container_high = db.Column('container_high', db.String(10)) # 车厢高度 container_volume = db.Column('container_volume', db.String(10)) # 车厢体积 fk_operator_id = db.Column('fk_operator_id', db.Integer) # 操作人id create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, plate, status, plate_type, vehicle_type, container_type, container_length, container_wide, container_high, container_volume, fk_operator_id): BaseFunc.__init__(self) self.plate = plate self.status = status self.container_type = container_type self.plate_type = plate_type self.vehicle_type = vehicle_type self.container_length = container_length self.container_wide = container_wide self.container_high = container_high self.container_volume = container_volume self.fk_operator_id = fk_operator_id
class Location(BaseFunc, db.Model): """ 网点信息表 """ __tablename__ = 'location' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) location_name = db.Column('location_name', db.String(256)) # 网点名称 location_code = db.Column('location_code', db.Integer) # 网点编码 detailed_address = db.Column('detailed_address', db.String(256)) # 网点详细地址 lot = db.Column('lot', db.Integer) # 经度 lat = db.Column('lat', db.Integer) # 纬度 province = db.Column('province', db.String(256)) # 省份 city = db.Column('city', db.String(256)) # 省份 location_status = db.Column('location_status', db.Integer) # 转运网点属性 1 启动,2 禁用 create_time = db.Column('create_time', db.TIMESTAMP) # 创建时间 update_time = db.Column('update_time', db.TIMESTAMP) # 更新时间 def __init__(self, location_name, location_code, detailed_address, lot, lat, province, city, location_status): BaseFunc.__init__(self) self.location_name = location_name self.location_code = location_code self.detailed_address = detailed_address self.lot = lot self.lat = lat self.province = province self.city = city self.location_status = location_status