from unitls.LogerinTxt import app_logger
from unitls.StaticDataclass import get_dic
from .flightDB import flightDB


def ManCahangeWorkload(workload:flightDB,data):
    try:
        fullkeys=get_dic('newWorkloadLabel')
        newdic = {"编号": data["id"], '人员': data["people"], '标准工时': data["costtime"],"备4":"Y","备5": data["info"]}
        for key in fullkeys:
            if key in newdic:
                continue
            else:
                newdic[key] = ""
        workload.insertData("Workload%s" % data["day"], newdic)
        return "ok"
    except Exception as e:
        app_logger.log_error(e)
        return "error"

