import datetime

from unitls.LogerinTxt import app_logger
from .flightDB import flightDB


def selftaxiLogs(database:flightDB,TEXT:str,flightid:str):
    try:
        now = datetime.datetime.now()
        noteid=database.queryTabel("logs","*","航班编号='%s' and 警告信息='%s'"%(flightid,TEXT))
        if len(noteid) == 0:
            newdic = {"航班编号":flightid, "警告信息":TEXT, "信息状态": "",
                      "提示信息": "","产生时间": "%s" % now, "处理人": "", "处理时间": "", "变更字段": "自滑提示","显示对象":"","提示内容":""}
            database.insertData("logs", newdic)
    except Exception as e:
        app_logger.log_error(e)