|
@@ -7,7 +7,73 @@ from datetime import datetime
|
|
|
|
|
|
|
|
|
|
|
|
|
###############helper##################
|
|
###############helper##################
|
|
|
|
|
+
|
|
|
|
|
+def getDingercj_default(root, bh, bt, qdbm, debm):
|
|
|
|
|
+ result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
|
|
|
|
|
+ "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
|
|
|
|
|
+ #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
|
|
|
|
|
+ item = None
|
|
|
|
|
+ for child in root:
|
|
|
|
|
+
|
|
|
|
|
+ if child.tag == "Dxgcxx":
|
|
|
|
|
+ for child1 in child:
|
|
|
|
|
+ Dwgcbh = child1.attrib["Dwgcbh"]
|
|
|
|
|
+ if Dwgcbh == bh:
|
|
|
|
|
+ item = child1
|
|
|
|
|
+ break
|
|
|
|
|
+ ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
|
|
|
|
|
+ Fywj = None
|
|
|
|
|
+ for child in item:
|
|
|
|
|
+ if child.tag == 'Qdxm':
|
|
|
|
|
+ Fywj= child
|
|
|
|
|
+ break
|
|
|
|
|
+ Rcjhz = None
|
|
|
|
|
+ for child in item:
|
|
|
|
|
+ if child.tag == 'Rcjhz':
|
|
|
|
|
+ Rcjhz = child
|
|
|
|
|
+ break
|
|
|
|
|
+ kv = {}
|
|
|
|
|
+ for entry in Rcjhz:
|
|
|
|
|
+ kv[entry.attrib["RcjId"]]=entry
|
|
|
|
|
+
|
|
|
|
|
+ container = None
|
|
|
|
|
+ for child in Fywj:
|
|
|
|
|
+ ##child is mx
|
|
|
|
|
+ if child.tag == "Qdmx" and child.attrib["Qdbm"] == qdbm:
|
|
|
|
|
+ zimu = child
|
|
|
|
|
+ break
|
|
|
|
|
+ box = None
|
|
|
|
|
+ if not zimu:
|
|
|
|
|
+ return result
|
|
|
|
|
+ for child in zimu:
|
|
|
|
|
+ if child.tag == "Qdxdezj":
|
|
|
|
|
+ box = child
|
|
|
|
|
+ break
|
|
|
|
|
+ hlmx_parent = None
|
|
|
|
|
+ for child in box:
|
|
|
|
|
+ if child.attrib["Debm"] == debm:
|
|
|
|
|
+ for grandchild in child:
|
|
|
|
|
+ if grandchild.tag == "Qdxdercjhl":
|
|
|
|
|
+ hlmx_parent = grandchild
|
|
|
|
|
+ for child in hlmx_parent:
|
|
|
|
|
+ result.append([child.attrib["RcjId"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["RcjBm"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Mc"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Ggxh"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Dw"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Dj"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Cd"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Gycs"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Rcjlb"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Jgbz"],
|
|
|
|
|
+ child.attrib["Rcjhl"], child.attrib["Rcjhj"], "",
|
|
|
|
|
+ "", "", ""
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
|
|
+ return result
|
|
|
def getDingercj_(root, bh, bt, qdbm, debm):
|
|
def getDingercj_(root, bh, bt, qdbm, debm):
|
|
|
|
|
+ if bt == 'Default':
|
|
|
|
|
+ return getDingercj_default(root, bh, bt, qdbm, debm)
|
|
|
result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
|
|
result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
|
|
|
"供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
|
|
"供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
|
|
|
#result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
|
|
#result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
|
|
@@ -82,11 +148,72 @@ def getDingercj_(root, bh, bt, qdbm, debm):
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
return result
|
|
return result
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def getQingdanrcj_default(root, bh, bt, bm):
|
|
|
|
|
+
|
|
|
|
|
+ result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
|
|
|
|
|
+ "供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
|
|
|
|
|
+ #result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
|
|
|
|
|
+ item = None
|
|
|
|
|
+ for child in root:
|
|
|
|
|
+
|
|
|
|
|
+ if child.tag == "Dxgcxx":
|
|
|
|
|
+ for child1 in child:
|
|
|
|
|
+ Dwgcbh = child1.attrib["Dwgcbh"]
|
|
|
|
|
+ if Dwgcbh == bh:
|
|
|
|
|
+ item = child1
|
|
|
|
|
+ break
|
|
|
|
|
+ ##result.append([child.attrib["Dxgcmc"], child.attrib["Je"], child.attrib["Zgj"], child.attrib["Aqwmf"], child.attrib["Gf"]])
|
|
|
|
|
+ Fywj = None
|
|
|
|
|
+ for child in item:
|
|
|
|
|
+ if child.tag == 'Qdxm':
|
|
|
|
|
+ Fywj= child
|
|
|
|
|
+ break
|
|
|
|
|
+ Rcjhz = None
|
|
|
|
|
+ for child in item:
|
|
|
|
|
+ if child.tag == 'Rcjhz':
|
|
|
|
|
+ Rcjhz = child
|
|
|
|
|
+ break
|
|
|
|
|
+ kv = {}
|
|
|
|
|
+ for entry in Rcjhz:
|
|
|
|
|
+ kv[entry.attrib["RcjId"]]=entry
|
|
|
|
|
+
|
|
|
|
|
+ container = None
|
|
|
|
|
+ for child in Fywj:
|
|
|
|
|
+ ##child is mx
|
|
|
|
|
+ if child.tag == "Qdmx" and child.attrib["Qdbm"] == bm:
|
|
|
|
|
+ zimu = child
|
|
|
|
|
+ break
|
|
|
|
|
+ box = None
|
|
|
|
|
+ if not zimu:
|
|
|
|
|
+ return result
|
|
|
|
|
+ for child in zimu:
|
|
|
|
|
+ if child.tag == "Qdxrcjhl":
|
|
|
|
|
+ box = child
|
|
|
|
|
+ break
|
|
|
|
|
+ for child in box:
|
|
|
|
|
+ result.append([child.attrib["RcjId"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["RcjBm"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Mc"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Ggxh"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Dw"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Dj"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Cd"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Gycs"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Rcjlb"],
|
|
|
|
|
+ kv[child.attrib["RcjId"]].attrib["Jgbz"],
|
|
|
|
|
+ child.attrib["Rcjhl"], child.attrib["Rcjhj"], child.attrib["Zgjbz"],
|
|
|
|
|
+ child.attrib["Zyclbz"], child.attrib["Zcbz"], child.attrib["Sbbz"]
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
|
|
+ return result
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def getQingdanrcj_(root, bh, bt, bm):
|
|
def getQingdanrcj_(root, bh, bt, bm):
|
|
|
- print("getQingdanrcj_")
|
|
|
|
|
- print(bh)
|
|
|
|
|
- print(bt)
|
|
|
|
|
- print(bm)
|
|
|
|
|
|
|
+ if bt == 'Default':
|
|
|
|
|
+ return getQingdanrcj_default(root, bh, bt, bm)
|
|
|
|
|
+
|
|
|
result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
|
|
result = [["ID", "人材机编码", "名称", "规格型号", "单位", "单价", "产地",
|
|
|
"供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
|
|
"供应厂商", "人材机类别", "甲供标志", "含量", "合价", "暂估价标志", "主要材料标志", "主材标志", "设备标志" ]]
|
|
|
#result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
|
|
#result.append(["ming cheng", "jin e", "zan gu jia", "anquan wenming fei", "guifei"])
|
|
@@ -408,10 +535,10 @@ async def resolve(data, client):
|
|
|
|
|
|
|
|
bts = service.getQdxm(root, entry["bh"])
|
|
bts = service.getQdxm(root, entry["bh"])
|
|
|
for bt in bts:
|
|
for bt in bts:
|
|
|
- print("###################")
|
|
|
|
|
- print(entry['bh'])
|
|
|
|
|
- print(bt)
|
|
|
|
|
- qdmx = service.getQdmx(root, entry["bh"], bt)
|
|
|
|
|
|
|
+ if bt == 'Default':
|
|
|
|
|
+ qdmx = service.getQdmx_default(root, entry["bh"], bt)
|
|
|
|
|
+ else:
|
|
|
|
|
+ qdmx = service.getQdmx(root, entry["bh"], bt)
|
|
|
for qd in qdmx:
|
|
for qd in qdmx:
|
|
|
qd["DogNum"] = entry["num"]
|
|
qd["DogNum"] = entry["num"]
|
|
|
qd["Dwgcbh"] = entry["bh"]
|
|
qd["Dwgcbh"] = entry["bh"]
|
|
@@ -1742,13 +1869,10 @@ async def zongjiaDwgc(client, biao_id, bh):
|
|
|
qdbt = document['qdbt']
|
|
qdbt = document['qdbt']
|
|
|
qdbt_addition = document['qdbt_addition']
|
|
qdbt_addition = document['qdbt_addition']
|
|
|
bts = {}
|
|
bts = {}
|
|
|
- distinguish = False
|
|
|
|
|
- if 'Default' in qdbt:
|
|
|
|
|
- pass
|
|
|
|
|
- else:
|
|
|
|
|
- distinguish = True
|
|
|
|
|
- for item in qdbt_addition:
|
|
|
|
|
- bts[item['Mc']] = 0
|
|
|
|
|
|
|
+ distinguish = True
|
|
|
|
|
+
|
|
|
|
|
+ for item in qdbt_addition:
|
|
|
|
|
+ bts[item['Mc']] = 0
|
|
|
|
|
|
|
|
collection = db["qdxm"]
|
|
collection = db["qdxm"]
|
|
|
qd_sum = 0
|
|
qd_sum = 0
|
|
@@ -1765,7 +1889,7 @@ async def zongjiaDwgc(client, biao_id, bh):
|
|
|
jxf_sum = jxf_sum + float(post['数量']) * float(post['机械费'])
|
|
jxf_sum = jxf_sum + float(post['数量']) * float(post['机械费'])
|
|
|
glf_sum = glf_sum + float(post['数量']) * float(post['管理费'])
|
|
glf_sum = glf_sum + float(post['数量']) * float(post['管理费'])
|
|
|
lr_sum = lr_sum + float(post['数量']) * float(post['利润'])
|
|
lr_sum = lr_sum + float(post['数量']) * float(post['利润'])
|
|
|
- if distinguish:
|
|
|
|
|
|
|
+ if distinguish and post['bt'] in bts:
|
|
|
bts[post['bt']] = bts[post['bt']] + float(post['合价'])
|
|
bts[post['bt']] = bts[post['bt']] + float(post['合价'])
|
|
|
|
|
|
|
|
|
|
|