|
@@ -1,6 +1,8 @@
|
|
package com.fdkankan.download.service.impl;
|
|
package com.fdkankan.download.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.date.TimeInterval;
|
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
|
import cn.hutool.core.thread.ExecutorBuilder;
|
|
import cn.hutool.core.thread.ExecutorBuilder;
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
@@ -50,7 +52,7 @@ public class GenSceneRunnerImpl implements CommandLineRunner {
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer mqProducer;
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
|
- private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setCorePoolSize(5).setMaxPoolSize(5).build();
|
|
|
|
|
|
+ private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setCorePoolSize(30).setMaxPoolSize(30).build();
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
ILaserService laserService;
|
|
ILaserService laserService;
|
|
@@ -82,6 +84,8 @@ public class GenSceneRunnerImpl implements CommandLineRunner {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Thread.sleep(5000L);
|
|
|
|
+
|
|
List<DownloadLog> downloadLogList = downloadLogService.getByNum(scenePlus.getNum());
|
|
List<DownloadLog> downloadLogList = downloadLogService.getByNum(scenePlus.getNum());
|
|
Set<String> types = downloadLogList.stream().map(DownloadLog::getType).collect(Collectors.toSet());
|
|
Set<String> types = downloadLogList.stream().map(DownloadLog::getType).collect(Collectors.toSet());
|
|
|
|
|
|
@@ -92,13 +96,14 @@ public class GenSceneRunnerImpl implements CommandLineRunner {
|
|
threadPoolExecutor.submit(() -> {
|
|
threadPoolExecutor.submit(() -> {
|
|
try {
|
|
try {
|
|
// TODO: 2024/1/3 文杰实现
|
|
// TODO: 2024/1/3 文杰实现
|
|
|
|
+ TimeInterval timer = DateUtil.timer();
|
|
String zipPath = laserService.downloadHandler(scenePlus.getNum());
|
|
String zipPath = laserService.downloadHandler(scenePlus.getNum());
|
|
- if (StrUtil.isNotEmpty(zipPath)){
|
|
|
|
- send(zipPath);
|
|
|
|
- }
|
|
|
|
- downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.SUCCESS.code(), null);
|
|
|
|
|
|
+// if (StrUtil.isNotEmpty(zipPath)){
|
|
|
|
+// send(zipPath);
|
|
|
|
+// }
|
|
|
|
+ downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000));
|
|
|
|
|
|
+ downloadLogService.saveLog(scenePlus.getNum(), "laser", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
|
|
log.error("点云场景打包失败,num:{}", scenePlus.getNum(), e);
|
|
log.error("点云场景打包失败,num:{}", scenePlus.getNum(), e);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -114,12 +119,13 @@ public class GenSceneRunnerImpl implements CommandLineRunner {
|
|
if(!types.contains("kankan")) {
|
|
if(!types.contains("kankan")) {
|
|
threadPoolExecutor.submit(() -> {
|
|
threadPoolExecutor.submit(() -> {
|
|
try {
|
|
try {
|
|
|
|
+ TimeInterval timer = DateUtil.timer();
|
|
String zipPath = downloadService.downloadHandler(scenePlus.getNum());
|
|
String zipPath = downloadService.downloadHandler(scenePlus.getNum());
|
|
- send(zipPath);
|
|
|
|
- downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.SUCCESS.code(), null);
|
|
|
|
|
|
+// send(zipPath);
|
|
|
|
+ downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.SUCCESS.code(), null, timer.intervalMinute());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("看看场景打包失败,num:{}", scenePlus.getNum(), e);
|
|
log.error("看看场景打包失败,num:{}", scenePlus.getNum(), e);
|
|
- downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000));
|
|
|
|
|
|
+ downloadLogService.saveLog(scenePlus.getNum(), "kankan", CommonSuccessStatus.FAIL.code(), ExceptionUtil.stacktraceToString(e, 3000), null);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|