|
@@ -22,12 +22,17 @@ class NoFieldChecker(object):
|
|
"budget": self.check_budget,
|
|
"budget": self.check_budget,
|
|
"bidamount": self.check_bidamount,
|
|
"bidamount": self.check_bidamount,
|
|
"area":self.check_region,
|
|
"area":self.check_region,
|
|
|
|
+ "city":self.check_city,
|
|
|
|
+ "district": self.check_district,
|
|
"projectcode": self.check_projectcode,
|
|
"projectcode": self.check_projectcode,
|
|
"toptype":self.check_toptype,
|
|
"toptype":self.check_toptype,
|
|
"subtype":self.check_subtype,
|
|
"subtype":self.check_subtype,
|
|
"publishtime":self.check_publishtime,
|
|
"publishtime":self.check_publishtime,
|
|
"multipackage":self.check_subpackage,
|
|
"multipackage":self.check_subpackage,
|
|
- "purchasinglist":self.check_purchasinglist
|
|
|
|
|
|
+ "purchasinglist":self.check_purchasinglist,
|
|
|
|
+ "detail":self.check_detail,
|
|
|
|
+ "href":self.check_href,
|
|
|
|
+ "est_purchase_time":self.check_est_purchase_time
|
|
}
|
|
}
|
|
|
|
|
|
def check_bidamount(self,obj,catch_content: CatchContentObject) -> bool:
|
|
def check_bidamount(self,obj,catch_content: CatchContentObject) -> bool:
|
|
@@ -99,7 +104,7 @@ class NoFieldChecker(object):
|
|
|
|
|
|
def check_region(self,obj, catch_content: CatchContentObject) -> bool:
|
|
def check_region(self,obj, catch_content: CatchContentObject) -> bool:
|
|
"""
|
|
"""
|
|
- 区域为空检测
|
|
|
|
|
|
+ 省份为空检测
|
|
:param obj:代表一个item
|
|
:param obj:代表一个item
|
|
:return:返回true 代表异常
|
|
:return:返回true 代表异常
|
|
"""
|
|
"""
|
|
@@ -107,6 +112,26 @@ class NoFieldChecker(object):
|
|
if not area:
|
|
if not area:
|
|
return True
|
|
return True
|
|
return False
|
|
return False
|
|
|
|
+ def check_city(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 城市为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ city = obj.get("city")
|
|
|
|
+ if not city:
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ def check_district(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 区县为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ district = obj.get("district")
|
|
|
|
+ if not district:
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
|
|
def check_title(self,obj, catch_content: CatchContentObject) -> bool:
|
|
def check_title(self,obj, catch_content: CatchContentObject) -> bool:
|
|
"""
|
|
"""
|
|
@@ -181,4 +206,234 @@ class NoFieldChecker(object):
|
|
def check_publishtime(self,obj, catch_content: CatchContentObject) -> bool:
|
|
def check_publishtime(self,obj, catch_content: CatchContentObject) -> bool:
|
|
if not obj.get("publishtime"):
|
|
if not obj.get("publishtime"):
|
|
return True
|
|
return True
|
|
- return False
|
|
|
|
|
|
+ return False
|
|
|
|
+ def check_detail(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ if not obj.get("detail"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ def check_href(self,obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ if not obj.get("href"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ def check_est_purchase_time(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 预计采购时间为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ if obj.get("toptype") == "预告":
|
|
|
|
+ if not obj.get("est_purchase_time"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_docstarttime(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 招标文件获取开始时间为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ if obj.get("toptype") == "招标":
|
|
|
|
+ if not obj.get("docstarttime"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ def check_docendtime(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 招标文件获取截止时间为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ if obj.get("toptype") == "招标":
|
|
|
|
+ if not obj.get("docendtime"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+ def check_bidstarttime(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 投标文件递交开始时间为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ if obj.get("toptype") == "招标":
|
|
|
|
+ if not obj.get("bidstarttime"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_bidendtime(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 投标截止日期为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ if obj.get("toptype") == "招标":
|
|
|
|
+ if not obj.get("bidendtime"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_bidopentime(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 开标日期为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ if obj.get("toptype") != "结果" and obj.get("toptype") != "预告":
|
|
|
|
+ if not obj.get("bidopentime"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_bidway(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 投标方式为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ toptype = obj.get("toptype")
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if toptype == "招标" or subtype in ["合同", "验收"]:
|
|
|
|
+ if not obj.get("bidway"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_buyerperson(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 采购单位联系人为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ toptype = obj.get("toptype")
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if toptype =="招标" or subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("buyerperson"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_buyertel(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 采购单位联系电话为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ toptype = obj.get("toptype")
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if toptype =="招标" or subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("buyertel"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_agency(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 招标代理机构空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ toptype = obj.get("toptype")
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if toptype =="招标" or subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("agency"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_agencyperson(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 招标代理机构联系人为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ toptype = obj.get("toptype")
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if toptype =="招标" or subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("agencyperson"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_agencytel(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 招标代理机构联系电话为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ toptype = obj.get("toptype")
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if toptype =="招标" or subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("agencytel"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_winnerperson(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 中标单位联系人为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("winnerperson"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_winnertel(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 中标单位联系电话为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if subtype in ["中标", "成交", "合同", "验收"]:
|
|
|
|
+ if not obj.get("winnertel"):
|
|
|
|
+ return True
|
|
|
|
+ return False
|
|
|
|
+ return False
|
|
|
|
+ def check_entname(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 候选人名称为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if subtype in ["中标", "成交"]:
|
|
|
|
+ if "winnerorder" not in obj:
|
|
|
|
+ return True # 如果没有winnerorder字段,视为无entname
|
|
|
|
+
|
|
|
|
+ for item in obj["winnerorder"]:
|
|
|
|
+ if "entname" in item:
|
|
|
|
+ return False # 只要有一个entname存在,就返回False
|
|
|
|
+
|
|
|
|
+ return True # 所有条目都没有entname,返回True
|
|
|
|
+ return False
|
|
|
|
+ def check_sort(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 候选人名次为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if subtype in ["中标", "成交"]:
|
|
|
|
+ if "winnerorder" not in obj:
|
|
|
|
+ return True # 如果没有winnerorder字段,视为无entname
|
|
|
|
+
|
|
|
|
+ for item in obj["winnerorder"]:
|
|
|
|
+ if "sort" in item or "sortstr" in item:
|
|
|
|
+ return False # 只要有一个entname存在,就返回False
|
|
|
|
+
|
|
|
|
+ return True # 所有条目都没有entname,返回True
|
|
|
|
+ return False
|
|
|
|
+ def check_price(self, obj, catch_content: CatchContentObject) -> bool:
|
|
|
|
+ """
|
|
|
|
+ 投标报价为空检测
|
|
|
|
+ :param obj:代表一个item
|
|
|
|
+ :return:返回true 代表异常
|
|
|
|
+ """
|
|
|
|
+ subtype = obj.get("subtype", "")
|
|
|
|
+ if subtype in ["中标", "成交"]:
|
|
|
|
+ if "winnerorder" not in obj:
|
|
|
|
+ return True # 如果没有winnerorder字段,视为无entname
|
|
|
|
+
|
|
|
|
+ for item in obj["winnerorder"]:
|
|
|
|
+ if "price" in item :
|
|
|
|
+ return False # 只要有一个entname存在,就返回False
|
|
|
|
+
|
|
|
|
+ return True # 所有条目都没有entname,返回True
|
|
|
|
+ return False
|