resource_provision_base.py 42 KB

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