指标库:修复“获取原子指标配置(指标库列表中点击衍生)”

This commit is contained in:
huangge1199 2025-08-11 11:06:49 +08:00
parent bbcab977bd
commit db18f06c49
2 changed files with 5 additions and 4 deletions

View File

@ -100,8 +100,7 @@ public class TargetController {
@Operation(summary = "获取原子指标配置(指标库列表中点击衍生)")
@PostMapping("/getDetailExpandTarget")
public R<JSONObject> getDetailExpandTarget(@RequestBody JSONObject params) {
JSONObject result;
result = targetService.getDetailExpandTarget(params);
JSONObject result = targetService.getDetailExpandTarget(params);
Page<?> list = tableColumnService.getDataByTableName(result.getJSONObject("list"));
result.put("list", list);
result.put("columnList", tableColumnService.getColumnsByTableName(result.getString("tableName")));

View File

@ -456,9 +456,11 @@ public class TargetServiceImpl extends ServiceImpl<TargetMapper, Target>
CheckUtils.checkEmpty(id, "指标ID");
target = targetMapper.selectById(id);
List<TargetOption> optionList = new ArrayList<>();
while (id != null) {
Target parent = targetMapper.selectById(id);
while (!StringUtils.isEmpty(id)) {
optionList.addAll(0, targetOptionMapper.selectList(new QueryWrapper<TargetOption>().eq("target_id", id)));
id = target.getParent();
id = parent.getParent();
parent = targetMapper.selectById(id);
}
return getDetailTarget(optionList, target);
}