liumiaomiao 1 year ago
parent
commit
bc7a15f7a5

+ 4 - 1
docs/table_head_doc/title_abnormal.csv

@@ -1 +1,4 @@
-nbsp
+nbsp
+...
+.
+..

+ 0 - 1
docs/table_head_doc/title_abnormal_contain.csv

@@ -1,4 +1,3 @@
 nbsp
 ...
-.
 ..

+ 5 - 3
tables/fields/NoField.py

@@ -119,9 +119,11 @@ class NoFieldChecker(object):
         :param obj:代表一个item
         :return:返回true 代表异常
         """
-        projectcode = obj.get("projectcode")
-        if not projectcode:
-            return True
+        toptype = obj.get("toptype", "")
+        if toptype  not in ["拟建","采购意向"]:
+            projectcode = obj.get("projectcode")
+            if not projectcode:
+                return True
         return False
 
     def check_subpackage(self,obj, catch_content: CatchContentObject) -> bool:

+ 1 - 1
tables/fields/budget.py

@@ -1,5 +1,5 @@
 """
-    中标金额字段检查
+    预算金额字段检查
 """
 
 

+ 14 - 9
tables/fields/projectname.py

@@ -103,12 +103,17 @@ class ProjectnameChecker(object):
                 if w[0] in projectname:
                     return True
         # 项目名称以异常字符结尾
-        with open(abnormal_config["table_field_config"]["path5"], "r") as f:
-            reads = csv.reader(f)
-            for w in reads:
-                if re.search(f"{w[0]}$", projectname) != None:
-                    return True
-        # 项目名称以异常字符开始
-        p1 = re.compile(r"^[3|6|7|8|0|\.]")
-        if p1.match(projectname):
-            return True
+        # with open(abnormal_config["table_field_config"]["path5"], "r") as f:
+        #     reads = csv.reader(f)
+        #     for w in reads:
+        #         if re.search(f"{w[0]}$", projectname) != None:
+        #             return True
+        p2 = re.search("[nbsp\..\...\.]$",projectname)
+        #re.search():匹配整个字符串,并返回第一个成功的匹配,如果匹配失败,则返回None
+        if p2!=None:
+            return True
+
+        #项目名称以异常字符开始
+        p1 = re.search("^[36780\.]",projectname)
+        if p1!=None:
+            return True

+ 12 - 8
tables/fields/title.py

@@ -105,13 +105,17 @@ class TitleChecker(object):
                     return True
         #标题以异常字符结尾
         #re.search()匹配整个字符串,并返回第一个成功的匹配,如果匹配失败,则返回None
-        with open(abnormal_config["table_field_config"]["path5"], "r") as f:
-            reads = csv.reader(f)
-            for w in reads:
-                ret=re.search(f"{w[0]}$", title)
-                if  ret != None:
-                    return True
+        # with open(abnormal_config["table_field_config"]["path5"], "r") as f:
+        #     reads = csv.reader(f)
+        #     for w in reads:
+        #         ret=re.search(f"{w[0]}$", title)
+        #         if  (ret!= None) or (ret.group() == w[0]):
+        #             return True
+        p2 = re.search("[nbsp\..\...\.]$",title)
+        #re.search():匹配整个字符串,并返回第一个成功的匹配,如果匹配失败,则返回None
+        if p2!=None:
+            return True
         #标题以异常字符开始
-        p1 = re.compile(r"^[3|6|7|8|0|\.]")
-        if p1.match(title):
+        p1 = re.search("^[36780\.]",title)
+        if p1!=None:
             return True