异步方式修改

master
bynt 10 months ago
parent 51ef60e5b6
commit 3ef508b2d3

@ -122,9 +122,11 @@ public class DmpCallbackServiceImpl implements DmpCallbackService {
// 异步方式下载 // 异步方式下载
List<String> finalResponseList = responseList; List<String> finalResponseList = responseList;
CompletableFuture.runAsync(() -> downResource(bathNo, byTaskName, originalList, finalResponseList)); CompletableFuture.runAsync(() -> downResource(bathNo, byTaskName, originalList, finalResponseList));
deliveryRecordService.updateStatusByTaskName(DefaultNumberConstants.ONE_NUMBER, finalResponseList.size(), bathNo);
} }
if (byTaskName.getType() == DefaultNumberConstants.FOUR_NUMBER) { if (byTaskName.getType() == DefaultNumberConstants.FOUR_NUMBER) {
CompletableFuture.runAsync(() -> downReceptionResource(bathNo, byTaskName, originalList)); CompletableFuture.runAsync(() -> downReceptionResource(bathNo, byTaskName, originalList));
deliveryRecordService.updateStatusByTaskName(DefaultNumberConstants.ONE_NUMBER, originalList.size(), bathNo);
} }
} }
// 兑换结果失败也将结果返回 // 兑换结果失败也将结果返回
@ -197,7 +199,6 @@ public class DmpCallbackServiceImpl implements DmpCallbackService {
FileZipUtil.writeToCsv(csvList, parseFile.getPath(), Boolean.TRUE); FileZipUtil.writeToCsv(csvList, parseFile.getPath(), Boolean.TRUE);
// 设置压缩文件 // 设置压缩文件
CompressUtil.decryptionCompression(path, parseFile.getPath(), null); CompressUtil.decryptionCompression(path, parseFile.getPath(), null);
deliveryRecordService.updateStatusByTaskName(DefaultNumberConstants.ONE_NUMBER, responseList.size(), taskName);
FileUtil.del(unzipPath); FileUtil.del(unzipPath);
return; return;
} }
@ -218,7 +219,6 @@ public class DmpCallbackServiceImpl implements DmpCallbackService {
FileUtil.del(csvPath); FileUtil.del(csvPath);
String downUrl = deliveryProperties.getDmpDownPath().concat(filePath); String downUrl = deliveryProperties.getDmpDownPath().concat(filePath);
deliveryRecordClient.updatePath(zipPath, downUrl, byTaskName.getDownId(), SecurityConstants.FROM_IN); deliveryRecordClient.updatePath(zipPath, downUrl, byTaskName.getDownId(), SecurityConstants.FROM_IN);
deliveryRecordService.updateStatusByTaskName(DefaultNumberConstants.ONE_NUMBER, responseList.size(), taskName);
redisUtils.set(CacheKey.DMP_DOWN_URL.concat(String.valueOf(byTaskName.getDownId())), zipPath, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS); redisUtils.set(CacheKey.DMP_DOWN_URL.concat(String.valueOf(byTaskName.getDownId())), zipPath, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS);
} }
@ -250,7 +250,7 @@ public class DmpCallbackServiceImpl implements DmpCallbackService {
Integer.parseInt(downNum.toString()) + strings.size() : strings.size(); Integer.parseInt(downNum.toString()) + strings.size() : strings.size();
// 设置压缩文件 // 设置压缩文件
CompressUtil.decryptionCompression(path, parseFile.getPath(), null); CompressUtil.decryptionCompression(path, parseFile.getPath(), null);
deliveryRecordService.updateStatusByTaskName(DefaultNumberConstants.ONE_NUMBER, originalList.size(), bathNo);
deliveryRecordClient.updateOriginAndSize(byTaskName.getUserId(), format, size, SecurityConstants.FROM_IN); deliveryRecordClient.updateOriginAndSize(byTaskName.getUserId(), format, size, SecurityConstants.FROM_IN);
redisUtils.set(CacheKey.DMP_TRIPARTITE_NUM.concat(format), size, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS); redisUtils.set(CacheKey.DMP_TRIPARTITE_NUM.concat(format), size, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS);
FileUtil.del(unzipPath); FileUtil.del(unzipPath);
@ -272,7 +272,6 @@ public class DmpCallbackServiceImpl implements DmpCallbackService {
(zipPath.lastIndexOf(StrPool.SLASH) + DefaultNumberConstants.ONE_NUMBER); (zipPath.lastIndexOf(StrPool.SLASH) + DefaultNumberConstants.ONE_NUMBER);
FileUtil.del(csvPath); FileUtil.del(csvPath);
String downUrl = deliveryProperties.getDmpDownPath().concat(filePath); String downUrl = deliveryProperties.getDmpDownPath().concat(filePath);
deliveryRecordService.updateStatusByTaskName(DefaultNumberConstants.ONE_NUMBER, stringSet.size(), bathNo);
deliveryRecordClient.savePathAndSetDateStr(byTaskName.getUserId(), stringSet.size(), zipPath, downUrl, format, SecurityConstants.FROM_IN); deliveryRecordClient.savePathAndSetDateStr(byTaskName.getUserId(), stringSet.size(), zipPath, downUrl, format, SecurityConstants.FROM_IN);
redisUtils.set(CacheKey.DMP_TRIPARTITE_URL.concat(format), zipPath, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS); redisUtils.set(CacheKey.DMP_TRIPARTITE_URL.concat(format), zipPath, DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS);
redisUtils.set(CacheKey.DMP_TRIPARTITE_NUM.concat(format), originalList.size(), DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS); redisUtils.set(CacheKey.DMP_TRIPARTITE_NUM.concat(format), originalList.size(), DefaultNumberConstants.ONE_NUMBER, TimeUnit.DAYS);

Loading…
Cancel
Save