from sqlalchemy import ForeignKey,Column, String, Numeric, DateTime, Integer,Float,Boolean,BigInteger,Text # from sqlalchemy.orm import declarative_base from sqlalchemy.ext.declarative import declarative_base from datetime import datetime import uuid Base = declarative_base() class WaterResourceProject(Base): __tablename__ = 'water_resource_projects' id = Column(Integer, primary_key=True, autoincrement=True, comment='数据自增键') jsdwzjlx = Column(String(50), comment='建设单位证件类型') lxfs = Column(String(50), comment='联系方式') sjtgbmtyshxydm = Column(String(18), comment='数据提供部门统一社会信用代码') jdgljgbm = Column(String(50), comment='监督管理机关编码') cd_time = Column(DateTime, comment='插入时间') sjtgbmmc = Column(String(400), comment='数据提供部门名称') ggmj = Column(String(50), comment='灌溉面积') sjtgbmxzqhdm = Column(String(12), comment='数据提供部门行政区划代码') jsdwzjhm = Column(String(50), comment='建设单位证件号码') xzqhdm = Column(String(50), comment='水利设施和水利工程所在地行政区划代码') cd_operation = Column(String(10), comment='新增数据类型 I-INSERT, U_UPDATE, D-DELETE') zdmj = Column(String(50), comment='占地面积') d_bmmc = Column(String(500), comment='前置机归属数源部门名称源') etl_time = Column(DateTime, comment='ETL时间') jssj = Column(String(50), comment='建设时间') jsdwmc = Column(String(400), comment='建设单位名称') slsshslgcmc = Column(String(400), comment='水利设施和水利工程名称') cd_batch = Column(String(200), comment='数据批次号') slsshslgcdd = Column(String(400), comment='水利设施和水利工程地点') jdgljg = Column(String(400), comment='监督管理机关') jingdu = Column(String(50), comment='经度') weidu = Column(String(50), comment='维度') is_delete = Column(Integer, comment='删除标识') class Config: allow_population_by_field_name = True orm_mode = True def to_dict(self): return { "id": self.id, "jsdwzjlx": self.jsdwzjlx, "lxfs": self.lxfs, "sjtgbmtyshxydm": self.sjtgbmtyshxydm, "jdgljgbm": self.jdgljgbm, "cd_time": self.cd_time, "sjtgbmmc": self.sjtgbmmc, "ggmj": self.ggmj, "sjtgbmxzqhdm": self.sjtgbmxzqhdm, "jsdwzjhm": self.jsdwzjhm, "xzqhdm": self.xzqhdm, "cd_operation": self.cd_operation, "zdmj": self.zdmj, "d_bmmc": self.d_bmmc, "etl_time": self.etl_time, "jssj": self.jssj, "jsdwmc": self.jsdwmc, "slsshslgcmc": self.slsshslgcmc, "cd_batch": self.cd_batch, "slsshslgcdd": self.slsshslgcdd, "jdgljg": self.jdgljg, "jingdu": self.jingdu, "weidu": self.weidu, # "is_delete": self.is_delete } class Unit(Base): __tablename__ = 'rescue_units' id = Column(Integer, autoincrement=True, primary_key=True) name = Column(String(255), nullable=False, comment='单位名称') category = Column(String(100), nullable=False, comment='类别') address = Column(String(255), nullable=False, comment='地址') equipment = Column(String(255), comment='装备') training = Column(String(255), comment='训练') responsible_person = Column(String(100), comment='负责人') contact_number = Column(String(20), comment='联系电话') longitude = Column(Float, comment='经度') latitude = Column(Float, comment='纬度') is_delete = Column(Integer, comment='删除标识') position = Column(String(100), comment='负责人职务') team_size = Column(Integer, comment='队伍人数') supervisor_unit = Column(String(100), comment='主管单位') def to_dict(self): return { "id": self.id, "name": self.name, "category": self.category, "address": self.address, "equipment": self.equipment, "training": self.training, "responsible_person": self.responsible_person, "contact_number": self.contact_number, "longitude": self.longitude, "latitude": self.latitude, "position": self.position, # 新增字段:负责人职务 "team_size": self.team_size, # 新增字段:队伍人数 "supervisor_unit": self.supervisor_unit, # 新增字段:主管单位 # "is_delete": self.is_delete } class Config: allow_population_by_field_name = True orm_mode = True class RescuePersonnel(Base): __tablename__ = 'rescue_personnel' id = Column(Integer, primary_key=True, autoincrement=True) name = Column(String(255), nullable=False, comment='姓名') contact_number = Column(String(20), nullable=False, comment='联系电话') gender = Column(String(10), nullable=False, comment='性别') current_address = Column(String(255), nullable=False, comment='现在地址') position = Column(String(100), comment='职务') unit_id = Column(Integer, comment='所属救援人员单位ID') unit_name = Column(Integer, comment='所属救援人员单位') is_delete = Column(Integer, default=0, comment='删除标识') modified_time = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, comment='修改时间') created_time = Column(DateTime, default=datetime.utcnow, comment='创建时间') def to_dict(self): return { "id": self.id, "name": self.name, "contact_number": self.contact_number, "gender": self.gender, "current_address": self.current_address, "position": self.position, "unit_id": self.unit_id, # "is_delete": self.is_delete, "unit_name": self.unit_name, "modified_time": self.modified_time.isoformat() if self.modified_time else None, "created_time": self.created_time.isoformat() if self.created_time else None } class RescueStation(Base): __tablename__ = 'rescue_stations' id = Column(Integer, primary_key=True, autoincrement=True, comment='数字自增ID') data_id = Column(String(255), primary_key=True, default=uuid.uuid4, comment='uuid主键') fwdx = Column(String(100), comment='服务对象姓名') zj = Column(String(20), comment='所属镇街') lng = Column(String(30), comment='救助站经度') cd_time = Column(DateTime, comment='更新时间') fwdmc = Column(String(50), comment='救助站名称') fwnr = Column(String(500), comment='服务内容') add_time = Column(DateTime, comment='新增时间') cd_operation = Column(String(1), comment='操作方式') fwdlx = Column(String(2), comment='救助站类型') lxdh = Column(String(30), comment='联系电话') kfsj = Column(String(100), comment='开放时间') lat = Column(String(30), comment='救助站纬度') fwdjj = Column(String(1000), comment='救助站简介') lxr = Column(String(30), comment='联系人') fid = Column(String(36), comment='主键') fwdzt = Column(String(1), comment='服务点状态') fwdaddr = Column(String(80), comment='服务点地址') ssqx = Column(String(80), comment='所属区县') #新增 is_delete = Column(Boolean, default=False, comment='删除标识') def to_dict(self): return { "id": self.id, "data_id": self.data_id, "fwdx": self.fwdx, "zj": self.zj, "lng": self.lng, "cd_time": self.cd_time.isoformat() if self.cd_time else None, "fwdmc": self.fwdmc, "fwnr": self.fwnr, "add_time": self.add_time.isoformat() if self.add_time else None, "cd_operation": self.cd_operation, "fwdlx": self.fwdlx, "lxdh": self.lxdh, "kfsj": self.kfsj, "lat": self.lat, "fwdjj": self.fwdjj, "lxr": self.lxr, "fid": self.fid, "fwdzt": self.fwdzt, "fwdaddr": self.fwdaddr, "ssqx":self.ssqx # "is_delete": self.is_delete } class DefenseProject(Base): __tablename__ = 'defense_projects' data_id = Column(String(255), primary_key=True, default=uuid.uuid4, comment='uuid主键') id = Column(BigInteger, primary_key=True, autoincrement=True, comment='数字自增ID') gcmc = Column(String(200), comment='工程名称') jsdw = Column(String(100), comment='建设单位') whdw = Column(String(100), comment='维护单位') rfzyjlgcs = Column(String(100), comment='人防专业监理工程师') jsdd = Column(String(100), comment='建设地点') cd_operation = Column(String(1), comment='操作方式') yjdxsmj = Column(Numeric(12), comment='应建人防地下室面积(㎡)') sjdxsmj = Column(Numeric(12), comment='实建人防地下室面积(㎡)') cd_time = Column(DateTime, default=datetime.utcnow, comment='更新时间') add_time = Column(DateTime, default=datetime.utcnow, comment='新增时间') jldw = Column(String(100), comment='监理单位') jsdwdm = Column(String(100), comment='建设单位统一社会信用代码') kgsj = Column(DateTime, comment='开工时间') stdw = Column(String(100), comment='审图单位') cd_batch = Column(String(100), comment='批次号') #新增 rfsjdwdm = Column(String(100), comment='人防设计单位单位统一社会信用代码') rfsjdw = Column(String(100), comment='人防设计单位单位') ybrs = Column(Numeric, comment='掩蔽人数') stdwdm = Column(String(100), comment='审图单位统一社会信用代码') whdwdm = Column(String(100), comment='维护单位统一社会信用代码') jldwdm = Column(String(100), comment='监理单位统一社会信用代码') rfzjlgcs = Column(String(100), comment='人防总监理工程师') gcid = Column(String(50), comment='主键') extend2 = Column(String(200), comment='扩展2') data_area = Column(String(12), comment='数据区域') extend1 = Column(String(200), comment='扩展1') jgsj = Column(DateTime, comment='竣工时间') rffhsbdw = Column(String(100), comment='人防防护设备单位')#新增 rffhsbdwdm = Column(String(100), comment='人防防护设备单位统一社会信用代码')#新增 jingdu = Column(Float, comment='经度')#新增 weidu = Column(Float, comment='纬度')#新增 is_delete = Column(Boolean, default=False, comment='删除标识') def to_dict(self): return { "id": self.id, "data_id": str(self.data_id), # 确保UUID转换为字符串 "gcmc": self.gcmc, "jsdw": self.jsdw, "whdw": self.whdw, "rfzyjlgcs": self.rfzyjlgcs, "jsdd": self.jsdd, "cd_operation": self.cd_operation, "yjdxsmj": self.yjdxsmj, "sjdxsmj": self.sjdxsmj, "cd_time": self.cd_time.isoformat() if self.cd_time else None, "add_time": self.add_time.isoformat() if self.add_time else None, "jldw": self.jldw, "jsdwdm": self.jsdwdm, "kgsj": self.kgsj.isoformat() if self.kgsj else None, "stdw": self.stdw, "rfsjdwdm": self.rfsjdwdm, "rfsjdw": self.rfsjdw, "ybrs": self.ybrs, "stdwdm": self.stdwdm, "whdwdm": self.whdwdm, "jldwdm": self.jldwdm, "rfzjlgcs": self.rfzjlgcs, "gcid": self.gcid, "extend2": self.extend2, "data_area": self.data_area, "extend1": self.extend1, "jgsj": self.jgsj.isoformat() if self.jgsj else None, "cd_batch":self.cd_batch, "rffhsbdw":self.rffhsbdw, "rffhsbdwdm":self.rffhsbdwdm, "jingdu":self.jingdu, "weidu":self.weidu # "is_delete": self.is_delete, } class Shelter(Base): __tablename__ = 'shelters' data_id = Column(String(255), primary_key=True, default=uuid.uuid4, comment='uuid主键') id = Column(Integer, primary_key=True, autoincrement=True, comment='数字自增ID') admin_area = Column(String(100), comment='行政区域') full_name = Column(String(200), comment='应急避难场所全称') address = Column(String(255), comment='应急避难场所地址') incident_type = Column(String(100), comment='按突发事件类型分类') shelter_type = Column(String(100), comment='避难种类') total_area = Column(Numeric, comment='应急避难场所占地总面积(平方米)') indoor_area = Column(Numeric, comment='应急避难场所室内面积(平方米)') capacity = Column(Numeric, comment='避难场所容纳人数(人)') supplies = Column(String(500), comment='物资储备') facilities = Column(String(500), comment='应急设施') is_delete = Column(Boolean, default=False, comment='删除标识') modified_time = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, comment='修改时间') created_time = Column(DateTime, default=datetime.utcnow, comment='创建时间') def to_dict(self): return { "id": self.id, "data_id": str(self.data_id), "admin_area": self.admin_area, "full_name": self.full_name, "address": self.address, "incident_type": self.incident_type, "shelter_type": self.shelter_type, "total_area": self.total_area, "indoor_area": self.indoor_area, "capacity": self.capacity, "supplies": self.supplies, "facilities": self.facilities, # "is_delete": self.is_delete, "modified_time": self.modified_time.isoformat() if self.modified_time else None, "created_time": self.created_time.isoformat() if self.created_time else None, } class ResourceProvisionMaterialType(Base): __tablename__ = 'resource_provision_material_types' id = Column(Integer, autoincrement=True, primary_key=True, comment='物资类型ID') parent_id = Column(Integer, ForeignKey('resource_provision_material_types.id', ondelete='SET NULL'), comment='父类ID') material_category_name = Column(String(255), nullable=False, comment='物资类别名称') material_category_level = Column(Integer, comment='物资类别等级') sort_order = Column(Integer, comment='排序') display_status = Column(String(1), default='1', comment='显示状态(1显示 0不显示)') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') remark = Column(Text, nullable=True, comment='备注') def __repr__(self): return f"" class ResourceProvisionWarehouseInfo(Base): __tablename__ = 'resource_provision_warehouse_info' warehouse_id = Column(String(255), primary_key=True, autoincrement=True, comment='仓库id') warehouse_name = Column(String(255), nullable=True, comment='仓库名称') status = Column(String(50), nullable=True, comment='状态') contact_person = Column(String(100), nullable=True, comment='联系人') contact_phone = Column(String(20), nullable=True, comment='联系电话') address = Column(String(255), nullable=True, comment='地址') remark = Column(Text, nullable=True, comment='备注') type = Column(String(50), nullable=True, comment='类型') level = Column(String(50), nullable=True, comment='等级') storage_dept_id = Column(Integer, nullable=True, comment='物资保管部门id') storage_dept_name = Column(String(255), nullable=True, comment='物资保管部门名称') area_name = Column(String(100), nullable=True, comment='地区') longitude = Column(Numeric(9, 6), nullable=True, comment='经度') latitude = Column(Numeric(8, 6), nullable=True, comment='纬度') area = Column(Numeric(15, 2), nullable=True, comment='占地面积(平方米)') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') class ResourceProvisionWarehouseRoomInfo(Base): __tablename__ = 'resource_provision_warehouse_room_info' id = Column(String(255), primary_key=True, comment='ID') room_name = Column(String(255), nullable=True, comment='库房名称') warehouse = Column(String(255), nullable=True, comment='所在仓库') room_area = Column(Numeric(15, 2), nullable=True, comment='库房面积(平方米)') available_area = Column(Numeric(15, 2), nullable=True, comment='可用仓储面积(平方米)') height = Column(Numeric(10, 2), nullable=True, comment='高度(米)') room_volume = Column(Numeric(20, 2), nullable=True, comment='库房容积(立方米)') available_volume = Column(Numeric(20, 2), nullable=True, comment='可用库房容积(立方米)') level = Column(String(50), nullable=True, comment='等级') storage_type_code = Column(String(50), nullable=True, comment='存放类型') storage_type = Column(String(50), nullable=True, comment='保管类型') last_inventory_time = Column(DateTime, nullable=True, comment='库存确认最新时间') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionMaterialInfo(Base): __tablename__ = 'resource_provision_material_info' material_id = Column(Integer, primary_key=True, autoincrement=True, comment='物资编码') material_name = Column(String(255), nullable=True, comment='物资名称') warehouse_id = Column(Integer, nullable=True, comment='仓库id') inventory = Column(Integer, nullable=True, comment='库存') specification = Column(String(255), nullable=True, comment='规格') model = Column(String(255), nullable=True, comment='型号') category_name = Column(String(255), nullable=True, comment='分类名称') material_type = Column(String(255), nullable=True, comment='物资类型') unit_name = Column(String(255), nullable=True, comment='计量单位名称') brand_name = Column(String(255), nullable=True, comment='品牌名称') length = Column(Numeric(10, 2), nullable=True, comment='长(厘米)') width = Column(Numeric(10, 2), nullable=True, comment='宽(厘米)') height = Column(Numeric(10, 2), nullable=True, comment='高(厘米)') volume = Column(Numeric(20, 2), nullable=True, comment='体积(立方厘米)') gross_weight = Column(Numeric(10, 2), nullable=True, comment='毛重(kg)') net_weight = Column(Numeric(10, 2), nullable=True, comment='净重(kg)') manufacturer = Column(String(255), nullable=True, comment='生产厂商') origin = Column(String(255), nullable=True, comment='产地') status = Column(String(50), nullable=True, comment='状态') room_id = Column(Integer, nullable=True, comment='库房id') package_quantity = Column(Integer, nullable=True, comment='包装数量') package_volume = Column(Numeric(20, 2), nullable=True, comment='包装体积(立方厘米)') package_weight = Column(Numeric(10, 2), nullable=True, comment='包装重量(kg)') price = Column(Numeric(10, 2), nullable=True, comment='价格') selling_price = Column(Numeric(10, 2), nullable=True, comment='售卖价格') value = Column(Numeric(10, 2), nullable=True, comment='价值') cost_price = Column(Numeric(10, 2), nullable=True, comment='成本价格') disaster_types = Column(String(255), nullable=True, comment='适用灾种') maintenance = Column(Text, nullable=True, comment='使用保养') supplier_name = Column(String(255), nullable=True, comment='供应商名称') special_transportation_requirements = Column(Text, nullable=True, comment='特殊运输要求') material = Column(String(255), nullable=True, comment='材质') shelf_life = Column(DateTime, nullable=True, comment='保质期') inventory_warning_pusher = Column(String(255), nullable=True, comment='库存预警推送人') inventory_warning_quantity = Column(Integer, nullable=True, comment='库存预警数量') shelf_life_warning_days = Column(Integer, nullable=True, comment='保质期到期预警天数') shelf_life_warning_pusher = Column(String(255), nullable=True, comment='保质期预警推送人') from_sys= Column(String(255), nullable=True, comment='来源系统') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionFile(Base): __tablename__ = 'resource_provision_file' id = Column(Integer, autoincrement=True, primary_key=True) file_id = Column(String(50), nullable=False, comment='文件id') file_name = Column(String(255), nullable=False, comment='文件名称') file_name_desc = Column(String(255), nullable=False, comment='文件名称原名') file_path = Column(String(255), comment='文件存储路径') file_size = Column(String(50), comment='文件大小') status = Column(String(50), comment='文件状态') foreign_key = Column(String(50), comment='文件外键 --技术字段') from_scenario = Column(String(50), comment='对应标识 --技术字段') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') #更新预案信息的时候 先将原有的进行备注删除 remark = Column(Text, nullable=True, comment='备注') class Config: orm_mode = True class ResourceProvisionMaterialBarcode(Base): __tablename__ = 'resource_provision_material_barcode' id = Column(String(255), primary_key=True, comment='ID') material_code = Column(String(50), nullable=True, comment='物资编码') barcode = Column(String(255), nullable=True, comment='条形码') qr_code = Column(String(255), nullable=True, comment='二维码') status = Column(String(50), default='1',nullable=True, comment='状态') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class Config: orm_mode = True class ResourceProvisionProcurementDeclaration(Base): __tablename__ = 'resource_provision_procurement_declaration' id = Column(Integer, primary_key=True, comment='ID') declaration_date = Column(DateTime, default=datetime.now, nullable=False, comment='申报日期') declaration_amount = Column(Float, nullable=False, comment='申报金额(元)') declaration_unit = Column(String(255), nullable=False, comment='申报单位') declaration_person = Column(String(255), nullable=False, comment='申报人') declaration_details = Column(String(255), nullable=False, comment='申报情况') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionProcurementDeclarationDetail(Base): __tablename__ = 'resource_provision_procurement_declaration_detail' id = Column(Integer, primary_key=True, comment='ID') serial_number = Column(Integer, nullable=False, comment='序号') declaration_id = Column(String(255), nullable=False, comment='申报基础表id') warehouse_id= Column(String(255), nullable=False, comment='仓库id') material_type = Column(String(255), nullable=False, comment='物资类型') material_code = Column(String(255), nullable=False, comment='物资名称') material_quantity = Column(Integer, nullable=False, comment='物资数量(件)') material_unit_price = Column(Float, nullable=False, comment='物资单价') material_purpose = Column(Text, nullable=False, comment='物资用途') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionProcurementReview(Base): __tablename__ = 'resource_provision_procurement_review' id = Column(Integer, primary_key=True, comment='ID') reviewer = Column(String(255), nullable=False, comment='审核人') declaration_id = Column(Integer, nullable=False, comment='申报基础表id') review_result = Column(String(50), nullable=False, comment='审核结果') review_comments = Column(Text, comment='审核意见') review_date = Column(DateTime, default=datetime.now, comment='审核时间') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionDispatch(Base): __tablename__ = 'resource_provision_dispatch' id = Column(Integer, primary_key=True, comment='ID') dispatch_date = Column(DateTime, default=datetime.now, nullable=False, comment='调度日期') dispatch_purpose = Column(Text, nullable=False, comment='调度目的') dispatch_unit = Column(String(255), nullable=False, comment='申报单位') dispatch_person = Column(String(255), nullable=False, comment='申报人') dispatch_status = Column(String(255), nullable=False, comment='申报情况') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionDispatchDetail(Base): __tablename__ = 'resource_provision_dispatch_detail' id = Column(Integer, primary_key=True, comment='ID') serial_number = Column(Integer, nullable=False, comment='序号') dispatch_id = Column(String(255), nullable=False, comment='调度基础表id') warehouse_id= Column(String(255), nullable=False, comment='仓库id') material_type_id = Column(String(255), nullable=False, comment='物资类型id') material_type = Column(String(255), nullable=False, comment='物资类型') material_code = Column(String(255), nullable=False, comment='物资id') material_name = Column(String(255), nullable=False, comment='物资名称') material_quantity = Column(Integer, nullable=False, comment='物资数量(件)') material_purpose = Column(Text, nullable=False, comment='物资用途') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionDispatchReview(Base): __tablename__ = 'resource_provision_dispatch_review' id = Column(Integer, primary_key=True, comment='ID') reviewer = Column(String(255), nullable=False, comment='审核人') dispatch_id = Column(Integer, nullable=False, comment='调度基础表id') review_result = Column(String(50), nullable=False, comment='审核结果') review_comments = Column(Text, comment='审核意见') review_date = Column(DateTime, default=datetime.now, comment='审核时间') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, nullable=True, comment='备注') class ResourceProvisionOutboundBasic(Base): __tablename__ = 'resource_provision_outbound_basic' id = Column(Integer, primary_key=True, autoincrement=True, comment='ID') outbound_number = Column(String(255), nullable=False, comment='出库单号') warehouse_id = Column(String(255), nullable=False, comment='仓库id') total_volume = Column(Numeric(20, 2), nullable=False, comment='出库单商品总体积(立方厘米)') total_weight = Column(Numeric(20, 2), nullable=False, comment='出库单商品总重量(kg)') total_shipping_volume = Column(Numeric(20, 2), nullable=False, comment='出库单发货总体积(立方厘米)') total_shipping_weight = Column(Numeric(20, 2), nullable=False, comment='出库单发货总重量(kg)') total_quantity = Column(Integer, nullable=False, comment='出库单商品总数量') shipping_time = Column(DateTime, comment='出库单发货时间') disaster_type = Column(String(255), comment='灾种名称') dispatching_agency = Column(String(255), comment='调运机构名称') shipper_name = Column(String(255), comment='发货人姓名') shipper_mobile = Column(String(20), comment='发货人手机') shipper_address = Column(String(255), comment='发货人地址') shipper_remark = Column(Text, comment='发货方备注') receiver_name = Column(String(255), comment='收货人姓名') receiver_mobile = Column(String(20), comment='收货人手机') receiver_address = Column(String(255), comment='收货人地址') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, comment='备注') class ResourceProvisionWarehouseMovement(Base): __tablename__ = 'resource_provision_warehouse_movement' id = Column(Integer, primary_key=True, autoincrement=True, comment='ID') material_id = Column(String(255), nullable=False, comment='物资id') io_number = Column(String(255), nullable=False, comment='出入库单号') io_flag = Column(String(10), nullable=False, comment='出入库标识') changed_stock = Column(Integer, nullable=False, comment='变动库存') remaining_stock = Column(Integer, nullable=False, comment='剩余库存') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') remark = Column(Text, comment='备注') class ResourceProvisionInboundBasic(Base): __tablename__ = 'resource_provision_inbound_basic' id = Column(Integer, primary_key=True, autoincrement=True, comment='ID') warehouse_id = Column(String(255), nullable=False, comment='仓库id') purchase_order_number = Column(String(255), nullable=False, comment='采购单号') is_donation = Column(String(10), nullable=False, comment='是否捐赠(是、否)') transport_order_number = Column(String(255), nullable=False, comment='运输单号') donator_phone = Column(String(20), comment='捐赠人联系电话') donator_name = Column(String(255), comment='捐赠人姓名') reviewer = Column(String(255), comment='审核人') enterprise_name = Column(String(255), comment='企业名称') enterprise_code = Column(String(255), comment='企业编号') grading_info = Column(String(255), comment='分级信息') type = Column(Integer, nullable=False, comment='类型(1 调拨入库、2 归还入库、3 回收入库)') supplier_name = Column(String(255), comment='供应商名称') creation_time = Column(DateTime,default=datetime.now, comment='创建时间') remark = Column(Text, comment='备注') supplier_code = Column(String(255), comment='供应商编号') completion_time = Column(DateTime, comment='完成时间') planned_completion_time = Column(DateTime, comment='计划完成时间') room_id = Column(String(255), comment='库房id') inbound_order_number = Column(String(255), comment='入库单号') new_time = Column(DateTime, default=datetime.now, comment='新增时间') create_time = Column(DateTime, default=datetime.now, comment='数据创建时间') update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间') create_dept = Column(BigInteger, default=None, comment='创建部门') create_by = Column(BigInteger, default=None, comment='创建者') update_by = Column(BigInteger, default=None, comment='更新者') del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')