|
@@ -20,7 +20,6 @@ from BaseDataMaintenance.common.multiThread import MultiThreadHandler
|
|
|
|
|
|
from BaseDataMaintenance.maintenance.dataflow_settings import *
|
|
from BaseDataMaintenance.maintenance.dataflow_settings import *
|
|
|
|
|
|
-from BaseDataMaintenance.maintenance.dataflow_mq import fixDoc_to_queue_extract,fixDoc_to_queue_init
|
|
|
|
|
|
|
|
import pandas as pd
|
|
import pandas as pd
|
|
|
|
|
|
@@ -37,6 +36,48 @@ flow_init_check_dir = "/data/python/flow_init_check"
|
|
flow_dumplicate_log_path = "/home/appuser/python/flow_dumplicate.log"
|
|
flow_dumplicate_log_path = "/home/appuser/python/flow_dumplicate.log"
|
|
|
|
|
|
|
|
|
|
|
|
+def fixDoc_to_queue_init(filename=""):
|
|
|
|
+ import pandas as pd
|
|
|
|
+ from BaseDataMaintenance.model.oracle.GongGaoTemp import dict_oracle2ots
|
|
|
|
+ from BaseDataMaintenance.model.oracle.TouSuTemp import dict_oracle2ots as dict_oracle2ots_tousu
|
|
|
|
+
|
|
|
|
+ from BaseDataMaintenance.dataSource.source import getConnection_oracle
|
|
|
|
+ current_path = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
+ if filename=="":
|
|
|
|
+ filename = os.path.join(current_path,"check.xlsx")
|
|
|
|
+ df = pd.read_excel(filename)
|
|
|
|
+ if "docchannel" in dict_oracle2ots:
|
|
|
|
+ dict_oracle2ots.pop("docchannel")
|
|
|
|
+ row_name = ",".join(list(dict_oracle2ots.keys()))
|
|
|
|
+
|
|
|
|
+ list_tousu_keys = []
|
|
|
|
+ for k,v in dict_oracle2ots_tousu.items():
|
|
|
|
+ if str(k).isupper():
|
|
|
|
+ list_tousu_keys.append(k)
|
|
|
|
+ row_name_tousu = ",".join(list(list_tousu_keys))
|
|
|
|
+ conn = getConnection_oracle()
|
|
|
|
+ cursor = conn.cursor()
|
|
|
|
+ _count = 0
|
|
|
|
+ for uuid,tablename,_exists,_toolong in zip(df["uuid"],df["tablename"],df["exists"],df["tolong"]):
|
|
|
|
+ if _exists==0 and _toolong==0:
|
|
|
|
+ _count += 1
|
|
|
|
+ is_tousu = False
|
|
|
|
+ if tablename in ('bxkc.t_wei_fa_ji_lu_temp','bxkc.t_tou_su_chu_li_temp','bxkc.t_qi_ta_shi_xin_temp'):
|
|
|
|
+ is_tousu = True
|
|
|
|
+ _source = str(tablename).replace("_TEMP","")
|
|
|
|
+ if is_tousu:
|
|
|
|
+ _source = str(tablename).replace("_temp","")
|
|
|
|
+ _rowname = row_name_tousu if is_tousu else row_name
|
|
|
|
+
|
|
|
|
+ sql = " insert into %s(%s) select %s from %s where id='%s' "%(tablename,_rowname,_rowname,_source,uuid)
|
|
|
|
+ log("%d:%s"%(_count,sql))
|
|
|
|
+ cursor.execute(sql)
|
|
|
|
+
|
|
|
|
+ conn.commit()
|
|
|
|
+ conn.close()
|
|
|
|
+
|
|
|
|
+ return _count
|
|
|
|
+
|
|
class BaseDataMonitor():
|
|
class BaseDataMonitor():
|
|
|
|
|
|
def __init__(self):
|
|
def __init__(self):
|