bidopentime.py 963 B

12345678910111213141516171819202122232425262728293031323334
  1. """
  2. 中标时间字段检查
  3. """
  4. class BidopentimeChecker(object):
  5. """
  6. 中标时间字段检查
  7. """
  8. def __init__(self):
  9. self.errors_tables = {
  10. "0201": {
  11. "name": "发布时间 > 开标时间",
  12. "parent_name": "数据范围类型",
  13. "parent_code": "02",
  14. "checkFn": self.check0201
  15. }
  16. }
  17. def check0201(self, subtype:str,bidopentime: int, publishtime:int ) -> bool:
  18. """
  19. return true 代表返回异常
  20. """
  21. if subtype in ["招标", "邀标", "询价", "竞谈","单一","竞价","变更"]:
  22. if bidopentime and publishtime:
  23. if bidopentime < publishtime :
  24. return True
  25. else:
  26. return False
  27. else:
  28. # 两者中有一方为空不判断
  29. return False
  30. else:
  31. return False