liumiaomiao 1 سال پیش
والد
کامیت
016c9af89e
5فایلهای تغییر یافته به همراه104 افزوده شده و 33 حذف شده
  1. 7 2
      app.py
  2. 1 0
      docs/config.py
  3. 19 0
      docs/table_head_doc/trusted_site.csv
  4. 72 27
      score.py
  5. 5 4
      tables/fields/purchasing.py

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 7 - 2
app.py


+ 1 - 0
docs/config.py

@@ -29,6 +29,7 @@ abnormal_config = {
         "path4": "./docs/table_head_doc/projectcode.csv",
         "path5": "./docs/table_head_doc/title_abnormal.csv",
         "path6": "./docs/table_head_doc/title_abnormal_contain.csv",
+        "path7": "./docs/table_head_doc/trusted_site.csv"
     }}
 
 # 调试

+ 19 - 0
docs/table_head_doc/trusted_site.csv

@@ -0,0 +1,19 @@
+湖南省政府采购电子卖场	结果	成交
+江西省政府采购电子卖场	其它	合同
+中国政府采购网	其它	合同
+新疆维吾尔自治区政府采购网	结果	成交
+新疆维吾尔自治区政府采购网	其它	合同
+广东政府采购智慧云平台电子卖场	结果	成交
+江西省政府采购电子卖场	结果	成交
+山西省政府采购电子卖场	其它	合同
+贵州省政府采购电子卖场	结果	成交
+中央国家机关政府采购中心电子卖场	预告	需求公示
+中央国家机关政府采购中心电子卖场	结果	成交
+铜仁市政府采购电子卖场	结果	成交
+湖南省政府采购电子卖场	招标	竞价
+黑龙江省政府采购电子卖场	预告	需求公示
+广西壮族自治区政府采购电子卖场	结果	成交
+江西省政府采购电子卖场	招标	邀标
+江西省政府采购电子卖场	招标	竞价
+黑龙江省政府采购电子卖场	结果	成交
+

+ 72 - 27
score.py

@@ -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()

+ 5 - 4
tables/fields/purchasing.py

@@ -364,7 +364,8 @@ class PurchasingChecker(object):
         purchasing_evaluate_list, score = purchasing_evaluate_start(purchasinglist, purchasingsource)
         print(score)
         #大于0.85的通过验证的
-        if score < 0.85:
-            return True
-        else:
-            return False
+        # if score < 0.85:
+        #     return True
+        # else:
+        #     return False
+        return score

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است