提交 cb2d8076 编写于 作者: zhouweidong's avatar zhouweidong

模型导入、导出逻辑优化

上级 e1bbfeca
......@@ -231,10 +231,11 @@ public class MetaModelExService extends MetaModelServiceImpl {
String strModel = JSON.toJSONString(models);
File modelFile = generateModelFile(strModel);
HttpServletResponse resp = ((ServletRequestAttributes) req).getResponse();
if (resp != null)
if (resp != null){
resp.setContentType("APPLICATION/OCTET-STREAM");//返回格式为流
resp.setHeader("Content-Disposition", "attachment;filename=" + getFileName(modelFile.getName()));
sendResponse(resp, modelFile);
sendResponse(resp, modelFile);
}
return true;
}
......@@ -256,17 +257,18 @@ public class MetaModelExService extends MetaModelServiceImpl {
// 查询模型
MetaModel metaModel = metaModelService.get(et.getId());
// 查询模型对应的N个规则
for (RuleItem ruleItem : metaModel.getRuleitems()) {
JSONObject fieldSet = JSONObject.parseObject(ruleItem.getFieldSet());
if (!ObjectUtils.isEmpty(fieldSet)) {
for (String entityName : fieldSet.keySet()) {
if (entityName.endsWith("entity")) {
entities.add(fieldSet.getString(entityName));
if(!ObjectUtils.isEmpty(metaModel.getRuleitems())){
for (RuleItem ruleItem : metaModel.getRuleitems()) {
JSONObject fieldSet = JSONObject.parseObject(ruleItem.getFieldSet());
if (!ObjectUtils.isEmpty(fieldSet)) {
for (String entityName : fieldSet.keySet()) {
if (entityName.endsWith("entity")) {
entities.add(fieldSet.getString(entityName));
}
}
}
}
}
// 查询模型对应的N个(分析)构建
if (!ObjectUtils.isEmpty(metaModel.getBuilds())) {
for (DABuild build : metaModel.getBuilds()) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册