|
@@ -31,6 +31,8 @@ from Functions.DButilsFunction import flightDB, judge_bc as Judge_bc, initFlight
|
|
calltry as Calltry, callon as Callon,get_empNos_phoone as Get_empNos_phoone,FlightSearchInsert,TaskListInsert,checkWorkerlaod_new,\
|
|
calltry as Calltry, callon as Callon,get_empNos_phoone as Get_empNos_phoone,FlightSearchInsert,TaskListInsert,checkWorkerlaod_new,\
|
|
GetPglistInDatabase,Getworkload ,HandoverStsChange,ManCahangeWorkload,UpdateNoteItem,postgresql_bakup
|
|
GetPglistInDatabase,Getworkload ,HandoverStsChange,ManCahangeWorkload,UpdateNoteItem,postgresql_bakup
|
|
|
|
|
|
|
|
+from urllib3.exceptions import InsecureRequestWarning
|
|
|
|
+requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
|
|
|
|
|
app = Flask(__name__)
|
|
app = Flask(__name__)
|
|
dir = os.getcwd()
|
|
dir = os.getcwd()
|
|
@@ -48,6 +50,9 @@ ServerClas = Server_Class()
|
|
severVersion = "17.0.1"
|
|
severVersion = "17.0.1"
|
|
displayVersion = "17.0.0"
|
|
displayVersion = "17.0.0"
|
|
print(f"当前客户端版本:{severVersion}/白板版本:{displayVersion}")
|
|
print(f"当前客户端版本:{severVersion}/白板版本:{displayVersion}")
|
|
|
|
+print(f"当前服务器为:【{ServerClas}】")
|
|
|
|
+print(f"当前服务器航班数据传输模式为:【{flightDataTransfer}】")
|
|
|
|
+print(f"当前服务器显示计算请求模式为:【{displayDataTransfer}】")
|
|
|
|
|
|
# 获取本地IP地址
|
|
# 获取本地IP地址
|
|
def get_local_ip():
|
|
def get_local_ip():
|
|
@@ -271,15 +276,20 @@ def postgresql():
|
|
if displayDataTransfer == 1:
|
|
if displayDataTransfer == 1:
|
|
res= DataComputer.mytask()
|
|
res= DataComputer.mytask()
|
|
if res == "ok":
|
|
if res == "ok":
|
|
- url = "https://"+online_host+":5070/computerDispalydata"
|
|
|
|
|
|
+ url = "https://"+online_host+":7162/computerDispalydata"
|
|
|
|
+ #url = "https://192.168.2.87:5070/computerDispalydata"
|
|
try:
|
|
try:
|
|
- ress=requests.get(url, verify=False).json()
|
|
|
|
- #ress=requests.get(url, verify='D:\\flightinfo\\DATABASE\\secret.pem').json()
|
|
|
|
- if ress == "ok":
|
|
|
|
|
|
+ ress=requests.get(url, verify=False)
|
|
|
|
+ ress.raise_for_status() # 检查HTTP状态码是否为成功
|
|
|
|
+ data = ress.json()
|
|
|
|
+ #ress=requests.post(url, cert=('D:\\flightinfo\\DATABASE\\sichuanair.com.pem','D:\\flightinfo\\DATABASE\\sichuanair.com.key')).json()
|
|
|
|
+ if data == "ok":
|
|
|
|
+ #if data.get("result") == "ok":
|
|
print(datetime.datetime.now(), "远端显示中心计算请求成功")
|
|
print(datetime.datetime.now(), "远端显示中心计算请求成功")
|
|
else:
|
|
else:
|
|
print(datetime.datetime.now(), "[返回为fail]远端显示中心计算请求失败")
|
|
print(datetime.datetime.now(), "[返回为fail]远端显示中心计算请求失败")
|
|
- except:
|
|
|
|
|
|
+ except Exception as e:
|
|
|
|
+ print(e)
|
|
print(datetime.datetime.now(), "[请求被拒绝]远端显示中心计算请求失败")
|
|
print(datetime.datetime.now(), "[请求被拒绝]远端显示中心计算请求失败")
|
|
return "ok"
|
|
return "ok"
|
|
except:
|
|
except:
|
|
@@ -1214,9 +1224,9 @@ def get_dic():
|
|
remote_addr = request.remote_addr
|
|
remote_addr = request.remote_addr
|
|
data = json.loads(request.get_data())
|
|
data = json.loads(request.get_data())
|
|
fdb = flightDB(host=dbhost,port=dbport,user=dbuser,password=dbpassword,database=databaseDB4)
|
|
fdb = flightDB(host=dbhost,port=dbport,user=dbuser,password=dbpassword,database=databaseDB4)
|
|
- Get_dic(fdb,data["fileName"])
|
|
|
|
|
|
+ ress=Get_dic(fdb,data["fileName"])
|
|
fdb.close()
|
|
fdb.close()
|
|
- res = {"返回值": "ok"}
|
|
|
|
|
|
+ res = {"返回值": ress}
|
|
print(datetime.datetime.now(),"[%s]获取人员信息EXCEL表格"%remote_addr)
|
|
print(datetime.datetime.now(),"[%s]获取人员信息EXCEL表格"%remote_addr)
|
|
return res
|
|
return res
|
|
@app.route('/static/handovechange',methods=["GET","POST"])
|
|
@app.route('/static/handovechange',methods=["GET","POST"])
|
|
@@ -1356,6 +1366,7 @@ def init():
|
|
fl = utils.flight_list()
|
|
fl = utils.flight_list()
|
|
si = ipcall.searchinfo()
|
|
si = ipcall.searchinfo()
|
|
loaclseverip = get_local_ip()
|
|
loaclseverip = get_local_ip()
|
|
|
|
+ print(f"当前服务器IP:{loaclseverip}")
|
|
singlePeopleNotice = initialize_file('D:\\flightinfo\\DATABASE\\singlepoeple_notice.txt',False)
|
|
singlePeopleNotice = initialize_file('D:\\flightinfo\\DATABASE\\singlepoeple_notice.txt',False)
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
serve(app, host='0.0.0.0',port=7162, threads=20)
|
|
serve(app, host='0.0.0.0',port=7162, threads=20)
|