resource_provision_base.py 38 KB

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