|
@@ -16,11 +16,18 @@ def postgresql_bakup(bakcup:flightDB,main:flightDB,type):
|
|
|
'risktable':get_dic('RiskLabel'),'workerinfo':get_dic('workerinfoLabel'),'pglist%s'%today:get_dic('pglistLabel'),'pglist%s'%yesterday:get_dic('pglistLabel'),
|
|
|
'logs':get_dic('logsLabel'),'taskauto':get_dic('taskLabel'),'calllist':get_dic('CalllistLabel'),
|
|
|
'flightsts%s'%today:get_dic('flightstsLabel'),'flightsts%s'%yesterday:get_dic('flightstsLabel'),
|
|
|
- 'logintoken':logintoken_dic,'loginsts':loginsts_dic,'logintable':logintable_dic}
|
|
|
+ 'logintoken':logintoken_dic,'loginsts':loginsts_dic,'logintable':logintable_dic,
|
|
|
+ "TaskFlightinfo%s"%today:get_dic('TaskflightinfoLabel'),"TaskFlightinfo%s"%yesterday:get_dic('TaskflightinfoLabel'),"TaskFlightinfo%s"%tomorrow:get_dic('TaskflightinfoLabel'),
|
|
|
+ "flightsearch%s"%today:get_dic('flightsearchLabel'),"flightsearch%s"%yesterday:get_dic('flightsearchLabel'),"flightsearch%s"%tomorrow:get_dic('flightsearchLabel'),
|
|
|
+ "sortFlight%s"%today:get_dic('sortLabel'),"sortFlight%s"%yesterday:get_dic('sortLabel'),"sortFlight%s"%tomorrow:get_dic('sortLabel'),"display":get_dic('displayLabel'),
|
|
|
+ }
|
|
|
if type == 1:
|
|
|
dbtables=["peopleschedule%s"%today,"peopleschedule%s"%yesterday,"peopleschedule%s"%tomorrow,'risktable',
|
|
|
'workerinfo','pglist%s'%today,'pglist%s'%yesterday,'taskauto','calllist',
|
|
|
- 'flightsts%s'%today,'flightsts%s'%yesterday]#logs太大无法同步
|
|
|
+ 'flightsts%s'%today,'flightsts%s'%yesterday,
|
|
|
+ "TaskFlightinfo%s"%today,"TaskFlightinfo%s"%yesterday,"TaskFlightinfo%s"%tomorrow,
|
|
|
+ "flightsearch%s"%today,"flightsearch%s"%yesterday,"flightsearch%s"%tomorrow,
|
|
|
+ "sortFlight%s"%today,"sortFlight%s"%yesterday,"sortFlight%s"%tomorrow,"display"]#logs太大无法同步
|
|
|
elif type == 2:
|
|
|
dbtables=['logintable']
|
|
|
elif type == 3:
|
|
@@ -39,8 +46,19 @@ def postgresql_bakup(bakcup:flightDB,main:flightDB,type):
|
|
|
all_source_data=bakcup.getAlldata(dbtable)
|
|
|
if len(all_source_data)!=0:
|
|
|
main.lazydeleteTable(dbtable)
|
|
|
- for row in all_source_data:
|
|
|
- main.lazyInsertData2(dbtable,', '.join(table_colmuns[dbtable]),row)
|
|
|
+ if dbtable=="display":
|
|
|
+ dispaly_res=main.getSingledata("A", 'display')
|
|
|
+ if dispaly_res == None or len(dispaly_res) == 0:
|
|
|
+ main.insertData('display', {'ID': 1, 'A': '{}', 'B': '{}'})
|
|
|
+ main.insertData('display', {'ID': 2, 'A': '{}', 'B': '{}'})
|
|
|
+ main.insertData('display', {'ID': 3, 'A': '{}', 'B': '{}'})
|
|
|
+ for row in all_source_data:
|
|
|
+ newdic = {"A": '"{}"'.format(row[1]),"B": '"{}"'.format(row[2])}
|
|
|
+ main.lazyUpdateItem(dbtable, newdic, "ID = '%s'"%row[0])
|
|
|
+ #online.FunctionCommit()
|
|
|
+ else:
|
|
|
+ for row in all_source_data:
|
|
|
+ main.lazyInsertData2(dbtable,', '.join(table_colmuns[dbtable]),row)
|
|
|
main.FunctionCommit()
|
|
|
tablesok=tablesok+dbtable+"/"
|
|
|
tablenum+=1
|