Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-platform
Commits
923f9a08
Commit
923f9a08
authored
Nov 30, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
清数据新增用户中心几张表
parent
0ccc8d66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
ClearDataController.java
.../cn/qg/qaplatform/controller/yxm/ClearDataController.java
+24
-0
No files found.
src/main/java/cn/qg/qaplatform/controller/yxm/ClearDataController.java
View file @
923f9a08
...
@@ -63,6 +63,7 @@ public class ClearDataController {
...
@@ -63,6 +63,7 @@ public class ClearDataController {
jdbcTemplate
.
execute
(
"DELETE FROM `t_ka_process_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `t_ka_process_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `t_coupon_user` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `t_coupon_user` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `t_comment_info` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `t_comment_info` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `t_after_service_apply` WHERE user_id = "
+
userId
);
log
.
info
(
"开始删除{}环境{}用户vcc_talos中的数据!"
,
namespace
,
phoneNo
);
log
.
info
(
"开始删除{}环境{}用户vcc_talos中的数据!"
,
namespace
,
phoneNo
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_talos"
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_talos"
);
...
@@ -76,6 +77,9 @@ public class ClearDataController {
...
@@ -76,6 +77,9 @@ public class ClearDataController {
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `msg_record` WHERE phone_no = '%s'"
,
phoneNo
));
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `msg_record` WHERE phone_no = '%s'"
,
phoneNo
));
jdbcTemplate
.
execute
(
"DELETE FROM `order_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `order_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `trade_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `trade_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `shandong_summary` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `trade_contract_record` WHERE user_id = "
+
userId
);
log
.
info
(
"开始删除{}环境{}用户acsdb中的数据!"
,
namespace
,
phoneNo
);
log
.
info
(
"开始删除{}环境{}用户acsdb中的数据!"
,
namespace
,
phoneNo
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"acsdb"
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"acsdb"
);
...
@@ -83,6 +87,7 @@ public class ClearDataController {
...
@@ -83,6 +87,7 @@ public class ClearDataController {
jdbcTemplate
.
execute
(
"DELETE FROM `acs_bill` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_bill` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_cash_account` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_cash_account` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_cash_account_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_cash_account_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_cash_back_task` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_commodity` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_commodity` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `acs_customer` WHERE uuid = '%s'"
,
uuid
));
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `acs_customer` WHERE uuid = '%s'"
,
uuid
));
jdbcTemplate
.
execute
(
"DELETE FROM `acs_pay_order` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_pay_order` WHERE user_id = "
+
userId
);
...
@@ -90,19 +95,38 @@ public class ClearDataController {
...
@@ -90,19 +95,38 @@ public class ClearDataController {
jdbcTemplate
.
execute
(
"DELETE FROM `acs_plan` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_plan` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `acs_sms` WHERE mobile_no = ''"
,
phoneNo
));
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `acs_sms` WHERE mobile_no = ''"
,
phoneNo
));
jdbcTemplate
.
execute
(
"DELETE FROM `acs_trans` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_trans` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_capital_loan_bill` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_capital_loan_bill_flow` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_capital_loan_bill_flow` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_capital_plan` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_compensatory_plan` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_coupon` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_limit` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `acs_limit_package` WHERE user_id = "
+
userId
);
log
.
info
(
"开始删除{}环境{}用户vcc_quota中的数据!"
,
namespace
,
phoneNo
);
log
.
info
(
"开始删除{}环境{}用户vcc_quota中的数据!"
,
namespace
,
phoneNo
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_quota"
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"vcc_quota"
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_locker` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_locker` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_log` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_log` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_record` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_quota_package` WHERE user_id = "
+
userId
);
log
.
info
(
"开始删除{}环境{}用户xyqb_user中的数据!"
,
namespace
,
phoneNo
);
log
.
info
(
"开始删除{}环境{}用户xyqb_user中的数据!"
,
namespace
,
phoneNo
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"xyqb_user"
);
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"xyqb_user"
);
List
<
Map
<
String
,
Object
>>
productLoginList
=
jdbcTemplate
.
queryForList
(
"SELECT * FROM `product_login` WHERE EXTENSION_ACCOUNT_ID = "
+
userId
);
for
(
Map
<
String
,
Object
>
productLogin:
productLoginList
)
{
String
customerId
=
productLogin
.
get
(
"CUSTOMER_ID"
).
toString
();
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `product_login` WHERE CUSTOMER_ID = '%s'"
,
customerId
));
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `customer_login` WHERE CUSTOMER_ID = '%s'"
,
customerId
));
jdbcTemplate
.
execute
(
String
.
format
(
"DELETE FROM `customer_info` WHERE CUSTOMER_ID = '%s'"
,
customerId
));
}
jdbcTemplate
.
execute
(
"DELETE FROM `user` WHERE id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user` WHERE id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_detail` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_detail` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `wechat_userinfo` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `wechat_userinfo` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `address` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `address` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `user_attached` WHERE user_id = "
+
userId
);
jdbcTemplate
.
execute
(
"DELETE FROM `contact` WHERE user_id = "
+
userId
);
return
Result
.
buildSuccessResult
(
String
.
format
(
"%s环境,用户%s数据清除成功"
,
namespace
,
phoneNo
),
true
);
return
Result
.
buildSuccessResult
(
String
.
format
(
"%s环境,用户%s数据清除成功"
,
namespace
,
phoneNo
),
true
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment