|
@@ -3,6 +3,7 @@ package com.css.simulation.resource.scheduler.consumer;
|
|
|
|
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
import api.common.pojo.dto.ProjectMessageDTO;
|
|
|
+import api.common.util.CollectionUtil;
|
|
|
import api.common.util.JsonUtil;
|
|
|
import api.common.util.StringUtil;
|
|
|
import api.common.util.TimeUtil;
|
|
@@ -113,9 +114,15 @@ public class ManualProjectConsumer {
|
|
|
}
|
|
|
}
|
|
|
List<ScenePO> sceneList = new ArrayList<>();
|
|
|
- sceneList.addAll(sceneMapper.selectNaturalByIdList(naturalIdList));
|
|
|
- sceneList.addAll(sceneMapper.selectStandardByIdList(standardIdList));
|
|
|
- sceneList.addAll(sceneMapper.selectAccidentByIdList(accidentIdList));
|
|
|
+ if (CollectionUtil.isNotEmpty(naturalIdList)){
|
|
|
+ sceneList.addAll(sceneMapper.selectNaturalByIdList(naturalIdList));
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(standardIdList)){
|
|
|
+ sceneList.addAll(sceneMapper.selectStandardByIdList(standardIdList));
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(accidentIdList)){
|
|
|
+ sceneList.addAll(sceneMapper.selectAccidentByIdList(accidentIdList));
|
|
|
+ }
|
|
|
projectMapper.updateTaskNumber(projectId, sceneList.size());
|
|
|
|
|
|
|
|
@@ -315,9 +322,15 @@ public class ManualProjectConsumer {
|
|
|
}
|
|
|
}
|
|
|
List<ScenePO> sceneList = new ArrayList<>();
|
|
|
- sceneList.addAll(sceneMapper.selectNaturalByIdList(naturalIdList));
|
|
|
- sceneList.addAll(sceneMapper.selectStandardByIdList(standardIdList));
|
|
|
- sceneList.addAll(sceneMapper.selectAccidentByIdList(accidentIdList));
|
|
|
+ if (CollectionUtil.isNotEmpty(naturalIdList)){
|
|
|
+ sceneList.addAll(sceneMapper.selectNaturalByIdList(naturalIdList));
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(standardIdList)){
|
|
|
+ sceneList.addAll(sceneMapper.selectStandardByIdList(standardIdList));
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(accidentIdList)){
|
|
|
+ sceneList.addAll(sceneMapper.selectAccidentByIdList(accidentIdList));
|
|
|
+ }
|
|
|
projectMapper.updateTaskNumber(projectId, sceneList.size());
|
|
|
|
|
|
|
|
@@ -397,8 +410,8 @@ public class ManualProjectConsumer {
|
|
|
|
|
|
String taskJson = JsonUtil.beanToJson(taskTO);
|
|
|
|
|
|
-
|
|
|
- kafkaTemplate.send("test", taskJson).addCallback(success -> {
|
|
|
+ kafkaTemplate.send(projectId, taskJson).addCallback(success -> {
|
|
|
+
|
|
|
|
|
|
String topic = success.getRecordMetadata().topic();
|
|
|
|