maintainAuthCheck.py 1.0 KB

123456789101112131415161718192021222324252627
  1. from .flightDB import flightDB
  2. from unitls.LogerinTxt import app_logger
  3. def maintainAuthCheck(fdb:flightDB,name,flighttype):
  4. try:
  5. list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]
  6. notpasspeople=[]
  7. sts=False
  8. if name != "清空项目12345678987654321" and str(name) not in list:
  9. names = name.split(",")
  10. for people in names:
  11. search = fdb.queryTabel("workerinfo","姓名","姓名 = '{}' and 南航授权 like '%{}%'".format(people,flighttype))
  12. if search or len(search) !=0:
  13. sts = True
  14. else:
  15. sts = False
  16. notpasspeople.append(people)
  17. if sts:
  18. return { "返回值" : "ok" }
  19. else:
  20. return {"返回值" : "notpass","未通过人员":notpasspeople}
  21. else:
  22. return {"返回值": "ok"}
  23. except Exception as e:
  24. app_logger.log_error(e)
  25. return {"返回值": "fail"}