fix:数据总览:针对 任务的展示,当右侧下拉框从mergeSameNameChildren中选择节点时,需要将选择的节点的UUID设置到TagReq对应的tag字段中
This commit is contained in:
@@ -301,8 +301,12 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
}
|
||||
|
||||
|
||||
// 3、获取当前节点下的任务(仅展示“应挂载在当前层”的任务,避免任务提前出现在上层)
|
||||
// 3、获取当前节点下的任务(仅展示"应挂载在当前层"的任务,避免任务提前出现在上层)
|
||||
List<List<String>> displayTagLevels = buildDisplayTagLevels(dimensionNodeTypeLevels);
|
||||
|
||||
// 针对 任务,当右侧下拉框从mergeSameNameChildren中选择节点时,需要将选择的节点的UUID设置到TagReq对应的tag字段中
|
||||
delTagReq(req, chooseNodeType, chooseUuids);
|
||||
|
||||
List<String> taskUuids = getTaskByTagReq(req.getTagReq(), displayTagLevels, currentLevelIndex);
|
||||
uuids.addAll(taskUuids);
|
||||
log.info("获取节点下task的uudis:{}", taskUuids);
|
||||
@@ -336,6 +340,24 @@ public class DimensionTemplateServiceImpl extends ServiceImpl<DimensionTemplateM
|
||||
return SdmResponse.success(mergedResult);
|
||||
}
|
||||
|
||||
private void delTagReq(GetSimulationNodeTreeReq req, String chooseNodeType, List<String> chooseUuids) {
|
||||
Map<String, String> nodeTypeToTagMap = tagMapService.getTagMapName();
|
||||
String chooseNodeTag = nodeTypeToTagMap.get(chooseNodeType);
|
||||
|
||||
// 通过反射将当前选中节点的UUID列表设置到TagReq对应的tag字段中
|
||||
if (StringUtils.isNotBlank(chooseNodeTag) && req.getTagReq() != null) {
|
||||
try {
|
||||
String chooseUuidsCsv = String.join(",", chooseUuids);
|
||||
java.lang.reflect.Field field = TagReq.class.getDeclaredField(chooseNodeTag);
|
||||
field.setAccessible(true);
|
||||
field.set(req.getTagReq(), chooseUuidsCsv);
|
||||
log.info("通过反射设置TagReq.{} = {}", chooseNodeTag, chooseUuidsCsv);
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
log.error("反射设置TagReq字段失败, chooseNodeTag: {}", chooseNodeTag, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> getTaskByTagReq(TagReq tagReq, List<List<String>> displayTagLevels, int currentLevelIndex) {
|
||||
LambdaQueryChainWrapper<FileMetadataInfo> wrapper = new LambdaQueryChainWrapper<>(fileMetadataInfoService.getBaseMapper());
|
||||
// 查task
|
||||
|
||||
Reference in New Issue
Block a user