12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- from .flightDB import flightDB
- import datetime
- from unitls.LogerinTxt import app_logger
- from unitls.StaticDataclass import get_dic
- def updateDragDropItem(fdb:flightDB,column,text,flightid,displayMode,flighttype,selectedtime):
- try:
- rowlistLabel=get_dic('rowlistLabelA') if displayMode =="A" else get_dic('rowlistLabel')
- flightid_new=""
- if displayMode =="A":
- if flighttype =="短停接" or flighttype =="航后" or flighttype =="特后前接" or flighttype =="停场":
- flightid_new=flightid+"-1"+"-A"
- flightid_other=flightid+"-2"+"-A"
- elif flighttype =="短停送" or flighttype =="航前" or flighttype =="特后前送":
- flightid_new = flightid + "-2" + "-A"
- flightid_other=flightid+"-1"+"-A"
- elif displayMode =="B":
- if flighttype =="短停" or flighttype =="航后" or flighttype =="特后前" or flighttype =="停场":
- flightid_new=flightid+"-1"+"-B"
- elif flighttype =="航前":
- flightid_new = flightid + "-2" + "-B"
- nowDay = datetime.datetime.now().strftime("%Y%m%d")
- flightids_in_peopleSchedule=fdb.getSingledata("编号","peopleSchedule{}".format(selectedtime))
- newdic = {}
- if str(flightid_new) not in str(flightids_in_peopleSchedule) and str(flightid_new) !="":
- newdic={"编号":flightid_new,"航班编号":flightid,"显示模式":displayMode}
- for i in rowlistLabel.keys():
- if i == int(column):
- if text != "清空项目12345678987654321":
- newdic[rowlistLabel[i]] = text
- else:
- newdic[rowlistLabel[i]] = ""
- else:
- newdic[rowlistLabel[i]] = ""
- fdb.insertData("peopleSchedule{}".format(selectedtime),newdic)
- if flighttype[-1] in ["接","送"] and column =="31":
- newdic["编号"]=flightid_other
- fdb.insertData("peopleSchedule{}".format(selectedtime),newdic)
- else:
- if text != "清空项目12345678987654321":
- newdic[rowlistLabel[int(column)]]="'%s'"%text
- else:
- newdic[rowlistLabel[int(column)]]="''"
- fdb.upDateItem("peopleSchedule{}".format(selectedtime),newdic,"编号='%s'"%flightid_new)
- if flighttype[-1] in ["接","送"] and column =="31":
- fdb.upDateItem("peopleSchedule{}".format(selectedtime),newdic,"编号='%s'"%flightid_other)
- except Exception as e:
- app_logger.log_error(e)
|