score.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from pymongo import MongoClient
  2. from bson import ObjectId
  3. def bid_score():
  4. # db = MongoClient('192.168.3.167', 27080, unicode_decode_error_handler="ignore").jyqyfw_historyData2023_1
  5. # coll_user = db["20230921Ssk_endo"]
  6. db = MongoClient('192.168.3.206', 27080, unicode_decode_error_handler="ignore").data_quality
  7. coll_user = db["bidding_20231122"]
  8. count=0
  9. score=100
  10. for item in coll_user.find({"_id":ObjectId("655ec5319aed6eb2ffa5d77f")}):
  11. # for item in coll_user.find().sort("_id",1):
  12. if item.get('title_qa'):
  13. score-=10
  14. if item.get('projectname_qa'):
  15. score-=10
  16. if item.get('area_qa'):
  17. score-=10
  18. if item.get('projectcode_qa'):
  19. score-=10
  20. # if item['bidopentime_qa']:
  21. # score-=10
  22. if item.get('buyer_qa'):
  23. score-=10
  24. if item.get('winner_qa'):
  25. score-=10
  26. if item.get('budget_qa'):
  27. score-=10
  28. if item.get('bidamount_qa'):
  29. score-=10
  30. if item.get("multipackage_qa"):
  31. score -= 10
  32. print(score)
  33. coll_user.update_one({"_id": item["_id"]}, {"$set": {"score": score}})
  34. score = 100
  35. bid_score()