|
|
@@ -1106,16 +1106,61 @@ async def tiaojia(client, biao_id, bh, bm, mingcheng, danwei, jiage, glf, lr, bz
|
|
|
|
|
|
|
|
|
|
|
|
+def bjhz_template():
|
|
|
+ result = []
|
|
|
+ result.append({'序号': '1', '名称': '分部分项工程', '金额': '0', '暂估价': '0', '类别' : '1', '__children': [
|
|
|
+ {'序号': '1.1', '名称': '人工费', '金额': '0', '暂估价': '0', '类别' : '1.1'},
|
|
|
+ {'序号': '1.2', '名称': '材料费', '金额': '0', '暂估价': '0', '类别' : '1.2'},
|
|
|
+ {'序号': '1.3', '名称': '施工机具使用费', '金额': '0', '暂估价': '0', '类别' : '1.3'},
|
|
|
+ {'序号': '1.4', '名称': '企业管理费', '金额': '0', '暂估价': '0', '类别' : '1.4'},
|
|
|
+ {'序号': '1.5', '名称': '利润', '金额': '0', '暂估价': '0', '类别' : '1.5'}
|
|
|
+ ]})
|
|
|
+ result.append({'序号': '2', '名称': '措施项目', '金额': '0', '暂估价': '0', '类别' : '2', '__children': [
|
|
|
+ {'序号': '2.1', '名称': '单价措施项目费', '金额': '0', '暂估价': '0', '类别' : '2.1'},
|
|
|
+ {'序号': '2.2', '名称': '总价措施项目费', '金额': '0', '暂估价': '0', '类别' : '2.2', '__children' : [
|
|
|
+ {'序号': '2.2.1', '名称': '其中:安全文明施工措施费', '金额': '0', '暂估价': '0', '类别' : '2.2.1'},]
|
|
|
+ }
|
|
|
+
|
|
|
+ ]})
|
|
|
+ result.append({'序号': '3', '名称': '其他项目', '金额': '0', '暂估价': '0', '类别' : '3', '__children': [
|
|
|
+ {'序号': '3.1', '名称': '其中:暂列金额', '金额': '0', '暂估价': '0', '类别' : '3.1'},
|
|
|
+ {'序号': '3.2', '名称': '其中:专业工程暂估价', '金额': '0', '暂估价': '0', '类别' : '3.2'},
|
|
|
+ {'序号': '3.3', '名称': '其中:计日工', '金额': '0', '暂估价': '0', '类别' : '3.3'},
|
|
|
+ {'序号': '3.4', '名称': '其中:总承包服务费', '金额': '0', '暂估价': '0', '类别' : '3.4'},
|
|
|
+
|
|
|
+ ]})
|
|
|
+ result.append({'序号': '4', '名称': '规费', '金额': '0', '暂估价': '0', '类别' : '4', })
|
|
|
+ result.append({'序号': '5', '名称': '税金', '金额': '0', '暂估价': '0', '类别' : '5', })
|
|
|
+ result.append({'序号': '6', '名称': '工程造价', '金额': '0', '暂估价': '0', '类别' : '6', })
|
|
|
+
|
|
|
+ return result
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
async def zongjiaDwgc(client, biao_id, bh):
|
|
|
db = client["baojia"]
|
|
|
collection = db["qdxm"]
|
|
|
- sum = 0
|
|
|
+ qd_sum = 0
|
|
|
+ djcs_sum = 0
|
|
|
+ rgf_sum = 0
|
|
|
+ clf_sum = 0
|
|
|
+ jxf_sum = 0
|
|
|
+ glf_sum = 0
|
|
|
+ lr_sum = 0
|
|
|
async for post in collection.find({'biao_id': biao_id, "Dwgcbh": bh}, {'__children': 0}):
|
|
|
- sum = sum + float(post['合价'])
|
|
|
+ qd_sum = qd_sum + float(post['合价'])
|
|
|
+ rgf_sum = rgf_sum + float(post['数量']) * float(post['人工费'])
|
|
|
+ clf_sum = clf_sum + float(post['数量']) * float(post['材料费'])
|
|
|
+ jxf_sum = jxf_sum + float(post['数量']) * float(post['机械费'])
|
|
|
+ glf_sum = glf_sum + float(post['数量']) * float(post['管理费'])
|
|
|
+ lr_sum = lr_sum + float(post['数量']) * float(post['利润'])
|
|
|
collection = db["Djcs"]
|
|
|
async for post in collection.find({'biao_id': biao_id, "Dwgcbh": bh}, {'__children': 0}):
|
|
|
- sum = sum + float(post['合价'])
|
|
|
+ djcs_sum = djcs_sum + float(post['合价'])
|
|
|
+ sum = qd_sum + djcs_sum
|
|
|
collection = db['Dwgc']
|
|
|
document = await collection.find_one({'biao_id': biao_id, "Dwgcbh": bh}, {'rcjhz': 0})
|
|
|
zjcs = document['zjcs']
|
|
|
@@ -1167,10 +1212,74 @@ async def zongjiaDwgc(client, biao_id, bh):
|
|
|
if item['名称'] == '合计':
|
|
|
item['取费基数'] = str(sj_sum + gf_sum)
|
|
|
item['金额'] = item['取费基数']
|
|
|
+
|
|
|
+ qtxm = document['qtxm']
|
|
|
+ zlje = 0
|
|
|
+ zygczgj = 0
|
|
|
+ jrg = 0
|
|
|
+ zcbfwf = 0
|
|
|
+ clzgj = 0
|
|
|
+ for entry in qtxm:
|
|
|
+ if entry['序号'] == '1':
|
|
|
+ zlje = entry['金额']
|
|
|
+ if entry['序号'] == '3':
|
|
|
+ jrg = entry['金额']
|
|
|
+ if entry['序号'] == '4':
|
|
|
+ zcbfwf = entry['金额']
|
|
|
+ if entry['序号'] == '2':
|
|
|
+ for child in entry['__children']:
|
|
|
+ if child['序号'] == '2.2':
|
|
|
+ zygczgj = child['金额']
|
|
|
+ if child['序号'] == '2.1':
|
|
|
+ clzgj = child['金额']
|
|
|
+ qtxm_sum = zlje + zygczgj + jrg + zcbfwf + clzgj
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ bjhz = bjhz_template()
|
|
|
+ for entry in bjhz:
|
|
|
+ if entry['序号'] == '1':
|
|
|
+ entry['金额'] = qd_sum
|
|
|
+ for child in entry['__children']:
|
|
|
+ if child['序号'] == '1.1':
|
|
|
+ child['金额'] = str(rgf_sum)
|
|
|
+ if child['序号'] == '1.2':
|
|
|
+ child['金额'] = str(clf_sum)
|
|
|
+ if child['序号'] == '1.3':
|
|
|
+ child['金额'] = str(jxf_sum)
|
|
|
+ if child['序号'] == '1.4':
|
|
|
+ child['金额'] = str(glf_sum)
|
|
|
+ if child['序号'] == '1.5':
|
|
|
+ child['金额'] = str(lr_sum)
|
|
|
+ if entry['序号'] == '2':
|
|
|
+ entry['金额'] = str(djcs_sum + zjcs_sum)
|
|
|
+ for child in entry['__children']:
|
|
|
+ if child['序号'] == '2.1':
|
|
|
+ child['金额'] = str(djcs_sum)
|
|
|
+ if child['序号'] == '2.2':
|
|
|
+ child['金额'] = str(zjcs_sum)
|
|
|
+ for grandchild in child['__children']:
|
|
|
+ if grandchild['序号'] == '2.2.1':
|
|
|
+ grandchild['金额'] = str(sum_)
|
|
|
+ if entry['序号'] == '3':
|
|
|
+ entry['金额'] = str(qtxm_sum)
|
|
|
+ if entry['序号'] == '4':
|
|
|
+ entry['金额'] = str(gf_sum)
|
|
|
+ if entry['序号'] == '5':
|
|
|
+ entry['金额'] = str(sj_sum)
|
|
|
+ if entry['序号'] == '6':
|
|
|
+ entry['金额'] = str(float(qd_sum) + float(djcs_sum) + float(zjcs_sum) + float(qtxm_sum) + float(gf_sum) + float(sj_sum))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
- await collection.update_one({'biao_id': biao_id, "Dwgcbh": bh}, {'$set': {'zjcs': result, 'gfsj' : gfsj}})
|
|
|
+ await collection.update_one({'biao_id': biao_id, "Dwgcbh": bh}, {'$set': {'zjcs': result, 'gfsj' : gfsj, 'bjhz': bjhz}})
|
|
|
|
|
|
|
|
|
|