competent_department.py 733 B

123456789101112131415161718192021222324252627282930
  1. """
  2. competent_department字段检查
  3. """
  4. class Competent_departmentChecker(object):
  5. """
  6. competent_department字段检查
  7. """
  8. def __init__(self):
  9. self.errors_tables = {
  10. "0101": {
  11. "name": "主管部门数据长度<3",
  12. "parent_name": "名称长度异常错误",
  13. "parent_code": "01",
  14. "checkFn": self.check0101
  15. }
  16. }
  17. @staticmethod
  18. def check0101(competent_department: str) -> bool :
  19. """
  20. :param price:
  21. :return: 返回true 代表异常
  22. """
  23. if competent_department:
  24. if len(competent_department) < 3:
  25. return True
  26. return False