Browse Source

在做安装之前需要整理一下

Xiaopeng Zhang 5 tháng trước cách đây
mục cha
commit
8f856fec6f
3 tập tin đã thay đổi với 84 bổ sung0 xóa
  1. 5 0
      README
  2. 4 0
      special_case.txt
  3. 75 0
      specialdetection.py

+ 5 - 0
README

@@ -5,3 +5,8 @@ TODO
 公式 比如 [1-274]*2 没必要支持,完全可以改数量
 附注 小众情况还不支持
 材料甲供标志是有用的,这个还没处理
+
+
+
+钢筋工程,铁件制作,铁件安装的定额有意思5-28
+安装工程有蛮大的不同

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4 - 0
special_case.txt


+ 75 - 0
specialdetection.py

@@ -0,0 +1,75 @@
+import pymongo
+import pandas
+import json
+from pymongo import MongoClient
+client = MongoClient()
+client2 = MongoClient()
+db = client["baojia"]
+collection = db["qdxm"]
+db2 = client2["dinge"]
+collection2 = db2["de-collection"]
+def clean(debh):
+    if "附注" in debh:
+        position = debh.find("附注")
+        debh = debh[:position]
+    if "*" in debh:
+        position = debh.find("*")
+        debh = debh[:position]
+    if debh.endswith("换"):
+        debh = debh[:-1]
+    if "[" in debh:
+        position = debh.find("[")
+        debh = debh[:position-1]
+    return debh
+
+for post in collection.find({"biao_id": '6879086d5d280edee4b4aa15', 'Dwgcbh': '007'}):
+    for entry in (post['__children']):
+        ##print(entry['清单编码'])
+        cleaned = clean(entry['清单编码'])
+        if cleaned.startswith("D"):
+            continue
+        dercj = (entry['dercj'])
+        post2 = collection2.find_one({'zhuanye': '安装', 'DEBH' : cleaned })
+        if post2 == None:
+            pass##input(cleaned + " not found ")
+        else:
+            mongo_cl = post2['mongo_cl']
+            mongo_jx = post2['mongo_jx']
+            mongo_rg = post2['mongo_rg']
+            for item in dercj:
+                bm = item[1]
+                if bm == '人材机编码':
+                    continue
+                if "商品砼" in item[2]:
+                    continue
+                hit = False
+                for rg in mongo_rg:
+                    if rg['CLBH'] == bm:
+                        hit = True
+                for cl in mongo_cl:
+                    if cl['CLBH'] == bm:
+                        hit = True
+                for jx in mongo_jx:
+                    if jx['jxbh'] == bm:
+                        hit = True
+                if not hit:
+                    print(cleaned)
+                    print("special case found for" + str(item))
+                    
+                    print("来自清单")
+                    print(post['bt'])
+                    print(post)
+                    break
+
+                   
+                
+
+
+
+    
+
+    
+
+
+
+

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác