Commit a1f4ac15 authored by 郝彦辉's avatar 郝彦辉

检测tidb的call_record表数据是否有重复数据工具

parent 8b2ffc20
......@@ -794,6 +794,7 @@ public class CleanningTransactionLogService {
for (int i = 0; i < tidbCallRecordCFList.size(); i++) {
//ee86810a076d45d58a5d87d7cfc60e8f,032f14da-b905-4a1c-9c38-9db3dd0b1304,ZhiChengAFuAntiFraud,1004,2019-12-24 21:48:53
log.info("删除重复数据ST:"+i);
String[] arry = tidbCallRecordCFList.get(i).trim().split(",");
Stopwatch callRStopwatch = Stopwatch.createStarted();
......@@ -817,10 +818,10 @@ public class CleanningTransactionLogService {
String sql = DELETE_CALL_SQL.replace("##ID##", ""+bean1.getId());
sql = sql.replace("##TRANSACTION_ID##", bean1.getTransactionId());
try {
FileUtils.write(new File(bakFileName), JSON.toJSONString(bean1)+"\r\n", "UTF-8", true);
int update =tidbRiskJdbcTemplate.update(sql);
log.info("删除bean1成功, sql: {} ,update: {} ",sql,update);
FileUtils.write(new File(bakFileName), JSON.toJSONString(bean1)+"\r\n", "UTF-8", true);
} catch (IOException e) {
} catch (Exception e) {
log.error("删除bean1数据是不, sql: {} ",sql, e);
}
......@@ -831,10 +832,10 @@ public class CleanningTransactionLogService {
String sql = DELETE_CALL_SQL.replace("##ID##", ""+bean2.getId());
sql = sql.replace("##TRANSACTION_ID##", bean2.getTransactionId());
try {
FileUtils.write(new File(bakFileName), JSON.toJSONString(bean2)+"\r\n", "UTF-8", true);
int update = tidbRiskJdbcTemplate.update(sql);
log.info("删除bean2成功, sql: {} , update: {} ",sql,update);
FileUtils.write(new File(bakFileName), JSON.toJSONString(bean2)+"\r\n", "UTF-8", true);
} catch (IOException e) {
} catch (Exception e) {
log.error("删除bean2数据是不, sql: {} ",sql, e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment