resource_provision_base.py 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. from sqlalchemy import ForeignKey,Column, String, Numeric, DateTime, Integer,Float,Boolean,BigInteger,Text
  2. # from sqlalchemy.orm import declarative_base
  3. from sqlalchemy.ext.declarative import declarative_base
  4. from datetime import datetime
  5. import uuid
  6. Base = declarative_base()
  7. class WaterResourceProject(Base):
  8. __tablename__ = 'water_resource_projects'
  9. id = Column(Integer, primary_key=True, autoincrement=True, comment='数据自增键')
  10. jsdwzjlx = Column(String(50), comment='建设单位证件类型')
  11. lxfs = Column(String(50), comment='联系方式')
  12. sjtgbmtyshxydm = Column(String(18), comment='数据提供部门统一社会信用代码')
  13. jdgljgbm = Column(String(50), comment='监督管理机关编码')
  14. cd_time = Column(DateTime, comment='插入时间')
  15. sjtgbmmc = Column(String(400), comment='数据提供部门名称')
  16. ggmj = Column(String(50), comment='灌溉面积')
  17. sjtgbmxzqhdm = Column(String(12), comment='数据提供部门行政区划代码')
  18. jsdwzjhm = Column(String(50), comment='建设单位证件号码')
  19. xzqhdm = Column(String(50), comment='水利设施和水利工程所在地行政区划代码')
  20. cd_operation = Column(String(10), comment='新增数据类型 I-INSERT, U_UPDATE, D-DELETE')
  21. zdmj = Column(String(50), comment='占地面积')
  22. d_bmmc = Column(String(500), comment='前置机归属数源部门名称源')
  23. etl_time = Column(DateTime, comment='ETL时间')
  24. jssj = Column(String(50), comment='建设时间')
  25. jsdwmc = Column(String(400), comment='建设单位名称')
  26. slsshslgcmc = Column(String(400), comment='水利设施和水利工程名称')
  27. cd_batch = Column(String(200), comment='数据批次号')
  28. slsshslgcdd = Column(String(400), comment='水利设施和水利工程地点')
  29. jdgljg = Column(String(400), comment='监督管理机关')
  30. jingdu = Column(String(50), comment='经度')
  31. weidu = Column(String(50), comment='维度')
  32. is_delete = Column(Integer, comment='删除标识')
  33. class Config:
  34. allow_population_by_field_name = True
  35. orm_mode = True
  36. def to_dict(self):
  37. return {
  38. "id": self.id,
  39. "jsdwzjlx": self.jsdwzjlx,
  40. "lxfs": self.lxfs,
  41. "sjtgbmtyshxydm": self.sjtgbmtyshxydm,
  42. "jdgljgbm": self.jdgljgbm,
  43. "cd_time": self.cd_time,
  44. "sjtgbmmc": self.sjtgbmmc,
  45. "ggmj": self.ggmj,
  46. "sjtgbmxzqhdm": self.sjtgbmxzqhdm,
  47. "jsdwzjhm": self.jsdwzjhm,
  48. "xzqhdm": self.xzqhdm,
  49. "cd_operation": self.cd_operation,
  50. "zdmj": self.zdmj,
  51. "d_bmmc": self.d_bmmc,
  52. "etl_time": self.etl_time,
  53. "jssj": self.jssj,
  54. "jsdwmc": self.jsdwmc,
  55. "slsshslgcmc": self.slsshslgcmc,
  56. "cd_batch": self.cd_batch,
  57. "slsshslgcdd": self.slsshslgcdd,
  58. "jdgljg": self.jdgljg,
  59. "jingdu": self.jingdu,
  60. "weidu": self.weidu,
  61. # "is_delete": self.is_delete
  62. }
  63. class Unit(Base):
  64. __tablename__ = 'rescue_units'
  65. id = Column(Integer, autoincrement=True, primary_key=True)
  66. name = Column(String(255), nullable=False, comment='单位名称')
  67. category = Column(String(100), nullable=False, comment='类别')
  68. address = Column(String(255), nullable=False, comment='地址')
  69. equipment = Column(String(255), comment='装备')
  70. training = Column(String(255), comment='训练')
  71. responsible_person = Column(String(100), comment='负责人')
  72. contact_number = Column(String(20), comment='联系电话')
  73. longitude = Column(Float, comment='经度')
  74. latitude = Column(Float, comment='纬度')
  75. is_delete = Column(Integer, comment='删除标识')
  76. position = Column(String(100), comment='负责人职务')
  77. team_size = Column(Integer, comment='队伍人数')
  78. supervisor_unit = Column(String(100), comment='主管单位')
  79. add_time = Column(DateTime, comment='插入时间')
  80. def to_dict(self):
  81. return {
  82. "id": self.id,
  83. "name": self.name,
  84. "category": self.category,
  85. "address": self.address,
  86. "equipment": self.equipment,
  87. "training": self.training,
  88. "responsible_person": self.responsible_person,
  89. "contact_number": self.contact_number,
  90. "longitude": self.longitude,
  91. "latitude": self.latitude,
  92. "position": self.position, # 新增字段:负责人职务
  93. "team_size": self.team_size, # 新增字段:队伍人数
  94. "supervisor_unit": self.supervisor_unit, # 新增字段:主管单位
  95. "add_time": self.add_time
  96. # "is_delete": self.is_delete
  97. }
  98. class Config:
  99. allow_population_by_field_name = True
  100. orm_mode = True
  101. class RescuePersonnel(Base):
  102. __tablename__ = 'rescue_personnel'
  103. id = Column(Integer, primary_key=True, autoincrement=True)
  104. name = Column(String(255), nullable=False, comment='姓名')
  105. contact_number = Column(String(20), nullable=False, comment='联系电话')
  106. gender = Column(String(10), nullable=False, comment='性别')
  107. current_address = Column(String(255), nullable=False, comment='现在地址')
  108. position = Column(String(100), comment='职务')
  109. unit_id = Column(Integer, comment='所属救援人员单位ID')
  110. unit_name = Column(Integer, comment='所属救援人员单位')
  111. is_delete = Column(Integer, default=0, comment='删除标识')
  112. modified_time = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, comment='修改时间')
  113. created_time = Column(DateTime, default=datetime.utcnow, comment='创建时间')
  114. def to_dict(self):
  115. return {
  116. "id": self.id,
  117. "name": self.name,
  118. "contact_number": self.contact_number,
  119. "gender": self.gender,
  120. "current_address": self.current_address,
  121. "position": self.position,
  122. "unit_id": self.unit_id,
  123. # "is_delete": self.is_delete,
  124. "unit_name": self.unit_name,
  125. "modified_time": self.modified_time.isoformat() if self.modified_time else None,
  126. "created_time": self.created_time.isoformat() if self.created_time else None
  127. }
  128. class RescueStation(Base):
  129. __tablename__ = 'rescue_stations'
  130. id = Column(Integer, primary_key=True, autoincrement=True, comment='数字自增ID')
  131. data_id = Column(String(255), primary_key=True, default=uuid.uuid4, comment='uuid主键')
  132. fwdx = Column(String(100), comment='服务对象姓名')
  133. zj = Column(String(20), comment='所属镇街')
  134. lng = Column(String(30), comment='救助站经度')
  135. cd_time = Column(DateTime, comment='更新时间')
  136. fwdmc = Column(String(50), comment='救助站名称')
  137. fwnr = Column(String(500), comment='服务内容')
  138. add_time = Column(DateTime, comment='新增时间')
  139. cd_operation = Column(String(1), comment='操作方式')
  140. fwdlx = Column(String(2), comment='救助站类型')
  141. lxdh = Column(String(30), comment='联系电话')
  142. kfsj = Column(String(100), comment='开放时间')
  143. lat = Column(String(30), comment='救助站纬度')
  144. fwdjj = Column(String(1000), comment='救助站简介')
  145. lxr = Column(String(30), comment='联系人')
  146. fid = Column(String(36), comment='主键')
  147. fwdzt = Column(String(1), comment='服务点状态')
  148. fwdaddr = Column(String(80), comment='服务点地址')
  149. ssqx = Column(String(80), comment='所属区县') #新增
  150. is_delete = Column(Boolean, default=False, comment='删除标识')
  151. def to_dict(self):
  152. return {
  153. "id": self.id,
  154. "data_id": self.data_id,
  155. "fwdx": self.fwdx,
  156. "zj": self.zj,
  157. "lng": self.lng,
  158. "cd_time": self.cd_time.isoformat() if self.cd_time else None,
  159. "fwdmc": self.fwdmc,
  160. "fwnr": self.fwnr,
  161. "add_time": self.add_time.isoformat() if self.add_time else None,
  162. "cd_operation": self.cd_operation,
  163. "fwdlx": self.fwdlx,
  164. "lxdh": self.lxdh,
  165. "kfsj": self.kfsj,
  166. "lat": self.lat,
  167. "fwdjj": self.fwdjj,
  168. "lxr": self.lxr,
  169. "fid": self.fid,
  170. "fwdzt": self.fwdzt,
  171. "fwdaddr": self.fwdaddr,
  172. "ssqx":self.ssqx
  173. # "is_delete": self.is_delete
  174. }
  175. class DefenseProject(Base):
  176. __tablename__ = 'defense_projects'
  177. data_id = Column(String(255), primary_key=True, default=uuid.uuid4, comment='uuid主键')
  178. id = Column(BigInteger, primary_key=True, autoincrement=True, comment='数字自增ID')
  179. gcmc = Column(String(200), comment='工程名称')
  180. jsdw = Column(String(100), comment='建设单位')
  181. whdw = Column(String(100), comment='维护单位')
  182. rfzyjlgcs = Column(String(100), comment='人防专业监理工程师')
  183. jsdd = Column(String(100), comment='建设地点')
  184. cd_operation = Column(String(1), comment='操作方式')
  185. yjdxsmj = Column(Numeric(12), comment='应建人防地下室面积(㎡)')
  186. sjdxsmj = Column(Numeric(12), comment='实建人防地下室面积(㎡)')
  187. cd_time = Column(DateTime, default=datetime.utcnow, comment='更新时间')
  188. add_time = Column(DateTime, default=datetime.utcnow, comment='新增时间')
  189. jldw = Column(String(100), comment='监理单位')
  190. jsdwdm = Column(String(100), comment='建设单位统一社会信用代码')
  191. kgsj = Column(DateTime, comment='开工时间')
  192. stdw = Column(String(100), comment='审图单位')
  193. cd_batch = Column(String(100), comment='批次号') #新增
  194. rfsjdwdm = Column(String(100), comment='人防设计单位单位统一社会信用代码')
  195. rfsjdw = Column(String(100), comment='人防设计单位单位')
  196. ybrs = Column(Numeric, comment='掩蔽人数')
  197. stdwdm = Column(String(100), comment='审图单位统一社会信用代码')
  198. whdwdm = Column(String(100), comment='维护单位统一社会信用代码')
  199. jldwdm = Column(String(100), comment='监理单位统一社会信用代码')
  200. rfzjlgcs = Column(String(100), comment='人防总监理工程师')
  201. gcid = Column(String(50), comment='主键')
  202. extend2 = Column(String(200), comment='扩展2')
  203. data_area = Column(String(12), comment='数据区域')
  204. extend1 = Column(String(200), comment='扩展1')
  205. jgsj = Column(DateTime, comment='竣工时间')
  206. rffhsbdw = Column(String(100), comment='人防防护设备单位')#新增
  207. rffhsbdwdm = Column(String(100), comment='人防防护设备单位统一社会信用代码')#新增
  208. jingdu = Column(Float, comment='经度')#新增
  209. weidu = Column(Float, comment='纬度')#新增
  210. is_delete = Column(Boolean, default=False, comment='删除标识')
  211. def to_dict(self):
  212. return {
  213. "id": self.id,
  214. "data_id": str(self.data_id), # 确保UUID转换为字符串
  215. "gcmc": self.gcmc,
  216. "jsdw": self.jsdw,
  217. "whdw": self.whdw,
  218. "rfzyjlgcs": self.rfzyjlgcs,
  219. "jsdd": self.jsdd,
  220. "cd_operation": self.cd_operation,
  221. "yjdxsmj": self.yjdxsmj,
  222. "sjdxsmj": self.sjdxsmj,
  223. "cd_time": self.cd_time.isoformat() if self.cd_time else None,
  224. "add_time": self.add_time.isoformat() if self.add_time else None,
  225. "jldw": self.jldw,
  226. "jsdwdm": self.jsdwdm,
  227. "kgsj": self.kgsj.isoformat() if self.kgsj else None,
  228. "stdw": self.stdw,
  229. "rfsjdwdm": self.rfsjdwdm,
  230. "rfsjdw": self.rfsjdw,
  231. "ybrs": self.ybrs,
  232. "stdwdm": self.stdwdm,
  233. "whdwdm": self.whdwdm,
  234. "jldwdm": self.jldwdm,
  235. "rfzjlgcs": self.rfzjlgcs,
  236. "gcid": self.gcid,
  237. "extend2": self.extend2,
  238. "data_area": self.data_area,
  239. "extend1": self.extend1,
  240. "jgsj": self.jgsj.isoformat() if self.jgsj else None,
  241. "cd_batch":self.cd_batch,
  242. "rffhsbdw":self.rffhsbdw,
  243. "rffhsbdwdm":self.rffhsbdwdm,
  244. "jingdu":self.jingdu,
  245. "weidu":self.weidu
  246. # "is_delete": self.is_delete,
  247. }
  248. class Shelter(Base):
  249. __tablename__ = 'shelters'
  250. data_id = Column(String(255), primary_key=True, default=uuid.uuid4, comment='uuid主键')
  251. id = Column(Integer, primary_key=True, autoincrement=True, comment='数字自增ID')
  252. admin_area = Column(String(100), comment='行政区域')
  253. full_name = Column(String(200), comment='应急避难场所全称')
  254. address = Column(String(255), comment='应急避难场所地址')
  255. incident_type = Column(String(100), comment='按突发事件类型分类')
  256. shelter_type = Column(String(100), comment='避难种类')
  257. total_area = Column(Numeric, comment='应急避难场所占地总面积(平方米)')
  258. indoor_area = Column(Numeric, comment='应急避难场所室内面积(平方米)')
  259. capacity = Column(Numeric, comment='避难场所容纳人数(人)')
  260. supplies = Column(String(500), comment='物资储备')
  261. facilities = Column(String(500), comment='应急设施')
  262. is_delete = Column(Boolean, default=False, comment='删除标识')
  263. modified_time = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, comment='修改时间')
  264. created_time = Column(DateTime, default=datetime.utcnow, comment='创建时间')
  265. def to_dict(self):
  266. return {
  267. "id": self.id,
  268. "data_id": str(self.data_id),
  269. "admin_area": self.admin_area,
  270. "full_name": self.full_name,
  271. "address": self.address,
  272. "incident_type": self.incident_type,
  273. "shelter_type": self.shelter_type,
  274. "total_area": self.total_area,
  275. "indoor_area": self.indoor_area,
  276. "capacity": self.capacity,
  277. "supplies": self.supplies,
  278. "facilities": self.facilities,
  279. # "is_delete": self.is_delete,
  280. "modified_time": self.modified_time.isoformat() if self.modified_time else None,
  281. "created_time": self.created_time.isoformat() if self.created_time else None,
  282. }
  283. class ResourceProvisionMaterialType(Base):
  284. __tablename__ = 'resource_provision_material_types'
  285. id = Column(Integer, autoincrement=True, primary_key=True, comment='物资类型ID')
  286. parent_id = Column(Integer, ForeignKey('resource_provision_material_types.id', ondelete='SET NULL'), comment='父类ID')
  287. material_category_name = Column(String(255), nullable=False, comment='物资类别名称')
  288. material_category_level = Column(Integer, comment='物资类别等级')
  289. sort_order = Column(Integer, comment='排序')
  290. display_status = Column(String(1), default='1', comment='显示状态(1显示 0不显示)')
  291. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  292. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  293. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  294. create_dept = Column(BigInteger, default=None, comment='创建部门')
  295. create_by = Column(BigInteger, default=None, comment='创建者')
  296. update_by = Column(BigInteger, default=None, comment='更新者')
  297. remark = Column(Text, nullable=True, comment='备注')
  298. def __repr__(self):
  299. return f"<MaterialType(name='{self.material_category_name}', level='{self.material_category_level}')>"
  300. class ResourceProvisionWarehouseInfo(Base):
  301. __tablename__ = 'resource_provision_warehouse_info'
  302. warehouse_id = Column(String(255), primary_key=True, autoincrement=True, comment='仓库id')
  303. warehouse_name = Column(String(255), nullable=True, comment='仓库名称')
  304. status = Column(String(50), nullable=True, comment='状态')
  305. contact_person = Column(String(100), nullable=True, comment='联系人')
  306. contact_phone = Column(String(20), nullable=True, comment='联系电话')
  307. address = Column(String(255), nullable=True, comment='地址')
  308. remark = Column(Text, nullable=True, comment='备注')
  309. type = Column(String(50), nullable=True, comment='类型')
  310. level = Column(String(50), nullable=True, comment='等级')
  311. storage_dept_id = Column(Integer, nullable=True, comment='物资保管部门id')
  312. storage_dept_name = Column(String(255), nullable=True, comment='物资保管部门名称')
  313. area_name = Column(String(100), nullable=True, comment='地区')
  314. longitude = Column(Numeric(9, 6), nullable=True, comment='经度')
  315. latitude = Column(Numeric(8, 6), nullable=True, comment='纬度')
  316. area = Column(Numeric(15, 2), nullable=True, comment='占地面积(平方米)')
  317. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  318. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  319. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  320. create_dept = Column(BigInteger, default=None, comment='创建部门')
  321. create_by = Column(BigInteger, default=None, comment='创建者')
  322. update_by = Column(BigInteger, default=None, comment='更新者')
  323. class ResourceProvisionWarehouseRoomInfo(Base):
  324. __tablename__ = 'resource_provision_warehouse_room_info'
  325. id = Column(String(255), primary_key=True, comment='ID')
  326. room_name = Column(String(255), nullable=True, comment='库房名称')
  327. warehouse = Column(String(255), nullable=True, comment='所在仓库')
  328. room_area = Column(Numeric(15, 2), nullable=True, comment='库房面积(平方米)')
  329. available_area = Column(Numeric(15, 2), nullable=True, comment='可用仓储面积(平方米)')
  330. height = Column(Numeric(10, 2), nullable=True, comment='高度(米)')
  331. room_volume = Column(Numeric(20, 2), nullable=True, comment='库房容积(立方米)')
  332. available_volume = Column(Numeric(20, 2), nullable=True, comment='可用库房容积(立方米)')
  333. level = Column(String(50), nullable=True, comment='等级')
  334. storage_type_code = Column(String(50), nullable=True, comment='存放类型')
  335. storage_type = Column(String(50), nullable=True, comment='保管类型')
  336. last_inventory_time = Column(DateTime, nullable=True, comment='库存确认最新时间')
  337. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  338. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  339. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  340. create_dept = Column(BigInteger, default=None, comment='创建部门')
  341. create_by = Column(BigInteger, default=None, comment='创建者')
  342. update_by = Column(BigInteger, default=None, comment='更新者')
  343. remark = Column(Text, nullable=True, comment='备注')
  344. class ResourceProvisionMaterialInfo(Base):
  345. __tablename__ = 'resource_provision_material_info'
  346. material_id = Column(Integer, primary_key=True, autoincrement=True, comment='物资编码')
  347. material_name = Column(String(255), nullable=True, comment='物资名称')
  348. warehouse_id = Column(Integer, nullable=True, comment='仓库id')
  349. inventory = Column(Integer, nullable=True, comment='库存')
  350. specification = Column(String(255), nullable=True, comment='规格')
  351. model = Column(String(255), nullable=True, comment='型号')
  352. category_name = Column(String(255), nullable=True, comment='分类名称')
  353. material_type = Column(String(255), nullable=True, comment='物资类型')
  354. unit_name = Column(String(255), nullable=True, comment='计量单位名称')
  355. brand_name = Column(String(255), nullable=True, comment='品牌名称')
  356. length = Column(Numeric(10, 2), nullable=True, comment='长(厘米)')
  357. width = Column(Numeric(10, 2), nullable=True, comment='宽(厘米)')
  358. height = Column(Numeric(10, 2), nullable=True, comment='高(厘米)')
  359. volume = Column(Numeric(20, 2), nullable=True, comment='体积(立方厘米)')
  360. gross_weight = Column(Numeric(10, 2), nullable=True, comment='毛重(kg)')
  361. net_weight = Column(Numeric(10, 2), nullable=True, comment='净重(kg)')
  362. manufacturer = Column(String(255), nullable=True, comment='生产厂商')
  363. origin = Column(String(255), nullable=True, comment='产地')
  364. status = Column(String(50), nullable=True, comment='状态')
  365. room_id = Column(Integer, nullable=True, comment='库房id')
  366. package_quantity = Column(Integer, nullable=True, comment='包装数量')
  367. package_volume = Column(Numeric(20, 2), nullable=True, comment='包装体积(立方厘米)')
  368. package_weight = Column(Numeric(10, 2), nullable=True, comment='包装重量(kg)')
  369. price = Column(Numeric(10, 2), nullable=True, comment='价格')
  370. selling_price = Column(Numeric(10, 2), nullable=True, comment='售卖价格')
  371. value = Column(Numeric(10, 2), nullable=True, comment='价值')
  372. cost_price = Column(Numeric(10, 2), nullable=True, comment='成本价格')
  373. disaster_types = Column(String(255), nullable=True, comment='适用灾种')
  374. maintenance = Column(Text, nullable=True, comment='使用保养')
  375. supplier_name = Column(String(255), nullable=True, comment='供应商名称')
  376. special_transportation_requirements = Column(Text, nullable=True, comment='特殊运输要求')
  377. material = Column(String(255), nullable=True, comment='材质')
  378. shelf_life = Column(DateTime, nullable=True, comment='保质期')
  379. inventory_warning_pusher = Column(String(255), nullable=True, comment='库存预警推送人')
  380. inventory_warning_quantity = Column(Integer, nullable=True, comment='库存预警数量')
  381. shelf_life_warning_days = Column(Integer, nullable=True, comment='保质期到期预警天数')
  382. shelf_life_warning_pusher = Column(String(255), nullable=True, comment='保质期预警推送人')
  383. from_sys= Column(String(255), nullable=True, comment='来源系统')
  384. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  385. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  386. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  387. create_dept = Column(BigInteger, default=None, comment='创建部门')
  388. create_by = Column(BigInteger, default=None, comment='创建者')
  389. update_by = Column(BigInteger, default=None, comment='更新者')
  390. remark = Column(Text, nullable=True, comment='备注')
  391. class ResourceProvisionFile(Base):
  392. __tablename__ = 'resource_provision_file'
  393. id = Column(Integer, autoincrement=True, primary_key=True)
  394. file_id = Column(String(50), nullable=False, comment='文件id')
  395. file_name = Column(String(255), nullable=False, comment='文件名称')
  396. file_name_desc = Column(String(255), nullable=False, comment='文件名称原名')
  397. file_path = Column(String(255), comment='文件存储路径')
  398. file_size = Column(String(50), comment='文件大小')
  399. status = Column(String(50), comment='文件状态')
  400. foreign_key = Column(String(50), comment='文件外键 --技术字段')
  401. from_scenario = Column(String(50), comment='对应标识 --技术字段')
  402. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  403. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  404. create_dept = Column(BigInteger, default=None, comment='创建部门')
  405. create_by = Column(BigInteger, default=None, comment='创建者')
  406. update_by = Column(BigInteger, default=None, comment='更新者')
  407. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)') #更新预案信息的时候 先将原有的进行备注删除
  408. remark = Column(Text, nullable=True, comment='备注')
  409. class Config:
  410. orm_mode = True
  411. class ResourceProvisionMaterialBarcode(Base):
  412. __tablename__ = 'resource_provision_material_barcode'
  413. id = Column(String(255), primary_key=True, comment='ID')
  414. material_code = Column(String(50), nullable=True, comment='物资编码')
  415. barcode = Column(String(255), nullable=True, comment='条形码')
  416. qr_code = Column(String(255), nullable=True, comment='二维码')
  417. status = Column(String(50), default='1',nullable=True, comment='状态')
  418. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  419. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  420. create_dept = Column(BigInteger, default=None, comment='创建部门')
  421. create_by = Column(BigInteger, default=None, comment='创建者')
  422. update_by = Column(BigInteger, default=None, comment='更新者')
  423. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  424. remark = Column(Text, nullable=True, comment='备注')
  425. class Config:
  426. orm_mode = True
  427. class ResourceProvisionProcurementDeclaration(Base):
  428. __tablename__ = 'resource_provision_procurement_declaration'
  429. id = Column(Integer, primary_key=True, comment='ID')
  430. declaration_date = Column(DateTime, default=datetime.now, nullable=False, comment='申报日期')
  431. declaration_amount = Column(Float, nullable=False, comment='申报金额(元)')
  432. declaration_unit = Column(String(255), nullable=False, comment='申报单位')
  433. declaration_person = Column(String(255), nullable=False, comment='申报人')
  434. declaration_details = Column(String(255), nullable=False, comment='申报情况')
  435. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  436. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  437. create_dept = Column(BigInteger, default=None, comment='创建部门')
  438. create_by = Column(BigInteger, default=None, comment='创建者')
  439. update_by = Column(BigInteger, default=None, comment='更新者')
  440. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  441. remark = Column(Text, nullable=True, comment='备注')
  442. class ResourceProvisionProcurementDeclarationDetail(Base):
  443. __tablename__ = 'resource_provision_procurement_declaration_detail'
  444. id = Column(Integer, primary_key=True, comment='ID')
  445. serial_number = Column(Integer, nullable=False, comment='序号')
  446. declaration_id = Column(String(255), nullable=False, comment='申报基础表id')
  447. warehouse_id= Column(String(255), nullable=False, comment='仓库id')
  448. material_type = Column(String(255), nullable=False, comment='物资类型')
  449. material_code = Column(String(255), nullable=False, comment='物资名称')
  450. material_quantity = Column(Integer, nullable=False, comment='物资数量(件)')
  451. material_unit_price = Column(Float, nullable=False, comment='物资单价')
  452. material_purpose = Column(Text, nullable=False, comment='物资用途')
  453. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  454. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  455. create_dept = Column(BigInteger, default=None, comment='创建部门')
  456. create_by = Column(BigInteger, default=None, comment='创建者')
  457. update_by = Column(BigInteger, default=None, comment='更新者')
  458. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  459. remark = Column(Text, nullable=True, comment='备注')
  460. class ResourceProvisionProcurementReview(Base):
  461. __tablename__ = 'resource_provision_procurement_review'
  462. id = Column(Integer, primary_key=True, comment='ID')
  463. reviewer = Column(String(255), nullable=False, comment='审核人')
  464. declaration_id = Column(Integer, nullable=False, comment='申报基础表id')
  465. review_result = Column(String(50), nullable=False, comment='审核结果')
  466. review_comments = Column(Text, comment='审核意见')
  467. review_date = Column(DateTime, default=datetime.now, comment='审核时间')
  468. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  469. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  470. create_dept = Column(BigInteger, default=None, comment='创建部门')
  471. create_by = Column(BigInteger, default=None, comment='创建者')
  472. update_by = Column(BigInteger, default=None, comment='更新者')
  473. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  474. remark = Column(Text, nullable=True, comment='备注')
  475. class ResourceProvisionDispatch(Base):
  476. __tablename__ = 'resource_provision_dispatch'
  477. id = Column(Integer, primary_key=True, comment='ID')
  478. dispatch_date = Column(DateTime, default=datetime.now, nullable=False, comment='调度日期')
  479. dispatch_purpose = Column(Text, nullable=False, comment='调度目的')
  480. dispatch_unit = Column(String(255), nullable=False, comment='申报单位')
  481. dispatch_person = Column(String(255), nullable=False, comment='申报人')
  482. dispatch_status = Column(String(255), nullable=False, comment='申报情况')
  483. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  484. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  485. create_dept = Column(BigInteger, default=None, comment='创建部门')
  486. create_by = Column(BigInteger, default=None, comment='创建者')
  487. update_by = Column(BigInteger, default=None, comment='更新者')
  488. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  489. remark = Column(Text, nullable=True, comment='备注')
  490. class ResourceProvisionDispatchDetail(Base):
  491. __tablename__ = 'resource_provision_dispatch_detail'
  492. id = Column(Integer, primary_key=True, comment='ID')
  493. serial_number = Column(Integer, nullable=False, comment='序号')
  494. dispatch_id = Column(String(255), nullable=False, comment='调度基础表id')
  495. warehouse_id= Column(String(255), nullable=False, comment='仓库id')
  496. material_type_id = Column(String(255), nullable=False, comment='物资类型id')
  497. material_type = Column(String(255), nullable=False, comment='物资类型')
  498. material_code = Column(String(255), nullable=False, comment='物资id')
  499. material_name = Column(String(255), nullable=False, comment='物资名称')
  500. material_quantity = Column(Integer, nullable=False, comment='物资数量(件)')
  501. material_purpose = Column(Text, nullable=False, comment='物资用途')
  502. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  503. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  504. create_dept = Column(BigInteger, default=None, comment='创建部门')
  505. create_by = Column(BigInteger, default=None, comment='创建者')
  506. update_by = Column(BigInteger, default=None, comment='更新者')
  507. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  508. remark = Column(Text, nullable=True, comment='备注')
  509. class ResourceProvisionDispatchReview(Base):
  510. __tablename__ = 'resource_provision_dispatch_review'
  511. id = Column(Integer, primary_key=True, comment='ID')
  512. reviewer = Column(String(255), nullable=False, comment='审核人')
  513. dispatch_id = Column(Integer, nullable=False, comment='调度基础表id')
  514. review_result = Column(String(50), nullable=False, comment='审核结果')
  515. review_comments = Column(Text, comment='审核意见')
  516. review_date = Column(DateTime, default=datetime.now, comment='审核时间')
  517. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  518. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  519. create_dept = Column(BigInteger, default=None, comment='创建部门')
  520. create_by = Column(BigInteger, default=None, comment='创建者')
  521. update_by = Column(BigInteger, default=None, comment='更新者')
  522. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  523. remark = Column(Text, nullable=True, comment='备注')
  524. class ResourceProvisionOutboundBasic(Base):
  525. __tablename__ = 'resource_provision_outbound_basic'
  526. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  527. outbound_number = Column(String(255), nullable=False, comment='出库单号')
  528. warehouse_id = Column(String(255), nullable=False, comment='仓库id')
  529. room_id = Column(String(255), comment='库房id')
  530. total_volume = Column(Numeric(20, 2), nullable=False, comment='出库单商品总体积(立方厘米)')
  531. total_weight = Column(Numeric(20, 2), nullable=False, comment='出库单商品总重量(kg)')
  532. total_shipping_volume = Column(Numeric(20, 2), nullable=False, comment='出库单发货总体积(立方厘米)')
  533. total_shipping_weight = Column(Numeric(20, 2), nullable=False, comment='出库单发货总重量(kg)')
  534. total_quantity = Column(Integer, nullable=False, comment='出库单商品总数量')
  535. shipping_time = Column(DateTime, comment='出库单发货时间')
  536. disaster_type = Column(String(255), comment='灾种名称')
  537. dispatching_agency = Column(String(255), comment='调运机构名称')
  538. shipper_name = Column(String(255), comment='发货人姓名')
  539. shipper_mobile = Column(String(20), comment='发货人手机')
  540. shipper_address = Column(String(255), comment='发货人地址')
  541. shipper_remark = Column(Text, comment='发货方备注')
  542. receiver_name = Column(String(255), comment='收货人姓名')
  543. receiver_mobile = Column(String(20), comment='收货人手机')
  544. receiver_address = Column(String(255), comment='收货人地址')
  545. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  546. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  547. create_dept = Column(BigInteger, default=None, comment='创建部门')
  548. create_by = Column(BigInteger, default=None, comment='创建者')
  549. update_by = Column(BigInteger, default=None, comment='更新者')
  550. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  551. remark = Column(Text, comment='备注')
  552. class ResourceProvisionWarehouseMovement(Base):
  553. __tablename__ = 'resource_provision_warehouse_movement'
  554. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  555. material_id = Column(String(255), nullable=False, comment='物资id')
  556. warehouse_id = Column(String(255), nullable=False, comment='仓库id')
  557. room_id = Column(String(255), comment='库房id')
  558. io_number = Column(String(255), nullable=False, comment='出入库单号')
  559. io_flag = Column(String(10), nullable=False, comment='出入库标识')
  560. changed_stock = Column(Integer, nullable=False, comment='变动库存')
  561. remaining_stock = Column(Integer, nullable=False, comment='剩余库存')
  562. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  563. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  564. create_dept = Column(BigInteger, default=None, comment='创建部门')
  565. create_by = Column(BigInteger, default=None, comment='创建者')
  566. update_by = Column(BigInteger, default=None, comment='更新者')
  567. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  568. remark = Column(Text, comment='备注')
  569. class ResourceProvisionInboundBasic(Base):
  570. __tablename__ = 'resource_provision_inbound_basic'
  571. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  572. warehouse_id = Column(String(255), nullable=False, comment='仓库id')
  573. purchase_order_number = Column(String(255), nullable=False, comment='采购单号')
  574. is_donation = Column(String(10), nullable=False, comment='是否捐赠(是、否)')
  575. transport_order_number = Column(String(255), nullable=False, comment='运输单号')
  576. donator_phone = Column(String(20), comment='捐赠人联系电话')
  577. donator_name = Column(String(255), comment='捐赠人姓名')
  578. reviewer = Column(String(255), comment='审核人')
  579. enterprise_name = Column(String(255), comment='企业名称')
  580. enterprise_code = Column(String(255), comment='企业编号')
  581. grading_info = Column(String(255), comment='分级信息')
  582. type = Column(Integer, nullable=False, comment='类型(1 调拨入库、2 归还入库、3 回收入库)')
  583. supplier_name = Column(String(255), comment='供应商名称')
  584. creation_time = Column(DateTime,default=datetime.now, comment='创建时间')
  585. remark = Column(Text, comment='备注')
  586. supplier_code = Column(String(255), comment='供应商编号')
  587. completion_time = Column(DateTime, comment='完成时间')
  588. planned_completion_time = Column(DateTime, comment='计划完成时间')
  589. room_id = Column(String(255), comment='库房id')
  590. inbound_order_number = Column(String(255), comment='入库单号')
  591. new_time = Column(DateTime, default=datetime.now, comment='新增时间')
  592. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  593. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  594. create_dept = Column(BigInteger, default=None, comment='创建部门')
  595. create_by = Column(BigInteger, default=None, comment='创建者')
  596. update_by = Column(BigInteger, default=None, comment='更新者')
  597. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')