wms-py/app/models/location.py
2025-06-04 10:39:32 +08:00

45 lines
2.0 KiB
Python

from sqlalchemy import Column, String, Integer, Text
from app.utils.database import Base
class TAppLocation(Base):
__tablename__ = "t_app_location"
location_id = Column(String(50), primary_key=True, comment="库位ID")
location_name = Column(String(100), default="", comment="库位名称")
location_type = Column(Integer, default=1, comment="库位类型")
is_occupy = Column(Integer, default=0, comment="是否占用 0-未占用 1-已占用")
is_enable = Column(Integer, default=0, comment="是否启用")
equipment_id = Column(Integer, default=0, comment="设备ID")
aisle_num_left = Column(Integer, comment="左侧巷道号")
aisle_num_right = Column(Integer, comment="右侧巷道号")
l_row = Column(Integer, comment="")
l_col = Column(Integer, comment="")
l_layer = Column(Integer, comment="")
l_depth = Column(Integer, comment="深度")
remark = Column(Text, default="", comment="备注")
area_id = Column(Integer, default=1, comment="区域ID")
sub_area = Column(String(50), default="", comment="子区域")
def __init__(self, location_id=None, location_name="", location_type=1,
is_occupy=0, is_enable=0, equipment_id=0, aisle_num_left=None,
aisle_num_right=None, l_row=None, l_col=None, l_layer=None,
l_depth=None, remark="", area_id=1, sub_area=""):
self.location_id = location_id
self.location_name = location_name
self.location_type = location_type
self.is_occupy = is_occupy
self.is_enable = is_enable
self.equipment_id = equipment_id
self.aisle_num_left = aisle_num_left
self.aisle_num_right = aisle_num_right
self.l_row = l_row
self.l_col = l_col
self.l_layer = l_layer
self.l_depth = l_depth
self.remark = remark
self.area_id = area_id
self.sub_area = sub_area
def __repr__(self):
return f"<TAppLocation(location_id='{self.location_id}', location_name='{self.location_name}')>"