|
|
@@ -412,6 +412,29 @@ def getDjcsQingdanrcj_(root, bh, bt, bm):
|
|
|
])
|
|
|
|
|
|
return result
|
|
|
+def getRcjbc(rcj):
|
|
|
+ result = []
|
|
|
+ for entry in rcj:
|
|
|
+ if entry[1] == '410000F':
|
|
|
+ result.append({
|
|
|
+ "id": str(uuid.uuid4()),
|
|
|
+ "主材标志": "true",
|
|
|
+ "主要材料标志": "true",
|
|
|
+ "产地": "",
|
|
|
+ "人材机类别": "2",
|
|
|
+ "人材机编码": "410000F",
|
|
|
+ "供应厂商": "",
|
|
|
+ "单价": entry[5],
|
|
|
+ "单位": entry[4],
|
|
|
+ "名称": entry[2],
|
|
|
+ "含量": entry[10],
|
|
|
+ "暂估价标志": "",
|
|
|
+ "甲供标志": "",
|
|
|
+ "规格型号": "",
|
|
|
+ "设备标志": ""
|
|
|
+ })
|
|
|
+ return result
|
|
|
+
|
|
|
|
|
|
######################end of helper ########################
|
|
|
async def resolve(data, client):
|
|
|
@@ -555,12 +578,11 @@ async def resolve(data, client):
|
|
|
child["dercj"] = dercj
|
|
|
child['fuzhuEnable'] = False
|
|
|
child['yuban'] = []
|
|
|
- child['rcjbc'] = []
|
|
|
- if '-F' in child['清单编码']:
|
|
|
- #######TODO########
|
|
|
- child['azfytag'] = ['人工费', 10, 100, 0, 0]
|
|
|
- if '11-F2' in child['清单编码'] or '1-F2' in child['清单编码']:
|
|
|
- child['azfytag'] = ['人工费+机械费', 10, 100, 0, 0]
|
|
|
+ child['rcjbc'] = getRcjbc(dercj)
|
|
|
+
|
|
|
+
|
|
|
+ child['azfytag'] = []###常规定额
|
|
|
+
|
|
|
await collection.insert_one(qd)
|
|
|
|
|
|
|
|
|
@@ -1446,14 +1468,18 @@ async def save(client, data):
|
|
|
async for post in collection.find({'biao_id': biao_id, "Dwgcbh": bh}, {'__children': 0}):
|
|
|
qdrcj = post['rcj'][1:]
|
|
|
for entry in qdrcj:
|
|
|
- entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
+ print(entry[4])
|
|
|
+ if entry[4] != '%':
|
|
|
+ entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
rcjhz = rcjhz + qdrcj
|
|
|
collection = db["Djcs"]
|
|
|
async for post in collection.find({'biao_id': biao_id, "Dwgcbh": bh}, {'__children': 0}):
|
|
|
|
|
|
qdrcj = post['rcj'][1:]
|
|
|
for entry in qdrcj:
|
|
|
- entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
+ print(entry[4])
|
|
|
+ if entry[4] != '%':
|
|
|
+ entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
rcjhz = rcjhz + qdrcj
|
|
|
newHuizong = util.huizongrcj(rcjhz)
|
|
|
collection = db["Dwgc"]
|
|
|
@@ -1481,13 +1507,15 @@ async def savedjcs(client, data):
|
|
|
async for post in collection.find({'biao_id': biao_id, "Dwgcbh": bh}, {'__children': 0}):
|
|
|
qdrcj = post['rcj'][1:]
|
|
|
for entry in qdrcj:
|
|
|
- entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
+ if entry[4] != '%':
|
|
|
+ entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
rcjhz = rcjhz + qdrcj
|
|
|
collection = db["Djcs"]
|
|
|
async for post in collection.find({'biao_id': biao_id, "Dwgcbh": bh}, {'__children': 0}):
|
|
|
qdrcj = post['rcj'][1:]
|
|
|
for entry in qdrcj:
|
|
|
- entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
+ if entry[4] != '%':
|
|
|
+ entry[10] = float(entry[10]) * float(post['数量'])
|
|
|
rcjhz = rcjhz + qdrcj
|
|
|
newHuizong = util.huizongrcj(rcjhz)
|
|
|
collection = db["Dwgc"]
|