1
This commit is contained in:
+17
-15
@@ -215,10 +215,11 @@ def importDataToElastic(elastic, file_excel, index_name_o, tcode_label, tcode_id
|
||||
qanon_title = row[column_names[2]]
|
||||
code_state = row[column_names[3]]
|
||||
row_number = row[column_names[4]]
|
||||
if code_state :
|
||||
print ( 'ddddddddddddddcode_state' , code_state)
|
||||
else :
|
||||
print ( 'ccccccccccccccode_state' , code_state)
|
||||
# if code_state :
|
||||
# print ( 'ddddddddddddddcode_state' , code_state)
|
||||
# else :
|
||||
# print ( 'ccccccccccccccode_state' , code_state)
|
||||
|
||||
qanon_id = 0
|
||||
section_id = 0
|
||||
state = ''
|
||||
@@ -296,10 +297,11 @@ def importDataToElastic(elastic, file_excel, index_name_o, tcode_label, tcode_id
|
||||
"label" : tcode_label,
|
||||
"id" : tcode_id
|
||||
}
|
||||
if code_state :
|
||||
if code_state == True :
|
||||
tcode_mains.append(code)
|
||||
else:
|
||||
tcode_subs.append(code)
|
||||
|
||||
data={
|
||||
'_id':section_id,
|
||||
'_source' : {
|
||||
@@ -325,18 +327,18 @@ def importDataToElastic(elastic, file_excel, index_name_o, tcode_label, tcode_id
|
||||
elastic.updateBulkList(bulk_data, index_name_o)
|
||||
|
||||
|
||||
# columns=['جزء', 'مصوب', 'قانون', 'اصلی', 'ردیف', 'شناسه قانون', 'شناسه جزء', 'وضعیت پردازش']
|
||||
columns=[0, 1, 2, 3, 4, 5, 6, 7]
|
||||
new_df = pd.DataFrame(rows_list_new, columns=columns)
|
||||
if result_path == '' :
|
||||
directory_path = os.path.dirname(file_excel)
|
||||
result_path = directory_path + "/result/"
|
||||
##### columns=['جزء', 'مصوب', 'قانون', 'اصلی', 'ردیف', 'شناسه قانون', 'شناسه جزء', 'وضعیت پردازش']
|
||||
# columns=[0, 1, 2, 3, 4, 5, 6, 7]
|
||||
# new_df = pd.DataFrame(rows_list_new, columns=columns)
|
||||
# if result_path == '' :
|
||||
# directory_path = os.path.dirname(file_excel)
|
||||
# result_path = directory_path + "/result/"
|
||||
|
||||
file_name = os.path.basename(file_excel)
|
||||
file_excel2 = result_path + file_name.replace('.xlsx', '_result.xlsx')
|
||||
# file_name = os.path.basename(file_excel)
|
||||
# file_excel2 = result_path + file_name.replace('.xlsx', '_result.xlsx')
|
||||
|
||||
print('rows_list_new', str(len(rows_list_new)), ' --> ', file_excel2)
|
||||
new_df.to_excel(file_excel2, index=False, engine='openpyxl')
|
||||
# print('rows_list_new', str(len(rows_list_new)), ' --> ', file_excel2)
|
||||
# new_df.to_excel(file_excel2, index=False, engine='openpyxl')
|
||||
|
||||
|
||||
except Exception as e:
|
||||
|
||||
+14
-6
@@ -16,8 +16,8 @@ from temp_LawSection_content import *
|
||||
load_dotenv(dotenv_path='config.env')
|
||||
|
||||
|
||||
# host=os.getenv('HOST_160')
|
||||
# password=os.getenv('HOST_160_PASS')
|
||||
host=os.getenv('HOST_160')
|
||||
password=os.getenv('HOST_160_PASS')
|
||||
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ load_dotenv(dotenv_path='config.env')
|
||||
# host=os.getenv('HOST_161')
|
||||
# password=os.getenv('HOST_161_PASS')
|
||||
|
||||
host=os.getenv('HOST_80')
|
||||
password=os.getenv('HOST_80_PASS')
|
||||
# host=os.getenv('HOST_80')
|
||||
# password=os.getenv('HOST_80_PASS')
|
||||
|
||||
|
||||
print(host)
|
||||
@@ -40,9 +40,17 @@ print(host)
|
||||
path_base_map = "G:/Project2/gateway2_main/repo/_other/"
|
||||
elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111/haditha", "dh_volume")
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111/haditha", "dh_haditha")
|
||||
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section-m1")
|
||||
# elastic.createIndex( 'mj_qa_section-m1', 'majles', 'mj_qa_section')
|
||||
|
||||
# elastic.restorFileToElastic2('G:/Project2/111/mj_qa_section-m1.zip', 'mj_qa_section-m1', 'majles', False, 'mj_qa_section')
|
||||
|
||||
|
||||
#elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section")
|
||||
|
||||
# elastic.restorFileToElastic2('G:/Project2/111/gn_setting.zip', 'gn_setting', 'general', False, 'gn_setting')
|
||||
#-------------------------------------------------------
|
||||
##
|
||||
# elastic.backupIndexToZipfile("G:/Project2/111", "dh_haditha")
|
||||
@@ -80,7 +88,7 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map)
|
||||
#-------------------------------------------------------
|
||||
## backup from 160
|
||||
#-------------------------------------------------------
|
||||
# path_back = 'G:/Project2/_back/server160/_back_elastic0126/'
|
||||
path_back = 'G:/Project2/111/server160/'
|
||||
# elastic.backupIndexToZipfile(path_back, "gn_log_change")
|
||||
# elastic.backupIndexToZipfile(path_back, "gn_log_action")
|
||||
# elastic.backupIndexToZipfile(path_back, "gn_log_search")
|
||||
|
||||
Reference in New Issue
Block a user