service.py 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002
  1. import xml.etree.ElementTree as ET
  2. from typing import Union
  3. from fastapi import FastAPI
  4. import os
  5. import uuid
  6. import re
  7. from fastapi.middleware.cors import CORSMiddleware
  8. from pydantic import BaseModel
  9. import pandas as pd
  10. from numpy import float64
  11. def getDjcsDingercj(root, bh, bt, qdbm, debm):
  12. result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
  13. "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
  14. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  15. item = None
  16. for child in root:
  17. if child.tag == "Dxgcxx":
  18. for child1 in child:
  19. Dwgcbh = child1.attrib["Dwgcbh"]
  20. if Dwgcbh == bh:
  21. item = child1
  22. break
  23. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  24. Fywj = None
  25. for child in item:
  26. if child.tag == 'Csxm':
  27. Fywj= child
  28. break
  29. Rcjhz = None
  30. for child in item:
  31. if child.tag == 'Rcjhz':
  32. Rcjhz = child
  33. break
  34. kv = {}
  35. for entry in Rcjhz:
  36. kv[entry.attrib["RcjId"]]=entry
  37. container = None
  38. for child in Fywj:
  39. if child.tag == "DjCs":
  40. container = child
  41. break
  42. zimu = None
  43. for child in container:
  44. if child.attrib["Bm"] == qdbm:
  45. zimu = child
  46. break
  47. box = None
  48. if not zimu:
  49. return result
  50. for child in zimu:
  51. if child.tag == "Csxdezj":
  52. box = child
  53. break
  54. hlmx_parent = None
  55. for child in box:
  56. if child.attrib["Debm"] == debm:
  57. for grandchild in child:
  58. if grandchild.tag == "Csxdercjhl":
  59. hlmx_parent = grandchild
  60. for child in hlmx_parent:
  61. result.append([child.attrib["RcjId"],
  62. kv[child.attrib["RcjId"]].attrib["RcjBm"],
  63. kv[child.attrib["RcjId"]].attrib["Mc"],
  64. kv[child.attrib["RcjId"]].attrib["Ggxh"],
  65. kv[child.attrib["RcjId"]].attrib["Dw"],
  66. kv[child.attrib["RcjId"]].attrib["Dj"],
  67. kv[child.attrib["RcjId"]].attrib["Cd"],
  68. kv[child.attrib["RcjId"]].attrib["Gycs"],
  69. kv[child.attrib["RcjId"]].attrib["Rcjlb"],
  70. kv[child.attrib["RcjId"]].attrib["Jgbz"],
  71. child.attrib["Rcjhl"], child.attrib["Rcjhj"], "",
  72. "", "", ""
  73. ])
  74. return result
  75. def getDingercj(root, bh, bt, qdbm, debm):
  76. result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
  77. "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
  78. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  79. item = None
  80. for child in root:
  81. if child.tag == "Dxgcxx":
  82. for child1 in child:
  83. Dwgcbh = child1.attrib["Dwgcbh"]
  84. if Dwgcbh == bh:
  85. item = child1
  86. break
  87. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  88. Fywj = None
  89. for child in item:
  90. if child.tag == 'Qdxm':
  91. Fywj= child
  92. break
  93. Rcjhz = None
  94. for child in item:
  95. if child.tag == 'Rcjhz':
  96. Rcjhz = child
  97. break
  98. kv = {}
  99. for entry in Rcjhz:
  100. kv[entry.attrib["RcjId"]]=entry
  101. container = None
  102. for child in Fywj:
  103. ##child is mx
  104. if child.tag == "QdBt":
  105. if child.attrib["Mc"] == bt:
  106. container = child
  107. break
  108. if not container:
  109. container = Fywj
  110. zimu = None
  111. for child in container:
  112. if child.attrib["Qdbm"] == qdbm:
  113. zimu = child
  114. break
  115. box = None
  116. if not zimu:
  117. return result
  118. for child in zimu:
  119. if child.tag == "Qdxdezj":
  120. box = child
  121. break
  122. hlmx_parent = None
  123. for child in box:
  124. if child.attrib["Debm"] == debm:
  125. for grandchild in child:
  126. if grandchild.tag == "Qdxdercjhl":
  127. hlmx_parent = grandchild
  128. for child in hlmx_parent:
  129. result.append([child.attrib["RcjId"],
  130. kv[child.attrib["RcjId"]].attrib["RcjBm"],
  131. kv[child.attrib["RcjId"]].attrib["Mc"],
  132. kv[child.attrib["RcjId"]].attrib["Ggxh"],
  133. kv[child.attrib["RcjId"]].attrib["Dw"],
  134. kv[child.attrib["RcjId"]].attrib["Dj"],
  135. kv[child.attrib["RcjId"]].attrib["Cd"],
  136. kv[child.attrib["RcjId"]].attrib["Gycs"],
  137. kv[child.attrib["RcjId"]].attrib["Rcjlb"],
  138. kv[child.attrib["RcjId"]].attrib["Jgbz"],
  139. child.attrib["Rcjhl"], child.attrib["Rcjhj"], "",
  140. "", "", ""
  141. ])
  142. return result
  143. def getDjcsQingdanrcj(root, bh, bt, bm):
  144. result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
  145. "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
  146. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  147. item = None
  148. for child in root:
  149. if child.tag == "Dxgcxx":
  150. for child1 in child:
  151. Dwgcbh = child1.attrib["Dwgcbh"]
  152. if Dwgcbh == bh:
  153. item = child1
  154. break
  155. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  156. Fywj = None
  157. for child in item:
  158. if child.tag == 'Csxm':
  159. Fywj= child
  160. break
  161. hl_parent = None
  162. for child in Fywj:
  163. if child.tag == "DjCs":
  164. hl_parent = child
  165. Rcjhz = None
  166. for child in item:
  167. if child.tag == 'Rcjhz':
  168. Rcjhz = child
  169. break
  170. kv = {}
  171. for entry in Rcjhz:
  172. kv[entry.attrib["RcjId"]]=entry
  173. zimu = None
  174. for child in hl_parent:
  175. if child.attrib["Bm"] == bm:
  176. zimu = child
  177. break
  178. box = None
  179. if not zimu:
  180. return result
  181. for child in zimu:
  182. if child.tag == "Csxrcjhl":
  183. box = child
  184. break
  185. for child in box:
  186. result.append([child.attrib["RcjId"],
  187. kv[child.attrib["RcjId"]].attrib["RcjBm"],
  188. kv[child.attrib["RcjId"]].attrib["Mc"],
  189. kv[child.attrib["RcjId"]].attrib["Ggxh"],
  190. kv[child.attrib["RcjId"]].attrib["Dw"],
  191. kv[child.attrib["RcjId"]].attrib["Dj"],
  192. kv[child.attrib["RcjId"]].attrib["Cd"],
  193. kv[child.attrib["RcjId"]].attrib["Gycs"],
  194. kv[child.attrib["RcjId"]].attrib["Rcjlb"],
  195. kv[child.attrib["RcjId"]].attrib["Jgbz"],
  196. child.attrib["Rcjhl"], child.attrib["Rcjhj"], child.attrib["Zgjbz"],
  197. child.attrib["Zyclbz"], child.attrib["Zcbz"], child.attrib["Sbbz"]
  198. ])
  199. return result
  200. def getQingdanTuijian(bh, bt, bm):
  201. result = []
  202. try:
  203. all = pd.read_csv("QingDanAllInOne.csv")
  204. bm_ = int(bm) // 1000
  205. hit = all[all["qdbh"] == str(bm_)]
  206. for i in range(len(hit)):
  207. result.append({'ID': hit.iloc[i]["index"].item(), '定额编号': hit.iloc[i]["debh"], '工程量名称': hit.iloc[i]["gclmc"], '工作内容': hit.iloc[i]["work"]})
  208. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  209. finally:
  210. return result
  211. def getQingdanrcj(root, bh, bt, bm):
  212. result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
  213. "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
  214. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  215. item = None
  216. for child in root:
  217. if child.tag == "Dxgcxx":
  218. for child1 in child:
  219. Dwgcbh = child1.attrib["Dwgcbh"]
  220. if Dwgcbh == bh:
  221. item = child1
  222. break
  223. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  224. Fywj = None
  225. for child in item:
  226. if child.tag == 'Qdxm':
  227. Fywj= child
  228. break
  229. Rcjhz = None
  230. for child in item:
  231. if child.tag == 'Rcjhz':
  232. Rcjhz = child
  233. break
  234. kv = {}
  235. for entry in Rcjhz:
  236. kv[entry.attrib["RcjId"]]=entry
  237. container = None
  238. for child in Fywj:
  239. ##child is mx
  240. if child.tag == "QdBt":
  241. if child.attrib["Mc"] == bt:
  242. container = child
  243. break
  244. if not container:
  245. container = Fywj
  246. zimu = None
  247. for child in container:
  248. if child.attrib["Qdbm"] == bm:
  249. zimu = child
  250. break
  251. box = None
  252. if not zimu:
  253. return result
  254. for child in zimu:
  255. if child.tag == "Qdxrcjhl":
  256. box = child
  257. break
  258. for child in box:
  259. result.append([child.attrib["RcjId"],
  260. kv[child.attrib["RcjId"]].attrib["RcjBm"],
  261. kv[child.attrib["RcjId"]].attrib["Mc"],
  262. kv[child.attrib["RcjId"]].attrib["Ggxh"],
  263. kv[child.attrib["RcjId"]].attrib["Dw"],
  264. kv[child.attrib["RcjId"]].attrib["Dj"],
  265. kv[child.attrib["RcjId"]].attrib["Cd"],
  266. kv[child.attrib["RcjId"]].attrib["Gycs"],
  267. kv[child.attrib["RcjId"]].attrib["Rcjlb"],
  268. kv[child.attrib["RcjId"]].attrib["Jgbz"],
  269. child.attrib["Rcjhl"], child.attrib["Rcjhj"], child.attrib["Zgjbz"],
  270. child.attrib["Zyclbz"], child.attrib["Zcbz"], child.attrib["Sbbz"]
  271. ])
  272. return result
  273. def getDjcs(root, id):
  274. result = []
  275. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  276. item = None
  277. for child in root:
  278. if child.tag == "Dxgcxx":
  279. for child1 in child:
  280. Dwgcbh = child1.attrib["Dwgcbh"]
  281. if Dwgcbh == id:
  282. item = child1
  283. break
  284. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  285. Fywj = None
  286. for child in item:
  287. if child.tag == 'Csxm':
  288. Fywj= child
  289. break
  290. Djcs_parent = None
  291. for child in Fywj:
  292. if child.tag == 'DjCs':
  293. Djcs_parent = child
  294. break
  295. for child in Djcs_parent:
  296. ##child is mx {
  297. result.append({
  298. "序号": child.attrib["Xh"], "清单编码": child.attrib["Bm"], "名称" : child.attrib["Mc"],
  299. "项目特征" : child.attrib["Xmtz"],
  300. "计算规则" : child.attrib["Jsgz"], "单位" : child.attrib["Dw"], "数量" : child.attrib["Sl"],
  301. "综合单价" : child.attrib["Zhdj"], "合价" : child.attrib["Zhhj"], "人工费" : child.attrib["Rgf"],
  302. "主材费" : child.attrib["Zcf"],
  303. "设备费" : child.attrib["Sbf"], "辅材费" : child.attrib["Fcf"], "材料费" : child.attrib["Clf"],
  304. "机械费" : child.attrib["Jxf"], "管理费" : child.attrib["Glf"], "利润" : child.attrib["Lr"],
  305. "暂估价" : child.attrib["Zgj"], "综合人工工日" : child.attrib["Zgr"] })
  306. __children = []
  307. zj_parent = None
  308. for grandchild in child:
  309. if grandchild.tag == "Csxdezj":
  310. zj_parent = grandchild
  311. if zj_parent:
  312. for entry in zj_parent:
  313. __children.append({
  314. "序号": None, "清单编码": entry.attrib["Debm"], "名称" : entry.attrib["Mc"],
  315. "项目特征" : None,
  316. "计算规则" : None, "单位" : entry.attrib["Dw"], "数量" : entry.attrib["DwQdSl"],
  317. "综合单价" : entry.attrib["Dj"], "合价" : entry.attrib["Hj"], "人工费" : entry.attrib["Rgf"],
  318. "主材费" : entry.attrib["Zcf"],
  319. "设备费" : entry.attrib["Sbf"], "辅材费" : entry.attrib["Fcf"], "材料费" : entry.attrib["Clf"],
  320. "机械费" : entry.attrib["Jxf"], "管理费" : entry.attrib["Glf"], "利润" : entry.attrib["Lr"],
  321. "暂估价" : None, "综合人工工日" : None })
  322. if len(__children) > 0:
  323. result[-1]["__children"] = __children
  324. return result
  325. def getQdmx(root, bh, bt):
  326. result = []
  327. #result = [["序号", "清单编码", "名称", "项目特征", "计算规则", "单位", "数量", "综合单价", "合价", "人工费", "主材费", "设备费", "辅材费", "材料费", "机械费", "管理费", "利润" , "暂估价", "综合人工工日", "备注" ]]
  328. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  329. item = None
  330. for child in root:
  331. if child.tag == "Dxgcxx":
  332. for child1 in child:
  333. Dwgcbh = child1.attrib["Dwgcbh"]
  334. if Dwgcbh == bh:
  335. item = child1
  336. break
  337. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  338. Fywj = None
  339. for child in item:
  340. if child.tag == 'Qdxm':
  341. Fywj= child
  342. break
  343. container = None
  344. for child in Fywj:
  345. ##child is mx
  346. if child.tag == "QdBt":
  347. if child.attrib["Mc"] == bt:
  348. count = 0
  349. for grandchild in child:
  350. count = count + 1
  351. if count > 0:
  352. container = child
  353. break
  354. if container == None:
  355. container = Fywj
  356. for child in container:
  357. #result = [["序号", "清单编码", "名称", "项目特征", "计算规则", "单位", "数量", "综合单价", "合价", "人工费", "主材费",
  358. # "设备费", "辅材费", "材料费", "机械费", "管理费", "利润" , "暂估价", "综合人工工日", "备注" ]]
  359. result.append({
  360. "操作" : "",
  361. "序号": child.attrib["Xh"], "清单编码" : child.attrib["Qdbm"], "名称" : child.attrib["Mc"],"项目特征" : child.attrib["Xmtz"],
  362. "计算规则" : child.attrib["Jsgz"],
  363. "单位" : child.attrib["Dw"],
  364. "数量": child.attrib["Sl"],
  365. "综合单价" : child.attrib["Zhdj"],
  366. "合价" : child.attrib["Zhhj"],
  367. "人工费": child.attrib["Rgf"],
  368. "主材费" : child.attrib["Zcf"],
  369. "设备费": child.attrib["Sbf"],
  370. "辅材费": child.attrib["Fcf"],
  371. "材料费" : child.attrib["Clf"],
  372. "机械费" : child.attrib["Jxf"],
  373. "管理费": child.attrib["Glf"],
  374. "利润": child.attrib["Lr"],
  375. "暂估价" : child.attrib["Zgj"],
  376. "综合人工工日" : child.attrib["Zgr"],
  377. "备注" : child.attrib["Bz"]}
  378. )
  379. for child_zj in child:
  380. if child_zj.tag == "Qdxdezj":
  381. for child_mx in child_zj:
  382. if child_mx.tag == "QdxdezjMx":
  383. parent = result[-1]
  384. if "__children" in parent:
  385. parent["__children"].append({
  386. "操作" : "",
  387. "序号": None, "清单编码" : child_mx.attrib["Debm"], "名称" : child_mx.attrib["Mc"],"项目特征" : None,
  388. "计算规则" : None,
  389. "单位" : child_mx.attrib["Dw"],
  390. "数量": child_mx.attrib["DwQdSl"],
  391. "综合单价" : child_mx.attrib["Dj"],
  392. "合价" : child_mx.attrib["Hj"],
  393. "人工费": child_mx.attrib["Rgf"],
  394. "主材费" : child_mx.attrib["Zcf"],
  395. "设备费": child_mx.attrib["Sbf"],
  396. "辅材费": child_mx.attrib["Fcf"],
  397. "材料费" : child_mx.attrib["Clf"],
  398. "机械费" : child_mx.attrib["Jxf"],
  399. "管理费": child_mx.attrib["Glf"],
  400. "利润": child_mx.attrib["Lr"],
  401. "暂估价" : None,
  402. "综合人工工日" : None,
  403. "备注" : None}
  404. )
  405. else:
  406. parent["__children"] = [{
  407. "操作" : "",
  408. "序号": None, "清单编码" : child_mx.attrib["Debm"], "名称" : child_mx.attrib["Mc"],"项目特征" : None,
  409. "计算规则" : None,
  410. "单位" : child_mx.attrib["Dw"],
  411. "数量": child_mx.attrib["DwQdSl"],
  412. "综合单价" : child_mx.attrib["Dj"],
  413. "合价" : child_mx.attrib["Hj"],
  414. "人工费": child_mx.attrib["Rgf"],
  415. "主材费" : child_mx.attrib["Zcf"],
  416. "设备费": child_mx.attrib["Sbf"],
  417. "辅材费": child_mx.attrib["Fcf"],
  418. "材料费" : child_mx.attrib["Clf"],
  419. "机械费" : child_mx.attrib["Jxf"],
  420. "管理费": child_mx.attrib["Glf"],
  421. "利润": child_mx.attrib["Lr"],
  422. "暂估价" : None,
  423. "综合人工工日" : None,
  424. "备注" : None}]
  425. return result
  426. def getQdmx_default(root, bh, bt):
  427. result = []
  428. #result = [["序号", "清单编码", "名称", "项目特征", "计算规则", "单位", "数量", "综合单价", "合价", "人工费", "主材费", "设备费", "辅材费", "材料费", "机械费", "管理费", "利润" , "暂估价", "综合人工工日", "备注" ]]
  429. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  430. item = None
  431. for child in root:
  432. if child.tag == "Dxgcxx":
  433. for child1 in child:
  434. Dwgcbh = child1.attrib["Dwgcbh"]
  435. if Dwgcbh == bh:
  436. item = child1
  437. break
  438. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  439. Fywj = None
  440. for child in item:
  441. if child.tag == 'Qdxm':
  442. Fywj= child
  443. break
  444. container = None
  445. for child in Fywj:
  446. ##child is mx
  447. if child.tag == "Qdmx":
  448. #result = [["序号", "清单编码", "名称", "项目特征", "计算规则", "单位", "数量", "综合单价", "合价", "人工费", "主材费",
  449. # "设备费", "辅材费", "材料费", "机械费", "管理费", "利润" , "暂估价", "综合人工工日", "备注" ]]
  450. result.append({
  451. "操作" : "",
  452. "序号": child.attrib["Xh"], "清单编码" : child.attrib["Qdbm"], "名称" : child.attrib["Mc"],"项目特征" : child.attrib["Xmtz"],
  453. "计算规则" : child.attrib["Jsgz"],
  454. "单位" : child.attrib["Dw"],
  455. "数量": child.attrib["Sl"],
  456. "综合单价" : child.attrib["Zhdj"],
  457. "合价" : child.attrib["Zhhj"],
  458. "人工费": child.attrib["Rgf"],
  459. "主材费" : child.attrib["Zcf"],
  460. "设备费": child.attrib["Sbf"],
  461. "辅材费": child.attrib["Fcf"],
  462. "材料费" : child.attrib["Clf"],
  463. "机械费" : child.attrib["Jxf"],
  464. "管理费": child.attrib["Glf"],
  465. "利润": child.attrib["Lr"],
  466. "暂估价" : child.attrib["Zgj"],
  467. "综合人工工日" : child.attrib["Zgr"],
  468. "备注" : child.attrib["Bz"]}
  469. )
  470. for child_zj in child:
  471. if child_zj.tag == "Qdxdezj":
  472. for child_mx in child_zj:
  473. if child_mx.tag == "QdxdezjMx":
  474. parent = result[-1]
  475. if "__children" in parent:
  476. parent["__children"].append({
  477. "操作" : "",
  478. "序号": None, "清单编码" : child_mx.attrib["Debm"], "名称" : child_mx.attrib["Mc"],"项目特征" : None,
  479. "计算规则" : None,
  480. "单位" : child_mx.attrib["Dw"],
  481. "数量": child_mx.attrib["DwQdSl"],
  482. "综合单价" : child_mx.attrib["Dj"],
  483. "合价" : child_mx.attrib["Hj"],
  484. "人工费": child_mx.attrib["Rgf"],
  485. "主材费" : child_mx.attrib["Zcf"],
  486. "设备费": child_mx.attrib["Sbf"],
  487. "辅材费": child_mx.attrib["Fcf"],
  488. "材料费" : child_mx.attrib["Clf"],
  489. "机械费" : child_mx.attrib["Jxf"],
  490. "管理费": child_mx.attrib["Glf"],
  491. "利润": child_mx.attrib["Lr"],
  492. "暂估价" : None,
  493. "综合人工工日" : None,
  494. "备注" : None}
  495. )
  496. else:
  497. parent["__children"] = [{
  498. "操作" : "",
  499. "序号": None, "清单编码" : child_mx.attrib["Debm"], "名称" : child_mx.attrib["Mc"],"项目特征" : None,
  500. "计算规则" : None,
  501. "单位" : child_mx.attrib["Dw"],
  502. "数量": child_mx.attrib["DwQdSl"],
  503. "综合单价" : child_mx.attrib["Dj"],
  504. "合价" : child_mx.attrib["Hj"],
  505. "人工费": child_mx.attrib["Rgf"],
  506. "主材费" : child_mx.attrib["Zcf"],
  507. "设备费": child_mx.attrib["Sbf"],
  508. "辅材费": child_mx.attrib["Fcf"],
  509. "材料费" : child_mx.attrib["Clf"],
  510. "机械费" : child_mx.attrib["Jxf"],
  511. "管理费": child_mx.attrib["Glf"],
  512. "利润": child_mx.attrib["Lr"],
  513. "暂估价" : None,
  514. "综合人工工日" : None,
  515. "备注" : None}]
  516. return result
  517. def getQdxm_addition(root, id):
  518. result = []
  519. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  520. item = None
  521. for child in root:
  522. if child.tag == "Dxgcxx":
  523. for child1 in child:
  524. Dwgcbh = child1.attrib["Dwgcbh"]
  525. if Dwgcbh == id:
  526. item = child1
  527. break
  528. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  529. Fywj = None
  530. for child in item:
  531. if child.tag == 'Qdxm':
  532. Fywj= child
  533. break
  534. for child in Fywj:
  535. ##child is mx
  536. if child.tag == "QdBt":
  537. count = 0
  538. for grandchild in child:
  539. count = count + 1
  540. if count > 0:
  541. result.append({'Bz': child.attrib["Bz"], 'Je': child.attrib['Je'], 'Mc': child.attrib['Mc'], 'Xh': child.attrib['Xh'], 'Zgj': child.attrib['Zgj']})
  542. return result
  543. def getQdxm(root, id):###qdxm下面既有qdmx,也有qdbt,qdbt可能为空
  544. result = []
  545. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  546. item = None
  547. for child in root:
  548. if child.tag == "Dxgcxx":
  549. for child1 in child:
  550. Dwgcbh = child1.attrib["Dwgcbh"]
  551. if Dwgcbh == id:
  552. item = child1
  553. break
  554. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  555. Fywj = None
  556. for child in item:
  557. if child.tag == 'Qdxm':
  558. Fywj= child
  559. break
  560. for child in Fywj:
  561. ##child is mx
  562. if child.tag == 'Qdmx':
  563. if 'Default' in result:
  564. pass
  565. else:
  566. result.append('Default')
  567. if child.tag == "QdBt":
  568. count = 0
  569. for grandchild in child:
  570. count = count + 1
  571. if count > 0:
  572. result.append(child.attrib["Mc"])
  573. return result
  574. def getZjcs(root, id):
  575. result = []
  576. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  577. item = None
  578. for child in root:
  579. if child.tag == "Dxgcxx":
  580. for child1 in child:
  581. Dwgcbh = child1.attrib["Dwgcbh"]
  582. if Dwgcbh == id:
  583. item = child1
  584. break
  585. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  586. Fywj = None
  587. for child in item:
  588. if child.tag == 'Csxm':
  589. Fywj= child
  590. break
  591. Zjcs_parent = None
  592. for child in Fywj:
  593. if child.tag == 'ZjCs':
  594. Zjcs_parent = child
  595. break
  596. for child in Zjcs_parent:
  597. ##child is mx {
  598. result.append({
  599. "序号" : child.attrib["Xh"], "清单编码": child.attrib["Bm"], "名称" : child.attrib["Mc"],
  600. "计算基数" : child.attrib["Js"],
  601. "计算基础" : child.attrib["Jsjc"], "费率" : child.attrib["Fl"],
  602. "金额" : child.attrib["Je"], "项目类别" : child.attrib["Xmlb"]})
  603. __children = []
  604. for grandchild in child:
  605. __children.append({
  606. "序号" : None, "清单编码": None, "名称" : grandchild.attrib["Mc"],
  607. "计算基数" : grandchild.attrib["Js"],
  608. "计算基础" : grandchild.attrib["Jsjc"], "费率" : grandchild.attrib["Fl"],
  609. "金额" : grandchild.attrib["Je"], "项目类别" : grandchild.attrib["Xmlb"]})
  610. if len(__children) > 0:
  611. result[-1]["__children"] = __children
  612. return result
  613. def getZcbfwf(root, id):
  614. result = []
  615. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  616. item = None
  617. for child in root:
  618. if child.tag == "Dxgcxx":
  619. for child1 in child:
  620. Dwgcbh = child1.attrib["Dwgcbh"]
  621. if Dwgcbh == id:
  622. item = child1
  623. break
  624. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  625. Fywj = None
  626. for child in item:
  627. if child.tag == 'Zcbfwf':
  628. Fywj= child
  629. break
  630. for child in Fywj:
  631. result.append(
  632. {'序号': child.attrib["Xh"],
  633. "名称" : child.attrib["Mc"], "项目价值" : child.attrib["Xmjz"], "服务内容" :child.attrib["Fwnr"], "计算基础" :child.attrib["Jsjc"],
  634. "费率" :child.attrib["Fl"], "金额" :child.attrib["Je"]}
  635. )
  636. return result
  637. def getRcjhz(root, id):
  638. result = [[ "ID", "编码", "名称", "规格型号", "单位", "数量", "单价", "合价", "产地",
  639. "供应厂商", "人材机类别", "主要材料标志", "主材标志", "设备标志", "甲供标志", "暂估价标志"]]
  640. for child in root:
  641. if child.tag == "Dxgcxx":
  642. for child1 in child:
  643. Dwgcbh = child1.attrib["Dwgcbh"]
  644. if Dwgcbh == id:
  645. item = child1
  646. break
  647. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  648. Fywj = None
  649. for child in item:
  650. if child.tag == 'Rcjhz':
  651. Fywj= child
  652. break
  653. for child in Fywj:
  654. result.append(
  655. [
  656. child.attrib["RcjId"], child.attrib["RcjBm"], child.attrib["Mc"], child.attrib["Ggxh"],
  657. child.attrib["Dw"], child.attrib["Sl"], child.attrib["Dj"], child.attrib["Hj"],
  658. child.attrib["Cd"], child.attrib["Gycs"], child.attrib["Rcjlb"],
  659. child.attrib["Zyclbz"], child.attrib["Zcbz"], child.attrib["Sbbz"], child.attrib["Jgbz"],
  660. child.attrib["Zgjbz"]]
  661. )
  662. return result
  663. def getFbrgycl(root, id):
  664. result = []
  665. for child in root:
  666. if child.tag == "Dxgcxx":
  667. for child1 in child:
  668. Dwgcbh = child1.attrib["Dwgcbh"]
  669. if Dwgcbh == id:
  670. item = child1
  671. break
  672. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  673. Fywj = None
  674. for child in item:
  675. if child.tag == 'Fbrgycl':
  676. Fywj= child
  677. break
  678. for child in Fywj:
  679. result.append(
  680. {'序号': child.attrib["Xh"],
  681. 'ID': child.attrib["RcjId"], '材料编号': child.attrib["Clbh"], '名称': child.attrib["Mc"], '规格型号': child.attrib["Ggxh"],
  682. '单位': child.attrib["Dw"], '数量': child.attrib["Sl"], '单价': child.attrib["Dj"], '合价': child.attrib["Hj"], '交货方式': child.attrib["Jhfs"],
  683. '送达地点': child.attrib["Sddd"], '备注': child.attrib["Bz"]}
  684. )
  685. return result
  686. def getJrg(root, id):
  687. result = []
  688. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  689. item = None
  690. for child in root:
  691. if child.tag == "Dxgcxx":
  692. for child1 in child:
  693. Dwgcbh = child1.attrib["Dwgcbh"]
  694. if Dwgcbh == id:
  695. item = child1
  696. break
  697. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  698. Fywj = None
  699. for child in item:
  700. if child.tag == 'Jrg':
  701. Fywj= child
  702. break
  703. for child in Fywj:
  704. result.append(
  705. {'序号': child.attrib["Xh"],
  706. '名称': child.attrib["Mc"], '金额': child.attrib["Je"], '类别': child.attrib["Lb"]}
  707. )
  708. return result
  709. def getZlje(root, id):
  710. result = []
  711. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  712. item = None
  713. for child in root:
  714. if child.tag == "Dxgcxx":
  715. for child1 in child:
  716. Dwgcbh = child1.attrib["Dwgcbh"]
  717. if Dwgcbh == id:
  718. item = child1
  719. break
  720. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  721. Fywj = None
  722. for child in item:
  723. if child.tag == 'Zlje':
  724. Fywj= child
  725. break
  726. for child in Fywj:
  727. result.append(
  728. {'序号': child.attrib["Xh"],
  729. '名称': child.attrib["Mc"], '单位': child.attrib["Dw"], '暂定金额': child.attrib["Zdje"], '备注': child.attrib["Bz"]}
  730. )
  731. return result
  732. def getZygczgj(root, id):
  733. result = []
  734. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  735. item = None
  736. for child in root:
  737. if child.tag == "Dxgcxx":
  738. for child1 in child:
  739. Dwgcbh = child1.attrib["Dwgcbh"]
  740. if Dwgcbh == id:
  741. item = child1
  742. break
  743. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  744. Fywj = None
  745. for child in item:
  746. if child.tag == 'Zygczg':
  747. Fywj= child
  748. break
  749. for child in Fywj:
  750. result.append(
  751. {'序号': child.attrib["Xh"],
  752. '名称': child.attrib["Mc"], '工程内容': child.attrib["Gcnr"], '金额': child.attrib["Je"], '备注': child.attrib["Bz"]}
  753. )
  754. return result
  755. def getQtxm(root, id):
  756. result = []
  757. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  758. item = None
  759. for child in root:
  760. if child.tag == "Dxgcxx":
  761. for child1 in child:
  762. Dwgcbh = child1.attrib["Dwgcbh"]
  763. if Dwgcbh == id:
  764. item = child1
  765. break
  766. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  767. Fywj = None
  768. for child in item:
  769. if child.tag == 'Qtxm':
  770. Fywj= child
  771. break
  772. for child in Fywj:
  773. ##child is mx
  774. xh = child.attrib["Xh"]
  775. if "." in xh:
  776. count = 0
  777. for entry in xh:
  778. if entry == ".":
  779. count = count + 1
  780. if count == 1:
  781. parent = result[-1]
  782. if "__children" in parent:
  783. children = parent["__children"]
  784. children.append(
  785. {"序号":xh, "名称": child.attrib["Mc"],
  786. "金额": child.attrib["Je"], "项目类别" : child.attrib["Xmlb"], "备注" : child.attrib["Bz"]}
  787. )
  788. else:
  789. parent["__children"] = [
  790. {"序号":xh, "名称": child.attrib["Mc"],
  791. "金额": child.attrib["Je"], "项目类别" : child.attrib["Xmlb"], "备注" : child.attrib["Bz"]}]
  792. else:
  793. result.append(
  794. {"序号":xh, "名称": child.attrib["Mc"],
  795. "金额": child.attrib["Je"], "项目类别" : child.attrib["Xmlb"], "备注" : child.attrib["Bz"]}
  796. )
  797. return result
  798. def getGfsj(root, id):
  799. result = []
  800. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  801. item = None
  802. for child in root:
  803. if child.tag == "Dxgcxx":
  804. for child1 in child:
  805. Dwgcbh = child1.attrib["Dwgcbh"]
  806. if Dwgcbh == id:
  807. item = child1
  808. break
  809. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  810. Fywj = None
  811. for child in item:
  812. if child.tag == 'Gfsj':
  813. Fywj= child
  814. break
  815. for child in Fywj:
  816. ##child is mx
  817. xh = child.attrib["Xh"]
  818. if "." in xh:
  819. count = 0
  820. for entry in xh:
  821. if entry == ".":
  822. count = count + 1
  823. if count == 1:
  824. parent = result[-1]
  825. if "__children" in parent:
  826. children = parent["__children"]
  827. children.append({"序号":xh, "名称": child.attrib["Mc"], "取费基数": child.attrib["Qfjs"], "计算基础": child.attrib["Jsjc"], "费率": child.attrib['Fl'], "金额": child.attrib["Je"], "类别" : child.attrib["Fyxlb"]})
  828. else:
  829. parent["__children"] = [{"序号":xh, "名称": child.attrib["Mc"], "取费基数": child.attrib["Qfjs"], "计算基础": child.attrib["Jsjc"], "费率": child.attrib['Fl'], "金额": child.attrib["Je"], "类别" : child.attrib["Fyxlb"]}]
  830. elif count == 2:
  831. parent = result[-1]
  832. if "__children" in parent:
  833. parent = parent["__children"][-1]
  834. print(parent)
  835. if "__children" in parent:
  836. children = parent["__children"]
  837. children.append({"序号":xh, "名称": child.attrib["Mc"], "取费基数": child.attrib["Qfjs"], "计算基础": child.attrib["Jsjc"], "费率": child.attrib['Fl'], "金额": child.attrib["Je"], "类别" : child.attrib["Fyxlb"]})
  838. else:
  839. parent["__children"] = [{"序号":xh, "名称": child.attrib["Mc"], "取费基数": child.attrib["Qfjs"], "计算基础": child.attrib["Jsjc"], "费率": child.attrib['Fl'], "金额": child.attrib["Je"], "类别" : child.attrib["Fyxlb"]}]
  840. else:
  841. ###["序号", "名称", "取费基数", "计算基础", "金额", "类别"]);
  842. result.append({"序号":xh, "名称": child.attrib["Mc"], "取费基数": child.attrib["Qfjs"], "计算基础": child.attrib["Jsjc"], "费率": child.attrib['Fl'], "金额": child.attrib["Je"], "类别" : child.attrib["Fyxlb"]})
  843. return result
  844. def getBjhz(root, id):
  845. print(root)
  846. print(id)
  847. result = []
  848. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  849. item = None
  850. for child in root:
  851. if child.tag == "Dxgcxx":
  852. for child1 in child:
  853. Dwgcbh = child1.attrib["Dwgcbh"]
  854. if Dwgcbh == id:
  855. item = child1
  856. break
  857. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  858. print(item)
  859. Fywj = None
  860. for child in item:
  861. if child.tag == 'Fywj':
  862. Fywj= child
  863. break
  864. for child in Fywj:
  865. ##child is mx
  866. xh = child.attrib["Xh"]
  867. if "." in xh:
  868. count = 0
  869. for entry in xh:
  870. if entry == ".":
  871. count = count + 1
  872. if count == 1:
  873. parent = result[-1]
  874. if "__children" in parent:
  875. children = parent["__children"]
  876. children.append({"序号":xh, "名称": child.attrib["Mc"], "金额": child.attrib["Je"], "暂估价" : child.attrib["Zgj"], "类别" : child.attrib["Fyxlb"]})
  877. else:
  878. parent["__children"] = [{"序号":xh, "名称": child.attrib["Mc"], "金额": child.attrib["Je"], "暂估价" : child.attrib["Zgj"], "类别" : child.attrib["Fyxlb"]}]
  879. elif count == 2:
  880. parent = result[-1]
  881. if "__children" in parent:
  882. parent = parent["__children"][-1]
  883. print(parent)
  884. if "__children" in parent:
  885. children = parent["__children"]
  886. children.append({"序号":xh, "名称": child.attrib["Mc"], "金额": child.attrib["Je"], "暂估价" : child.attrib["Zgj"], "类别" : child.attrib["Fyxlb"]})
  887. else:
  888. parent["__children"] = [{"序号":xh, "名称": child.attrib["Mc"], "金额": child.attrib["Je"], "暂估价" : child.attrib["Zgj"], "类别" : child.attrib["Fyxlb"]}]
  889. else:
  890. ###"序号", "名称", "金额", "暂估价", "类别"]
  891. result.append({"序号":xh, "名称": child.attrib["Mc"], "金额": child.attrib["Je"],
  892. "暂估价" : child.attrib["Zgj"], "类别" : child.attrib["Fyxlb"]})
  893. return result
  894. def processDes(dataframe, from_, end, level):
  895. result = []
  896. for i in range(from_, end):
  897. item = dataframe.iloc[i]
  898. fbcch = str(item['fbcch'])
  899. if fbcch == str(level):
  900. entry = {"id": str(item["ID"]), "label": str(item["zjbt"])}
  901. next = i + 1
  902. while next < end and str(dataframe.iloc[next]["fbcch"]) != str(level):
  903. next = next + 1
  904. entry["children"] = processDes(dataframe, i + 1, next, level + 1)
  905. result.append(entry)
  906. return result
  907. def processPbs(dataframe, from_, end, level):
  908. result = []
  909. for i in range(from_, end):
  910. item = dataframe.iloc[i]
  911. fbcch = str(item['fbcch'])
  912. if fbcch == str(level):
  913. entry = {"id": str(item["ID"]), "label": str(item["flmc"]), "data": item["pblbh"]}
  914. next = i + 1
  915. while next < end and str(dataframe.iloc[next]["fbcch"]) != str(level):
  916. next = next + 1
  917. entry["children"] = processPbs(dataframe, i + 1, next, level + 1)
  918. result.append(entry)
  919. return result
  920. def getCankao():
  921. tree = ET.parse('de/DeData_Fl.xml')
  922. root = tree.getroot()
  923. JSFF = None
  924. CsFl = None
  925. result = []
  926. for child in root:
  927. if child.tag == "JJFF":
  928. for grandchild in child:
  929. if grandchild.tag == 'JSFF':
  930. JSFF = grandchild
  931. for child in JSFF:
  932. if child.attrib['Markup'] == '1':
  933. for grandchild in child:
  934. if grandchild.tag == 'CsFl':
  935. CsFl = grandchild
  936. for child in CsFl:
  937. result.append({'工程类型': child.attrib['Gclx'], '名称': child.attrib['Mc'], '计算基础': child.attrib['Jsjc'],
  938. '参考费率': child.attrib['CkFl'], '地区': child.attrib['Dq'], '备注': child.attrib['Bz']})
  939. return result
  940. def getDes(value):
  941. if value == 10:
  942. shu = pd.read_csv("de/tj/JD_DingEShu.csv")
  943. elif value == 20:
  944. shu = pd.read_csv("de/sz/JD_DingEShu.csv")
  945. elif value == 30:
  946. shu = pd.read_csv("de/az/JD_DingEShu.csv")
  947. elif value == 40:
  948. shu = pd.read_csv("de/yl/JD_DingEShu.csv")
  949. elif value == 50:
  950. shu = pd.read_csv("de/xstj/JD_DingEShu.csv")
  951. else:
  952. shu = pd.read_csv("de/xsaz/JD_DingEShu.csv")
  953. length = len(shu)
  954. return processDes(shu, 1, length, 2)
  955. def getPbs(value):
  956. if value == 10:
  957. shu = pd.read_csv("de/tj/JD_PeiBiFLB.csv")
  958. else:
  959. shu = pd.read_csv("de/sz/JD_PeiBiFLB.csv")
  960. length = len(shu)
  961. return processPbs(shu, 0, length, 1)
  962. def getDeXilie(value, id):
  963. print(type(id))
  964. if value == 10:
  965. shu = pd.read_csv("de/tj/JD_DingEShu.csv")
  966. elif value == 20:
  967. shu = pd.read_csv("de/sz/JD_DingEShu.csv")
  968. elif value == 30:
  969. shu = pd.read_csv("de/az/JD_DingEShu.csv")
  970. elif value == 40:
  971. shu = pd.read_csv("de/yl/JD_DingEShu.csv")
  972. elif value == 50:
  973. shu = pd.read_csv("de/xstj/JD_DingEShu.csv")
  974. else:
  975. shu = pd.read_csv("de/xsaz/JD_DingEShu.csv")
  976. hit = shu[shu["ID"]==int(id)]
  977. print(hit)
  978. if len(hit) == 0:
  979. return []
  980. hit0 = hit.iloc[0]
  981. index = str(hit0['zjh'])
  982. print("index=" + index)
  983. if value == 10:
  984. gj = pd.read_csv("de/tj/JD_DanWeiGJ.csv")
  985. filtered = gj[gj["YSDELBH"]==int(index)]
  986. elif value == 20:
  987. gj = pd.read_csv("de/sz/JD_DanWeiGJ.csv")
  988. filtered = gj[gj["YSDELBH"]==(index)]
  989. elif value == 30:
  990. gj = pd.read_csv("de/az/JD_DanWeiGJ.csv")
  991. filtered = gj[gj["YSDELBH"]==(index)]
  992. elif value == 40:
  993. gj = pd.read_csv("de/yl/JD_DanWeiGJ.csv")
  994. filtered = gj[gj["YSDELBH"]==int(index)]
  995. elif value == 50:
  996. gj = pd.read_csv("de/xstj/JD_DanWeiGJ.csv")
  997. filtered = gj[gj["YSDELBH"]==int(index)]
  998. else:
  999. gj = pd.read_csv("de/xsaz/JD_DanWeiGJ.csv")
  1000. filtered = gj[gj["YSDELBH"]==int(index)]
  1001. return filtered.to_json(force_ascii=False)
  1002. def getQufei(name):
  1003. if name == "0":
  1004. gj = pd.read_csv("de/tj/JD_PeiBi.csv")
  1005. return gj.to_json(force_ascii=False)
  1006. shu = pd.read_csv("de/tj/JD_PeiBiFLB.csv")
  1007. hit = shu[shu["ID"]==int(name)]
  1008. print(hit)
  1009. if len(hit) == 0:
  1010. return []
  1011. hit0 = hit.iloc[0]
  1012. index = str(hit0['pblbh'])
  1013. index_list = index.split(";")
  1014. gj = pd.read_csv("de/tj/JD_PeiBi.csv")
  1015. filtered = gj[gj["PBBH"].str.startswith(tuple(index_list))]
  1016. return filtered.to_json(force_ascii=False)
  1017. def getPbxl(name):
  1018. if name == "0":
  1019. gj = pd.read_csv("de/tj/JD_PeiBi.csv")
  1020. return gj.to_json(force_ascii=False)
  1021. shu = pd.read_csv("de/tj/JD_PeiBiFLB.csv")
  1022. hit = shu[shu["ID"]==int(name)]
  1023. print(hit)
  1024. if len(hit) == 0:
  1025. return []
  1026. hit0 = hit.iloc[0]
  1027. index = str(hit0['pblbh'])
  1028. index_list = index.split(";")
  1029. gj = pd.read_csv("de/tj/JD_PeiBi.csv")
  1030. filtered = gj[gj["PBBH"].str.startswith(tuple(index_list))]
  1031. return filtered.to_json(force_ascii=False)
  1032. def getSingleDeXilie(zhuanye, debh):
  1033. if zhuanye == 10:
  1034. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_tj(debh)
  1035. if A1:
  1036. return A1, A2, A3, A4, A5, A6, A7, 10
  1037. else:
  1038. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_sz(debh)
  1039. return A1, A2, A3, A4,A5, A6, A7, 20
  1040. elif zhuanye == 20:##shizheng
  1041. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_sz(debh)
  1042. if A1:
  1043. return A1, A2, A3, A4, A5, A6, A7, 20
  1044. else:
  1045. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_tj(debh)
  1046. if A1:
  1047. return A1, A2, A3, A4, A5, A6, A7, 10
  1048. else:
  1049. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_az(debh)
  1050. return A1, A2, A3, A4, A5, A6, A7, 30
  1051. elif zhuanye == 30:##anzhuang
  1052. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_az(debh)
  1053. return A1, A2, A3, A4, A5, A6, A7, 30
  1054. elif zhuanye == 40:##yuanlin
  1055. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_yl(debh)
  1056. return A1, A2, A3, A4, A5, A6, A7, 40
  1057. elif zhuanye == 50: ## xiushan tujian
  1058. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_xstj(debh)
  1059. if A1:
  1060. return A1, A2, A3, A4, A5, A6, A7, 50
  1061. else:
  1062. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_tj(debh)
  1063. return A1, A2, A3, A4,A5, A6, A7, 10
  1064. else:
  1065. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_xsaz(debh)
  1066. if A1:
  1067. return A1, A2, A3, A4, A5, A6, A7, 60
  1068. else:
  1069. A1, A2, A3, A4, A5, A6, A7 = getSingleDeXilie_az(debh)
  1070. return A1, A2, A3, A4,A5, A6, A7, 30
  1071. def getSingleDeXilie_xsaz(debh):
  1072. id = None
  1073. bz_selected = []
  1074. bz_selected2 = []
  1075. if "附注" in debh:
  1076. position = debh.find("附注")
  1077. debh = debh[:position]
  1078. if "*" in debh:
  1079. position = debh.find("*")
  1080. debh = debh[:position]
  1081. if debh.endswith("换"):
  1082. debh = debh[:-1]
  1083. if "[" in debh:
  1084. position = debh.find("[")
  1085. debh = debh[:position-1]
  1086. gj = pd.read_csv("de/xsaz/JD_DanWeiGJ.csv")
  1087. filtered = gj[gj["DEBH"]==debh]
  1088. print(filtered)
  1089. if len(filtered) > 0:
  1090. index = (filtered.iloc[0]["YSDELBH"])
  1091. shu = pd.read_csv("de/xsaz/JD_DingEShu.csv")
  1092. hit = shu[shu["zjh"]==index]
  1093. if len(hit) > 0:
  1094. id = hit.iloc[0]["ID"]
  1095. beizhu = str(filtered.iloc[0]["BZBH"])
  1096. if 'nan' in beizhu:
  1097. pass
  1098. else:
  1099. beizhus = beizhu.split(";")
  1100. print(beizhus)
  1101. bzfile = pd.read_csv("de/xsaz/JD_BeiZhuZK.csv")
  1102. bzfile2 = pd.read_csv("de/xsaz/JD_BeiZhuFK.csv", dtype=str)
  1103. bz_selected = bzfile[bzfile["BZBH"].isin(beizhus)]
  1104. bz_selected2 = bzfile2[bzfile2["BZBH"].isin(beizhus)]
  1105. else:
  1106. return None, None, None, None, None, None, None
  1107. ####rengong
  1108. rgde = []
  1109. rg = pd.read_csv("de/xsaz/JD_GuJiaRG.csv")
  1110. filtered1 = rg[rg["DEBH"]==debh]
  1111. for i in range(len(filtered1)):
  1112. rgde_ = {}
  1113. gr = filtered1.iloc[i]["RGR"]##gongri
  1114. gf = filtered1.iloc[i]["RGF"]##gongfei
  1115. rcjID = filtered1.iloc[i]["RcjID"]
  1116. detail = pd.read_csv("de/xsaz/JD_CaiLiaoK.csv")
  1117. filtered2 = detail[detail["RcjID"]==rcjID]
  1118. if len(filtered2) > 0:
  1119. CLBH = filtered2.iloc[0]["CLBH"]
  1120. CLMC = filtered2.iloc[0]["CLMC"]
  1121. JLDW = filtered2.iloc[0]["JLDW"]
  1122. YSJG = filtered2.iloc[0]["YSJG"]
  1123. rgde_["CLBH"] = CLBH
  1124. rgde_["CLMC"] = CLMC
  1125. rgde_["JLDW"] = JLDW
  1126. rgde_["YSJG"] = YSJG.item()
  1127. rgde_["gr"] = gr.item()
  1128. rgde_["gf"] = gf.item()
  1129. rgde.append(rgde_)
  1130. ##print(rgde)
  1131. ####jixie
  1132. jxde = []
  1133. jx = pd.read_csv("de/xsaz/JD_GuJiaJX.csv")
  1134. filtered1 = jx[jx["DEBH"]==debh]
  1135. for i in range(len(filtered1)):
  1136. jxde_ = {}
  1137. sl = filtered1.iloc[i]["SL"]##shuliang
  1138. hj = filtered1.iloc[i]["HJ"]##hejia
  1139. rcjID = filtered1.iloc[i]["RcjID"]
  1140. detail = pd.read_csv("de/xsaz/JD_JiXieK.csv")
  1141. filtered2 = detail[detail["RcjID"]==rcjID]
  1142. if len(filtered2) > 0:
  1143. jxbh = filtered2.iloc[0]["jxbh"]
  1144. jxmc = filtered2.iloc[0]["jxmc"]
  1145. DW = filtered2.iloc[0]["DW"]
  1146. tbdj = filtered2.iloc[0]["tbdj"]
  1147. jxde_["jxbh"] = jxbh
  1148. jxde_["jxmc"] = jxmc
  1149. jxde_["DW"] = DW
  1150. jxde_["tbdj"] = tbdj.item()
  1151. jxde_["sl"] = sl.item()
  1152. jxde_["hj"] = hj.item()
  1153. jxde.append(jxde_)
  1154. ####cailiao
  1155. clde = []
  1156. cl = pd.read_csv("de/xsaz/JD_GuJiaCL.csv")
  1157. filtered1 = cl[cl["DEBH"]==debh]
  1158. for i in range(len(filtered1)):
  1159. clde_ = {}
  1160. SL = filtered1.iloc[i]["SL"]##shuliang
  1161. HJ = filtered1.iloc[i]["HJ"]##hejia
  1162. rcjID = filtered1.iloc[i]["RcjID"]
  1163. detail = pd.read_csv("de/xsaz/JD_CaiLiaoK.csv")
  1164. filtered2 = detail[detail["RcjID"]==rcjID]
  1165. if len(filtered2) > 0:
  1166. CLBH = filtered2.iloc[0]["CLBH"]
  1167. CLMC = filtered2.iloc[0]["CLMC"]
  1168. JLDW = filtered2.iloc[0]["JLDW"]
  1169. YSJG = filtered2.iloc[0]["YSJG"]
  1170. clde_["CLBH"] = CLBH
  1171. clde_["CLMC"] = CLMC
  1172. clde_["JLDW"] = JLDW
  1173. clde_["YSJG"] = YSJG.item()
  1174. clde_["SL"] = SL.item()
  1175. clde_["HJ"] = HJ.item()
  1176. clde.append(clde_)
  1177. else:
  1178. detail = pd.read_csv("de/xsaz/JD_PeiBi.csv")
  1179. filtered2 = detail[detail["RcjID"]==rcjID]
  1180. if len(filtered2) > 0:
  1181. CLBH = filtered2.iloc[0]["PBBH"]
  1182. CLMC = filtered2.iloc[0]["PBMC"]
  1183. JLDW = filtered2.iloc[0]["DW"]
  1184. YSJG = filtered2.iloc[0]["PBDJ"]
  1185. clde_["CLBH"] = CLBH.item()
  1186. clde_["CLMC"] = CLMC
  1187. clde_["JLDW"] = JLDW
  1188. clde_["YSJG"] = YSJG.item()
  1189. clde_["SL"] = SL.item()
  1190. clde_["HJ"] = HJ.item()
  1191. clde.append(clde_)
  1192. return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
  1193. def getSingleDeXilie_xstj(debh):
  1194. id = None
  1195. bz_selected = []
  1196. bz_selected2 = []
  1197. if "附注" in debh:
  1198. position = debh.find("附注")
  1199. debh = debh[:position]
  1200. if "*" in debh:
  1201. position = debh.find("*")
  1202. debh = debh[:position]
  1203. if debh.endswith("换"):
  1204. debh = debh[:-1]
  1205. if "[" in debh:
  1206. position = debh.find("[")
  1207. debh = debh[:position-1]
  1208. gj = pd.read_csv("de/xstj/JD_DanWeiGJ.csv")
  1209. filtered = gj[gj["DEBH"]==debh]
  1210. print(filtered)
  1211. if len(filtered) > 0:
  1212. index = (filtered.iloc[0]["YSDELBH"])
  1213. shu = pd.read_csv("de/xstj/JD_DingEShu.csv")
  1214. hit = shu[shu["zjh"]==index]
  1215. if len(hit) > 0:
  1216. id = hit.iloc[0]["ID"]
  1217. beizhu = str(filtered.iloc[0]["BZBH"])
  1218. if 'nan' in beizhu:
  1219. pass
  1220. else:
  1221. beizhus = beizhu.split(";")
  1222. print(beizhus)
  1223. bzfile = pd.read_csv("de/xstj/JD_BeiZhuZK.csv")
  1224. bzfile2 = pd.read_csv("de/xstj/JD_BeiZhuFK.csv", dtype=str)
  1225. bz_selected = bzfile[bzfile["BZBH"].isin(beizhus)]
  1226. bz_selected2 = bzfile2[bzfile2["BZBH"].isin(beizhus)]
  1227. else:
  1228. return None, None, None, None, None, None, None
  1229. ####rengong
  1230. rgde = []
  1231. rg = pd.read_csv("de/xstj/JD_GuJiaRG.csv")
  1232. filtered1 = rg[rg["DEBH"]==debh]
  1233. for i in range(len(filtered1)):
  1234. rgde_ = {}
  1235. gr = filtered1.iloc[i]["RGR"]##gongri
  1236. gf = filtered1.iloc[i]["RGF"]##gongfei
  1237. rcjID = filtered1.iloc[i]["RcjID"]
  1238. detail = pd.read_csv("de/xstj/JD_CaiLiaoK.csv")
  1239. filtered2 = detail[detail["RcjID"]==rcjID]
  1240. if len(filtered2) > 0:
  1241. CLBH = filtered2.iloc[0]["CLBH"]
  1242. CLMC = filtered2.iloc[0]["CLMC"]
  1243. JLDW = filtered2.iloc[0]["JLDW"]
  1244. YSJG = filtered2.iloc[0]["YSJG"]
  1245. rgde_["CLBH"] = CLBH
  1246. rgde_["CLMC"] = CLMC
  1247. rgde_["JLDW"] = JLDW
  1248. rgde_["YSJG"] = YSJG.item()
  1249. rgde_["gr"] = gr.item()
  1250. rgde_["gf"] = gf.item()
  1251. rgde.append(rgde_)
  1252. ##print(rgde)
  1253. ####jixie
  1254. jxde = []
  1255. jx = pd.read_csv("de/xstj/JD_GuJiaJX.csv")
  1256. filtered1 = jx[jx["DEBH"]==debh]
  1257. for i in range(len(filtered1)):
  1258. jxde_ = {}
  1259. sl = filtered1.iloc[i]["SL"]##shuliang
  1260. hj = filtered1.iloc[i]["HJ"]##hejia
  1261. rcjID = filtered1.iloc[i]["RcjID"]
  1262. detail = pd.read_csv("de/xstj/JD_JiXieK.csv")
  1263. filtered2 = detail[detail["RcjID"]==rcjID]
  1264. if len(filtered2) > 0:
  1265. jxbh = filtered2.iloc[0]["jxbh"]
  1266. jxmc = filtered2.iloc[0]["jxmc"]
  1267. DW = filtered2.iloc[0]["DW"]
  1268. tbdj = filtered2.iloc[0]["tbdj"]
  1269. jxde_["jxbh"] = jxbh
  1270. jxde_["jxmc"] = jxmc
  1271. jxde_["DW"] = DW
  1272. jxde_["tbdj"] = tbdj.item()
  1273. jxde_["sl"] = sl.item()
  1274. jxde_["hj"] = hj.item()
  1275. jxde.append(jxde_)
  1276. ####cailiao
  1277. clde = []
  1278. cl = pd.read_csv("de/xstj/JD_GuJiaCL.csv")
  1279. filtered1 = cl[cl["DEBH"]==debh]
  1280. for i in range(len(filtered1)):
  1281. clde_ = {}
  1282. SL = filtered1.iloc[i]["SL"]##shuliang
  1283. HJ = filtered1.iloc[i]["HJ"]##hejia
  1284. rcjID = filtered1.iloc[i]["RcjID"]
  1285. detail = pd.read_csv("de/xstj/JD_CaiLiaoK.csv")
  1286. filtered2 = detail[detail["RcjID"]==rcjID]
  1287. if len(filtered2) > 0:
  1288. CLBH = filtered2.iloc[0]["CLBH"]
  1289. CLMC = filtered2.iloc[0]["CLMC"]
  1290. JLDW = filtered2.iloc[0]["JLDW"]
  1291. YSJG = filtered2.iloc[0]["YSJG"]
  1292. clde_["CLBH"] = CLBH
  1293. clde_["CLMC"] = CLMC
  1294. clde_["JLDW"] = JLDW
  1295. clde_["YSJG"] = YSJG.item()
  1296. clde_["SL"] = SL.item()
  1297. clde_["HJ"] = HJ.item()
  1298. clde.append(clde_)
  1299. else:
  1300. detail = pd.read_csv("de/xstj/JD_PeiBi.csv")
  1301. filtered2 = detail[detail["RcjID"]==rcjID]
  1302. if len(filtered2) > 0:
  1303. CLBH = filtered2.iloc[0]["PBBH"]
  1304. CLMC = filtered2.iloc[0]["PBMC"]
  1305. JLDW = filtered2.iloc[0]["DW"]
  1306. YSJG = filtered2.iloc[0]["PBDJ"]
  1307. clde_["CLBH"] = CLBH.item()
  1308. clde_["CLMC"] = CLMC
  1309. clde_["JLDW"] = JLDW
  1310. clde_["YSJG"] = YSJG.item()
  1311. clde_["SL"] = SL.item()
  1312. clde_["HJ"] = HJ.item()
  1313. clde.append(clde_)
  1314. return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
  1315. def getSingleDeXilie_yl(debh):
  1316. id = None
  1317. bz_selected = []
  1318. bz_selected2 = []
  1319. if "附注" in debh:
  1320. position = debh.find("附注")
  1321. debh = debh[:position]
  1322. if "*" in debh:
  1323. position = debh.find("*")
  1324. debh = debh[:position]
  1325. if debh.endswith("换"):
  1326. debh = debh[:-1]
  1327. if "[" in debh:
  1328. position = debh.find("[")
  1329. debh = debh[:position-1]
  1330. gj = pd.read_csv("de/yl/JD_DanWeiGJ.csv")
  1331. filtered = gj[gj["DEBH"]==debh]
  1332. print(filtered)
  1333. if len(filtered) > 0:
  1334. index = (filtered.iloc[0]["YSDELBH"])
  1335. shu = pd.read_csv("de/yl/JD_DingEShu.csv")
  1336. hit = shu[shu["zjh"]==index]
  1337. if len(hit) > 0:
  1338. id = hit.iloc[0]["ID"]
  1339. beizhu = str(filtered.iloc[0]["BZBH"])
  1340. if 'nan' in beizhu:
  1341. pass
  1342. else:
  1343. beizhus = beizhu.split(";")
  1344. print(beizhus)
  1345. bzfile = pd.read_csv("de/yl/JD_BeiZhuZK.csv")
  1346. bzfile2 = pd.read_csv("de/yl/JD_BeiZhuFK.csv", dtype=str)
  1347. bz_selected = bzfile[bzfile["BZBH"].isin(beizhus)]
  1348. bz_selected2 = bzfile2[bzfile2["BZBH"].isin(beizhus)]
  1349. else:
  1350. return None, None, None, None, None, None, None
  1351. ####rengong
  1352. rgde = []
  1353. rg = pd.read_csv("de/yl/JD_GuJiaRG.csv")
  1354. filtered1 = rg[rg["DEBH"]==debh]
  1355. for i in range(len(filtered1)):
  1356. rgde_ = {}
  1357. gr = filtered1.iloc[i]["RGR"]##gongri
  1358. gf = filtered1.iloc[i]["RGF"]##gongfei
  1359. rcjID = filtered1.iloc[i]["RcjID"]
  1360. detail = pd.read_csv("de/yl/JD_CaiLiaoK.csv")
  1361. filtered2 = detail[detail["RcjID"]==rcjID]
  1362. if len(filtered2) > 0:
  1363. CLBH = filtered2.iloc[0]["CLBH"]
  1364. CLMC = filtered2.iloc[0]["CLMC"]
  1365. JLDW = filtered2.iloc[0]["JLDW"]
  1366. YSJG = filtered2.iloc[0]["YSJG"]
  1367. rgde_["CLBH"] = CLBH
  1368. rgde_["CLMC"] = CLMC
  1369. rgde_["JLDW"] = JLDW
  1370. rgde_["YSJG"] = YSJG.item()
  1371. rgde_["gr"] = gr.item()
  1372. rgde_["gf"] = gf.item()
  1373. rgde.append(rgde_)
  1374. ##print(rgde)
  1375. ####jixie
  1376. jxde = []
  1377. jx = pd.read_csv("de/yl/JD_GuJiaJX.csv")
  1378. filtered1 = jx[jx["DEBH"]==debh]
  1379. for i in range(len(filtered1)):
  1380. jxde_ = {}
  1381. sl = filtered1.iloc[i]["SL"]##shuliang
  1382. hj = filtered1.iloc[i]["HJ"]##hejia
  1383. rcjID = filtered1.iloc[i]["RcjID"]
  1384. detail = pd.read_csv("de/yl/JD_JiXieK.csv")
  1385. filtered2 = detail[detail["RcjID"]==rcjID]
  1386. if len(filtered2) > 0:
  1387. jxbh = filtered2.iloc[0]["jxbh"]
  1388. jxmc = filtered2.iloc[0]["jxmc"]
  1389. DW = filtered2.iloc[0]["DW"]
  1390. tbdj = filtered2.iloc[0]["tbdj"]
  1391. jxde_["jxbh"] = jxbh
  1392. jxde_["jxmc"] = jxmc
  1393. jxde_["DW"] = DW
  1394. jxde_["tbdj"] = tbdj.item()
  1395. jxde_["sl"] = sl.item()
  1396. jxde_["hj"] = hj.item()
  1397. jxde.append(jxde_)
  1398. ####cailiao
  1399. clde = []
  1400. cl = pd.read_csv("de/yl/JD_GuJiaCL.csv")
  1401. filtered1 = cl[cl["DEBH"]==debh]
  1402. for i in range(len(filtered1)):
  1403. clde_ = {}
  1404. SL = filtered1.iloc[i]["SL"]##shuliang
  1405. HJ = filtered1.iloc[i]["HJ"]##hejia
  1406. rcjID = filtered1.iloc[i]["RcjID"]
  1407. detail = pd.read_csv("de/yl/JD_CaiLiaoK.csv")
  1408. filtered2 = detail[detail["RcjID"]==rcjID]
  1409. if len(filtered2) > 0:
  1410. CLBH = filtered2.iloc[0]["CLBH"]
  1411. CLMC = filtered2.iloc[0]["CLMC"]
  1412. JLDW = filtered2.iloc[0]["JLDW"]
  1413. YSJG = filtered2.iloc[0]["YSJG"]
  1414. clde_["CLBH"] = CLBH
  1415. clde_["CLMC"] = CLMC
  1416. clde_["JLDW"] = JLDW
  1417. clde_["YSJG"] = YSJG.item()
  1418. clde_["SL"] = SL.item()
  1419. clde_["HJ"] = HJ.item()
  1420. clde.append(clde_)
  1421. else:
  1422. detail = pd.read_csv("de/yl/JD_PeiBi.csv")
  1423. filtered2 = detail[detail["RcjID"]==rcjID]
  1424. if len(filtered2) > 0:
  1425. CLBH = filtered2.iloc[0]["PBBH"]
  1426. CLMC = filtered2.iloc[0]["PBMC"]
  1427. JLDW = filtered2.iloc[0]["DW"]
  1428. YSJG = filtered2.iloc[0]["PBDJ"]
  1429. clde_["CLBH"] = CLBH.item()
  1430. clde_["CLMC"] = CLMC
  1431. clde_["JLDW"] = JLDW
  1432. clde_["YSJG"] = YSJG.item()
  1433. clde_["SL"] = SL.item()
  1434. clde_["HJ"] = HJ.item()
  1435. clde.append(clde_)
  1436. return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
  1437. def getSingleDeXilie_az(debh):
  1438. id = None
  1439. bz_selected = []
  1440. bz_selected2 = []
  1441. if "附注" in debh:
  1442. position = debh.find("附注")
  1443. debh = debh[:position]
  1444. if "*" in debh:
  1445. position = debh.find("*")
  1446. debh = debh[:position]
  1447. if debh.endswith("换"):
  1448. debh = debh[:-1]
  1449. if "[" in debh:
  1450. position = debh.find("[")
  1451. debh = debh[:position-1]
  1452. gj = pd.read_csv("de/az/JD_DanWeiGJ.csv")
  1453. filtered = gj[gj["DEBH"]==debh]
  1454. print(filtered)
  1455. if len(filtered) > 0:
  1456. index = (filtered.iloc[0]["YSDELBH"])
  1457. shu = pd.read_csv("de/az/JD_DingEShu.csv")
  1458. hit = shu[shu["zjh"]==index]
  1459. if len(hit) > 0:
  1460. id = hit.iloc[0]["ID"]
  1461. beizhu = str(filtered.iloc[0]["BZBH"])
  1462. if 'nan' in beizhu:
  1463. pass
  1464. else:
  1465. beizhus = beizhu.split(";")
  1466. print(beizhus)
  1467. bzfile = pd.read_csv("de/az/JD_BeiZhuZK.csv")
  1468. bzfile2 = pd.read_csv("de/az/JD_BeiZhuFK.csv", dtype=str)
  1469. bz_selected = bzfile[bzfile["BZBH"].isin(beizhus)]
  1470. bz_selected2 = bzfile2[bzfile2["BZBH"].isin(beizhus)]
  1471. else:
  1472. return None, None, None, None, None, None, None
  1473. ####rengong
  1474. rgde = []
  1475. rg = pd.read_csv("de/az/JD_GuJiaRG.csv")
  1476. filtered1 = rg[rg["DEBH"]==debh]
  1477. for i in range(len(filtered1)):
  1478. rgde_ = {}
  1479. gr = filtered1.iloc[i]["RGR"]##gongri
  1480. gf = filtered1.iloc[i]["RGF"]##gongfei
  1481. rcjID = filtered1.iloc[i]["RcjID"]
  1482. detail = pd.read_csv("de/az/JD_CaiLiaoK.csv")
  1483. filtered2 = detail[detail["RcjID"]==rcjID]
  1484. if len(filtered2) > 0:
  1485. CLBH = filtered2.iloc[0]["CLBH"]
  1486. CLMC = filtered2.iloc[0]["CLMC"]
  1487. JLDW = filtered2.iloc[0]["JLDW"]
  1488. YSJG = filtered2.iloc[0]["YSJG"]
  1489. rgde_["CLBH"] = CLBH
  1490. rgde_["CLMC"] = CLMC
  1491. rgde_["JLDW"] = JLDW
  1492. rgde_["YSJG"] = YSJG
  1493. rgde_["gr"] = gr
  1494. rgde_["gf"] = gf
  1495. rgde.append(rgde_)
  1496. ##print(rgde)
  1497. ####jixie
  1498. jxde = []
  1499. jx = pd.read_csv("de/az/JD_GuJiaJX.csv")
  1500. filtered1 = jx[jx["DEBH"]==debh]
  1501. for i in range(len(filtered1)):
  1502. jxde_ = {}
  1503. sl = filtered1.iloc[i]["SL"]##shuliang
  1504. hj = filtered1.iloc[i]["HJ"]##hejia
  1505. rcjID = filtered1.iloc[i]["RcjID"]
  1506. detail = pd.read_csv("de/az/JD_JiXieK.csv")
  1507. filtered2 = detail[detail["RcjID"]==rcjID]
  1508. if len(filtered2) > 0:
  1509. jxbh = filtered2.iloc[0]["jxbh"]
  1510. jxmc = filtered2.iloc[0]["jxmc"]
  1511. DW = filtered2.iloc[0]["DW"]
  1512. tbdj = filtered2.iloc[0]["tbdj"]
  1513. jxde_["jxbh"] = jxbh
  1514. jxde_["jxmc"] = jxmc
  1515. jxde_["DW"] = DW
  1516. jxde_["tbdj"] = tbdj
  1517. jxde_["sl"] = sl
  1518. jxde_["hj"] = hj
  1519. jxde.append(jxde_)
  1520. ####cailiao
  1521. clde = []
  1522. cl = pd.read_csv("de/az/JD_GuJiaCL.csv")
  1523. filtered1 = cl[cl["DEBH"]==debh]
  1524. for i in range(len(filtered1)):
  1525. clde_ = {}
  1526. SL = filtered1.iloc[i]["SL"]##shuliang
  1527. HJ = filtered1.iloc[i]["HJ"]##hejia
  1528. rcjID = filtered1.iloc[i]["RcjID"]
  1529. detail = pd.read_csv("de/az/JD_CaiLiaoK.csv")
  1530. filtered2 = detail[detail["RcjID"]==rcjID]
  1531. if len(filtered2) > 0:
  1532. CLBH = filtered2.iloc[0]["CLBH"]
  1533. CLMC = filtered2.iloc[0]["CLMC"]
  1534. JLDW = filtered2.iloc[0]["JLDW"]
  1535. YSJG = filtered2.iloc[0]["YSJG"]
  1536. clde_["CLBH"] = CLBH
  1537. clde_["CLMC"] = CLMC
  1538. clde_["JLDW"] = JLDW
  1539. clde_["YSJG"] = YSJG
  1540. clde_["SL"] = SL
  1541. clde_["HJ"] = HJ
  1542. clde.append(clde_)
  1543. else:
  1544. detail = pd.read_csv("de/az/JD_PeiBi.csv")
  1545. filtered2 = detail[detail["RcjID"]==rcjID]
  1546. if len(filtered2) > 0:
  1547. CLBH = filtered2.iloc[0]["PBBH"]
  1548. CLMC = filtered2.iloc[0]["PBMC"]
  1549. JLDW = filtered2.iloc[0]["DW"]
  1550. YSJG = filtered2.iloc[0]["PBDJ"]
  1551. clde_["CLBH"] = CLBH
  1552. clde_["CLMC"] = CLMC
  1553. clde_["JLDW"] = JLDW
  1554. clde_["YSJG"] = YSJG
  1555. clde_["SL"] = SL
  1556. clde_["HJ"] = HJ
  1557. clde.append(clde_)
  1558. return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
  1559. def getSingleDeXilie_sz(debh):
  1560. id = None
  1561. bz_selected = []
  1562. bz_selected2 = []
  1563. if "附注" in debh:
  1564. position = debh.find("附注")
  1565. debh = debh[:position]
  1566. if "*" in debh:
  1567. position = debh.find("*")
  1568. debh = debh[:position]
  1569. if debh.endswith("换"):
  1570. debh = debh[:-1]
  1571. if "[" in debh:
  1572. position = debh.find("[")
  1573. debh = debh[:position-1]
  1574. gj = pd.read_csv("de/sz/JD_DanWeiGJ.csv")
  1575. filtered = gj[gj["DEBH"]==debh]
  1576. print(filtered)
  1577. if len(filtered) > 0:
  1578. index = (filtered.iloc[0]["YSDELBH"])
  1579. shu = pd.read_csv("de/sz/JD_DingEShu.csv")
  1580. hit = shu[shu["zjh"]==index]
  1581. if len(hit) > 0:
  1582. id = hit.iloc[0]["ID"]
  1583. beizhu = str(filtered.iloc[0]["BZBH"])
  1584. if 'nan' in beizhu:
  1585. pass
  1586. else:
  1587. beizhus = beizhu.split(";")
  1588. print(beizhus)
  1589. bzfile = pd.read_csv("de/sz/JD_BeiZhuZK.csv")
  1590. bzfile2 = pd.read_csv("de/sz/JD_BeiZhuFK.csv", dtype=str)
  1591. bz_selected = bzfile[bzfile["BZBH"].isin(beizhus)]
  1592. bz_selected2 = bzfile2[bzfile2["BZBH"].isin(beizhus)]
  1593. else:
  1594. return None, None, None, None, None, None, None
  1595. ####rengong
  1596. rgde = []
  1597. rg = pd.read_csv("de/sz/JD_GuJiaRG.csv")
  1598. filtered1 = rg[rg["DEBH"]==debh]
  1599. for i in range(len(filtered1)):
  1600. rgde_ = {}
  1601. gr = filtered1.iloc[i]["RGR"]##gongri
  1602. gf = filtered1.iloc[i]["RGF"]##gongfei
  1603. rcjID = filtered1.iloc[i]["RcjID"]
  1604. detail = pd.read_csv("de/sz/JD_CaiLiaoK.csv")
  1605. filtered2 = detail[detail["RcjID"]==rcjID]
  1606. if len(filtered2) > 0:
  1607. CLBH = filtered2.iloc[0]["CLBH"]
  1608. CLMC = filtered2.iloc[0]["CLMC"]
  1609. JLDW = filtered2.iloc[0]["JLDW"]
  1610. YSJG = filtered2.iloc[0]["YSJG"]
  1611. rgde_["CLBH"] = CLBH
  1612. rgde_["CLMC"] = CLMC
  1613. rgde_["JLDW"] = JLDW
  1614. rgde_["YSJG"] = YSJG.item() if type(YSJG) == float64 else YSJG
  1615. rgde_["gr"] = gr.item() if type(gr) == float64 else gr
  1616. rgde_["gf"] = gf.item() if type(gf) == float64 else gf
  1617. rgde.append(rgde_)
  1618. ##print(rgde)
  1619. ####jixie
  1620. jxde = []
  1621. jx = pd.read_csv("de/sz/JD_GuJiaJX.csv")
  1622. filtered1 = jx[jx["DEBH"]==debh]
  1623. for i in range(len(filtered1)):
  1624. jxde_ = {}
  1625. sl = filtered1.iloc[i]["SL"]##shuliang
  1626. hj = filtered1.iloc[i]["HJ"]##hejia
  1627. rcjID = filtered1.iloc[i]["RcjID"]
  1628. detail = pd.read_csv("de/sz/JD_JiXieK.csv")
  1629. filtered2 = detail[detail["RcjID"]==rcjID]
  1630. if len(filtered2) > 0:
  1631. jxbh = filtered2.iloc[0]["jxbh"]
  1632. jxmc = filtered2.iloc[0]["jxmc"]
  1633. DW = filtered2.iloc[0]["DW"]
  1634. tbdj = filtered2.iloc[0]["tbdj"]
  1635. jxde_["jxbh"] = jxbh
  1636. jxde_["jxmc"] = jxmc
  1637. jxde_["DW"] = DW
  1638. jxde_["tbdj"] = tbdj.item() if type(tbdj) == float64 else tbdj
  1639. jxde_["sl"] = sl.item() if type(sl) == float64 else sl
  1640. jxde_["hj"] = hj.item() if type(hj) == float64 else hj
  1641. jxde.append(jxde_)
  1642. ####cailiao
  1643. clde = []
  1644. cl = pd.read_csv("de/sz/JD_GuJiaCL.csv")
  1645. filtered1 = cl[cl["DEBH"]==debh]
  1646. for i in range(len(filtered1)):
  1647. clde_ = {}
  1648. SL = filtered1.iloc[i]["SL"]##shuliang
  1649. HJ = filtered1.iloc[i]["HJ"]##hejia
  1650. rcjID = filtered1.iloc[i]["RcjID"]
  1651. detail = pd.read_csv("de/sz/JD_CaiLiaoK.csv")
  1652. filtered2 = detail[detail["RcjID"]==rcjID]
  1653. if len(filtered2) > 0:
  1654. CLBH = filtered2.iloc[0]["CLBH"]
  1655. CLMC = filtered2.iloc[0]["CLMC"]
  1656. JLDW = filtered2.iloc[0]["JLDW"]
  1657. YSJG = filtered2.iloc[0]["YSJG"]
  1658. clde_["CLBH"] = CLBH
  1659. clde_["CLMC"] = CLMC
  1660. clde_["JLDW"] = JLDW
  1661. clde_["YSJG"] = YSJG.item() if type(YSJG) == float64 else YSJG
  1662. clde_["SL"] = SL.item() if type(SL) == float64 else SL
  1663. clde_["HJ"] = HJ.item() if type(HJ) == float64 else HJ
  1664. clde.append(clde_)
  1665. else:
  1666. detail = pd.read_csv("de/sz/JD_PeiBi.csv")
  1667. filtered2 = detail[detail["RcjID"]==rcjID]
  1668. if len(filtered2) > 0:
  1669. CLBH = filtered2.iloc[0]["PBBH"]
  1670. CLMC = filtered2.iloc[0]["PBMC"]
  1671. JLDW = filtered2.iloc[0]["DW"]
  1672. YSJG = filtered2.iloc[0]["PBDJ"]
  1673. clde_["CLBH"] = CLBH
  1674. clde_["CLMC"] = CLMC
  1675. clde_["JLDW"] = JLDW
  1676. clde_["YSJG"] = YSJG.item() if type(YSJG) == float64 else YSJG
  1677. clde_["SL"] = SL.item() if type(SL) == float64 else SL
  1678. clde_["HJ"] = HJ.item() if type(HJ) == float64 else HJ
  1679. clde.append(clde_)
  1680. return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
  1681. def getSingleDeXilie_tj(debh):
  1682. id = None
  1683. bz_selected = []
  1684. bz_selected2 = []
  1685. if "附注" in debh:
  1686. position = debh.find("附注")
  1687. debh = debh[:position]
  1688. if "*" in debh:
  1689. position = debh.find("*")
  1690. debh = debh[:position]
  1691. if debh.endswith("换"):
  1692. debh = debh[:-1]
  1693. if "[" in debh:
  1694. position = debh.find("[")
  1695. debh = debh[:position-1]
  1696. gj = pd.read_csv("de/tj/JD_DanWeiGJ.csv")
  1697. filtered = gj[gj["DEBH"]==debh]
  1698. print(filtered)
  1699. if len(filtered) > 0:
  1700. index = int(filtered.iloc[0]["YSDELBH"])
  1701. shu = pd.read_csv("de/tj/JD_DingEShu.csv")
  1702. hit = shu[shu["zjh"]==index]
  1703. if len(hit) > 0:
  1704. id = hit.iloc[0]["ID"]
  1705. beizhu = str(filtered.iloc[0]["BZBH"])
  1706. if 'nan' in beizhu:
  1707. pass
  1708. else:
  1709. beizhus = beizhu.split(";")
  1710. print(beizhus)
  1711. bzfile = pd.read_csv("de/tj/JD_BeiZhuZK.csv")
  1712. bzfile2 = pd.read_csv("de/tj/JD_BeiZhuFK.csv", dtype=str)
  1713. bz_selected = bzfile[bzfile["BZBH"].isin(beizhus)]
  1714. bz_selected2 = bzfile2[bzfile2["BZBH"].isin(beizhus)]
  1715. else:
  1716. return None, None, None, None, None, None, None
  1717. ####rengong
  1718. rgde = []
  1719. rg = pd.read_csv("de/tj/JD_GuJiaRG.csv")
  1720. filtered1 = rg[rg["DEBH"]==debh]
  1721. for i in range(len(filtered1)):
  1722. rgde_ = {}
  1723. gr = filtered1.iloc[i]["RGR"]##gongri
  1724. gf = filtered1.iloc[i]["RGF"]##gongfei
  1725. rcjID = filtered1.iloc[i]["RcjID"]
  1726. detail = pd.read_csv("de/tj/JD_CaiLiaoK.csv")
  1727. filtered2 = detail[detail["RcjID"]==rcjID]
  1728. if len(filtered2) > 0:
  1729. CLBH = filtered2.iloc[0]["CLBH"]
  1730. CLMC = filtered2.iloc[0]["CLMC"]
  1731. JLDW = filtered2.iloc[0]["JLDW"]
  1732. YSJG = filtered2.iloc[0]["YSJG"]
  1733. rgde_["CLBH"] = CLBH
  1734. rgde_["CLMC"] = CLMC
  1735. rgde_["JLDW"] = JLDW
  1736. rgde_["YSJG"] = YSJG.item() if type(YSJG) == float64 else YSJG
  1737. rgde_["gr"] = gr.item() if type(gr) == float64 else gr
  1738. rgde_["gf"] = gf.item() if type(gf) == float64 else gf
  1739. rgde.append(rgde_)
  1740. ##print(rgde)
  1741. ####jixie
  1742. jxde = []
  1743. jx = pd.read_csv("de/tj/JD_GuJiaJX.csv")
  1744. filtered1 = jx[jx["DEBH"]==debh]
  1745. for i in range(len(filtered1)):
  1746. jxde_ = {}
  1747. sl = filtered1.iloc[i]["SL"]##shuliang
  1748. hj = filtered1.iloc[i]["HJ"]##hejia
  1749. rcjID = filtered1.iloc[i]["RcjID"]
  1750. detail = pd.read_csv("de/tj/JD_JiXieK.csv")
  1751. filtered2 = detail[detail["RcjID"]==rcjID]
  1752. if len(filtered2) > 0:
  1753. jxbh = filtered2.iloc[0]["jxbh"]
  1754. jxmc = filtered2.iloc[0]["jxmc"]
  1755. DW = filtered2.iloc[0]["DW"]
  1756. tbdj = filtered2.iloc[0]["tbdj"]
  1757. jxde_["jxbh"] = jxbh
  1758. jxde_["jxmc"] = jxmc
  1759. jxde_["DW"] = DW
  1760. jxde_["tbdj"] = tbdj.item() if type(tbdj) == float64 else tbdj
  1761. jxde_["sl"] = sl.item() if type(sl) == float64 else sl
  1762. jxde_["hj"] = hj.item() if type(hj) == float64 else hj
  1763. jxde.append(jxde_)
  1764. ####cailiao
  1765. clde = []
  1766. cl = pd.read_csv("de/tj/JD_GuJiaCL.csv")
  1767. filtered1 = cl[cl["DEBH"]==debh]
  1768. for i in range(len(filtered1)):
  1769. clde_ = {}
  1770. SL = filtered1.iloc[i]["SL"]##shuliang
  1771. HJ = filtered1.iloc[i]["HJ"]##hejia
  1772. rcjID = filtered1.iloc[i]["RcjID"]
  1773. detail = pd.read_csv("de/tj/JD_CaiLiaoK.csv")
  1774. filtered2 = detail[detail["RcjID"]==rcjID]
  1775. if len(filtered2) > 0:
  1776. CLBH = filtered2.iloc[0]["CLBH"]
  1777. CLMC = filtered2.iloc[0]["CLMC"]
  1778. JLDW = filtered2.iloc[0]["JLDW"]
  1779. YSJG = filtered2.iloc[0]["YSJG"]
  1780. clde_["CLBH"] = CLBH
  1781. clde_["CLMC"] = CLMC
  1782. clde_["JLDW"] = JLDW
  1783. clde_["YSJG"] = YSJG.item() if type(YSJG) == float64 else YSJG
  1784. clde_["SL"] = SL.item() if type(SL) == float64 else SL
  1785. clde_["HJ"] = HJ.item() if type(HJ) == float64 else HJ
  1786. clde.append(clde_)
  1787. else:
  1788. detail = pd.read_csv("de/tj/JD_PeiBi.csv")
  1789. filtered2 = detail[detail["RcjID"]==rcjID]
  1790. if len(filtered2) > 0:
  1791. CLBH = filtered2.iloc[0]["PBBH"]
  1792. CLMC = filtered2.iloc[0]["PBMC"]
  1793. JLDW = filtered2.iloc[0]["DW"]
  1794. YSJG = filtered2.iloc[0]["PBDJ"]
  1795. clde_["CLBH"] = CLBH
  1796. clde_["CLMC"] = CLMC
  1797. clde_["JLDW"] = JLDW
  1798. clde_["YSJG"] = YSJG.item() if type(YSJG) == float64 else YSJG
  1799. clde_["SL"] = SL.item() if type(SL) == float64 else SL
  1800. clde_["HJ"] = HJ.item() if type(HJ) == float64 else HJ
  1801. clde.append(clde_)
  1802. return filtered.to_json(force_ascii=False), id, rgde, jxde, clde, bz_selected.to_json(force_ascii=False) if len(bz_selected) > 0 else None, bz_selected2.to_json(force_ascii=False) if len(bz_selected2) > 0 else None
  1803. def getDwgc(root, id, Zylb):
  1804. result = []
  1805. #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
  1806. item = None
  1807. for child in root:
  1808. if child.tag == "Dxgcxx":
  1809. for child1 in child:
  1810. Dwgcbh = child1.attrib["Dwgcbh"]
  1811. if Dwgcbh == id:
  1812. item = child1
  1813. break
  1814. ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
  1815. id = id + "Zylb" + Zylb
  1816. for child in item:
  1817. if child.tag == "Fywj":
  1818. result.append({"id": id + "bao jia hui zong", "label": "报价汇总表"})
  1819. elif child.tag == "Gfsj":
  1820. result.append({"id": id + "gui fei shui jin", "label": "规费税金"})
  1821. elif child.tag == "Qdxm":
  1822. result.append({"id": id + "qing dan xiang mu", "label": "清单项目"})
  1823. elif child.tag == "Csxm":
  1824. result.append({"id": id + "cuo shi xiang mu", "label": "措施项目"})
  1825. elif child.tag == "Qtxm":
  1826. result.append({"id": id +"qi ta xiang mu", "label": "其他项目"})
  1827. elif child.tag == "Zlje":
  1828. result.append({"id": id +"zan lie jin e", "label": "暂列金额"})
  1829. elif child.tag == "Clzg":
  1830. result.append({"id": id +"cai liao zan gu jia", "label": "材料暂估价"})
  1831. elif child.tag == "Zygczg":
  1832. result.append({"id": id + "zhuan ye gong cheng zan gu jia", "label": "专业工程暂估价"})
  1833. elif child.tag == "Jrg":
  1834. result.append({"id": id + "ji ri gong", "label": "计日工"})
  1835. elif child.tag == "Zcbfwf":
  1836. result.append({"id": id + "zong cheng bao fu wu fei", "label": "总承包服务费"})
  1837. elif child.tag == "Zjxmjdkzffj":
  1838. result.append({"id": id + "zong jia xiang mu jin du kuan zhi fu fen jie", "label": "总价项目进度款支付分解"})
  1839. elif child.tag == "Fbrgycl":
  1840. result.append({"id": id + "fa bao ren gong ying cai liao", "label": "发包人供应材料"})
  1841. elif child.tag == "Cbrgycl":
  1842. result.append({"id": id + "cheng bao ren gong ying cai liao", "label": "承包人供应材料"})
  1843. elif child.tag == "Rcjhz":
  1844. result.append({"id": id + "ren cai ji hui zong", "label": "人材机汇总"})
  1845. else:
  1846. print(child.tag)
  1847. print("WARNING####################################################################")
  1848. return result