| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- import pymongo
- import pandas
- import json
- from pymongo import MongoClient
- client = MongoClient()
- db = client["dinge"]
- collection = db["de-collection"]
- from subdir import service
- ##print(collection.find_one({"DEBH": "3-94"}))
- def handle_cl(cl):
- result = {}
- result["CLBH"] = cl["CLBH"]
- result["CLMC"] = cl["CLMC"]
- result["JLDW"] = cl["JLDW"]
- result["YSJG"] = cl["YSJG"]
- result["SL"] = cl["SL"]
- result["HJ"] = cl["HJ"]
- return result
- def handle_rg(rg):
- result = {}
- result["CLBH"] = rg["CLBH"]
- result["CLMC"] = rg["CLMC"]
- result["JLDW"] = rg["JLDW"]
- result["YSJG"] = rg["YSJG"]
- result["gr"] = rg["gr"]
- result["gf"] = rg["gf"]
- return result
- def handle_jx(jx):
- result = {}
- result["jxbh"] = jx["jxbh"]
- result["jxmc"] = jx["jxmc"]
- result["DW"] = jx["DW"]
- result["tbdj"] = jx["tbdj"]
- result["sl"] = jx["sl"]
- result["hj"] = jx["hj"]
- return result
- liebiao = set()
- for post in collection.find({"zhuanye": "土建"}):
-
-
-
- myquery = { "zhuanye": "土建",
- "DEBH": post["DEBH"]
- }
- A1, A2, rg, jx, cl, bz_, bzfk = service.getSingleDeXilie_tj(post["DEBH"])
- #print(rg)
- #print(jx)
- #print(cl)
- #print(bzfk)
-
- if bzfk == None:
- pass
- else:
- bzfk = json.loads(bzfk)
- BH = bzfk['BH']
- values = []
- for key, value in BH.items():
- if value == '000001':
- pass
- elif value == '000000':
- pass
- elif value == 'J00000':
- pass
- elif value == '100000':
- pass
- elif '-' in value:
- pass
- else:
-
- hit = False
- for entry in rg:
- if entry['CLBH'] == value:
- hit = True
- for entry in cl:
- if entry['CLBH'] == value:
- hit = True
- for entry in jx:
- if entry['jxbh'] == value:
- hit = True
- if not hit:
- print(post['DEBH'])
- print(value)
- liebiao.add(value)
- print(bzfk['LB'][key])
- ##raise Exception
- print(list(liebiao))
-
-
-
-
-
|