resource_provision_base.py 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  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), comment='行政区域')
  285. full_name = Column(String(200), comment='应急避难场所全称')
  286. address = Column(String(255), comment='应急避难场所地址')
  287. incident_type = Column(String(100), comment='按突发事件类型分类')
  288. shelter_type = Column(String(100), comment='避难种类')
  289. total_area = Column(Numeric, comment='应急避难场所占地总面积(平方米)')
  290. indoor_area = Column(Numeric, comment='应急避难场所室内面积(平方米)')
  291. capacity = Column(Numeric, comment='避难场所容纳人数(人)')
  292. supplies = Column(String(500), comment='物资储备')
  293. facilities = Column(String(500), 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. def to_dict(self):
  298. return {
  299. "id": self.id,
  300. "data_id": str(self.data_id),
  301. "admin_area": self.admin_area,
  302. "full_name": self.full_name,
  303. "address": self.address,
  304. "incident_type": self.incident_type,
  305. "shelter_type": self.shelter_type,
  306. "total_area": self.total_area,
  307. "indoor_area": self.indoor_area,
  308. "capacity": self.capacity,
  309. "supplies": self.supplies,
  310. "facilities": self.facilities,
  311. # "is_delete": self.is_delete,
  312. "modified_time": self.modified_time.isoformat() if self.modified_time else None,
  313. "created_time": self.created_time.isoformat() if self.created_time else None,
  314. }
  315. class ResourceProvisionMaterialType(Base):
  316. __tablename__ = 'resource_provision_material_types'
  317. id = Column(Integer, autoincrement=True, primary_key=True, comment='物资类型ID')
  318. parent_id = Column(Integer, ForeignKey('resource_provision_material_types.id', ondelete='SET NULL'), comment='父类ID')
  319. material_category_name = Column(String(255), nullable=False, comment='物资类别名称')
  320. material_category_level = Column(Integer, comment='物资类别等级')
  321. sort_order = Column(Integer, comment='排序')
  322. display_status = Column(String(1), default='1', comment='显示状态(1显示 0不显示)')
  323. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  324. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  325. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  326. create_dept = Column(BigInteger, default=None, comment='创建部门')
  327. create_by = Column(BigInteger, default=None, comment='创建者')
  328. update_by = Column(BigInteger, default=None, comment='更新者')
  329. remark = Column(Text, nullable=True, comment='备注')
  330. def __repr__(self):
  331. return f"<MaterialType(name='{self.material_category_name}', level='{self.material_category_level}')>"
  332. class ResourceProvisionWarehouseInfo(Base):
  333. __tablename__ = 'resource_provision_warehouse_info'
  334. warehouse_id = Column(String(255), primary_key=True, autoincrement=True, comment='仓库id')
  335. warehouse_name = Column(String(255), nullable=True, comment='仓库名称')
  336. status = Column(String(50), nullable=True, comment='状态')
  337. contact_person = Column(String(100), nullable=True, comment='联系人')
  338. contact_phone = Column(String(20), nullable=True, comment='联系电话')
  339. address = Column(String(255), nullable=True, comment='地址')
  340. remark = Column(Text, nullable=True, comment='备注')
  341. type = Column(String(50), nullable=True, comment='类型')
  342. level = Column(String(50), nullable=True, comment='等级')
  343. storage_dept_id = Column(Integer, nullable=True, comment='物资保管部门id')
  344. storage_dept_name = Column(String(255), nullable=True, comment='物资保管部门名称')
  345. area_name = Column(String(100), nullable=True, comment='地区')
  346. longitude = Column(Numeric(9, 6), nullable=True, comment='经度')
  347. latitude = Column(Numeric(8, 6), nullable=True, comment='纬度')
  348. area = Column(Numeric(15, 2), nullable=True, comment='占地面积(平方米)')
  349. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  350. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  351. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  352. create_dept = Column(BigInteger, default=None, comment='创建部门')
  353. create_by = Column(BigInteger, default=None, comment='创建者')
  354. update_by = Column(BigInteger, default=None, comment='更新者')
  355. class ResourceProvisionWarehouseRoomInfo(Base):
  356. __tablename__ = 'resource_provision_warehouse_room_info'
  357. id = Column(String(255), primary_key=True, comment='ID')
  358. room_name = Column(String(255), nullable=True, comment='库房名称')
  359. warehouse = Column(String(255), nullable=True, comment='所在仓库')
  360. room_area = Column(Numeric(15, 2), nullable=True, comment='库房面积(平方米)')
  361. available_area = Column(Numeric(15, 2), nullable=True, comment='可用仓储面积(平方米)')
  362. height = Column(Numeric(10, 2), nullable=True, comment='高度(米)')
  363. room_volume = Column(Numeric(20, 2), nullable=True, comment='库房容积(立方米)')
  364. available_volume = Column(Numeric(20, 2), nullable=True, comment='可用库房容积(立方米)')
  365. level = Column(String(50), nullable=True, comment='等级')
  366. storage_type_code = Column(String(50), nullable=True, comment='存放类型')
  367. storage_type = Column(String(50), nullable=True, comment='保管类型')
  368. last_inventory_time = Column(DateTime, nullable=True, comment='库存确认最新时间')
  369. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  370. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  371. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  372. create_dept = Column(BigInteger, default=None, comment='创建部门')
  373. create_by = Column(BigInteger, default=None, comment='创建者')
  374. update_by = Column(BigInteger, default=None, comment='更新者')
  375. remark = Column(Text, nullable=True, comment='备注')
  376. class ResourceProvisionMaterialInfo(Base):
  377. __tablename__ = 'resource_provision_material_info'
  378. material_id = Column(Integer, primary_key=True, autoincrement=True, comment='物资编码')
  379. material_name = Column(String(255), nullable=True, comment='物资名称')
  380. warehouse_id = Column(Integer, nullable=True, comment='仓库id')
  381. inventory = Column(Integer, nullable=True, comment='库存')
  382. specification = Column(String(255), nullable=True, comment='规格')
  383. model = Column(String(255), nullable=True, comment='型号')
  384. category_name = Column(String(255), nullable=True, comment='分类名称')
  385. material_type = Column(String(255), nullable=True, comment='物资类型')
  386. unit_name = Column(String(255), nullable=True, comment='计量单位名称')
  387. brand_name = Column(String(255), nullable=True, comment='品牌名称')
  388. length = Column(Numeric(10, 2), nullable=True, comment='长(厘米)')
  389. width = Column(Numeric(10, 2), nullable=True, comment='宽(厘米)')
  390. height = Column(Numeric(10, 2), nullable=True, comment='高(厘米)')
  391. volume = Column(Numeric(20, 2), nullable=True, comment='体积(立方厘米)')
  392. gross_weight = Column(Numeric(10, 2), nullable=True, comment='毛重(kg)')
  393. net_weight = Column(Numeric(10, 2), nullable=True, comment='净重(kg)')
  394. manufacturer = Column(String(255), nullable=True, comment='生产厂商')
  395. origin = Column(String(255), nullable=True, comment='产地')
  396. status = Column(String(50), nullable=True, comment='状态')
  397. room_id = Column(Integer, nullable=True, comment='库房id')
  398. package_quantity = Column(Integer, nullable=True, comment='包装数量')
  399. package_volume = Column(Numeric(20, 2), nullable=True, comment='包装体积(立方厘米)')
  400. package_weight = Column(Numeric(10, 2), nullable=True, comment='包装重量(kg)')
  401. price = Column(Numeric(10, 2), nullable=True, comment='价格')
  402. selling_price = Column(Numeric(10, 2), nullable=True, comment='售卖价格')
  403. value = Column(Numeric(10, 2), nullable=True, comment='价值')
  404. cost_price = Column(Numeric(10, 2), nullable=True, comment='成本价格')
  405. disaster_types = Column(String(255), nullable=True, comment='适用灾种')
  406. maintenance = Column(Text, nullable=True, comment='使用保养')
  407. supplier_name = Column(String(255), nullable=True, comment='供应商名称')
  408. special_transportation_requirements = Column(Text, nullable=True, comment='特殊运输要求')
  409. material = Column(String(255), nullable=True, comment='材质')
  410. shelf_life = Column(DateTime, nullable=True, comment='保质期')
  411. inventory_warning_pusher = Column(String(255), nullable=True, comment='库存预警推送人')
  412. inventory_warning_quantity = Column(Integer, nullable=True, comment='库存预警数量')
  413. shelf_life_warning_days = Column(Integer, nullable=True, comment='保质期到期预警天数')
  414. shelf_life_warning_pusher = Column(String(255), nullable=True, comment='保质期预警推送人')
  415. from_sys= Column(String(255), nullable=True, comment='来源系统')
  416. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  417. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  418. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  419. create_dept = Column(BigInteger, default=None, comment='创建部门')
  420. create_by = Column(BigInteger, default=None, comment='创建者')
  421. update_by = Column(BigInteger, default=None, comment='更新者')
  422. remark = Column(Text, nullable=True, comment='备注')
  423. class ResourceProvisionFile(Base):
  424. __tablename__ = 'resource_provision_file'
  425. id = Column(Integer, autoincrement=True, primary_key=True)
  426. file_id = Column(String(50), nullable=False, comment='文件id')
  427. file_name = Column(String(255), nullable=False, comment='文件名称')
  428. file_name_desc = Column(String(255), nullable=False, comment='文件名称原名')
  429. file_path = Column(String(255), comment='文件存储路径')
  430. file_size = Column(String(50), comment='文件大小')
  431. status = Column(String(50), comment='文件状态')
  432. foreign_key = Column(String(50), comment='文件外键 --技术字段')
  433. from_scenario = Column(String(50), 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 ResourceProvisionMaterialBarcode(Base):
  444. __tablename__ = 'resource_provision_material_barcode'
  445. id = Column(String(255), primary_key=True, comment='ID')
  446. material_code = Column(String(50), nullable=True, comment='物资编码')
  447. barcode = Column(String(255), nullable=True, comment='条形码')
  448. qr_code = Column(String(255), nullable=True, comment='二维码')
  449. status = Column(String(50), default='1',nullable=True, comment='状态')
  450. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  451. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  452. create_dept = Column(BigInteger, default=None, comment='创建部门')
  453. create_by = Column(BigInteger, default=None, comment='创建者')
  454. update_by = Column(BigInteger, default=None, comment='更新者')
  455. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  456. remark = Column(Text, nullable=True, comment='备注')
  457. class Config:
  458. orm_mode = True
  459. class ResourceProvisionProcurementDeclaration(Base):
  460. __tablename__ = 'resource_provision_procurement_declaration'
  461. id = Column(Integer, primary_key=True, comment='ID')
  462. declaration_date = Column(DateTime, default=datetime.now, nullable=False, comment='申报日期')
  463. declaration_amount = Column(Float, nullable=False, comment='申报金额(元)')
  464. declaration_unit = Column(String(255), nullable=False, comment='申报单位')
  465. declaration_person = Column(String(255), nullable=False, comment='申报人')
  466. declaration_details = Column(String(255), nullable=False, comment='申报情况')
  467. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  468. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  469. create_dept = Column(BigInteger, default=None, comment='创建部门')
  470. create_by = Column(BigInteger, default=None, comment='创建者')
  471. update_by = Column(BigInteger, default=None, comment='更新者')
  472. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  473. remark = Column(Text, nullable=True, comment='备注')
  474. class ResourceProvisionProcurementDeclarationDetail(Base):
  475. __tablename__ = 'resource_provision_procurement_declaration_detail'
  476. id = Column(Integer, primary_key=True, comment='ID')
  477. serial_number = Column(Integer, nullable=False, comment='序号')
  478. declaration_id = Column(String(255), nullable=False, comment='申报基础表id')
  479. warehouse_id= Column(String(255), nullable=False, comment='仓库id')
  480. material_type = Column(String(255), nullable=False, comment='物资类型')
  481. material_code = Column(String(255), nullable=False, comment='物资名称')
  482. material_quantity = Column(Integer, nullable=False, comment='物资数量(件)')
  483. material_unit_price = Column(Float, nullable=False, comment='物资单价')
  484. material_purpose = Column(Text, nullable=False, comment='物资用途')
  485. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  486. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  487. create_dept = Column(BigInteger, default=None, comment='创建部门')
  488. create_by = Column(BigInteger, default=None, comment='创建者')
  489. update_by = Column(BigInteger, default=None, comment='更新者')
  490. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  491. remark = Column(Text, nullable=True, comment='备注')
  492. class ResourceProvisionProcurementReview(Base):
  493. __tablename__ = 'resource_provision_procurement_review'
  494. id = Column(Integer, primary_key=True, comment='ID')
  495. reviewer = Column(String(255), nullable=False, comment='审核人')
  496. declaration_id = Column(Integer, nullable=False, comment='申报基础表id')
  497. review_result = Column(String(50), nullable=False, comment='审核结果')
  498. review_comments = Column(Text, comment='审核意见')
  499. review_date = Column(DateTime, default=datetime.now, comment='审核时间')
  500. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  501. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  502. create_dept = Column(BigInteger, default=None, comment='创建部门')
  503. create_by = Column(BigInteger, default=None, comment='创建者')
  504. update_by = Column(BigInteger, default=None, comment='更新者')
  505. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  506. remark = Column(Text, nullable=True, comment='备注')
  507. class ResourceProvisionDispatch(Base):
  508. __tablename__ = 'resource_provision_dispatch'
  509. id = Column(Integer, primary_key=True, comment='ID')
  510. dispatch_date = Column(DateTime, default=datetime.now, nullable=False, comment='调度日期')
  511. dispatch_purpose = Column(Text, nullable=False, comment='调度目的')
  512. dispatch_unit = Column(String(255), nullable=False, comment='申报单位')
  513. dispatch_person = Column(String(255), nullable=False, comment='申报人')
  514. dispatch_status = Column(String(255), nullable=False, comment='申报情况')
  515. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  516. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  517. create_dept = Column(BigInteger, default=None, comment='创建部门')
  518. create_by = Column(BigInteger, default=None, comment='创建者')
  519. update_by = Column(BigInteger, default=None, comment='更新者')
  520. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  521. remark = Column(Text, nullable=True, comment='备注')
  522. class ResourceProvisionDispatchDetail(Base):
  523. __tablename__ = 'resource_provision_dispatch_detail'
  524. id = Column(Integer, primary_key=True, comment='ID')
  525. serial_number = Column(Integer, nullable=False, comment='序号')
  526. dispatch_id = Column(String(255), nullable=False, comment='调度基础表id')
  527. warehouse_id= Column(String(255), nullable=False, comment='仓库id')
  528. material_type_id = Column(String(255), nullable=False, comment='物资类型id')
  529. material_type = Column(String(255), nullable=False, comment='物资类型')
  530. material_code = Column(String(255), nullable=False, comment='物资id')
  531. material_name = Column(String(255), nullable=False, comment='物资名称')
  532. material_quantity = Column(Integer, nullable=False, comment='物资数量(件)')
  533. material_purpose = Column(Text, nullable=False, 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 ResourceProvisionDispatchReview(Base):
  542. __tablename__ = 'resource_provision_dispatch_review'
  543. id = Column(Integer, primary_key=True, comment='ID')
  544. reviewer = Column(String(255), nullable=False, comment='审核人')
  545. dispatch_id = Column(Integer, nullable=False, comment='调度基础表id')
  546. review_result = Column(String(50), nullable=False, comment='审核结果')
  547. review_comments = Column(Text, comment='审核意见')
  548. review_date = Column(DateTime, default=datetime.now, 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 ResourceProvisionOutboundBasic(Base):
  557. __tablename__ = 'resource_provision_outbound_basic'
  558. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  559. outbound_number = Column(String(255), nullable=False, comment='出库单号')
  560. warehouse_id = Column(String(255), nullable=False, comment='仓库id')
  561. room_id = Column(String(255), comment='库房id')
  562. total_volume = Column(Numeric(20, 2), nullable=False, comment='出库单商品总体积(立方厘米)')
  563. total_weight = Column(Numeric(20, 2), nullable=False, comment='出库单商品总重量(kg)')
  564. total_shipping_volume = Column(Numeric(20, 2), nullable=False, comment='出库单发货总体积(立方厘米)')
  565. total_shipping_weight = Column(Numeric(20, 2), nullable=False, comment='出库单发货总重量(kg)')
  566. total_quantity = Column(Integer, nullable=False, comment='出库单商品总数量')
  567. shipping_time = Column(DateTime, comment='出库单发货时间')
  568. disaster_type = Column(String(255), comment='灾种名称')
  569. dispatching_agency = Column(String(255), comment='调运机构名称')
  570. shipper_name = Column(String(255), comment='发货人姓名')
  571. shipper_mobile = Column(String(20), comment='发货人手机')
  572. shipper_address = Column(String(255), comment='发货人地址')
  573. shipper_remark = Column(Text, comment='发货方备注')
  574. receiver_name = Column(String(255), comment='收货人姓名')
  575. receiver_mobile = Column(String(20), comment='收货人手机')
  576. receiver_address = Column(String(255), comment='收货人地址')
  577. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  578. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  579. create_dept = Column(BigInteger, default=None, comment='创建部门')
  580. create_by = Column(BigInteger, default=None, comment='创建者')
  581. update_by = Column(BigInteger, default=None, comment='更新者')
  582. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  583. remark = Column(Text, comment='备注')
  584. class ResourceProvisionWarehouseMovement(Base):
  585. __tablename__ = 'resource_provision_warehouse_movement'
  586. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  587. material_id = Column(String(255), nullable=False, comment='物资id')
  588. warehouse_id = Column(String(255), nullable=False, comment='仓库id')
  589. room_id = Column(String(255), comment='库房id')
  590. io_number = Column(String(255), nullable=False, comment='出入库单号')
  591. io_flag = Column(String(10), nullable=False, comment='出入库标识')
  592. changed_stock = Column(Integer, nullable=False, comment='变动库存')
  593. remaining_stock = Column(Integer, nullable=False, comment='剩余库存')
  594. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  595. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  596. create_dept = Column(BigInteger, default=None, comment='创建部门')
  597. create_by = Column(BigInteger, default=None, comment='创建者')
  598. update_by = Column(BigInteger, default=None, comment='更新者')
  599. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
  600. remark = Column(Text, comment='备注')
  601. class ResourceProvisionInboundBasic(Base):
  602. __tablename__ = 'resource_provision_inbound_basic'
  603. id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
  604. warehouse_id = Column(String(255), nullable=False, comment='仓库id')
  605. purchase_order_number = Column(String(255), nullable=False, comment='采购单号')
  606. is_donation = Column(String(10), nullable=False, comment='是否捐赠(是、否)')
  607. transport_order_number = Column(String(255), nullable=False, comment='运输单号')
  608. donator_phone = Column(String(20), comment='捐赠人联系电话')
  609. donator_name = Column(String(255), comment='捐赠人姓名')
  610. reviewer = Column(String(255), comment='审核人')
  611. enterprise_name = Column(String(255), comment='企业名称')
  612. enterprise_code = Column(String(255), comment='企业编号')
  613. grading_info = Column(String(255), comment='分级信息')
  614. type = Column(Integer, nullable=False, comment='类型(1 调拨入库、2 归还入库、3 回收入库)')
  615. supplier_name = Column(String(255), comment='供应商名称')
  616. creation_time = Column(DateTime,default=datetime.now, comment='创建时间')
  617. remark = Column(Text, comment='备注')
  618. supplier_code = Column(String(255), comment='供应商编号')
  619. completion_time = Column(DateTime, comment='完成时间')
  620. planned_completion_time = Column(DateTime, comment='计划完成时间')
  621. room_id = Column(String(255), comment='库房id')
  622. inbound_order_number = Column(String(255), comment='入库单号')
  623. new_time = Column(DateTime, default=datetime.now, comment='新增时间')
  624. create_time = Column(DateTime, default=datetime.now, comment='数据创建时间')
  625. update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='数据更新时间')
  626. create_dept = Column(BigInteger, default=None, comment='创建部门')
  627. create_by = Column(BigInteger, default=None, comment='创建者')
  628. update_by = Column(BigInteger, default=None, comment='更新者')
  629. del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')