|
@@ -3,7 +3,9 @@ import datetime
|
|
|
from unitls.LogerinTxt import app_logger
|
|
|
import unitls.baseFunction as baseFunction
|
|
|
from unitls.StaticDataclass import get_dic
|
|
|
+from unitls.settings import MesgTime
|
|
|
|
|
|
+APZBZ, JJZBZ, ESZBZ, APGR, JJGR, ESGR,APPG,JJPG,ESPG=MesgTime()
|
|
|
|
|
|
def WarningInsert(database, taskid, mesg, types):
|
|
|
newdic = {"航班编号": "%s" % taskid, "警告信息": mesg, "信息状态": "",
|
|
@@ -133,6 +135,10 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
|
|
|
if ETA_40 < now and BAY_A == "" and "机位未出提醒" not in str(singlelogsall):
|
|
|
WarningInsert(database,i[0],"[机位未出提醒]请确认%s/%s机位情况!"%(a,b),"机位警告")
|
|
|
+ elif BAY_A != "" and "机位未出提醒" in str(singlelogsall):
|
|
|
+ mesg="[机位未出提醒]请确认%s/%s机位情况!"%(a,b)
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
|
|
|
# 短停15min 检查到位情况,推送准备组,推送个人每2min,直到点击到位
|
|
|
# 短停落地30min,且满足距离起飞时间小于50min检查放行情况,推送个人,3min间隔,落地30min,且满足距离起飞时间小于40min,推送准备组,直到点击放行
|
|
@@ -185,6 +191,10 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
WarningInsert(database,i[0],"请注意安排%s %s长短停值守,如无需则忽略!" % (a,c),"长短停值守提示")
|
|
|
if ETA_40 < now and BAY_A == "" and "机位未出提醒" not in str(singlelogsall):
|
|
|
WarningInsert(database,i[0],"[机位未出提醒]请确认%s/%s机位情况!"%(a,b),"机位警告")
|
|
|
+ elif BAY_A != "" and "机位未出提醒" in str(singlelogsall):
|
|
|
+ mesg="[机位未出提醒]请确认%s/%s机位情况!"%(a,b)
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
|
|
|
# 特后前15min 检查到位情况,推送准备组,推送个人每2min,直到点击到位
|
|
|
# 特后前落地30min,且满足距离起飞时间小于50min检查放行情况,推送个人,3min间隔,落地30min,且满足距离起飞时间小于40min,推送准备组,直到点击放行
|
|
@@ -231,39 +241,51 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
|
|
|
if ETA_40 < now and BAY_A == "" and "机位未出提醒" not in str(singlelogsall):
|
|
|
WarningInsert(database,i[0],"[机位未出提醒]请确认%s/%s机位情况!"%(a,b),"机位警告")
|
|
|
+ elif BAY_A != "" and "机位未出提醒" in str(singlelogsall):
|
|
|
+ mesg="[机位未出提醒]请确认%s/%s机位情况!"%(a,b)
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
|
|
|
|
|
|
#航前 起飞前 100min,没有确认任务,推送准备组, 二送起飞前40min没有确认任务推送准备组 105 和 45 min 2min 个人推送一次?
|
|
|
#短停 特后前 预计到达前40min没有确认任务推送准备组,短停特后前 预计起飞前40min没有确认任务推送准备组 45min 2min 个人推送一次?
|
|
|
#航后 预计到达前40min没有确认任务推送准备组 45min 2min 个人推送一次?
|
|
|
if b == "航前":
|
|
|
- bztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=100)
|
|
|
- esbztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=40)
|
|
|
-
|
|
|
- bztztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=105)
|
|
|
- estzbztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=45)
|
|
|
+ bztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=APZBZ)
|
|
|
+ esbztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=ESZBZ)
|
|
|
+ bztztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=APGR)
|
|
|
+ estzbztime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=ESGR)
|
|
|
+ pgtime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=APPG)
|
|
|
+ espgtime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=ESPG)
|
|
|
|
|
|
elif b == "短停":
|
|
|
- bztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=40)#40
|
|
|
- esbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=40)#40
|
|
|
- bztztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=45)
|
|
|
- estzbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=45)#45通知
|
|
|
+ bztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJZBZ)#40
|
|
|
+ esbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=ESZBZ)#40
|
|
|
+ bztztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJGR)
|
|
|
+ estzbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=ESGR)#45通知
|
|
|
+ pgtime = datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJPG)
|
|
|
+ espgtime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=ESPG)
|
|
|
elif b == "特后前":
|
|
|
- bztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=40)
|
|
|
- esbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=40)
|
|
|
- bztztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=45)
|
|
|
- estzbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=45)
|
|
|
+ bztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJZBZ)
|
|
|
+ esbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=ESZBZ)
|
|
|
+ bztztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJGR)
|
|
|
+ estzbztime = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=ESGR)
|
|
|
+ pgtime = datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJPG)
|
|
|
+ espgtime=datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=ESPG)
|
|
|
else:
|
|
|
- bztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=40)
|
|
|
+ bztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJZBZ)
|
|
|
esbztime=""
|
|
|
- bztztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=45)
|
|
|
+ bztztime=datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJGR)
|
|
|
estzbztime=""
|
|
|
+ pgtime = datetime.datetime.strptime(eta, "%Y-%m-%d %H:%M:%S")-datetime.timedelta(minutes=JJPG)
|
|
|
+ espgtime=""
|
|
|
if (wxry != "" or fxry != "") and bztztime < now and judgeFunction(singlelogsall1,"航前或接机任务接送通知",2) and singlePeopleNotice and "【交班航班】" not in fj:
|
|
|
peoples = ""
|
|
|
res = wxry.split(",") + fxry.split(",")
|
|
|
for l in res:
|
|
|
if "√" not in l:
|
|
|
peoples=peoples+","+l if peoples != "" else l
|
|
|
+
|
|
|
if peoples != "":
|
|
|
getpeopleinfo(peoples,peoplesinfo_today,peoplesinfo_yes)
|
|
|
print(datetime.datetime.now(),"航前或接机任务接送通知")
|
|
@@ -271,15 +293,17 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
|
|
|
|
|
|
if (wxry != "" or fxry != "") and bztime < now:
|
|
|
- peoples = ""
|
|
|
- res=wxry.split(",")+fxry.split(",")
|
|
|
+ res = wxry.split(",")+fxry.split(",")
|
|
|
for l in res:
|
|
|
if "√" not in l:
|
|
|
- peoples = peoples+"、"+l if peoples != "" else l
|
|
|
- if peoples != "":
|
|
|
- mesg = "请确认%s/%s/%s/%s人员任务接收情况!" % (a, b, c, peoples)
|
|
|
- if mesg not in str(singlelogsall):
|
|
|
- WarningInsert(database, i[0], mesg, "任务接收监控")
|
|
|
+ mesg = "请确认%s/%s/%s/%s人员任务接收情况!" % (a, b, c, l)
|
|
|
+ if mesg not in str(singlelogsall):
|
|
|
+ WarningInsert(database, i[0], mesg, "任务接收监控")
|
|
|
+ else:
|
|
|
+ mesg = "请确认%s/%s/%s/%s人员任务接收情况!" % (a, b, c, l)
|
|
|
+ if mesg in str(singlelogsall):
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
|
|
|
if ecsj != "" and estzbztime != "" and estzbztime < now and judgeFunction(singlelogsall1,"航前或接机任务接送通知",2) and singlePeopleNotice and "【交班航班】" not in fj:
|
|
|
peoples = ""
|
|
@@ -293,29 +317,47 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
noteInsert(database, i[0], "%s/%s/%s二送任务接送通知" % (a, b, c), "二送任务接送通知")
|
|
|
|
|
|
if ecsj != "" and esbztime != "" and esbztime < now: #and "任务执行情况" not in str(singlelogsall):
|
|
|
- peoples=""
|
|
|
- res=ecsj.split(",")
|
|
|
+ res = ecsj.split(",")
|
|
|
for l in res:
|
|
|
if "√" not in l:
|
|
|
- peoples=peoples+"、"+l if peoples != "" else l
|
|
|
- if peoples != "":
|
|
|
- mesg = "请确认%s/%s/%s/%s人员二送任务接收情况!" % (a, b, c, peoples)
|
|
|
- if mesg not in str(singlelogsall):
|
|
|
- WarningInsert(database, i[0], mesg, "任务接收监控")
|
|
|
-
|
|
|
- if wxry == "" and bztztime < now:
|
|
|
+ mesg = "请确认%s/%s/%s/%s人员二送任务接收情况!" % (a, b, c, l)
|
|
|
+ if mesg not in str(singlelogsall):
|
|
|
+ WarningInsert(database, i[0], mesg, "任务接收监控")
|
|
|
+ else:
|
|
|
+ mesg = "请确认%s/%s/%s/%s人员二送任务接收情况!" % (a, b, c, l)
|
|
|
+ if mesg in str(singlelogsall):
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
+
|
|
|
+ if wxry == "" and pgtime < now:
|
|
|
mesg = "请及时安排%s/%s/%s保障人员并派工!" % (a, b, c)
|
|
|
if mesg not in str(singlelogsall):
|
|
|
WarningInsert(database, i[0], mesg, "任务安排监控")
|
|
|
- if fxry == "" and bztztime < now:
|
|
|
+ elif wxry != "":
|
|
|
+ mesg = "请及时安排%s/%s/%s保障人员并派工!" % (a, b, c)
|
|
|
+ if mesg in str(singlelogsall):
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
+ if fxry == "" and pgtime < now:
|
|
|
mesg = "请及时安排%s/%s/%s放行人员并派工!" % (a, b, c)
|
|
|
if mesg not in str(singlelogsall):
|
|
|
WarningInsert(database, i[0], mesg, "任务安排监控")
|
|
|
+ elif fxry != "":
|
|
|
+ mesg = "请及时安排%s/%s/%s放行人员并派工!" % (a, b, c)
|
|
|
+ if mesg in str(singlelogsall):
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
|
|
|
- if ecsj == "" and b != "航前" and esbztime != "" and estzbztime < now:
|
|
|
+ if ecsj == "" and b != "航前" and espgtime != "" and espgtime < now:
|
|
|
mesg = "请及时安排%s/%s/%s二送保障人员并派工!" % (a, b, c)
|
|
|
if mesg not in str(singlelogsall):
|
|
|
WarningInsert(database, i[0], mesg, "任务安排监控")
|
|
|
+ elif ecsj != "" and b != "航前" :
|
|
|
+ mesg = "请及时安排%s/%s/%s二送保障人员并派工!" % (a, b, c)
|
|
|
+ if mesg in str(singlelogsall):
|
|
|
+ newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
|
|
|
+ database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
|
|
|
+
|
|
|
|
|
|
|
|
|
for i in flightcheck2:
|
|
@@ -330,7 +372,7 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
singlelogsall=baseFunction.TuplefindInList33(logsall, i[0], 1, 2) #所有警告信息
|
|
|
singlelogs=baseFunction.TuplefindInList33(logs, i[0], 1, 2) #未确认所有警告信息
|
|
|
sjdw=baseFunction.TuplefindInList3(flightsts, i[0], 0, 6)
|
|
|
- if b =="航前":
|
|
|
+ if b == "航前":
|
|
|
c = data2[0][11]
|
|
|
else:
|
|
|
c = data2[0][10]
|
|
@@ -343,13 +385,10 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
if "随机离港" in str(fj) and "随机2H提醒" not in str(singlelogsall) and STD_120 < now:
|
|
|
sjry = sjry_str.split(" ")[1]
|
|
|
WarningInsert(database, i[0], "[随机2H提醒]%s/%s/%s/%s"% (a, flightno, c, sjry),"随机2H提醒")
|
|
|
-
|
|
|
if "随机离港" in str(fj) and "随机到位确认" not in str(singlelogs) and STD_60 < now and "已到位" not in str(sjdw):
|
|
|
-
|
|
|
sjry = sjry_str.split("随机离港 ")[1]
|
|
|
WarningInsert(database, i[0], "[随机到位确认]%s/%s/%s/%s"% (a, flightno, c, sjry),"随机到位警告")
|
|
|
|
|
|
-
|
|
|
elif b=="短停" :
|
|
|
TD = std
|
|
|
TD_time_120 = datetime.datetime.strptime(TD, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=120)
|
|
@@ -365,7 +404,7 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
|
|
|
elif b != "短停" and b != "航后" and b != "航前" and b != "未显示" and b != "停场" :
|
|
|
TD_time_120= datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=120)
|
|
|
TD_time_60 = datetime.datetime.strptime(std, "%Y-%m-%d %H:%M:%S") - datetime.timedelta(minutes=60)
|
|
|
- if "随机离港" in str(fj) and "随机2H提醒" not in str(singlelogsall) and TD_time_120 < now:
|
|
|
+ if "随机离港" in str(fj) and "随机2H提醒" not in str(singlelogsall) and TD_time_120 < now:
|
|
|
sjry=sjry_str.split(" ")[1]
|
|
|
WarningInsert(database,i[0],"[随机2H提醒]%s/%s/%s/%s"%(a,flightno,c,sjry),"随机2H提醒")
|
|
|
if "随机离港" in str(fj) and "随机到位确认" not in str(singlelogs) and TD_time_60 < now and "已到位" not in str(sjdw):
|