关联文件时的处理
This commit is contained in:
parent
c274442117
commit
634bbf559b
Binary file not shown.
@ -72,6 +72,7 @@ import com.actionsoft.sdk.local.SDK;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
public class DesignerRelationShapeWeb extends ActionWeb {
|
public class DesignerRelationShapeWeb extends ActionWeb {
|
||||||
private UserContext _uc;
|
private UserContext _uc;
|
||||||
@ -1004,7 +1005,20 @@ public class DesignerRelationShapeWeb extends ActionWeb {
|
|||||||
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
|
||||||
if ("file".equals(type)) {// 关联模型文件
|
if ("file".equals(type)) {// 关联模型文件
|
||||||
Set<String> ids = new HashSet<>();// 之前代码会造成数据库出现多余数据,过滤重复数据
|
Set<String> ids = new HashSet<>();// 之前代码会造成数据库出现多余数据,过滤重复数据
|
||||||
List<DesignerShapeRelationModel> list = dao.getModelListByShapeIdAndRelationShapeId(ruuid, shapeId, null, relationFileIds);
|
List<String> versionIds = new ArrayList();
|
||||||
|
String [] arr = relationFileIds.split(",");
|
||||||
|
for (int i = 0; i < arr.length; i++) {
|
||||||
|
PALRepositoryModel model = PALRepositoryCache.getCache().get(arr[i]);
|
||||||
|
if (model != null) {
|
||||||
|
versionIds.add(model.getVersionId());
|
||||||
|
} else {
|
||||||
|
if (PALRepositoryCache.getByVersionId(arr[i]) != null && PALRepositoryCache.getByVersionId(arr[i]).size() > 0) {
|
||||||
|
versionIds.add(arr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String tmpStr = StringUtils.join(versionIds, ",");
|
||||||
|
List<DesignerShapeRelationModel> list = dao.getModelListByShapeIdAndRelationShapeId(ruuid, shapeId, null, tmpStr);
|
||||||
for (DesignerShapeRelationModel model : list) {
|
for (DesignerShapeRelationModel model : list) {
|
||||||
if (ids.contains(model.getRelationFileId())) {
|
if (ids.contains(model.getRelationFileId())) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user