2 Commit-ok d7f61fbc89 ... 40295eefaa

Szerző SHA1 Üzenet Dátum
  maohu 40295eefaa R17.0.1 修复日志异常输出问题 1 hónapja
  maohu 3230cd07a5 R12 1 hónapja

+ 12 - 10
Functions/DButilsFunction/checkFlightAlert.py

@@ -79,6 +79,8 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
                         b = get_dic("taskType")[data[0][3]]
                         std=data[0][5]
                         singlelogs=baseFunction.TuplefindInList33(logs,i[0],1,8)#未处理的警告信息
+
+                        singlelogstext=baseFunction.TuplefindInList33(logs,i[0],1,2)#未处理的警告信息
                         singlelogsall=baseFunction.TuplefindInList33(logsall, i[0], 1, 2) #所有警告信息
                         singlelogsall1=baseFunction.TuplefindInList11(logsall1, i[0], 1) #所有和这个id相关的提示信息
                         jjdw=baseFunction.TuplefindInList3(flightsts,i[0],0,3)
@@ -135,7 +137,7 @@ 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):
+                            elif BAY_A != "" and "机位未出提醒" in str(singlelogstext):
                                 mesg="[机位未出提醒]请确认%s/%s机位情况!"%(a,b)
                                 newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                 database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
@@ -191,7 +193,7 @@ 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):
+                            elif BAY_A != "" and "机位未出提醒" in str(singlelogstext):
                                 mesg="[机位未出提醒]请确认%s/%s机位情况!"%(a,b)
                                 newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                 database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
@@ -241,7 +243,7 @@ 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):
+                            elif BAY_A != "" and "机位未出提醒" in str(singlelogstext):
                                 mesg="[机位未出提醒]请确认%s/%s机位情况!"%(a,b)
                                 newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                 database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
@@ -300,8 +302,8 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
                                     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):
+                                    mesg = "请确认%s/%s/%s/%s人员任务接收情况!" % (a, b, c, l.replace("√",""))
+                                    if mesg in str(singlelogstext):
                                         newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                         database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
 
@@ -324,8 +326,8 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
                                     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):
+                                    mesg = "请确认%s/%s/%s/%s人员二送任务接收情况!" % (a, b, c, l.replace("√",""))
+                                    if mesg in str(singlelogstext):
                                         newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                         database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
 
@@ -335,7 +337,7 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
                                 WarningInsert(database, i[0], mesg, "任务安排监控")
                         elif wxry != "":
                             mesg = "请及时安排%s/%s/%s保障人员并派工!" % (a, b, c)
-                            if mesg in str(singlelogsall):
+                            if mesg in str(singlelogstext):
                                 newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                 database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
                         if fxry == "" and pgtime < now:
@@ -344,7 +346,7 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
                                 WarningInsert(database, i[0], mesg, "任务安排监控")
                         elif fxry != "":
                             mesg = "请及时安排%s/%s/%s放行人员并派工!" % (a, b, c)
-                            if mesg in str(singlelogsall):
+                            if mesg in str(singlelogstext):
                                 newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                 database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
 
@@ -354,7 +356,7 @@ def checkFlightAlert(database:flightDB, singlePeopleNotice):
                                 WarningInsert(database, i[0], mesg, "任务安排监控")
                         elif ecsj != "" and b != "航前" :
                             mesg = "请及时安排%s/%s/%s二送保障人员并派工!" % (a, b, c)
-                            if mesg in str(singlelogsall):
+                            if mesg in str(singlelogstext):
                                 newdic = {"处理人": "'系统确认状态'", "处理时间": "'%s'" % now}
                                 database.lazyUpdateItem('logs', newdic, "航班编号='%s' and 警告信息='%s'" % (i[0],mesg))
 

+ 52 - 17
Functions/DButilsFunction/checkTFUairplane.py

@@ -136,43 +136,78 @@ def checkTFUairplane(database:flightDB):
                     bay_str = baseFunction.TuplefindInList3(flightinfo_flight_ids, flightstskey[0], 0, 11)
                 else:
                     bay_str =baseFunction.TuplefindInList3(flightinfo_flight_ids, flightstskey[0], 0, 10)
-                newdic = {"机位":"'%s'"%bay_str, "机号":"'%s'"%acno_str}
-                database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                if bay_str != baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 2) or acno_str != baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 1):
+                    newdic = {"机位":"'%s'"%bay_str, "机号":"'%s'"%acno_str}
+                    database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
                 worksts_str=baseFunction.TuplefindInList3(flightinfo_flight_ids, flightstskey[0], 0, 14)
                 worksts = int(worksts_str) if worksts_str != "" else 0
                 a=baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 2) if baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 2)!="" else "未显示机号"
 
                 if worksts >= 7 and str(flightstskey[0]) in str(flightsts_flight_ids_arr):
-                    newdic={"接机到位":"'已到位'", "放行": "'已放行'"}
-                    database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                    if baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0,3) != "已到位" or baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0,4) != "已放行":
+                        newdic={"接机到位":"'已到位'", "放行": "'已放行'"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
                     for i in code2:
-                        if "0" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, code22num[i]):
+                        if "1" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, code22num[i]):
                             newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s%s!%s"%(a,i,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
                             database.lazyInsertData('logs', newdic)
                             newdic = {"%s"%i: 1}
                             database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
                 elif worksts >= 4 and str(flightstskey[0]) in str(flightsts_flight_ids_arr):
-                    newdic = {"接机到位": "'已到位'"}
-                    database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
-                    if "0" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 8):
+                    if baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0,3) != "已到位" :
+                        newdic = {"接机到位": "'已到位'"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                    if "1" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 8):
                         newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s接机已到位提示!%s"%(a,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
                         database.lazyInsertData('logs', newdic)
                         newdic = {"接机已到位提示": 1}
                         database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'"% flightstskey[0])
+                    if "1" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 9) and "人工" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 4):
+                        newdic = {"放行": "''"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                        newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s放行退回至到位!%s"%(a,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
+                        database.lazyInsertData('logs', newdic)
+                        newdic = {"已放行提示": 0}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'"% flightstskey[0])
+                elif  str(flightstskey[0]) in str(flightsts_flight_ids_arr):
+                    if "1" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 8) and "人工" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 3):
+                        newdic = {"接机到位": "''"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                        newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s状态退回至初始状态!%s"%(a,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
+                        database.lazyInsertData('logs', newdic)
+                        newdic = {"接机已到位提示": 0}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'"% flightstskey[0])
+                    if "1" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 9) and "人工" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 4):
+                        newdic = {"放行": "''"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                        newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s状态退回至初始状态!%s"%(a,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
+                        database.lazyInsertData('logs', newdic)
+                        newdic = {"已放行提示": 0}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'"% flightstskey[0])
 
                 ECSJ_worksts_str = baseFunction.TuplefindInList3(flightinfo_flight_ids, flightstskey[0], 0, 20)
                 ECSJ_worksts_STR = ECSJ_worksts_str if len(ECSJ_worksts_str) != 0 else 0
                 ECSJ_worksts = int(ECSJ_worksts_STR) if ECSJ_worksts_STR != "" else 0
                 if ECSJ_worksts >= 15 and str(flightstskey[0]) in str(flightsts_flight_ids_arr):
-                    #newdic = {"接机到位": "'已到位'", "放行": "'已放行'", "二送到位": "'已到位'"}
-                    newdic = {"二送到位": "'已到位'"}
-                    database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
-                    for i in code:
-                        if "0" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, code2num[i]):
-                            newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s%s!%s"%(a,i,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
-                            database.lazyInsertData('logs', newdic)
-                            newdic = {"%s"%i: 1}
-                            database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                    if baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0,7) != "已到位" :
+                        #newdic = {"接机到位": "'已到位'", "放行": "'已放行'", "二送到位": "'已到位'"}
+                        newdic = {"二送到位": "'已到位'"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                    if"1" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 12):
+                        newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s二送已到位提示!%s"%(a,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
+                        database.lazyInsertData('logs', newdic)
+                        newdic = {"二送已到位提示": 1}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                elif str(flightstskey[0]) in str(flightsts_flight_ids_arr) and "人工" not in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 7):
+                    if baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0,7) != "" :
+                        #newdic = {"接机到位": "'已到位'", "放行": "'已放行'", "二送到位": "'已到位'"}
+                        newdic = {"二送到位": "''"}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
+                    if "1" in baseFunction.TuplefindInList3(flightsts_flight_ids, flightstskey[0], 0, 12):
+                        newdic={"航班编号":"%s"% flightstskey[0],"警告信息":"","信息状态":"","提示信息":"AMRO:%s二送到位取消到位!%s"%(a,now11),"产生时间":"%s"%now,"处理人":"","处理时间":"","变更字段":"","显示对象":"","提示内容":""}
+                        database.lazyInsertData('logs', newdic)
+                        newdic = {"二送已到位提示": 0}
+                        database.lazyUpdateItem('flightsts{}'.format(nowDayStr), newdic, "航班编号='%s'" % flightstskey[0])
         database.FunctionCommit()
 
     except Exception as e:

+ 2 - 1
Functions/DButilsFunction/checkworkload_New.py

@@ -3,6 +3,7 @@ import datetime
 from unitls.LogerinTxt import app_logger
 import unitls.baseFunction as baseFunction
 from unitls.StaticDataclass import get_dic
+
 newWorkloadLabel=get_dic("newWorkloadLabel")
 startimeReDic={"WXJJ":25,"WXAP":100,"WXAF":0,"WXTAF":0,"FXAP":100,"FXAF":0,"FXTAF":0,"FXTR":0,"WXES":35}
 endtimeReDic={"WXJJ":10,"WXAP":10,"WXAF":120,"WXTAF":60,"FXAP":10,"FXAF":120,"FXTAF":60,"FXTR":30,"WXES":10}
@@ -160,7 +161,7 @@ def checkWorkerlaod_new(database:flightDB, workload:flightDB,nowDayStr1,nowDay_1
                         Computer(workload,workload_ids_arr,flightinfo[8],flightinfo[6],flightinfo[10],flightinfo[13],flightinfo[2],flightinfo[0],
                                  flightinfo[3],day,workloadinfos,startimeReDic['FXAF'],endtimeReDic['FXAF'],standvalueReDic['FXAF'],"航后放行",flightinfo[37])
 
-                    if flightinfo[19] != "" and flightinfo[3] != "AF" and flightinfo[8]:
+                    if flightinfo[19] != "" and flightinfo[3] != "AF" and flightinfo[5]:
                         peopleslist = flightinfo[19].replace("√", "").split(",")
                         for people in peopleslist:
                             workloadAllidsnow.append((flightinfo[0]+"-2-"+people))

+ 25 - 28
Functions/DButilsFunction/get_dic.py

@@ -15,38 +15,35 @@ def get_full_pinyin2(word, style=Style.NORMAL, separator=''):
     return ''.join([word[0][0] for word in pinyin(word, style=Style.NORMAL)])
 
 def get_dic(database:flightDB, fileName):
+    dic=["维修一队","维修二队","维修三队","维修四队","支援人员"]
     try:
         fdb = database
+        IDS=fdb.getSingledata("工号",'workerinfo')
+        IDSNOW=[]
         try:
-            ''''
-            decrypted_workbook = io.BytesIO()
-            with open(fileName, 'rb') as file:
-                office_file = msoffcrypto.OfficeFile(file)
-                office_file.load_key(password='Scal_0177')
-                office_file.decrypt(decrypted_workbook)
-            workbook = openpyxl.load_workbook(filename=decrypted_workbook,data_only=True)
-            '''
             workbook = openpyxl.load_workbook(filename=fileName) #非加密文档
-            mysheet = workbook["主表"]
-            myrows = list(mysheet.values)[1:]
-            mytitle = list(mysheet.values)[0]
-            for myrow in myrows:
-                mydics0 = {}
-                mydics1 = {}
-                for i in range(0, (len(mytitle))):
-                    a = get_full_pinyin1(str(myrow[0])) + ":" + get_full_pinyin2(str(myrow[0]))
-                    mydics0[mytitle[i]] = "%s"%myrow[i]
-                    mydics0[mytitle[11]] = "%s" % a
-                    if i != 3 and i != 11:
-                        mydics1[mytitle[i]] = "'%s'" % myrow[i]
-                    elif i == 11:
-                        mydics1[mytitle[11]] = "'%s'" % a
-                #a= fdb.getSingledata("工号",'workerinfo')
-                if str(mydics0["工号"]) in str(fdb.getSingledata("工号",'workerinfo')):
-                    fdb.lazyUpdateItem('workerinfo',mydics1,"工号='%s'"%mydics0["工号"])
-                else:
-                    fdb.lazyInsertData('workerinfo',mydics0)
-            #print(1)
+            for sheetname in dic:
+                mysheet = workbook[sheetname]
+                myrows = list(mysheet.values)[1:]
+                mytitle = list(mysheet.values)[0]
+                for myrow in myrows:
+                    mydics0 = {}
+                    mydics1 = {}
+                    for i in range(0, (len(mytitle))):
+                        a = get_full_pinyin1(str(myrow[0])) + ":" + get_full_pinyin2(str(myrow[0]))
+                        mydics0[mytitle[i]] = "%s"%myrow[i]
+                        mydics0[mytitle[11]] = "%s" % a
+                        if i != 3 and i != 11:
+                            mydics1[mytitle[i]] = "'%s'" % myrow[i]
+                        elif i == 11:
+                            mydics1[mytitle[11]] = "'%s'" % a
+                    #a= fdb.getSingledata("工号",'workerinfo')
+                    if str(mydics0["工号"]) in str(IDS) or str(mydics0["工号"]) in IDSNOW:
+                        fdb.lazyUpdateItem('workerinfo',mydics1,"工号='%s'"%mydics0["工号"])
+                    else:
+                        fdb.lazyInsertData('workerinfo',mydics0)
+                        IDSNOW.append(mydics0["工号"])
+                #print(1)
             fdb.FunctionCommit()
             return 1
         except Exception as e:

+ 1 - 1
Functions/DButilsFunction/manChangests.py

@@ -7,7 +7,7 @@ def manChangests(database:flightDB,flight_id:str,changests_id:str,selectedtime,u
         nowDayStr = selectedtime
         now = datetime.datetime.now()
         now11=str(now).split(".")[0]
-        code = {"接机到位": "已到位", "放行": "已放行", "随机到位": "已到位", "销子夹板": "已取下", "二送到位": "已到位"}
+        code = {"接机到位": "人工已到位", "放行": "人工已放行", "随机到位": "人工已到位", "销子夹板": "人工已取下", "二送到位": "人工已到位"}
         code2 = {"接机到位": "接机已到位提示", "放行": "已放行提示", "随机到位": "随机已到位提示", "销子夹板": "销子夹板已提示", "二送到位": "二送已到位提示"}
         flightsts_search=database.queryTabel("flightsts{}".format(nowDayStr),"%s"%changests_id,"航班编号 = '%s'"%flight_id)
         waringsts=database.queryTabel("logs","*","航班编号='%s' and 处理时间 =''"%flight_id)

+ 22 - 4
SeverStart.py

@@ -30,6 +30,8 @@ from Functions.DButilsFunction import flightDB, judge_bc as Judge_bc, initFlight
     dealLogs as DealLogs,update_Pglist as Update_Pglist,getWorkjobInfo as GetWorkjobInfo,mandealAllLogs as MandealAllLogs,\
     calltry as Calltry, callon as Callon,get_empNos_phoone as Get_empNos_phoone,FlightSearchInsert,TaskListInsert,checkWorkerlaod_new,\
     GetPglistInDatabase,Getworkload ,HandoverStsChange,ManCahangeWorkload,UpdateNoteItem,postgresql_bakup
+
+
 app = Flask(__name__)
 dir = os.getcwd()
 app.config["SECRET_KEY"] = "Can't not guess it ."
@@ -43,9 +45,9 @@ databaseWorkLoad = 'workLoad'
 databaseLoginDB = 'loginDB'
 flightDataTransfer,displayDataTransfer=DataTransferMode()
 ServerClas = Server_Class()
-severVersion = "20.0.0"
-displayVersion = "20.0.0"
-
+severVersion = "17.0.1"
+displayVersion = "17.0.0"
+print(f"当前客户端版本:{severVersion}/白板版本:{displayVersion}")
 
 # 获取本地IP地址
 def get_local_ip():
@@ -320,7 +322,6 @@ async def getFlightData2(type):
     db = flaskDBUtils.flaskDB(host=dbhost, port=dbport, user=dbuser, password=dbpassword, database=database)
     fdb = flightDB(host=dbhost, port=dbport, user=dbuser, password=dbpassword, database=databaseDB4)
     workLoad = flightDB(host=dbhost, port=dbport, user=dbuser, password=dbpassword, database=databaseWorkLoad)
-    print(check_a_availability())
     if (mainseverip and mainseverip == loaclseverip) or mainseverip == "" or (mainseverip and mainseverip != loaclseverip and check_a_availability()):
         try:
             #print(type)
@@ -566,6 +567,23 @@ def handoverflight():
     workLoad.close()
     return {"返回值":res}
 
+
+@app.route('/static/handoverflightAMRO',methods=["GET","POST"])
+def handoverflightAMRO():
+    remote_addr = request.remote_addr
+    data = json.loads(request.get_data())
+    db = flaskDBUtils.flaskDB(host=dbhost,port=dbport,user=dbuser,password=dbpassword,database=database)
+    token = flaskDBUtils.getToken(db)
+    #token = utils.flight_list.get_cookie()
+
+    Pglistdata=fl.request_LM_TSK_HANDOVER(data,token)
+    if Pglistdata['code'] == 200:
+        res = {"返回值": "ok"}
+    else:
+        res = {"返回值": "fail"}
+    print(datetime.datetime.now(),"[%s]使用AMRO工作交接功能"%remote_addr)
+    return res
+
 @app.route('/static/MM_GJJH_LIST/<team>')
 def MM_GJJH_LIST(team):
     remote_addr = request.remote_addr