liumiaomiao 2 órája
szülő
commit
077786407e
2 módosított fájl, 23 hozzáadás és 11 törlés
  1. 10 10
      app.py
  2. 13 1
      tables/fields/NoField.py

+ 10 - 10
app.py

@@ -222,7 +222,7 @@ if __name__ == '__main__':
     "comeintime" : int(1698739748), 
     "area" : "内蒙古",
     "purchasingsource" : "[{\"start\": 13, \"verify\": \"确定\", \"direction\": \"h\", \"type\": \"识别\", \"header\": {\"itemname\": \"产品名称\", \"model\": \"技术规格\", \"number\": \"数量\", \"unitprice\": \"单价(元)\", \"totalprice\": \"金额(元)\"}, \"file_name\": \"公告\"}]",
-    "toptype" : "结果",
+    "toptype" : "预告",
     "spidercode" : "nm_nmgzzqzfcgw_dzmc_zgcgcjgs", 
     "extracttype" : int(1),
     "s_sha" : "9269588cb73151d8ec09cf16347539678549f81395559589a731ca1394828582", 
@@ -566,13 +566,13 @@ if __name__ == '__main__':
     # #     }
     # })
     result = check(row, rules={
-         "bidendtime" : {
-            "0101" : {
-                "name" : "投标截止日期<投标文件递交开始时间",
-                "parent_name" : "时间有效性异常",
-                "parent_code" : "01"
-            }
-        }
+        #  "bidendtime" : {
+        #     "0101" : {
+        #         "name" : "投标截止日期<投标文件递交开始时间",
+        #         "parent_name" : "时间有效性异常",
+        #         "parent_code" : "01"
+        #     }
+        # },
         # "buyer": {
         #     "0103": {
         #         "name": "包含叠词,异常词汇,特殊词汇",
@@ -590,8 +590,8 @@ if __name__ == '__main__':
         #         "parent_code": "01"
         #     }
         # },
-        # "entname": {
-        #     },
+        "note": {
+            },
         # "price": {
         # },
         # "sort": {

+ 13 - 1
tables/fields/NoField.py

@@ -49,7 +49,8 @@ class NoFieldChecker(object):
             "entname":self.check_entname,
             "sortstr":self.check_sort,
             "price":self.check_price,
-            "winnerorder":self.check_winnerorder
+            "winnerorder":self.check_winnerorder,
+            "note":self.check_note
         }
 
     def check_bidamount(self,obj,catch_content: CatchContentObject) -> bool:
@@ -464,4 +465,15 @@ class NoFieldChecker(object):
         if subtype in ["中标", "成交"]:
             if "winnerorder" not in obj:
                 return True  # 如果没有winnerorder字段,视为无
+        return False
+    def check_note(self, obj, catch_content: CatchContentObject) -> bool:
+        """
+        候选人信息为空检测
+        :param obj:代表一个item
+        :return:返回true 代表异常
+        """
+        toptype = obj.get("toptype", "")
+        if toptype == "预告" :
+            if "note" not in obj:
+                return True  # 如果没有note字段,视为无
         return False