|
|
@@ -473,7 +473,7 @@ def dfs2(items):
|
|
|
def dfs3(items):
|
|
|
result = []
|
|
|
for entry in items:
|
|
|
- result.append([entry['序号'], entry['名称'], entry['暂列金额'], entry['金额'], entry['项目类别'], entry['备注']])
|
|
|
+ result.append([entry['序号'], entry['名称'], entry['金额'], entry['项目类别'], entry['备注']])
|
|
|
if '__children' in entry:
|
|
|
result_ = dfs3(entry['__children'])
|
|
|
for r in result_:
|
|
|
@@ -534,6 +534,9 @@ async def build(client, root, id):
|
|
|
zygczgj = Dwgc['zygczgj']
|
|
|
jrg = Dwgc['jrg']
|
|
|
zcbfwf = Dwgc['zcbfwf']
|
|
|
+ fbrgycl = Dwgc['fbrgycl']
|
|
|
+ rcjhz = Dwgc['rcjhz']
|
|
|
+ zjcs = Dwgc['zjcs']
|
|
|
Fywj = ET.SubElement(Dwgcxx, 'Fywj')
|
|
|
for bjhz_ in bjhz:
|
|
|
FywjMx = ET.SubElement(Fywj, 'FywjMx')
|
|
|
@@ -552,6 +555,139 @@ async def build(client, root, id):
|
|
|
GfsjMx.set('Fl', str(gfsj_[4]))
|
|
|
GfsjMx.set('Je', str(gfsj_[5]))
|
|
|
GfsjMx.set('Fyxlb', str(gfsj_[6]))
|
|
|
+ Csxm = ET.SubElement(Dwgcxx, 'Csxm')
|
|
|
+ ZjCs = ET.SubElement(Csxm, 'ZjCs')
|
|
|
+ for zjcs_ in zjcs:
|
|
|
+ ZjCsMx = ET.SubElement(ZjCs, 'ZjCsMx')
|
|
|
+ ZjCsMx.set('Xh', str(zjcs_['序号']))
|
|
|
+ ZjCsMx.set('Bm', str(zjcs_['清单编码']))
|
|
|
+ ZjCsMx.set('Mc', str(zjcs_['名称']))
|
|
|
+ ZjCsMx.set('Js', str(zjcs_['计算基数']))
|
|
|
+ ZjCsMx.set('Jsjc', str(zjcs_['计算基础']))
|
|
|
+ ZjCsMx.set('Fl', str(zjcs_['费率']))
|
|
|
+ ZjCsMx.set('Je', str(zjcs_['金额']))
|
|
|
+ ZjCsMx.set('Xmlb', str(zjcs_['项目类别']))
|
|
|
+ if '__children' in zjcs_:
|
|
|
+ AqwmfMx = ET.SubElement(ZjCsMx, 'AqwmfMx')
|
|
|
+ AqwmfMx.set('Mc', str(zjcs_['__children'][0]['名称']))
|
|
|
+ AqwmfMx.set('Js', str(zjcs_['__children'][0]['计算基数']))
|
|
|
+ AqwmfMx.set('Jsjc', str(zjcs_['__children'][0]['计算基础']))
|
|
|
+ AqwmfMx.set('Fl', str(zjcs_['__children'][0]['费率']))
|
|
|
+ AqwmfMx.set('Je', str(zjcs_['__children'][0]['金额']))
|
|
|
+ AqwmfMx.set('Xmlb', str(zjcs_['__children'][0]['项目类别']))
|
|
|
+ AqwmfMx = ET.SubElement(ZjCsMx, 'AqwmfMx')
|
|
|
+ AqwmfMx.set('Mc', str(zjcs_['__children'][1]['名称']))
|
|
|
+ AqwmfMx.set('Js', str(zjcs_['__children'][1]['计算基数']))
|
|
|
+ AqwmfMx.set('Jsjc', str(zjcs_['__children'][1]['计算基础']))
|
|
|
+ AqwmfMx.set('Fl', str(zjcs_['__children'][1]['费率']))
|
|
|
+ AqwmfMx.set('Je', str(zjcs_['__children'][1]['金额']))
|
|
|
+ AqwmfMx.set('Xmlb', str(zjcs_['__children'][1]['项目类别']))
|
|
|
+ AqwmfMx = ET.SubElement(ZjCsMx, 'AqwmfMx')
|
|
|
+ AqwmfMx.set('Mc', str(zjcs_['__children'][2]['名称']))
|
|
|
+ AqwmfMx.set('Js', str(zjcs_['__children'][2]['计算基数']))
|
|
|
+ AqwmfMx.set('Jsjc', str(zjcs_['__children'][2]['计算基础']))
|
|
|
+ AqwmfMx.set('Fl', str(zjcs_['__children'][2]['费率']))
|
|
|
+ AqwmfMx.set('Je', str(zjcs_['__children'][2]['金额']))
|
|
|
+ AqwmfMx.set('Xmlb', str(zjcs_['__children'][2]['项目类别']))
|
|
|
+ DjCs = ET.SubElement(Csxm, 'DjCs')
|
|
|
+ collection = db["Djcs"]
|
|
|
+ before_sort = []
|
|
|
+ async for post in collection.find({"biao_id": id, "Dwgcbh": entry['Dwgcbh']}):
|
|
|
+ before_sort.append(post)
|
|
|
+ after_sort = sorted(before_sort, key=lambda x: int(x['序号']))
|
|
|
+ for djcs in after_sort:
|
|
|
+ DjCsMx = ET.SubElement(DjCs, 'DjCsMx')
|
|
|
+ DjCsMx.set('Xh', str(djcs['序号']))
|
|
|
+ DjCsMx.set('Bm', str(djcs['清单编码']))
|
|
|
+ DjCsMx.set('Mc', str(djcs['名称']))
|
|
|
+ DjCsMx.set('Xmtz', str(djcs['项目特征']))
|
|
|
+ DjCsMx.set('Jsgz', str(djcs['计算规则']))
|
|
|
+ DjCsMx.set('Dw', str(djcs['单位']))
|
|
|
+ DjCsMx.set('Sl', str(djcs['数量']))
|
|
|
+ DjCsMx.set('Zhdj', str(djcs['综合单价']))
|
|
|
+ DjCsMx.set('Zhhj', str(djcs['合价']))
|
|
|
+ DjCsMx.set('Rgf', str(djcs['人工费']))
|
|
|
+ DjCsMx.set('Zcf', str(djcs['主材费']))
|
|
|
+ DjCsMx.set('Sbf', str(djcs['设备费']))
|
|
|
+ DjCsMx.set('Fcf', str(djcs['辅材费']))
|
|
|
+ DjCsMx.set('Clf', str(djcs['材料费']))
|
|
|
+ DjCsMx.set('Jxf', str(djcs['机械费']))
|
|
|
+ DjCsMx.set('Glf', str(djcs['管理费']))
|
|
|
+ DjCsMx.set('Lr', str(djcs['利润']))
|
|
|
+ DjCsMx.set('Zgj', str(djcs['暂估价']))
|
|
|
+ DjCsMx.set('Zgr', str(djcs['综合人工工日']))
|
|
|
+ Csxdezj = ET.SubElement(DjCsMx, 'Csxdezj')
|
|
|
+ if '__children' in djcs:
|
|
|
+ for child in djcs['__children']:
|
|
|
+ CsxdezjMx = ET.SubElement(Csxdezj, 'CsxdezjMx')
|
|
|
+ CsxdezjMx.set('Debm', str(child['清单编码']))
|
|
|
+ CsxdezjMx.set('Mc', str(child['名称']))
|
|
|
+ CsxdezjMx.set('Dw', str(child['单位']))
|
|
|
+ CsxdezjMx.set('DwQdSl', str(child['数量']))
|
|
|
+ CsxdezjMx.set('Dj', str(child['综合单价']))
|
|
|
+ CsxdezjMx.set('Hj', str(child['合价']))
|
|
|
+ CsxdezjMx.set('Rgf', str(child['人工费']))
|
|
|
+ CsxdezjMx.set('Zcf', str(child['主材费']))
|
|
|
+ CsxdezjMx.set('Sbf', str(child['设备费']))
|
|
|
+ CsxdezjMx.set('Fcf', str(child['辅材费']))
|
|
|
+ CsxdezjMx.set('Clf', str(child['材料费']))
|
|
|
+ CsxdezjMx.set('Jxf', str(child['机械费']))
|
|
|
+ CsxdezjMx.set('Glf', str(child['管理费']))
|
|
|
+ CsxdezjMx.set('Lr', str(child['利润']))
|
|
|
+ Csxdercjhl = ET.SubElement(CsxdezjMx, 'Csxdercjhl')
|
|
|
+ for i in range(len(child['dercj'])):
|
|
|
+ if i == 0:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ CsxdercjhlMx = ET.SubElement(Csxdercjhl, 'CsxdercjhlMx')
|
|
|
+ CsxdercjhlMx.set('RcjId', str(child['dercj'][i][0]))
|
|
|
+ CsxdercjhlMx.set('Rcjhl', str(child['dercj'][i][10]))
|
|
|
+ CsxdercjhlMx.set('Rcjhj', str(child['dercj'][i][11]))
|
|
|
+ Csxrcjhl = ET.SubElement(DjCsMx, 'Csxrcjhl')
|
|
|
+ for i in range(len(djcs['rcj'])):
|
|
|
+ if i == 0:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ CsxrcjhlMx = ET.SubElement(Csxrcjhl, 'CsxrcjhlMx')
|
|
|
+ CsxrcjhlMx.set('RcjId', str(djcs['rcj'][i][0]))
|
|
|
+ CsxrcjhlMx.set('Rcjhl', str(djcs['rcj'][i][10]))
|
|
|
+ CsxrcjhlMx.set('Rcjhj', str(djcs['rcj'][i][11]))
|
|
|
+ CsxrcjhlMx.set('Zgjbz', str(djcs['rcj'][i][12]))
|
|
|
+ CsxrcjhlMx.set('Zyclbz', str(djcs['rcj'][i][13]))
|
|
|
+ CsxrcjhlMx.set('Zcbz', str(djcs['rcj'][i][14]))
|
|
|
+ CsxrcjhlMx.set('Sbbz', str(djcs['rcj'][i][15]))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
Qtxm = ET.SubElement(Dwgcxx, 'Qtxm')
|
|
|
for qtxm_ in qtxm:
|
|
|
QtxmMx = ET.SubElement(Qtxm, 'QtxmMx')
|
|
|
@@ -563,38 +699,79 @@ async def build(client, root, id):
|
|
|
Zlje = ET.SubElement(Dwgcxx, 'Zlje')
|
|
|
for i in range(len(zlje)):
|
|
|
ZljeMx = ET.SubElement(Zlje, 'ZljeMx')
|
|
|
- ZljeMx.set('Xh', str(zlje[i][0]))
|
|
|
- ZljeMx.set('Mc', str(zlje[i][1]))
|
|
|
- ZljeMx.set('Dw', str(zlje[i][2]))
|
|
|
- ZljeMx.set('Zdje', str(zlje[i][3]))
|
|
|
- ZljeMx.set('Bz', str(zlje[i][4]))
|
|
|
+ ZljeMx.set('Xh', str(zlje[i]['序号']))
|
|
|
+ ZljeMx.set('Mc', str(zlje[i]['名称']))
|
|
|
+ ZljeMx.set('Dw', str(zlje[i]['单位']))
|
|
|
+ ZljeMx.set('Zdje', str(zlje[i]['暂定金额']))
|
|
|
+ ZljeMx.set('Bz', str(zlje[i]['备注']))
|
|
|
Clzg = ET.SubElement(Dwgcxx, 'Clzg')
|
|
|
Zygczg = ET.SubElement(Dwgcxx, 'Zygczg')
|
|
|
for zygczgj_ in zygczgj:
|
|
|
ZygczgMx = ET.SubElement(Zygczg, 'ZygczgMx')
|
|
|
- ZygczgMx.set('Xh', str(zygczgj_[0]))
|
|
|
- ZygczgMx.set('Mc', str(zygczgj_[1]))
|
|
|
- ZygczgMx.set('Gcnr', str(zygczgj_[2]))
|
|
|
- ZygczgMx.set('Je', str(zygczgj_[3]))
|
|
|
- ZygczgMx.set('Bz', str(zygczgj_[4]))
|
|
|
+ ZygczgMx.set('Xh', str(zygczgj_['序号']))
|
|
|
+ ZygczgMx.set('Mc', str(zygczgj_['名称']))
|
|
|
+ ZygczgMx.set('Gcnr', str(zygczgj_['工程内容']))
|
|
|
+ ZygczgMx.set('Je', str(zygczgj_['金额']))
|
|
|
+ ZygczgMx.set('Bz', str(zygczgj_['备注']))
|
|
|
Jrg = ET.SubElement(Dwgcxx, 'Jrg')
|
|
|
for jrg_ in jrg:
|
|
|
JrgBt = ET.SubElement(Jrg, 'JrgBt')
|
|
|
- JrgBt.set('Xh', str(jrg_[0]))
|
|
|
- JrgBt.set('Mc', str(jrg_[1]))
|
|
|
- JrgBt.set('Je', str(jrg_[2]))
|
|
|
- JrgBt.set('Lb', str(jrg_[3]))
|
|
|
+ JrgBt.set('Xh', str(jrg_['序号']))
|
|
|
+ JrgBt.set('Mc', str(jrg_['名称']))
|
|
|
+ JrgBt.set('Je', str(jrg_['金额']))
|
|
|
+ JrgBt.set('Lb', str(jrg_['类别']))
|
|
|
Zcbfwf = ET.SubElement(Dwgcxx, 'Zcbfwf')
|
|
|
for zcbfwf_ in zcbfwf:
|
|
|
ZcbfwfMx = ET.SubElement(Zcbfwf, 'ZcbfwfMx')
|
|
|
- ZcbfwfMx.set('Xh', str(zcbfwf_[0]))
|
|
|
- ZcbfwfMx.set('Mc', str(zcbfwf_[1]))
|
|
|
- ZcbfwfMx.set('Xmjz', str(zcbfwf_[2]))
|
|
|
- ZcbfwfMx.set('Fwnr', str(zcbfwf_[3]))
|
|
|
- ZcbfwfMx.set('Jsjc', str(zcbfwf_[4]))
|
|
|
- ZcbfwfMx.set('Fl', str(zcbfwf_[5]))
|
|
|
- ZcbfwfMx.set('Je', str(zcbfwf_[6]))
|
|
|
+ ZcbfwfMx.set('Xh', str(zcbfwf_['序号']))
|
|
|
+ ZcbfwfMx.set('Mc', str(zcbfwf_['名称']))
|
|
|
+ ZcbfwfMx.set('Xmjz', str(zcbfwf_['项目价值']))
|
|
|
+ ZcbfwfMx.set('Fwnr', str(zcbfwf_['服务内容']))
|
|
|
+ ZcbfwfMx.set('Jsjc', str(zcbfwf_['计算基础']))
|
|
|
+ ZcbfwfMx.set('Fl', str(zcbfwf_['费率']))
|
|
|
+ ZcbfwfMx.set('Je', str(zcbfwf_['金额']))
|
|
|
Zjxmjdkzffj = ET.SubElement(Dwgcxx, 'Zjxmjdkzffj')
|
|
|
+ Fbrgycl = ET.SubElement(Dwgcxx, 'Fbrgycl')
|
|
|
+ for fbrgycl_ in fbrgycl:
|
|
|
+ FbrgyclMx = ET.SubElement(Fbrgycl, 'FbrgyclMx')
|
|
|
+ FbrgyclMx.set('Xh', str(fbrgycl_['序号']))
|
|
|
+ FbrgyclMx.set('RcjId', str(fbrgycl_['ID']))
|
|
|
+ FbrgyclMx.set('Clbh', str(fbrgycl_['材料编号']))
|
|
|
+ FbrgyclMx.set('Mc', str(fbrgycl_['名称']))
|
|
|
+ FbrgyclMx.set('Ggxh', str(fbrgycl_['规格型号']))
|
|
|
+ FbrgyclMx.set('Dw', str(fbrgycl_['单位']))
|
|
|
+ FbrgyclMx.set('Sl', str(fbrgycl_['数量']))
|
|
|
+ FbrgyclMx.set('Dj', str(fbrgycl_['单价']))
|
|
|
+ FbrgyclMx.set('Hj', str(fbrgycl_['合价']))
|
|
|
+ FbrgyclMx.set('Jhfs', str(fbrgycl_['交货方式']))
|
|
|
+ FbrgyclMx.set('Sddd', str(fbrgycl_['送达地点']))
|
|
|
+ FbrgyclMx.set('Bz', str(fbrgycl_['备注']))
|
|
|
+ Cbrgycl = ET.SubElement(Dwgcxx, 'Cbrgycl')
|
|
|
+ Rcjhz = ET.SubElement(Dwgcxx, 'Rcjhz')
|
|
|
+ for i in range(len(rcjhz)):
|
|
|
+ if i == 0:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ RcjhzMx = ET.SubElement(Rcjhz, 'RcjhzMx')
|
|
|
+ RcjhzMx.set('RcjId', str(rcjhz[i][0]))
|
|
|
+ RcjhzMx.set('RcjBm', str(rcjhz[i][1]))
|
|
|
+ RcjhzMx.set('Mc', str(rcjhz[i][2]))
|
|
|
+ RcjhzMx.set('Ggxh', str(rcjhz[i][3]))
|
|
|
+ RcjhzMx.set('Dw', str(rcjhz[i][4]))
|
|
|
+ RcjhzMx.set('Sl', str(rcjhz[i][5]))
|
|
|
+ RcjhzMx.set('Dj', str(rcjhz[i][6]))
|
|
|
+ RcjhzMx.set('Hj', str(rcjhz[i][7]))
|
|
|
+ RcjhzMx.set('Cd', str(rcjhz[i][8]))
|
|
|
+ RcjhzMx.set('Gycs', str(rcjhz[i][9]))
|
|
|
+ RcjhzMx.set('Rcjlb', str(rcjhz[i][10]))
|
|
|
+ RcjhzMx.set('Zyclbz', str(rcjhz[i][11]))
|
|
|
+ RcjhzMx.set('Zcbz', str(rcjhz[i][12]))
|
|
|
+ RcjhzMx.set('Sbbz', str(rcjhz[i][13]))
|
|
|
+ RcjhzMx.set('Jgbz', str(rcjhz[i][14]))
|
|
|
+ RcjhzMx.set('Zgjbz', str(rcjhz[i][15]))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1359,11 +1536,16 @@ async def tbxx(client, biao_id):
|
|
|
bh = post['Dwgcbh']
|
|
|
dx = dwdx[bh]
|
|
|
bjhz = post['bjhz']
|
|
|
- qtxm = post['qtxm']
|
|
|
- dx['Aqwmf'] = str(float(dx['Aqwmf']) + float(bjhz[1]['__children'][1]['__children'][0]['金额']))
|
|
|
- dx['Gf'] = str(float(dx['Gf']) + float(bjhz[3]['金额']))
|
|
|
- dx['Je'] = str(float(dx['Je']) + float(bjhz[5]['金额']))
|
|
|
- dx['Zgj']= str(float(dx['Zgj']) + float(qtxm[1]['金额']))
|
|
|
+ print('######################################################')
|
|
|
+ print(bjhz)
|
|
|
+ if len(bjhz) == 0:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ qtxm = post['qtxm']
|
|
|
+ dx['Aqwmf'] = str(float(dx['Aqwmf']) + float(bjhz[1]['__children'][1]['__children'][0]['金额']))
|
|
|
+ dx['Gf'] = str(float(dx['Gf']) + float(bjhz[3]['金额']))
|
|
|
+ dx['Je'] = str(float(dx['Je']) + float(bjhz[5]['金额']))
|
|
|
+ dx['Zgj']= str(float(dx['Zgj']) + float(qtxm[1]['金额']))
|
|
|
for dxgc in dxgcxx:
|
|
|
tbxx['Tbzj'] = str(float(tbxx['Tbzj']) + float(dxgc['Je']))
|
|
|
tbxx['Zgj'] = str(float(tbxx['Zgj']) + float(dxgc['Zgj']))
|