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

修改时副本上传问题

上级 04fbce83
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.lite.domain.DynamicModelConfig;
import cn.ibizlab.core.lite.domain.MetaDynamicModel;
import cn.ibizlab.core.lite.service.IMetaDynamicModelService;
import cn.ibizlab.core.lite.service.impl.MetaDynamicModelServiceImpl;
......@@ -72,6 +71,11 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
return unzip(et);
}
@Override
public boolean update(MetaDynamicModel et) {
return unzip(et);
}
/**
* 将zip解压到file目录
*
......@@ -83,8 +87,9 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
JSONObject system = null;
String strModelFile = et.getModelfile();
if (StringUtils.isEmpty(strModelFile))
if (StringUtils.isEmpty(strModelFile)){
throw new BadRequestAlertException("模型文件为空", "MetaDynamicModel", "unzip");
}
List<FileItem> items = JSONArray.parseArray(strModelFile, FileItem.class);
if (!ObjectUtils.isEmpty(items) && items.size() > 1) {
throw new BadRequestAlertException("单次只允许上传一个模型文件", "MetaDynamicModel", "unzip");
......@@ -109,7 +114,11 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
}
et.setDynainstid(system.getString("getPSDynaInstId"));
et.setSystemId(system.getString("name"));
if(StringUtils.isEmpty(et.getConfigid())){
super.create(et);
}else {
super.update(et);
}
JSONArray array = system.getJSONArray("getPSDynaInsts");
if(!ObjectUtils.isEmpty(array)){
for(int i = 0; i < array.size(); i++) {
......@@ -118,6 +127,7 @@ public class MetaDynamicModelExService extends MetaDynamicModelServiceImpl {
model.setConfigname(obj.get("name").toString());
model.setDynainstid(obj.get("id").toString());
model.setPdynainstid(et.getConfigid());
model.setSystemId(et.getSystemId());
dynamicModelService.create(model);
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册