|
|
@ -62,7 +62,7 @@ public class SendBigDataTask {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 用于随机选的环境代替字符, 如果添加环境就进行自动添加
|
|
|
|
* 用于随机选的环境代替字符, 如果添加环境就进行自动添加
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static final String BASE_URL_CHAR_NUMBER = "123456";
|
|
|
|
public static final String BASE_URL_CHAR_NUMBER = "1234567";
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 下游发送url
|
|
|
|
* 下游发送url
|
|
|
@ -135,7 +135,10 @@ public class SendBigDataTask {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 过滤的集合
|
|
|
|
// 过滤的集合
|
|
|
|
Set<String> filterCollect = collect.stream().map(Tag::getUid).filter(fileLines::contains).collect(Collectors.toSet());
|
|
|
|
Set<String> filterCollect = collect.stream().map(Tag::getUid).filter(fileLines::contains).collect(Collectors.toSet());
|
|
|
|
collect = collect.stream().filter(one -> !filterCollect.contains(one.getUid())).collect(Collectors.toList());
|
|
|
|
if (CollectionUtil.isNotEmpty(filterCollect)){
|
|
|
|
|
|
|
|
log.info("================== [Filter collect is ready, collect size is {} ] ================================",filterCollect.size());
|
|
|
|
|
|
|
|
collect = collect.stream().filter(one -> !filterCollect.contains(one.getUid())).collect(Collectors.toList());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 乱序
|
|
|
|
// 乱序
|
|
|
|
// Collections.shuffle(collect);
|
|
|
|
// Collections.shuffle(collect);
|
|
|
@ -148,10 +151,20 @@ public class SendBigDataTask {
|
|
|
|
Long sendTotal = atomicLong.get();
|
|
|
|
Long sendTotal = atomicLong.get();
|
|
|
|
// 之前要进行校验
|
|
|
|
// 之前要进行校验
|
|
|
|
Long dbCount = buildRecordDto.getSendTotal();
|
|
|
|
Long dbCount = buildRecordDto.getSendTotal();
|
|
|
|
|
|
|
|
// 这个数字会不准确和最开始的记录可能有冲突,这边加一个统计校验
|
|
|
|
|
|
|
|
Long sendCountFromDB = tagService.countSendSum(Long.valueOf(id), FINISH_SEND_TAG);
|
|
|
|
if (dbCount == null){
|
|
|
|
if (dbCount == null){
|
|
|
|
dbCount = 0L;
|
|
|
|
dbCount = 0L;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildRecordDto.setSendTotal( sendTotal + dbCount);
|
|
|
|
if (sendCountFromDB == null){
|
|
|
|
|
|
|
|
sendCountFromDB = 0L;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Objects.equals((sendTotal + dbCount), sendCountFromDB)){
|
|
|
|
|
|
|
|
// 设置一个容错校验
|
|
|
|
|
|
|
|
buildRecordDto.setSendTotal(sendCountFromDB);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
buildRecordDto.setSendTotal(sendTotal + dbCount);
|
|
|
|
|
|
|
|
}
|
|
|
|
BeanUtil.copyProperties(buildRecordDto, buildRecord);
|
|
|
|
BeanUtil.copyProperties(buildRecordDto, buildRecord);
|
|
|
|
buildRecordService.update(buildRecord);
|
|
|
|
buildRecordService.update(buildRecord);
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|