|
@@ -8,6 +8,8 @@
|
|
# @Tel 1501435553
|
|
# @Tel 1501435553
|
|
import datetime
|
|
import datetime
|
|
import logging
|
|
import logging
|
|
|
|
+
|
|
|
|
+from Apietl.conn.TidbConn import TidbConn
|
|
from Apietl.conn.TidbProConn import TidbProConn
|
|
from Apietl.conn.TidbProConn import TidbProConn
|
|
from Apietl.utlis.Utils import Utils
|
|
from Apietl.utlis.Utils import Utils
|
|
|
|
|
|
@@ -15,6 +17,7 @@ from Apietl.utlis.Utils import Utils
|
|
class MaterialFristCostDateUpdate:
|
|
class MaterialFristCostDateUpdate:
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.conn = TidbProConn.get_connection()
|
|
self.conn = TidbProConn.get_connection()
|
|
|
|
+ self.Innerconn = TidbConn.get_connection()
|
|
self.parm = Utils.get_args()
|
|
self.parm = Utils.get_args()
|
|
self.start_time = self.parm[0]
|
|
self.start_time = self.parm[0]
|
|
self.end_time = self.parm[1]
|
|
self.end_time = self.parm[1]
|
|
@@ -42,8 +45,12 @@ on a.signature=b.signature
|
|
""".format(start_time=self.start_time, end_time=self.end_time)
|
|
""".format(start_time=self.start_time, end_time=self.end_time)
|
|
print(sql)
|
|
print(sql)
|
|
TidbProConn.upsert(conn=self.conn, sql_buff=sql)
|
|
TidbProConn.upsert(conn=self.conn, sql_buff=sql)
|
|
|
|
+ TidbConn.upsert(conn=self.Innerconn, sql_buff=sql)
|
|
self.conn.commit()
|
|
self.conn.commit()
|
|
|
|
+ self.Innerconn.commit()
|
|
TidbProConn.conn_close(self.conn)
|
|
TidbProConn.conn_close(self.conn)
|
|
|
|
+ TidbConn.conn_close(self.Innerconn)
|
|
|
|
+
|
|
return 0
|
|
return 0
|
|
except Exception as e:
|
|
except Exception as e:
|
|
logging.error(e)
|
|
logging.error(e)
|