import datetime

from unitls.LogerinTxt import app_logger
from .flightDB import flightDB


def insertCalllist(fdb:flightDB,data):
    try:
        #CalllistLabel1 = ["航班编号", "电话", "工号", "姓名", "航班号", "附加消息", "拨号次数", "创建时间", "接通时间"]
        now = datetime.datetime.now()
        data["创建时间"]=now
        data["接通时间"] = ''
        fdb.insertData('Calllist',data)
        #print("test")
        res={"返回值":"ok"}
        return res
    except Exception as e:
        app_logger.log_error(e)
        return {"返回值":"error:{}".format(e)}