|
@@ -1,36 +1,81 @@
|
|
|
from pymongo import MongoClient
|
|
|
from bson import ObjectId
|
|
|
-
|
|
|
+from docs.config import abnormal_config
|
|
|
+import csv
|
|
|
def bid_score():
|
|
|
# db = MongoClient('192.168.3.167', 27080, unicode_decode_error_handler="ignore").jyqyfw_historyData2023_1
|
|
|
# coll_user = db["20230921Ssk_endo"]
|
|
|
db = MongoClient('192.168.3.206', 27080, unicode_decode_error_handler="ignore").data_quality
|
|
|
coll_user = db["bidding_20231122"]
|
|
|
- count=0
|
|
|
score=100
|
|
|
- for item in coll_user.find({"_id":ObjectId("655ec5319aed6eb2ffa5d77f")}):
|
|
|
- # for item in coll_user.find().sort("_id",1):
|
|
|
- if item.get('title_qa'):
|
|
|
- score-=10
|
|
|
- if item.get('projectname_qa'):
|
|
|
- score-=10
|
|
|
- if item.get('area_qa'):
|
|
|
- score-=10
|
|
|
- if item.get('projectcode_qa'):
|
|
|
- score-=10
|
|
|
- # if item['bidopentime_qa']:
|
|
|
- # score-=10
|
|
|
- if item.get('buyer_qa'):
|
|
|
- score-=10
|
|
|
- if item.get('winner_qa'):
|
|
|
- score-=10
|
|
|
- if item.get('budget_qa'):
|
|
|
- score-=10
|
|
|
- if item.get('bidamount_qa'):
|
|
|
- score-=10
|
|
|
- if item.get("multipackage_qa"):
|
|
|
- score -= 10
|
|
|
- print(score)
|
|
|
- coll_user.update_one({"_id": item["_id"]}, {"$set": {"score": score}})
|
|
|
- score = 100
|
|
|
+ # for item in coll_user.find({"_id":ObjectId("655ec5319aed6eb2ffa5d77f")}):
|
|
|
+ for item in coll_user.find().sort("_id",1):
|
|
|
+ title= item.get('title_qa')
|
|
|
+ projectname = item.get('projectname_qa')
|
|
|
+ area= item.get('area_qa')
|
|
|
+ projectcode= item.get('projectcode_qa')
|
|
|
+ #bidopentime= item.get('bidopentime_qa')
|
|
|
+ buyer= item.get('buyer_qa')
|
|
|
+ winner= item.get('winner_qa')
|
|
|
+ budget= item.get('budget_qa')
|
|
|
+ bidamount= item.get('bidamount_qa')
|
|
|
+ multipackage= item.get("multipackage_qa")
|
|
|
+ site=item.get("site")
|
|
|
+ toptype =item.get("toptype")
|
|
|
+ subtype = item.get("subtype")
|
|
|
+ flag=0
|
|
|
+ with open(abnormal_config["table_field_config"]["path7"], "r") as f:
|
|
|
+ reads = csv.reader(f)
|
|
|
+ for w in reads:
|
|
|
+ result=w[0].split("\t")
|
|
|
+ if result[0]==site and result[1]==toptype and result[2]==subtype:
|
|
|
+ flag = 1
|
|
|
+ if title:
|
|
|
+ score -= 1
|
|
|
+ if projectname:
|
|
|
+ score -= 1
|
|
|
+ if area:
|
|
|
+ score -= 1
|
|
|
+ if projectcode:
|
|
|
+ score -= 1
|
|
|
+ # if bidopentime:
|
|
|
+ # score-=1
|
|
|
+ if buyer:
|
|
|
+ score -= 1
|
|
|
+ if winner:
|
|
|
+ score -= 1
|
|
|
+ if budget:
|
|
|
+ score -= 1
|
|
|
+ if bidamount:
|
|
|
+ score -= 1
|
|
|
+ if multipackage:
|
|
|
+ score -= 1
|
|
|
+ coll_user.update_one({"_id": item["_id"]}, {"$set": {"score": score}})
|
|
|
+ print(score)
|
|
|
+ score = 100
|
|
|
+ if flag == 0:
|
|
|
+ if title:
|
|
|
+ score-=10
|
|
|
+ if projectname:
|
|
|
+ score-=10
|
|
|
+ if area:
|
|
|
+ score-=10
|
|
|
+ if projectcode:
|
|
|
+ score-=10
|
|
|
+ # if bidopentime:
|
|
|
+ # score-=10
|
|
|
+ if buyer:
|
|
|
+ score-=10
|
|
|
+ if winner:
|
|
|
+ score-=10
|
|
|
+ if budget:
|
|
|
+ score-=10
|
|
|
+ if bidamount:
|
|
|
+ score-=10
|
|
|
+ if multipackage:
|
|
|
+ score -= 10
|
|
|
+ coll_user.update_one({"_id": item["_id"]}, {"$set": {"score": score}})
|
|
|
+ print(score)
|
|
|
+ score = 100
|
|
|
+
|
|
|
bid_score()
|