提交 85fc6e0d 编写于 作者: tangyaolong's avatar tangyaolong

简化导出模型逻辑

上级 e3b67fec
...@@ -265,10 +265,8 @@ public class MetaModelExService extends MetaModelServiceImpl { ...@@ -265,10 +265,8 @@ public class MetaModelExService extends MetaModelServiceImpl {
LinkedHashSet<String> entities = new LinkedHashSet<>(); LinkedHashSet<String> entities = new LinkedHashSet<>();
List<DstDataSource> dataSources = new ArrayList<>(); List<DstDataSource> dataSources = new ArrayList<>();
// 查询模型 // 查询模型下的N个规则
MetaModel metaModel = metaModelService.get(et.getId()); List<RuleItem> ruleItems = ruleItemService.selectByModelId(et.getId());
// 查询模型对应的N个规则
List<RuleItem> ruleItems = ruleItemService.selectByModelId(metaModel.getId());
if(!ObjectUtils.isEmpty(ruleItems)){ if(!ObjectUtils.isEmpty(ruleItems)){
for (RuleItem ruleItem : ruleItems) { for (RuleItem ruleItem : ruleItems) {
JSONObject fieldSet = JSONObject.parseObject(ruleItem.getFieldSet()); JSONObject fieldSet = JSONObject.parseObject(ruleItem.getFieldSet());
...@@ -282,7 +280,7 @@ public class MetaModelExService extends MetaModelServiceImpl { ...@@ -282,7 +280,7 @@ public class MetaModelExService extends MetaModelServiceImpl {
} }
} }
// 查询模型下的N个构建 // 查询模型下的N个构建
List<DABuild> daBuilds = dabuildService.selectByModelId(metaModel.getId()); List<DABuild> daBuilds = dabuildService.selectByModelId(et.getId());
List<String> daBuildIds = daBuilds.stream().map(DABuild::getBuildId).collect(Collectors.toList()); List<String> daBuildIds = daBuilds.stream().map(DABuild::getBuildId).collect(Collectors.toList());
// 查询构建下关联的N个指标 // 查询构建下关联的N个指标
...@@ -334,7 +332,7 @@ public class MetaModelExService extends MetaModelServiceImpl { ...@@ -334,7 +332,7 @@ public class MetaModelExService extends MetaModelServiceImpl {
dataSources.addAll(dstDataSources.getContent()); dataSources.addAll(dstDataSources.getContent());
} }
models.setMetrics(metrics); models.setMetrics(metrics);
models.setMetaModel(metaModel); models.setMetaModel(et);
models.setEntityModels(entityModels); models.setEntityModels(entityModels);
models.setDaBuilds(daBuilds); models.setDaBuilds(daBuilds);
models.setRuleItems(ruleItems); models.setRuleItems(ruleItems);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册