|
@@ -34,10 +34,9 @@ class NoFieldChecker(object):
|
|
|
"""
|
|
|
subtype = obj.get("subtype", "")
|
|
|
if subtype in ["中标", "成交","合同","验收"]:
|
|
|
- bidamount = obj.get("bidamount", "")
|
|
|
- if bidamount:
|
|
|
- return False
|
|
|
- return True
|
|
|
+ bidamount = obj.get("bidamount")
|
|
|
+ if not bidamount:
|
|
|
+ return True
|
|
|
return False
|
|
|
|
|
|
def check_winner(self,obj, catch_content: CatchContentObject) -> bool:
|
|
@@ -48,11 +47,10 @@ class NoFieldChecker(object):
|
|
|
"""
|
|
|
subtype = obj.get("subtype", "")
|
|
|
if subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
- winner = obj.get("winner", "")
|
|
|
- if winner:
|
|
|
- return False
|
|
|
- return True
|
|
|
- return False
|
|
|
+ winner = obj.get("winner")
|
|
|
+ if not winner:
|
|
|
+ return True
|
|
|
+ return False
|
|
|
|
|
|
|
|
|
def check_buyer(self,obj,catch_content: CatchContentObject) -> bool:
|
|
@@ -62,10 +60,10 @@ class NoFieldChecker(object):
|
|
|
:param obj:代表一个item
|
|
|
:return:返回true 代表异常
|
|
|
"""
|
|
|
- buyer = obj.get("buyer", "")
|
|
|
- if buyer :
|
|
|
- return False
|
|
|
- return True
|
|
|
+ buyer = obj.get("buyer")
|
|
|
+ if not buyer :
|
|
|
+ return True
|
|
|
+ return False
|
|
|
|
|
|
def check_budget(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
"""
|
|
@@ -75,10 +73,9 @@ class NoFieldChecker(object):
|
|
|
"""
|
|
|
subtype = obj.get("subtype", "")
|
|
|
if subtype not in ["中标", "成交", "合同", "验收"]:
|
|
|
- budget = obj.get("budget", "")
|
|
|
- if budget:
|
|
|
- return False
|
|
|
- return True
|
|
|
+ budget = obj.get("budget")
|
|
|
+ if not budget:
|
|
|
+ return True
|
|
|
return False
|
|
|
|
|
|
def check_region(self,obj, catch_content: CatchContentObject) -> bool:
|
|
@@ -87,30 +84,30 @@ class NoFieldChecker(object):
|
|
|
:param obj:代表一个item
|
|
|
:return:返回true 代表异常
|
|
|
"""
|
|
|
- area = obj.get("area", "")
|
|
|
- if area:
|
|
|
- return False
|
|
|
- return True
|
|
|
+ area = obj.get("area")
|
|
|
+ if not area:
|
|
|
+ return True
|
|
|
+ return False
|
|
|
|
|
|
def check_title(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
"""
|
|
|
:param obj:代表一个item
|
|
|
:return:返回true 代表异常
|
|
|
"""
|
|
|
- title = obj.get("title", "")
|
|
|
- if title :
|
|
|
- return False
|
|
|
- return True
|
|
|
+ title = obj.get("title")
|
|
|
+ if not title :
|
|
|
+ return True
|
|
|
+ return False
|
|
|
|
|
|
def check_projectname(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
"""
|
|
|
:param obj:代表一个item
|
|
|
:return:返回true 代表异常
|
|
|
"""
|
|
|
- projectname = obj.get("projectname", "")
|
|
|
- if projectname :
|
|
|
- return False
|
|
|
- return True
|
|
|
+ projectname = obj.get("projectname")
|
|
|
+ if not projectname :
|
|
|
+ return True
|
|
|
+ return False
|
|
|
|
|
|
|
|
|
def check_projectcode(self,obj, catch_content: CatchContentObject) -> bool:
|
|
@@ -119,10 +116,10 @@ class NoFieldChecker(object):
|
|
|
:param obj:代表一个item
|
|
|
:return:返回true 代表异常
|
|
|
"""
|
|
|
- projectcode = obj.get("projectcode", "")
|
|
|
- if projectcode:
|
|
|
- return False
|
|
|
- return True
|
|
|
+ projectcode = obj.get("projectcode")
|
|
|
+ if not projectcode:
|
|
|
+ return True
|
|
|
+ return False
|
|
|
|
|
|
def check_subpackage(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
"""
|