diff --git a/mallinkAdmin/pom.xml b/mallinkAdmin/pom.xml
index d17aa1dd1..d5dd190d8 100644
--- a/mallinkAdmin/pom.xml
+++ b/mallinkAdmin/pom.xml
@@ -52,6 +52,13 @@
5.2.4
+
+
+ net.sourceforge.tess4j
+ tess4j
+ 4.5.2
+
+
diff --git a/mallinkAdmin/src/main/java/com/iformall/utils/NeusoftUtil.java b/mallinkAdmin/src/main/java/com/iformall/utils/NeusoftUtil.java
new file mode 100644
index 000000000..6eb6334ec
--- /dev/null
+++ b/mallinkAdmin/src/main/java/com/iformall/utils/NeusoftUtil.java
@@ -0,0 +1,68 @@
+package com.iformall.utils;
+
+import okhttp3.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.time.format.DateTimeFormatter;
+
+public class NeusoftUtil {
+
+ private static final Logger logger = LoggerFactory.getLogger(NeusoftUtil.class);
+
+ /**
+ * 域名地址
+ */
+ private static final String domain = "http://ota.neusoft.com";
+
+ /**
+ * 获取验证码
+ */
+ private static final String loginCaptchaUrl = "/service-user/login/captcha";
+
+ /**
+ * 登陆
+ * captcha: "05684"
+ * password: "wycjituan1"
+ * username: "wycjituan1"
+ */
+ private static final String loginUrl = "/service-user/login";
+
+ /**
+ * 店铺交易信息
+ * ?orgId=1&limit=10&offset=0
+ */
+ private static final String shopOrderSummaryUrl = "/unionService/orderStatistics/shopOrderSummary";
+
+
+ private final OkHttpClient client = new OkHttpClient();
+
+ private DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+
+
+ public static void main(String[] args) {
+ File imageFile = new File("C:\\Users\\xiaohu\\Desktop\\img\\captcha.jpg");
+
+// ITesseract instance = new Tesseract();
+// try {
+// System.out.println(System.getProperty("user.dir"));
+//
+// instance.setDatapath( "C:/Users/xiaohu/IdeaFmlkProjects/formallProject/mallinkAdmin/target/classes/tessdata");
+// String s = instance.doOCR(imageFile);
+// System.out.println(s);
+// } catch (TesseractException e) {
+// e.printStackTrace();
+// }
+
+
+ }
+
+ private boolean checkRespFailed(String resp) {
+ if (resp.startsWith("") || resp.startsWith("")) {
+ return true;
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/mallinkAdmin/src/main/resources/db/migration/V202009211000__集团版数据处理.sql b/mallinkAdmin/src/main/resources/db/migration/V202009211000__集团版数据处理.sql
index c88a8fd9a..2d51db685 100644
--- a/mallinkAdmin/src/main/resources/db/migration/V202009211000__集团版数据处理.sql
+++ b/mallinkAdmin/src/main/resources/db/migration/V202009211000__集团版数据处理.sql
@@ -1,42 +1,14 @@
---备份关键表数据,
-create table wx_c_user_basic_info_',@dateStr,' like wx_c_user_basic_info;
-insert into wx_c_user_basic_info_',@dateStr,' select * from wx_c_user_basic_info;
-create table wx_c_user_',@dateStr,' like wx_c_user;
-insert into wx_c_user_',@dateStr,' select * from wx_c_user;
-create table wx_order_',@dateStr,' like wx_order;
-insert into wx_order_',@dateStr,' select * from wx_order;
-create table wx_coupon_order_',@dateStr,' like wx_coupon_order;
-insert into wx_coupon_order_',@dateStr,' select * from wx_coupon_order;
-create table wx_pay_order_',@dateStr,' like wx_pay_order;
-insert into wx_pay_order_',@dateStr,' select * from wx_pay_order;
-create table wx_refund_order_',@dateStr,' like wx_refund_order;
-insert into wx_refund_order_',@dateStr,' select * from wx_refund_order;
-create table wx_order_group_',@dateStr,' like wx_order_group;
-insert into wx_order_group_',@dateStr,' select * from wx_order_group;
-create table wx_order_press_',@dateStr,' like wx_order_press;
-insert into wx_order_press_',@dateStr,' select * from wx_order_press;
-create table wx_c_user_from_b_',@dateStr,' like wx_c_user_from_b;
-insert into wx_c_user_from_b_',@dateStr,' select * from wx_c_user_from_b;
-create table wx_activity_join_',@dateStr,' like wx_activity_join;
-insert into wx_activity_join_',@dateStr,' select * from wx_activity_join;
-create table wx_question_log_',@dateStr,' like wx_question_log;
-insert into wx_question_log_',@dateStr,' select * from wx_question_log;
-create table wx_game_action_log_',@dateStr,' like wx_game_action_log;
-insert into wx_game_action_log_',@dateStr,' select * from wx_game_action_log;
-create table wx_credit_history_',@dateStr,' like wx_credit_history;
-insert into wx_credit_history_',@dateStr,' select * from wx_credit_history;
-create table wx_score_history_',@dateStr,' like wx_score_history;
-insert into wx_score_history_',@dateStr,' select * from wx_score_history;
-create table wx_card_spend_',@dateStr,' like wx_card_spend;
-insert into wx_card_spend_',@dateStr,' select * from wx_card_spend;
-create table wx_c_user_tags_',@dateStr,' like wx_c_user_tags;
-insert into wx_c_user_tags_',@dateStr,' select * from wx_c_user_tags;
-
---所有数据改成集团的数据 118.044s
--groupTenantId 集团tenantId
---tenantIds 子广场,拼接
+--tenantIds--子广场, 拼接
+
+--备份关键表数据,
+call back_up_and_move(varchar tenantIds,varchar groupTenantId);
+
+--所有数据改成集团的数据
+--tenantId 集团tenantId
+--subTenantIds 子广场,拼接
--el: call init_after_group('1025', '1008,1020');
-call init_after_group(groupTenantId, tenantIds);
+call init_after_group(varchar tenantId,varchar subTenantIds);
--合并子广场重复会员 清缓存
--tenantIds 子广场,拼接
@@ -44,16 +16,335 @@ call init_after_group(groupTenantId, tenantIds);
--call move_after_group(tenantIds);
-/*备份手机号重复数据**/
-CREATE TABLE wx_c_user_basic_info_1008_1020 LIKE wx_c_user_basic_info;
-INSERT INTO wx_c_user_basic_info_1008_1020 SELECT * FROM wx_c_user_basic_info WHERE final_tenant_id IN ('1008','1020') AND phone IN (
- SELECT phone FROM wx_c_user_basic_info t WHERE `final_tenant_id` IN ('1008','1020') GROUP BY phone HAVING COUNT(1) > 1
-)
+--单独处理 wx_c_user_basic_info,wx_c_user_tags 归属集团
+--UPDATE wx_c_user_basic_info SET final_tenant_id = groupTenantId WHERE FIND_IN_SET(final_tenant_id,tenantIds);
+--UPDATE wx_c_user_tags SET tenant_id = groupTenantId WHERE FIND_IN_SET(tenant_id,tenantIds);
+
+
+
+
+
+
+CREATE DEFINER=`root`@`%` PROCEDURE `back_up_and_move`(IN tenantIds VARCHAR(125),IN groupTenantId VARCHAR(125))
+BEGIN
+
+ select concat('_',date_format(now(),'%Y%m%d'),'_',REPLACE(tenantIds,',','_')) into @backUpSuffix;
+ select concat(@backUpSuffix,'_merge') into @mergeSuffix;
+
+
+ set @backUpSql1_0 = concat('create table wx_c_user_basic_info',@backUpSuffix,' like wx_c_user_basic_info;');
+ PREPARE back_up_sql1_0 FROM @backUpSql1_0;
+ EXECUTE back_up_sql1_0;
+ DEALLOCATE PREPARE back_up_sql1_0;
+ set @backUpSql2_0 = concat('insert into wx_c_user_basic_info',@backUpSuffix,' select * from wx_c_user_basic_info where FIND_IN_SET(final_tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql2_0 FROM @backUpSql2_0;
+ EXECUTE back_up_sql2_0;
+ DEALLOCATE PREPARE back_up_sql2_0;
+
+ set @backUpSql1_1 = concat('create table wx_c_user_basic_info',@mergeSuffix,' like wx_c_user_basic_info;');
+ PREPARE back_up_sql1_1 FROM @backUpSql1_1;
+ EXECUTE back_up_sql1_1;
+ DEALLOCATE PREPARE back_up_sql1_1;
+ set @backUpSql2_1 = concat('insert into wx_c_user_basic_info',@mergeSuffix,' select * from wx_c_user_basic_info',@backUpSuffix,' where phone in (SELECT phone FROM wx_c_user_basic_info',@backUpSuffix,' GROUP BY phone HAVING COUNT(1) > 1);');
+ PREPARE back_up_sql2_1 FROM @backUpSql2_1;
+ EXECUTE back_up_sql2_1;
+ DEALLOCATE PREPARE back_up_sql2_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_basic_info表备份处理数据成功',null);
+
+ set @backUpSql3_0 = concat('create table wx_c_user',@backUpSuffix,' like wx_c_user;');
+ PREPARE back_up_sql3_0 FROM @backUpSql3_0;
+ EXECUTE back_up_sql3_0;
+ DEALLOCATE PREPARE back_up_sql3_0;
+ set @backUpSql4_0 = concat('insert into wx_c_user',@backUpSuffix,' select * from wx_c_user where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql4_0 FROM @backUpSql4_0;
+ EXECUTE back_up_sql4_0;
+ DEALLOCATE PREPARE back_up_sql4_0;
+
+ set @backUpSql3_1 = concat('create table wx_c_user',@mergeSuffix,' like wx_c_user;');
+ PREPARE back_up_sql3_1 FROM @backUpSql3_1;
+ EXECUTE back_up_sql3_1;
+ DEALLOCATE PREPARE back_up_sql3_1;
+ set @backUpSql4_1 = concat('insert into wx_c_user',@mergeSuffix,' select * from wx_c_user',@backUpSuffix,' where user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql4_1 FROM @backUpSql4_1;
+ EXECUTE back_up_sql4_1;
+ DEALLOCATE PREPARE back_up_sql4_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user表备份、处理数据成功',null);
+
+ set @backUpSql5_0 = concat('create table wx_order',@backUpSuffix,' like wx_order;');
+ PREPARE back_up_sql5_0 FROM @backUpSql5_0;
+ EXECUTE back_up_sql5_0;
+ DEALLOCATE PREPARE back_up_sql5_0;
+ set @backUpSql6_0 = concat('insert into wx_order',@backUpSuffix,' select * from wx_order where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql6_0 FROM @backUpSql6_0;
+ EXECUTE back_up_sql6_0;
+ DEALLOCATE PREPARE back_up_sql6_0;
+
+ set @backUpSql5_1 = concat('create table wx_order',@mergeSuffix,' like wx_order;');
+ PREPARE back_up_sql5_1 FROM @backUpSql5_1;
+ EXECUTE back_up_sql5_1;
+ DEALLOCATE PREPARE back_up_sql5_1;
+ set @backUpSql6_1 = concat('insert into wx_order',@mergeSuffix,' select * from wx_order',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql6_1 FROM @backUpSql6_1;
+ EXECUTE back_up_sql6_1;
+ DEALLOCATE PREPARE back_up_sql6_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_order表备份、处理数据成功',null);
+
+ set @backUpSql7_0 = concat('create table wx_coupon_order',@backUpSuffix,' like wx_coupon_order;');
+ PREPARE back_up_sql7_0 FROM @backUpSql7_0;
+ EXECUTE back_up_sql7_0;
+ DEALLOCATE PREPARE back_up_sql7_0;
+ set @backUpSql8_0 = concat('insert into wx_coupon_order',@backUpSuffix,' select * from wx_coupon_order where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql8_0 FROM @backUpSql8_0;
+ EXECUTE back_up_sql8_0;
+ DEALLOCATE PREPARE back_up_sql8_0;
+
+ set @backUpSql7_1 = concat('create table wx_coupon_order',@mergeSuffix,' like wx_coupon_order;');
+ PREPARE back_up_sql7_1 FROM @backUpSql7_1;
+ EXECUTE back_up_sql7_1;
+ DEALLOCATE PREPARE back_up_sql7_1;
+ set @backUpSql8_1 = concat('insert into wx_coupon_order',@mergeSuffix,' select * from wx_coupon_order',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,') or owner_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql8_1 FROM @backUpSql8_1;
+ EXECUTE back_up_sql8_1;
+ DEALLOCATE PREPARE back_up_sql8_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_coupon_order表备份、处理数据成功',null);
+
+ set @backUpSql9_0 = concat('create table wx_pay_order',@backUpSuffix,' like wx_pay_order;');
+ PREPARE back_up_sql9_0 FROM @backUpSql9_0;
+ EXECUTE back_up_sql9_0;
+ DEALLOCATE PREPARE back_up_sql9_0;
+ set @backUpSql10_0 = concat('insert into wx_pay_order',@backUpSuffix,' select * from wx_pay_order where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql10_0 FROM @backUpSql10_0;
+ EXECUTE back_up_sql10_0;
+ DEALLOCATE PREPARE back_up_sql10_0;
+
+ set @backUpSql9_1 = concat('create table wx_pay_order',@mergeSuffix,' like wx_pay_order;');
+ PREPARE back_up_sql9_1 FROM @backUpSql9_1;
+ EXECUTE back_up_sql9_1;
+ DEALLOCATE PREPARE back_up_sql9_1;
+ set @backUpSql10_1 = concat('insert into wx_pay_order',@mergeSuffix,' select * from wx_pay_order',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql10_1 FROM @backUpSql10_1;
+ EXECUTE back_up_sql10_1;
+ DEALLOCATE PREPARE back_up_sql10_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_pay_order表备份、处理数据成功',null);
+
+ set @backUpSql11_0 = concat('create table wx_refund_order',@backUpSuffix,' like wx_refund_order;');
+ PREPARE back_up_sql11_0 FROM @backUpSql11_0;
+ EXECUTE back_up_sql11_0;
+ DEALLOCATE PREPARE back_up_sql11_0;
+ set @backUpSql12_0 = concat('insert into wx_refund_order',@backUpSuffix,' select * from wx_refund_order where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql12_0 FROM @backUpSql12_0;
+ EXECUTE back_up_sql12_0;
+ DEALLOCATE PREPARE back_up_sql12_0;
+
+ set @backUpSql11_1 = concat('create table wx_refund_order',@mergeSuffix,' like wx_refund_order;');
+ PREPARE back_up_sql11_1 FROM @backUpSql11_1;
+ EXECUTE back_up_sql11_1;
+ DEALLOCATE PREPARE back_up_sql11_1;
+ set @backUpSql12_1 = concat('insert into wx_refund_order',@mergeSuffix,' select * from wx_refund_order',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql12_1 FROM @backUpSql12_1;
+ EXECUTE back_up_sql12_1;
+ DEALLOCATE PREPARE back_up_sql12_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_refund_order表备份、处理数据成功',null);
+
+ set @backUpSql13_0 = concat('create table wx_order_group',@backUpSuffix,' like wx_order_group;');
+ PREPARE back_up_sql13_0 FROM @backUpSql13_0;
+ EXECUTE back_up_sql13_0;
+ DEALLOCATE PREPARE back_up_sql13_0;
+ set @backUpSql14_0 = concat('insert into wx_order_group',@backUpSuffix,' select * from wx_order_group where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql14_0 FROM @backUpSql14_0;
+ EXECUTE back_up_sql14_0;
+ DEALLOCATE PREPARE back_up_sql14_0;
+
+ set @backUpSql13_1 = concat('create table wx_order_group',@mergeSuffix,' like wx_order_group;');
+ PREPARE back_up_sql13_1 FROM @backUpSql13_1;
+ EXECUTE back_up_sql13_1;
+ DEALLOCATE PREPARE back_up_sql13_1;
+ set @backUpSql14_1 = concat('insert into wx_order_group',@mergeSuffix,' select * from wx_order_group',@backUpSuffix,' where user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql14_1 FROM @backUpSql14_1;
+ EXECUTE back_up_sql14_1;
+ DEALLOCATE PREPARE back_up_sql14_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_order_group表备份、处理数据成功',null);
+
+ set @backUpSql15_0 = concat('create table wx_order_press',@backUpSuffix,' like wx_order_press;');
+ PREPARE back_up_sql15_0 FROM @backUpSql15_0;
+ EXECUTE back_up_sql15_0;
+ DEALLOCATE PREPARE back_up_sql15_0;
+ set @backUpSql16_0 = concat('insert into wx_order_press',@backUpSuffix,' select * from wx_order_press where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql16_0 FROM @backUpSql16_0;
+ EXECUTE back_up_sql16_0;
+ DEALLOCATE PREPARE back_up_sql16_0;
+
+ set @backUpSql15_1 = concat('create table wx_order_press',@mergeSuffix,' like wx_order_press;');
+ PREPARE back_up_sql15_1 FROM @backUpSql15_1;
+ EXECUTE back_up_sql15_1;
+ DEALLOCATE PREPARE back_up_sql15_1;
+ set @backUpSql16_1 = concat('insert into wx_order_press',@mergeSuffix,' select * from wx_order_press',@backUpSuffix,' where user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql16_1 FROM @backUpSql16_1;
+ EXECUTE back_up_sql16_1;
+ DEALLOCATE PREPARE back_up_sql16_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_order_press表备份、处理数据成功',null);
+
+ set @backUpSql17_0 = concat('create table wx_c_user_from_b',@backUpSuffix,' like wx_c_user_from_b;');
+ PREPARE back_up_sql17_0 FROM @backUpSql17_0;
+ EXECUTE back_up_sql17_0;
+ DEALLOCATE PREPARE back_up_sql17_0;
+ set @backUpSql18_0 = concat('insert into wx_c_user_from_b',@backUpSuffix,' select * from wx_c_user_from_b where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql18_0 FROM @backUpSql18_0;
+ EXECUTE back_up_sql18_0;
+ DEALLOCATE PREPARE back_up_sql18_0;
+
+ set @backUpSql17_1 = concat('create table wx_c_user_from_b',@mergeSuffix,' like wx_c_user_from_b;');
+ PREPARE back_up_sql17_1 FROM @backUpSql17_1;
+ EXECUTE back_up_sql17_1;
+ DEALLOCATE PREPARE back_up_sql17_1;
+ set @backUpSql18_1 = concat('insert into wx_c_user_from_b',@mergeSuffix,' select * from wx_c_user_from_b',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql18_1 FROM @backUpSql18_1;
+ EXECUTE back_up_sql18_1;
+ DEALLOCATE PREPARE back_up_sql18_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_from_b表备份、处理数据成功',null);
+
+ set @backUpSql19_0 = concat('create table wx_activity_join',@backUpSuffix,' like wx_activity_join;');
+ PREPARE back_up_sql19_0 FROM @backUpSql19_0;
+ EXECUTE back_up_sql19_0;
+ DEALLOCATE PREPARE back_up_sql19_0;
+ set @backUpSql20_0 = concat('insert into wx_activity_join',@backUpSuffix,' select * from wx_activity_join where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql20_0 FROM @backUpSql20_0;
+ EXECUTE back_up_sql20_0;
+ DEALLOCATE PREPARE back_up_sql20_0;
+
+ set @backUpSql19_1 = concat('create table wx_activity_join',@mergeSuffix,' like wx_activity_join;');
+ PREPARE back_up_sql19_1 FROM @backUpSql19_1;
+ EXECUTE back_up_sql19_1;
+ DEALLOCATE PREPARE back_up_sql19_1;
+ set @backUpSql20_1 = concat('insert into wx_activity_join',@mergeSuffix,' select * from wx_activity_join',@backUpSuffix,' where user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql20_1 FROM @backUpSql20_1;
+ EXECUTE back_up_sql20_1;
+ DEALLOCATE PREPARE back_up_sql20_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_activity_join表备份、处理数据成功',null);
+
+ set @backUpSql21_0 = concat('create table wx_question_log',@backUpSuffix,' like wx_question_log;');
+ PREPARE back_up_sql21_0 FROM @backUpSql21_0;
+ EXECUTE back_up_sql21_0;
+ DEALLOCATE PREPARE back_up_sql21_0;
+ set @backUpSql22_0 = concat('insert into wx_question_log',@backUpSuffix,' select * from wx_question_log where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql22_0 FROM @backUpSql22_0;
+ EXECUTE back_up_sql22_0;
+ DEALLOCATE PREPARE back_up_sql22_0;
+
+ set @backUpSql21_1 = concat('create table wx_question_log',@mergeSuffix,' like wx_question_log;');
+ PREPARE back_up_sql21_1 FROM @backUpSql21_1;
+ EXECUTE back_up_sql21_1;
+ DEALLOCATE PREPARE back_up_sql21_1;
+ set @backUpSql22_1 = concat('insert into wx_question_log',@mergeSuffix,' select * from wx_question_log',@backUpSuffix,' where user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql22_1 FROM @backUpSql22_1;
+ EXECUTE back_up_sql22_1;
+ DEALLOCATE PREPARE back_up_sql22_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_question_log表备份、处理数据成功',null);
+
+ set @backUpSql23_0 = concat('create table wx_game_action_log',@backUpSuffix,' like wx_game_action_log;');
+ PREPARE back_up_sql23_0 FROM @backUpSql23_0;
+ EXECUTE back_up_sql23_0;
+ DEALLOCATE PREPARE back_up_sql23_0;
+ set @backUpSql24_0 = concat('insert into wx_game_action_log',@backUpSuffix,' select * from wx_game_action_log where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql24_0 FROM @backUpSql24_0;
+ EXECUTE back_up_sql24_0;
+ DEALLOCATE PREPARE back_up_sql24_0;
+
+ set @backUpSql23_1 = concat('create table wx_game_action_log',@mergeSuffix,' like wx_game_action_log;');
+ PREPARE back_up_sql23_1 FROM @backUpSql23_1;
+ EXECUTE back_up_sql23_1;
+ DEALLOCATE PREPARE back_up_sql23_1;
+ set @backUpSql24_1 = concat('insert into wx_game_action_log',@mergeSuffix,' select * from wx_game_action_log',@backUpSuffix,' where user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql24_1 FROM @backUpSql24_1;
+ EXECUTE back_up_sql24_1;
+ DEALLOCATE PREPARE back_up_sql24_1;
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_game_action_log表备份、处理数据成功',null);
-CREATE TABLE `zz_middle_uu` (
- `datestr` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+ set @backUpSql25_0 = concat('create table wx_credit_history',@backUpSuffix,' like wx_credit_history;');
+ PREPARE back_up_sql25_0 FROM @backUpSql25_0;
+ EXECUTE back_up_sql25_0;
+ DEALLOCATE PREPARE back_up_sql25_0;
+ set @backUpSql26_0 = concat('insert into wx_credit_history',@backUpSuffix,' select * from wx_credit_history where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql26_0 FROM @backUpSql26_0;
+ EXECUTE back_up_sql26_0;
+ DEALLOCATE PREPARE back_up_sql26_0;
+
+ set @backUpSql25_0 = concat('create table wx_credit_history',@mergeSuffix,' like wx_credit_history;');
+ PREPARE back_up_sql25_0 FROM @backUpSql25_0;
+ EXECUTE back_up_sql25_0;
+ DEALLOCATE PREPARE back_up_sql25_0;
+ set @backUpSql26_0 = concat('insert into wx_credit_history',@mergeSuffix,' select * from wx_credit_history',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,') or operator_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql26_0 FROM @backUpSql26_0;
+ EXECUTE back_up_sql26_0;
+ DEALLOCATE PREPARE back_up_sql26_0;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_credit_history表备份、处理数据成功',null);
+
+ set @backUpSql27_0 = concat('create table wx_score_history',@backUpSuffix,' like wx_score_history;');
+ PREPARE back_up_sql27_0 FROM @backUpSql27_0;
+ EXECUTE back_up_sql27_0;
+ DEALLOCATE PREPARE back_up_sql27_0;
+ set @backUpSql28_0 = concat('insert into wx_score_history',@backUpSuffix,' select * from wx_score_history where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql28_0 FROM @backUpSql28_0;
+ EXECUTE back_up_sql28_0;
+ DEALLOCATE PREPARE back_up_sql28_0;
+
+ set @backUpSql27_1 = concat('create table wx_score_history',@mergeSuffix,' like wx_score_history;');
+ PREPARE back_up_sql27_1 FROM @backUpSql27_1;
+ EXECUTE back_up_sql27_1;
+ DEALLOCATE PREPARE back_up_sql27_1;
+ set @backUpSql28_1 = concat('insert into wx_score_history',@mergeSuffix,' select * from wx_score_history',@backUpSuffix,' where c_user_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql28_1 FROM @backUpSql28_1;
+ EXECUTE back_up_sql28_1;
+ DEALLOCATE PREPARE back_up_sql28_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_score_history表备份、处理数据成功',null);
+
+ set @backUpSql29_0 = concat('create table wx_card_spend',@backUpSuffix,' like wx_card_spend;');
+ PREPARE back_up_sql29_0 FROM @backUpSql29_0;
+ EXECUTE back_up_sql29_0;
+ DEALLOCATE PREPARE back_up_sql29_0;
+ set @backUpSql30_0 = concat('insert into wx_card_spend',@backUpSuffix,' select * from wx_card_spend where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql30_0 FROM @backUpSql30_0;
+ EXECUTE back_up_sql30_0;
+ DEALLOCATE PREPARE back_up_sql30_0;
+
+ set @backUpSql29_1 = concat('create table wx_card_spend',@mergeSuffix,' like wx_card_spend;');
+ PREPARE back_up_sql29_1 FROM @backUpSql29_1;
+ EXECUTE back_up_sql29_1;
+ DEALLOCATE PREPARE back_up_sql29_1;
+ set @backUpSql30_1 = concat('insert into wx_card_spend',@mergeSuffix,' select * from wx_card_spend',@backUpSuffix,' where owner_id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql30_1 FROM @backUpSql30_1;
+ EXECUTE back_up_sql30_1;
+ DEALLOCATE PREPARE back_up_sql30_1;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_card_spend表备份、处理数据成功',null);
+
+ set @backUpSql31_0 = concat('create table wx_c_user_tags',@backUpSuffix,' like wx_c_user_tags;');
+ PREPARE back_up_sql31_0 FROM @backUpSql31_0;
+ EXECUTE back_up_sql31_0;
+ DEALLOCATE PREPARE back_up_sql31_0;
+ set @backUpSql32_0 = concat('insert into wx_c_user_tags',@backUpSuffix,' select * from wx_c_user_tags where FIND_IN_SET(tenant_id,\'',tenantIds,'\');');
+ PREPARE back_up_sql32_0 FROM @backUpSql32_0;
+ EXECUTE back_up_sql32_0;
+ DEALLOCATE PREPARE back_up_sql32_0;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_tags表备份、处理数据成功','无关键SQL操作');
+
+ set @handleSql_00 = concat('CREATE TABLE `wx_c_user_basic_info_middle',@mergeSuffix,'` (
`new_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`old_user_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
@@ -63,72 +354,302 @@ CREATE TABLE `zz_middle_uu` (
`sum_credit` int(11) DEFAULT NULL,
`sum_login_count` int(11) DEFAULT NULL,
UNIQUE INDEX `new_user_id`(`new_user_id`) USING BTREE,
- UNIQUE INDEX `old_user_id`(`old_user_id`) USING BTREE,
- UNIQUE INDEX `001`(`new_user_id`) USING BTREE,
- UNIQUE INDEX `002`(`old_user_id`) USING BTREE,
- INDEX `new_user_id_2`(`new_user_id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
+ UNIQUE INDEX `old_user_id`(`old_user_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;');
+ PREPARE handle_sql_00 FROM @handleSql_00;
+ EXECUTE handle_sql_00;
+ DEALLOCATE PREPARE handle_sql_00;
-/*处理手机号重复的数据**/
-INSERT INTO zz_middle_uu(phone,tenant_ids,user_ids,sum_poins,sum_credit,sum_login_count) SELECT phone,CONCAT(',',GROUP_CONCAT(final_tenant_id),','),GROUP_CONCAT(id),SUM(poins),SUM(credit),SUM(login_count) FROM wx_c_user_basic_info_1008_1020 GROUP BY phone;
---取第一个作为新的user_id
-UPDATE zz_middle_uu SET new_user_id = SUBSTRING_INDEX(user_ids,',',1);
+ set @handleSql_01 = concat('insert into wx_c_user_basic_info_middle',@mergeSuffix,' (phone,tenant_ids,user_ids,sum_poins,sum_credit,sum_login_count) select phone,CONCAT(\',\',GROUP_CONCAT(final_tenant_id),\',\'),GROUP_CONCAT(id),SUM(poins),SUM(credit),SUM(login_count) from wx_c_user_basic_info',@mergeSuffix,' GROUP BY phone;');
+ PREPARE handle_sql_01 FROM @handleSql_01;
+ EXECUTE handle_sql_01;
+ DEALLOCATE PREPARE handle_sql_01;
-UPDATE zz_middle_uu SET old_user_id = SUBSTRING_INDEX(user_ids,CONCAT(new_user_id,','),-1);
+ set @handleSql_02 = concat('UPDATE wx_c_user_basic_info_middle',@mergeSuffix,' SET new_user_id = SUBSTRING_INDEX(user_ids,\',\',1);');
+ PREPARE handle_sql_02 FROM @handleSql_02;
+ EXECUTE handle_sql_02;
+ DEALLOCATE PREPARE handle_sql_02;
+ set @handleSql_03 = concat('UPDATE wx_c_user_basic_info_middle',@mergeSuffix,' SET old_user_id = SUBSTRING_INDEX(user_ids,CONCAT(new_user_id,\',\'),-1);');
+ PREPARE handle_sql_03 FROM @handleSql_03;
+ EXECUTE handle_sql_03;
+ DEALLOCATE PREPARE handle_sql_03;
---处理重复手机号数据
- UPDATE wx_c_user a LEFT JOIN zz_middle_uu b on a.user_id=b.old_user_id
- SET a.token = null,a.expire_time=now(),a.user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_activity_join a LEFT JOIN zz_middle_uu b on a.user_id=b.old_user_id
- SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_game_action_log a LEFT JOIN zz_middle_uu b on a.user_id=b.old_user_id
- SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_order_group a LEFT JOIN zz_middle_uu b on a.user_id=b.old_user_id
- SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_order_press a LEFT JOIN zz_middle_uu b on a.user_id=b.old_user_id
- SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_question_log a LEFT JOIN zz_middle_uu b on a.user_id=b.old_user_id
- SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_basic_info_middle所有会员重复数据整理成功','无关键SQL操作');
- UPDATE wx_c_user_from_b a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_coupon_order a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_credit_history a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_order a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_pay_order a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_refund_order a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_score_history a LEFT JOIN zz_middle_uu b on a.c_user_id=b.old_user_id
- SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;
+ set @handleSql_10 = concat('UPDATE wx_c_user',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.user_id,b.old_user_id) SET a.token = null,a.expire_time=now(),a.user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_10 FROM @handleSql_10;
+ EXECUTE handle_sql_10;
+ DEALLOCATE PREPARE handle_sql_10;
- UPDATE wx_card_spend a LEFT JOIN zz_middle_uu b on a.owner_id=b.old_user_id
- SET a.owner_id = b.new_user_id WHERE b.new_user_id is not null;
- UPDATE wx_coupon_order a LEFT JOIN zz_middle_uu b on a.owner_id=b.old_user_id
- SET a.owner_id = b.new_user_id WHERE b.new_user_id is not null;
+ set @backUpSql3 = concat('delete from wx_c_user where id in (select id from wx_c_user',@mergeSuffix,');');
+ PREPARE back_up_sql3 FROM @backUpSql3;
+ EXECUTE back_up_sql3;
+ DEALLOCATE PREPARE back_up_sql3;
+ set @handleSql_11 = concat('insert into wx_c_user select * from wx_c_user',@mergeSuffix,';');
+ PREPARE handle_sql_11 FROM @handleSql_11;
+ EXECUTE handle_sql_11;
+ DEALLOCATE PREPARE handle_sql_11;
- UPDATE wx_credit_history a LEFT JOIN zz_middle_uu b on a.operator_id=b.old_user_id
- SET a.operator_id = b.new_user_id WHERE b.new_user_id is not null AND a.operator_type in (1,2);
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user表所有会员重复关联数据处理成功',concat(@backUpSql3,@handleSql_11));
+ set @handleSql_20 = concat('UPDATE wx_order',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_20 FROM @handleSql_20;
+ EXECUTE handle_sql_20;
+ DEALLOCATE PREPARE handle_sql_20;
- UPDATE wx_c_user_basic_info a LEFT JOIN zz_middle_uu b on a.id = b.new_user_id
- SET a.tenant_id = b.tenant_ids,a.poins = b.sum_poins,a.credit = b.sum_credit,a.login_count = b.sum_login_count
- WHERE b.new_user_id is not null;
+ set @backUpSql5 = concat('delete from wx_order where id in (select id from wx_order',@mergeSuffix,');');
+ PREPARE back_up_sql5 FROM @backUpSql5;
+ EXECUTE back_up_sql5;
+ DEALLOCATE PREPARE back_up_sql5;
+ set @handleSql_21 = concat('insert into wx_order select * from wx_order',@mergeSuffix,';');
+ PREPARE handle_sql_21 FROM @handleSql_21;
+ EXECUTE handle_sql_21;
+ DEALLOCATE PREPARE handle_sql_21;
- UPDATE wx_c_user_basic_info a LEFT JOIN zz_middle_uu b on a.id=b.old_user_id
- SET a.phone = concat(a.phone,'_del_',@dateStr),a.`status` = 1 WHERE b.old_user_id is not null;
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_order表所有会员重复关联数据处理成功',concat(@backUpSql5,@handleSql_21));
+ set @handleSql_30 = concat('UPDATE wx_coupon_order',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_30 FROM @handleSql_30;
+ EXECUTE handle_sql_30;
+ DEALLOCATE PREPARE handle_sql_30;
+ set @handleSql_31 = concat('UPDATE wx_coupon_order',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.owner_id,b.old_user_id)
+ SET a.owner_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_31 FROM @handleSql_31;
+ EXECUTE handle_sql_31;
+ DEALLOCATE PREPARE handle_sql_31;
+ set @backUpSql7 = concat('delete from wx_coupon_order where id in (select id from wx_coupon_order',@mergeSuffix,');');
+ PREPARE back_up_sql7 FROM @backUpSql7;
+ EXECUTE back_up_sql7;
+ DEALLOCATE PREPARE back_up_sql7;
+ set @handleSql_32 = concat('insert into wx_coupon_order select * from wx_coupon_order',@mergeSuffix,';');
+ PREPARE handle_sql_32 FROM @handleSql_32;
+ EXECUTE handle_sql_32;
+ DEALLOCATE PREPARE handle_sql_32;
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_coupon_order表所有会员重复关联数据处理成功',concat(@backUpSql7,@handleSql_32));
+ set @handleSql_40 = concat('UPDATE wx_pay_order',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_40 FROM @handleSql_40;
+ EXECUTE handle_sql_40;
+ DEALLOCATE PREPARE handle_sql_40;
+ set @backUpSql9 = concat('delete from wx_pay_order where id in (select id from wx_pay_order',@mergeSuffix,');');
+ PREPARE back_up_sql9 FROM @backUpSql9;
+ EXECUTE back_up_sql9;
+ DEALLOCATE PREPARE back_up_sql9;
+ set @handleSql_41 = concat('insert into wx_pay_order select * from wx_pay_order',@mergeSuffix,';');
+ PREPARE handle_sql_41 FROM @handleSql_41;
+ EXECUTE handle_sql_41;
+ DEALLOCATE PREPARE handle_sql_41;
---单独处理 wx_c_user_basic_info,wx_c_user_tags 归属集团
-UPDATE wx_c_user_basic_info SET final_tenant_id = groupTenantId WHERE FIND_IN_SET(final_tenant_id,tenantIds);
-UPDATE wx_c_user_tags SET tenant_id = groupTenantId WHERE FIND_IN_SET(tenant_id,tenantIds);
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_pay_order表所有会员重复关联数据处理成功',concat(@backUpSql9,@handleSql_41));
+
+ set @handleSql_50 = concat('UPDATE wx_refund_order',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_50 FROM @handleSql_50;
+ EXECUTE handle_sql_50;
+ DEALLOCATE PREPARE handle_sql_50;
+
+ set @backUpSql11 = concat('delete from wx_refund_order where id in (select id from wx_refund_order',@mergeSuffix,');');
+ PREPARE back_up_sql11 FROM @backUpSql11;
+ EXECUTE back_up_sql11;
+ DEALLOCATE PREPARE back_up_sql11;
+ set @handleSql_51 = concat('insert into wx_refund_order select * from wx_refund_order',@mergeSuffix,';');
+ PREPARE handle_sql_51 FROM @handleSql_51;
+ EXECUTE handle_sql_51;
+ DEALLOCATE PREPARE handle_sql_51;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_refund_order表所有会员重复关联数据处理成功',concat(@backUpSql11,@handleSql_51));
+
+ set @handleSql_60 = concat('UPDATE wx_order_group',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.user_id,b.old_user_id)
+ SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_60 FROM @handleSql_60;
+ EXECUTE handle_sql_60;
+ DEALLOCATE PREPARE handle_sql_60;
+
+ set @backUpSql13 = concat('delete from wx_order_group where id in (select id from wx_order_group',@mergeSuffix,');');
+ PREPARE back_up_sql13 FROM @backUpSql13;
+ EXECUTE back_up_sql13;
+ DEALLOCATE PREPARE back_up_sql13;
+ set @handleSql_61 = concat('insert into wx_order_group select * from wx_order_group',@mergeSuffix,';');
+ PREPARE handle_sql_61 FROM @handleSql_61;
+ EXECUTE handle_sql_61;
+ DEALLOCATE PREPARE handle_sql_61;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_order_group表所有会员重复关联数据处理成功',concat(@backUpSql13,@handleSql_61));
+
+ set @handleSql_70 = concat('UPDATE wx_order_press',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.user_id,b.old_user_id)
+ SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_70 FROM @handleSql_70;
+ EXECUTE handle_sql_70;
+ DEALLOCATE PREPARE handle_sql_70;
+
+ set @backUpSql15 = concat('delete from wx_order_press where id in (select id from wx_order_press',@mergeSuffix,');');
+ PREPARE back_up_sql15 FROM @backUpSql15;
+ EXECUTE back_up_sql15;
+ DEALLOCATE PREPARE back_up_sql15;
+ set @handleSql_71 = concat('insert into wx_order_press select * from wx_order_press',@mergeSuffix,';');
+ PREPARE handle_sql_71 FROM @handleSql_71;
+ EXECUTE handle_sql_71;
+ DEALLOCATE PREPARE handle_sql_71;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_order_press表所有会员重复关联数据处理成功',concat(@backUpSql15,@handleSql_71));
+
+ set @handleSql_80 = concat('UPDATE wx_c_user_from_b',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_80 FROM @handleSql_80;
+ EXECUTE handle_sql_80;
+ DEALLOCATE PREPARE handle_sql_80;
+
+ set @backUpSql17 = concat('delete from wx_c_user_from_b where id in (select id from wx_c_user_from_b',@mergeSuffix,');');
+ PREPARE back_up_sql17 FROM @backUpSql17;
+ EXECUTE back_up_sql17;
+ DEALLOCATE PREPARE back_up_sql17;
+ set @handleSql_81 = concat('insert into wx_c_user_from_b select * from wx_c_user_from_b',@mergeSuffix,';');
+ PREPARE handle_sql_81 FROM @handleSql_81;
+ EXECUTE handle_sql_81;
+ DEALLOCATE PREPARE handle_sql_81;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_from_b表所有会员重复关联数据处理成功',concat(@backUpSql17,@handleSql_81));
+
+ set @handleSql_90 = concat('UPDATE wx_activity_join',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.user_id,b.old_user_id)
+ SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_90 FROM @handleSql_90;
+ EXECUTE handle_sql_90;
+ DEALLOCATE PREPARE handle_sql_90;
+
+ set @backUpSql19 = concat('delete from wx_activity_join where id in (select id from wx_activity_join',@mergeSuffix,');');
+ PREPARE back_up_sql19 FROM @backUpSql19;
+ EXECUTE back_up_sql19;
+ DEALLOCATE PREPARE back_up_sql19;
+ set @handleSql_91 = concat('insert into wx_activity_join select * from wx_activity_join',@mergeSuffix,';');
+ PREPARE handle_sql_91 FROM @handleSql_91;
+ EXECUTE handle_sql_91;
+ DEALLOCATE PREPARE handle_sql_91;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_activity_join表所有会员重复关联数据处理成功',concat(@backUpSql19,@handleSql_91));
+
+ set @handleSql_100 = concat('UPDATE wx_question_log',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.user_id,b.old_user_id)
+ SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_100 FROM @handleSql_100;
+ EXECUTE handle_sql_100;
+ DEALLOCATE PREPARE handle_sql_100;
+
+ set @backUpSql21 = concat('delete from wx_question_log where id in (select id from wx_question_log',@mergeSuffix,');');
+ PREPARE back_up_sql21 FROM @backUpSql21;
+ EXECUTE back_up_sql21;
+ DEALLOCATE PREPARE back_up_sql21;
+ set @handleSql_101 = concat('insert into wx_question_log select * from wx_question_log',@mergeSuffix,';');
+ PREPARE handle_sql_101 FROM @handleSql_101;
+ EXECUTE handle_sql_101;
+ DEALLOCATE PREPARE handle_sql_101;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_question_log表所有会员重复关联数据处理成功',concat(@backUpSql21,@handleSql_101));
+
+ set @handleSql_110 = concat('UPDATE wx_game_action_log',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.user_id,b.old_user_id)
+ SET a.user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_110 FROM @handleSql_110;
+ EXECUTE handle_sql_110;
+ DEALLOCATE PREPARE handle_sql_110;
+
+ set @backUpSql23 = concat('delete from wx_game_action_log where id in (select id from wx_game_action_log',@mergeSuffix,');');
+ PREPARE back_up_sql23 FROM @backUpSql23;
+ EXECUTE back_up_sql23;
+ DEALLOCATE PREPARE back_up_sql23;
+ set @handleSql_111 = concat('insert into wx_game_action_log select * from wx_game_action_log',@mergeSuffix,';');
+ PREPARE handle_sql_111 FROM @handleSql_111;
+ EXECUTE handle_sql_111;
+ DEALLOCATE PREPARE handle_sql_111;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_game_action_log表所有会员重复关联数据处理成功',concat(@backUpSql23,@handleSql_111));
+
+ set @handleSql_120 = concat('UPDATE wx_credit_history',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_120 FROM @handleSql_120;
+ EXECUTE handle_sql_120;
+ DEALLOCATE PREPARE handle_sql_120;
+ set @handleSql_121 = concat('UPDATE wx_credit_history',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.operator_id,b.old_user_id)
+ SET a.operator_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_121 FROM @handleSql_121;
+ EXECUTE handle_sql_121;
+ DEALLOCATE PREPARE handle_sql_121;
+
+ set @backUpSql25 = concat('delete from wx_credit_history where id in (select id from wx_credit_history',@mergeSuffix,');');
+ PREPARE back_up_sql25 FROM @backUpSql25;
+ EXECUTE back_up_sql25;
+ DEALLOCATE PREPARE back_up_sql25;
+ set @handleSql_122 = concat('insert into wx_credit_history select * from wx_credit_history',@mergeSuffix,';');
+ PREPARE handle_sql_122 FROM @handleSql_122;
+ EXECUTE handle_sql_122;
+ DEALLOCATE PREPARE handle_sql_122;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_credit_history表所有会员重复关联数据处理成功',concat(@backUpSql25,@handleSql_122));
+
+ set @handleSql_130 = concat('UPDATE wx_score_history',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.c_user_id,b.old_user_id)
+ SET a.c_user_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_130 FROM @handleSql_130;
+ EXECUTE handle_sql_130;
+ DEALLOCATE PREPARE handle_sql_130;
+
+ set @backUpSql27 = concat('delete from wx_score_history where id in (select id from wx_score_history',@mergeSuffix,');');
+ PREPARE back_up_sql27 FROM @backUpSql27;
+ EXECUTE back_up_sql27;
+ DEALLOCATE PREPARE back_up_sql27;
+ set @handleSql_131 = concat('insert into wx_score_history select * from wx_score_history',@mergeSuffix,';');
+ PREPARE handle_sql_131 FROM @handleSql_131;
+ EXECUTE handle_sql_131;
+ DEALLOCATE PREPARE handle_sql_131;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_score_history表所有会员重复关联数据处理成功',concat(@backUpSql27,@handleSql_131));
+
+ set @handleSql_140 = concat('UPDATE wx_card_spend',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.owner_id,b.old_user_id)
+ SET a.owner_id = b.new_user_id WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_140 FROM @handleSql_140;
+ EXECUTE handle_sql_140;
+ DEALLOCATE PREPARE handle_sql_140;
+
+ set @backUpSql29 = concat('delete from wx_card_spend where id in (select id from wx_card_spend',@mergeSuffix,');');
+ PREPARE back_up_sql29 FROM @backUpSql29;
+ EXECUTE back_up_sql29;
+ DEALLOCATE PREPARE back_up_sql29;
+ set @handleSql_141 = concat('insert into wx_card_spend select * from wx_card_spend',@mergeSuffix,';');
+ PREPARE handle_sql_141 FROM @handleSql_141;
+ EXECUTE handle_sql_141;
+ DEALLOCATE PREPARE handle_sql_141;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_card_spend表所有会员重复关联数据处理成功',concat(@backUpSql29,@handleSql_141));
+
+ set @handleSql_150 = concat('UPDATE wx_c_user_basic_info',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on a.id = b.new_user_id SET a.tenant_id = b.tenant_ids,a.poins = b.sum_poins,a.credit = b.sum_credit,a.login_count = b.sum_login_count WHERE b.new_user_id is not null;');
+ PREPARE handle_sql_150 FROM @handleSql_150;
+ EXECUTE handle_sql_150;
+ DEALLOCATE PREPARE handle_sql_150;
+ set @handleSql_151 = concat('UPDATE wx_c_user_basic_info',@mergeSuffix,' a LEFT JOIN wx_c_user_basic_info_middle',@mergeSuffix,' b on FIND_IN_SET(a.id,b.old_user_id) SET a.phone = concat(a.phone,\'_del_\',date_format(now(),\'%Y%m%d%H%m%s\')),a.`status` = 1 WHERE b.old_user_id is not null;');
+ PREPARE handle_sql_151 FROM @handleSql_151;
+ EXECUTE handle_sql_151;
+ DEALLOCATE PREPARE handle_sql_151;
+
+ set @backUpSql1 = concat('delete from wx_c_user_basic_info where id in (select id from wx_c_user_basic_info',@mergeSuffix,');');
+ PREPARE back_up_sql1 FROM @backUpSql1;
+ EXECUTE back_up_sql1;
+ DEALLOCATE PREPARE back_up_sql1;
+ set @handleSql_152 = concat('insert into wx_c_user_basic_info select * from wx_c_user_basic_info',@mergeSuffix,';');
+ PREPARE handle_sql_152 FROM @handleSql_152;
+ EXECUTE handle_sql_152;
+ DEALLOCATE PREPARE handle_sql_152;
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_basic_info表所有会员重复关联数据处理成功',concat(@backUpSql1,@handleSql_152));
+
+ UPDATE wx_c_user_basic_info SET final_tenant_id = groupTenantId WHERE FIND_IN_SET(final_tenant_id,tenantIds);
+ UPDATE wx_c_user_tags SET tenant_id = groupTenantId WHERE FIND_IN_SET(tenant_id,tenantIds);
+
+ INSERT into zz_process_log VALUES(NOW(),'back_up()','wx_c_user_basic_info表会员归属集团修改成功',concat('UPDATE wx_c_user_basic_info SET final_tenant_id = ',groupTenantId,' WHERE FIND_IN_SET(final_tenant_id,',tenantIds,');'));
+
+ SELECT * from zz_process_log;
+END
diff --git a/mallinkAdmin/src/main/resources/tessdata/configs/api_config b/mallinkAdmin/src/main/resources/tessdata/configs/api_config
new file mode 100644
index 000000000..5cd6ec031
--- /dev/null
+++ b/mallinkAdmin/src/main/resources/tessdata/configs/api_config
@@ -0,0 +1 @@
+tessedit_zero_rejection T
diff --git a/mallinkAdmin/src/main/resources/tessdata/configs/digits b/mallinkAdmin/src/main/resources/tessdata/configs/digits
new file mode 100644
index 000000000..6a329f892
--- /dev/null
+++ b/mallinkAdmin/src/main/resources/tessdata/configs/digits
@@ -0,0 +1 @@
+tessedit_char_whitelist 0123456789-.
diff --git a/mallinkAdmin/src/main/resources/tessdata/configs/hocr b/mallinkAdmin/src/main/resources/tessdata/configs/hocr
new file mode 100644
index 000000000..72f83e89c
--- /dev/null
+++ b/mallinkAdmin/src/main/resources/tessdata/configs/hocr
@@ -0,0 +1 @@
+tessedit_create_hocr 1
\ No newline at end of file
diff --git a/mallinkAdmin/src/main/resources/tessdata/eng.traineddata b/mallinkAdmin/src/main/resources/tessdata/eng.traineddata
new file mode 100644
index 000000000..9f4704c9c
Binary files /dev/null and b/mallinkAdmin/src/main/resources/tessdata/eng.traineddata differ
diff --git a/mallinkAdmin/src/main/resources/tessdata/osd.traineddata b/mallinkAdmin/src/main/resources/tessdata/osd.traineddata
new file mode 100644
index 000000000..527457ca8
Binary files /dev/null and b/mallinkAdmin/src/main/resources/tessdata/osd.traineddata differ
diff --git a/mallinkAdmin/src/main/resources/tessdata/pdf.ttf b/mallinkAdmin/src/main/resources/tessdata/pdf.ttf
new file mode 100644
index 000000000..eb359b313
Binary files /dev/null and b/mallinkAdmin/src/main/resources/tessdata/pdf.ttf differ
diff --git a/mallinkAdmin/src/main/resources/tessdata/pdf.ttx b/mallinkAdmin/src/main/resources/tessdata/pdf.ttx
new file mode 100644
index 000000000..c6db1c8e9
--- /dev/null
+++ b/mallinkAdmin/src/main/resources/tessdata/pdf.ttx
@@ -0,0 +1,793 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+