class BidopentimeChecker(object): """ 开标日期字段检查 """ def __init__(self): self.errors_tables = { "0201": { "name": "发布时间 > 开标时间", "parent_name": "数据范围类型", "parent_code": "02", "checkFn": self.check0201 }, "0202": { "name": "开标时间 < 投标文件递交截止时间", "parent_name": "数据范围类型", "parent_code": "02", "checkFn": self.check0202 } } def check0201(self, subtype:str,bidopentime: int, publishtime:int ) -> bool: """ return true 代表返回异常 """ if subtype in ["招标", "邀标", "询价", "竞谈","单一","竞价","变更"]: if bidopentime and publishtime: if bidopentime < publishtime : return True else: return False else: # 两者中有一方为空不判断 return False else: return False def check0202(self, subtype:str,bidopentime: int, bidendtime:int ) -> bool: """ return true 代表返回异常 """ if subtype in ["招标", "邀标", "询价", "竞谈","单一","竞价","变更"]: if bidopentime and bidendtime: if bidopentime < bidendtime : return True else: return False else: # 两者中有一方为空不判断 return False else: return False