refactor auto import
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
import requests
|
||||
import json
|
||||
from decimal import Decimal
|
||||
|
||||
from config_base import *
|
||||
from general_functions import *
|
||||
from s1_LWTopic import *
|
||||
from s2_LawSection_ToElastic import *
|
||||
from s3_opinion_ToElastic import *
|
||||
from s4_RegulationSection_ToElastic import *
|
||||
from s5_LawSection_update_ref_state import *
|
||||
from s6_RegulationSection_update_ref_state import *
|
||||
from s7_LawReg_qanon_ToElastic import *
|
||||
from s8_Relations_qanon_LWReg import *
|
||||
from s9_Relations_qanon_opinion import *
|
||||
from s10_LawReg_lwphase_Info import *
|
||||
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
## ابتدا دستورات زیر را به ترتیب در دیتابیس فهرست اجرا شود
|
||||
# SELECT id from tl_projects where title='موضوعات درختی قانون'
|
||||
# DELETE from tl_subjects where project_id= (SELECT id from tl_projects where title='موضوعات درختی قانون')
|
||||
# -----------------------------------------------------------------
|
||||
# اجرای دستورات زیر در الاستیک
|
||||
# DELETE mj_qa_qanon_temp
|
||||
# DELETE mj_rg_section_temp
|
||||
# DELETE mj_qa_section_temp
|
||||
# DELETE mj_qa_opinion_temp
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
cursor, cnxn = create_cursor()
|
||||
|
||||
## ایجاد فهرست موضوعات قانون
|
||||
projectid = insertProejct()
|
||||
insertProjectItems(cursor, projectid)
|
||||
|
||||
# 2
|
||||
import_law_section_to_elastic(cursor)
|
||||
|
||||
|
||||
import_opinion_to_elastic(cursor)
|
||||
|
||||
|
||||
import_regulation_section_to_elastic(cursor)
|
||||
|
||||
### از ابتدا تا اینجا حدودا 24 ساعت کشید
|
||||
|
||||
|
||||
import_law_section_update_ref_state(cursor)
|
||||
|
||||
|
||||
import_regulation_section_update_ref_state(cursor)
|
||||
|
||||
|
||||
import_law_reg_qanon_to_elastic(cursor)
|
||||
|
||||
## تا اینجا رسید و خطا داد
|
||||
import_relations_qanon_lwreg(cursor)
|
||||
|
||||
## اینجا خطا داد
|
||||
import_relations_qanon_opinion(cursor)
|
||||
|
||||
|
||||
import_lawreg_lwphase_info(cursor)
|
||||
|
||||
cursor.close()
|
||||
cnxn.close()
|
||||
Reference in New Issue
Block a user