|
|
@ -47,6 +47,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import static me.zhengjie.modules.common.consts.SendBigDataConst.NON_FINISH_SEND_STATATUS;
|
|
|
|
import static me.zhengjie.modules.common.consts.SendBigDataConst.NON_FINISH_SEND_STATATUS;
|
|
|
|
import static me.zhengjie.modules.remoterec.consts.RemoteRecConst.SUCCESS_TAG;
|
|
|
|
import static me.zhengjie.modules.remoterec.consts.RemoteRecConst.SUCCESS_TAG;
|
|
|
|
|
|
|
|
import static me.zhengjie.modules.remoterec.consts.RemoteRecConst.WAIT_SUCCESS_TAG;
|
|
|
|
|
|
|
|
|
|
|
|
@Component
|
|
|
|
@Component
|
|
|
|
@Scope("prototype")
|
|
|
|
@Scope("prototype")
|
|
|
@ -126,6 +127,7 @@ public class SendBigDataTask {
|
|
|
|
|
|
|
|
|
|
|
|
if (remoteRecord.getId() != null){
|
|
|
|
if (remoteRecord.getId() != null){
|
|
|
|
RemoteRecordDto remoteRecordDto = remoteRecordService.findById(remoteRecord.getId());
|
|
|
|
RemoteRecordDto remoteRecordDto = remoteRecordService.findById(remoteRecord.getId());
|
|
|
|
|
|
|
|
waitSendSuccessRemoteRec(remoteRecordDto);
|
|
|
|
// 远程文件存储形式的源
|
|
|
|
// 远程文件存储形式的源
|
|
|
|
remoteCollect = getRemoteRecFromLocal(remoteRecordDto);
|
|
|
|
remoteCollect = getRemoteRecFromLocal(remoteRecordDto);
|
|
|
|
// 进行去重逻辑
|
|
|
|
// 进行去重逻辑
|
|
|
@ -139,6 +141,15 @@ public class SendBigDataTask {
|
|
|
|
// Collections.shuffle(collect);
|
|
|
|
// Collections.shuffle(collect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void waitSendSuccessRemoteRec(RemoteRecordDto remoteRecordDto) {
|
|
|
|
|
|
|
|
// 对发送后的状态进行更新
|
|
|
|
|
|
|
|
RemoteRecord remote = new RemoteRecord();
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(remoteRecordDto, remote);
|
|
|
|
|
|
|
|
remote.setTag(WAIT_SUCCESS_TAG);
|
|
|
|
|
|
|
|
remote.setWeight(5); // 把正在发送权重改成 5
|
|
|
|
|
|
|
|
remoteRecordService.update(remote);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void finishSendThenUpdateRec(BuildRecord resource, BuildRecordDto buildRecordDto, AtomicLong atomicLong) {
|
|
|
|
private void finishSendThenUpdateRec(BuildRecord resource, BuildRecordDto buildRecordDto, AtomicLong atomicLong) {
|
|
|
|
// 对发送后的状态进行更新
|
|
|
|
// 对发送后的状态进行更新
|
|
|
|
buildRecordDto.setIsSend(FINISH_SEND_TAG);
|
|
|
|
buildRecordDto.setIsSend(FINISH_SEND_TAG);
|
|
|
|