|
@@ -1393,6 +1393,15 @@ public class HanaOrderComponent {
|
|
|
log.info("importing salesOrder := {} rows data into mysql from {} and cost {} ms!", rows, filePath, (endTime - beginTime));
|
|
log.info("importing salesOrder := {} rows data into mysql from {} and cost {} ms!", rows, filePath, (endTime - beginTime));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //删除旧表
|
|
|
|
|
+ try (Connection tempConn = getMysqlConnection();
|
|
|
|
|
+ Statement tempStmt = tempConn.createStatement()) {
|
|
|
|
|
+ tempStmt.execute("DROP TABLE IF EXISTS meta_hana_sales_order_old");
|
|
|
|
|
+ log.info("成功删除旧表: meta_hana_sales_order_old");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("删除旧表失败,表名: meta_hana_sales_order_old", e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 1. 先设置会话级锁等待超时为3秒
|
|
// 1. 先设置会话级锁等待超时为3秒
|
|
|
try (Statement timeOut = conn.createStatement()) {
|
|
try (Statement timeOut = conn.createStatement()) {
|
|
|
timeOut.execute("SET SESSION innodb_lock_wait_timeout = 3");
|
|
timeOut.execute("SET SESSION innodb_lock_wait_timeout = 3");
|
|
@@ -1408,19 +1417,6 @@ public class HanaOrderComponent {
|
|
|
// 提交事务
|
|
// 提交事务
|
|
|
conn.commit();
|
|
conn.commit();
|
|
|
|
|
|
|
|
- // 4. 异步删除旧表
|
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
|
- try (Connection tempConn = getMysqlConnection();
|
|
|
|
|
- Statement tempStmt = tempConn.createStatement()) {
|
|
|
|
|
- tempStmt.execute("DROP TABLE IF EXISTS meta_hana_sales_order_old");
|
|
|
|
|
- log.info("成功删除旧表: meta_hana_sales_order_old");
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("删除旧表失败,表名: meta_hana_sales_order_old", e);
|
|
|
|
|
- }
|
|
|
|
|
- }).exceptionally(ex -> {
|
|
|
|
|
- log.error("异步删除旧表操作异常", ex);
|
|
|
|
|
- return null;
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
// 清空缓存
|
|
// 清空缓存
|
|
|
String result = HttpUtils.sendGet(orderGetDataHook);
|
|
String result = HttpUtils.sendGet(orderGetDataHook);
|
|
@@ -1525,6 +1521,15 @@ public class HanaOrderComponent {
|
|
|
log.info("importing selfDeliverOrder := {} rows data into mysql from {} and cost {} ms!", rows, filePath, (endTime - beginTime));
|
|
log.info("importing selfDeliverOrder := {} rows data into mysql from {} and cost {} ms!", rows, filePath, (endTime - beginTime));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //删除旧表
|
|
|
|
|
+ try (Connection tempConn = getMysqlConnection();
|
|
|
|
|
+ Statement tempStmt = tempConn.createStatement()) {
|
|
|
|
|
+ tempStmt.execute("DROP TABLE IF EXISTS meta_hana_self_deliver_order_old");
|
|
|
|
|
+ log.info("成功删除旧表: meta_hana_self_deliver_order_old");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("删除旧表失败,表名: meta_hana_self_deliver_order_old", e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 1. 先设置会话级锁等待超时为3秒
|
|
// 1. 先设置会话级锁等待超时为3秒
|
|
|
try (Statement timeOut = conn.createStatement()) {
|
|
try (Statement timeOut = conn.createStatement()) {
|
|
|
timeOut.execute("SET SESSION innodb_lock_wait_timeout = 3");
|
|
timeOut.execute("SET SESSION innodb_lock_wait_timeout = 3");
|
|
@@ -1541,19 +1546,6 @@ public class HanaOrderComponent {
|
|
|
// 提交事务
|
|
// 提交事务
|
|
|
conn.commit();
|
|
conn.commit();
|
|
|
|
|
|
|
|
- // 4. 异步删除旧表
|
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
|
- try (Connection tempConn = getMysqlConnection();
|
|
|
|
|
- Statement tempStmt = tempConn.createStatement()) {
|
|
|
|
|
- tempStmt.execute("DROP TABLE IF EXISTS meta_hana_self_deliver_order_old");
|
|
|
|
|
- log.info("成功删除旧表: meta_hana_self_deliver_order_old");
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("删除旧表失败,表名: meta_hana_self_deliver_order_old", e);
|
|
|
|
|
- }
|
|
|
|
|
- }).exceptionally(ex -> {
|
|
|
|
|
- log.error("异步删除旧表操作异常", ex);
|
|
|
|
|
- return null;
|
|
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1613,6 +1605,16 @@ public class HanaOrderComponent {
|
|
|
log.info("importing deliverOrder := {} rows data into mysql from {} and cost {} ms!", rows, filePath, (endTime - beginTime));
|
|
log.info("importing deliverOrder := {} rows data into mysql from {} and cost {} ms!", rows, filePath, (endTime - beginTime));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //删除旧表
|
|
|
|
|
+ try (Connection tempConn = getMysqlConnection();
|
|
|
|
|
+ Statement tempStmt = tempConn.createStatement()) {
|
|
|
|
|
+ tempStmt.execute("DROP TABLE IF EXISTS meta_hana_deliver_order_old");
|
|
|
|
|
+ log.info("成功删除旧表: meta_hana_deliver_order_old");
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("删除旧表失败,表名: meta_hana_deliver_order_old", e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 1. 先设置会话级锁等待超时为3秒
|
|
// 1. 先设置会话级锁等待超时为3秒
|
|
|
try (Statement timeOut = conn.createStatement()) {
|
|
try (Statement timeOut = conn.createStatement()) {
|
|
|
timeOut.execute("SET SESSION innodb_lock_wait_timeout = 3");
|
|
timeOut.execute("SET SESSION innodb_lock_wait_timeout = 3");
|
|
@@ -1629,19 +1631,7 @@ public class HanaOrderComponent {
|
|
|
// 提交事务
|
|
// 提交事务
|
|
|
conn.commit();
|
|
conn.commit();
|
|
|
|
|
|
|
|
- // 4. 异步删除旧表
|
|
|
|
|
- CompletableFuture.runAsync(() -> {
|
|
|
|
|
- try (Connection tempConn = getMysqlConnection();
|
|
|
|
|
- Statement tempStmt = tempConn.createStatement()) {
|
|
|
|
|
- tempStmt.execute("DROP TABLE IF EXISTS meta_hana_deliver_order_old");
|
|
|
|
|
- log.info("成功删除旧表: meta_hana_deliver_order_old");
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("删除旧表失败,表名: meta_hana_deliver_order_old", e);
|
|
|
|
|
- }
|
|
|
|
|
- }).exceptionally(ex -> {
|
|
|
|
|
- log.error("异步删除旧表操作异常", ex);
|
|
|
|
|
- return null;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 清空缓存
|
|
// 清空缓存
|
|
|
String result = HttpUtils.sendGet(orderGetDataHook);
|
|
String result = HttpUtils.sendGet(orderGetDataHook);
|