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

检测transaction_log重复工具

parent 7a5dd53e
......@@ -513,10 +513,10 @@ public class CleanningTransactionLogService {
for (int call = 0; call < queryResult.size(); call++) {
CallRecord1 callRecord1 = queryResult.get(call);
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(callRecord1.getCreated_at().getTime()));
String key = new StringBuffer(callRecord1.getTransactionId())
.append(StringUtils.isNotBlank(callRecord1.getUuid()) ? callRecord1.getUuid() : "")
.append(callRecord1.getUrlType())
.append(callRecord1.getCode())
String key = new StringBuffer(callRecord1.getTransactionId()).append(",")
.append(StringUtils.isNotBlank(callRecord1.getUuid()) ? callRecord1.getUuid() : "").append(",")
.append(callRecord1.getUrlType()).append(",")
.append(callRecord1.getCode()).append(",")
.append(format).toString();
if(callRecord1Map.containsKey(key)){
......@@ -585,10 +585,10 @@ public class CleanningTransactionLogService {
for (int call = 0; call < queryResult.size(); call++) {
TransactionLogPO callRecord1 = queryResult.get(call);
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(callRecord1.getTimeCreated());
String key = new StringBuffer(callRecord1.getTransactionId())
.append(StringUtils.isNotBlank(callRecord1.getUuid()) ? callRecord1.getUuid() : "")
.append(callRecord1.getUrlType())
.append(callRecord1.getCode())
String key = new StringBuffer(callRecord1.getTransactionId()).append(",")
.append(StringUtils.isNotBlank(callRecord1.getUuid()) ? callRecord1.getUuid() : "").append(",")
.append(callRecord1.getUrlType()).append(",")
.append(callRecord1.getCode()).append(",")
.append(format).toString();
if(callRecord1Map.containsKey(key)){
......
......@@ -2733,7 +2733,18 @@ public class ManualToolService implements CommonSuperService {
}
private static void buildSelectSql() {
List<String> oldD3ReqIdFileList = ReadOrWriteTxt.readTxtList("D:\\JavaTeam\\test\\transaction_call\\01_03\\cf_383.txt");
System.out.printf("开始,list Size="+oldD3ReqIdFileList.size());
for(String str:oldD3ReqIdFileList){
//599e2b99de5c4959890e65f302b810c9,5c536844-7c11-41de-ad77-6dce26115a5f,BaiRongSpecialList_c,1003,2018-10-20 00:00:00
String[] arry = str.trim().split(",");
String CALL_SQL = "select * from call_record where transaction_id ='" + arry[0] + "' and uuid ='" + arry[1] +"'"
+" and url_type ='" + arry[2] + "' and code ='" +arry[3]+ "' UNION ALL \n";
System.out.printf(CALL_SQL);
}
System.out.printf("结束,list Size="+oldD3ReqIdFileList.size());
}
public static void main(String[] args) {
......@@ -2806,10 +2817,10 @@ public class ManualToolService implements CommonSuperService {
//build_d2_1226();
//transaction_call();
transaction_call2();
//transaction_call2();
//transaction_call3();
buildSelectSql();
......
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