Commit b138cff8 authored by shyWang's avatar shyWang

PDM前端改造

对象创建文件夹调整,按初始化规则
parent dc0c359f
......@@ -79,7 +79,7 @@ public class DXChangeOrderService implements RemoteAccess {
}
if (container != null) {
changeIssue.setContainer(container);
String folderPath = null;
/* String folderPath = null;
DxDocumentFolderVO folderVO = null;
if (ObjectsUtil.nonNull(folderVO)) {
folderPath = folderVO.getFullPath();
......@@ -92,7 +92,7 @@ public class DXChangeOrderService implements RemoteAccess {
FolderHelper.assignLocations(loacationMap);
} else {
throw new WTException(String.format("未找到工程更改文件夹%d", folderPath));
}
}*/
} else {
throw new WTException(String.format("型号上下文%d不存在", dxContext.getName()));
}
......@@ -232,7 +232,7 @@ public class DXChangeOrderService implements RemoteAccess {
}
if (container != null) {
ecr.setContainer(container);
String folderPath = null;
/*String folderPath = null;
DxDocumentFolderVO folderVO = null;
if (ObjectsUtil.nonNull(folderVO)) {
folderPath = folderVO.getFullPath();
......@@ -245,7 +245,7 @@ public class DXChangeOrderService implements RemoteAccess {
FolderHelper.assignLocations(loacationMap);
} else {
System.out.println("未找到工程更改文件夹");
}
}*/
}
// TODO 动态获取变更类型
/* String type = entityVO.getSubTypeName();
......@@ -400,7 +400,7 @@ public class DXChangeOrderService implements RemoteAccess {
}
if (container != null) {
wtChangeOrder2.setContainer(container);
String folderPath = null;
/*String folderPath = null;
DxDocumentFolderVO folderVO = null;
if (ObjectsUtil.nonNull(folderVO)) {
folderPath = folderVO.getFullPath();
......@@ -413,7 +413,7 @@ public class DXChangeOrderService implements RemoteAccess {
FolderHelper.assignLocations(loacationMap);
} else {
System.out.println("未找到工程更改文件夹");
}
}*/
}
}
wtChangeOrder2 = ChangeOrderUtil.createWTChangeOrder2(wtChangeOrder2, changeNoticeVo.getName(), null,
......
......@@ -58,9 +58,9 @@ public class BaseLineUtil {
baseline.setTypeDefinitionReference(typeDef);
/*LifeCycleHelper.setLifeCycle(baseline,
LifeCycleHelper.service.getLifeCycleTemplate("", container.getContainerReference()));*/
WTContainerRef containerRef = WTContainerRef.newWTContainerRef(baseline.getContainer());
/* WTContainerRef containerRef = WTContainerRef.newWTContainerRef(baseline.getContainer());
Folder assignedFolder = FolderHelper.service.saveFolderPath("/Default", containerRef);
FolderHelper.assignLocation((FolderEntry) baseline, assignedFolder);
FolderHelper.assignLocation((FolderEntry) baseline, assignedFolder);*/
baseline = (ManagedBaseline) PersistenceHelper.manager.save(baseline);
ManagedBaselineIdentity identificationObject = (ManagedBaselineIdentity)baseline.getIdentificationObject();
......
......@@ -205,11 +205,6 @@ public class DxPartUtil implements RemoteAccess, Serializable {
}
public static WTPart createPart(DxPartVO dxPartVO) throws Exception {
/* if (!RemoteMethodServer.ServerFlag) {
return (WTPart) RemoteMethodServer.getDefault().invoke("createPart", DxPartUtil.class.getName(), null,
new Class[]{DxPartVO.class},
new Object[]{dxPartVO});
}*/
WTPart part = null;
String partSource = "";
String partAssembly = "";
......@@ -291,14 +286,6 @@ public class DxPartUtil implements RemoteAccess, Serializable {
if (partType == null || partType.equalsIgnoreCase("")) {
partType = "wt.part.WTPart";
}
if (partFolder == null || partFolder.equalsIgnoreCase("")) {
partFolder = "/Default";
} else {
if (!partFolder.startsWith("/Default")) {
partFolder = "/Default/" + partFolder;
}
}
part = WTPart.newWTPart(number, name, QuantityUnit.EA);
if (partType != null) {
......@@ -308,20 +295,24 @@ public class DxPartUtil implements RemoteAccess, Serializable {
WTContainerRef containerRef = WTContainerRef.newWTContainerRef(container);
part.setContainerReference(containerRef);
Folder location = null;
try {
location = FolderHelper.service.getFolder(partFolder, containerRef);
} catch (Exception e) {
location = null;
}
if (location == null)
location = FolderHelper.service.saveFolderPath(partFolder, containerRef);
if (StringUtils.isNotEmpty(partFolder)) {
if (!partFolder.startsWith("/Default")) {
partFolder = "/Default/" + partFolder;
}
Folder location = null;
try {
location = FolderHelper.service.getFolder(partFolder, containerRef);
} catch (Exception e) {
location = null;
}
if (location == null)
location = FolderHelper.service.saveFolderPath(partFolder, containerRef);
if (location != null) {
WTValuedHashMap map = new WTValuedHashMap();
map.put(part, location);
FolderHelper.assignLocations(map);
if (location != null) {
WTValuedHashMap map = new WTValuedHashMap();
map.put(part, location);
FolderHelper.assignLocations(map);
}
}
part.setPartType(part_assembly);
......
......@@ -67,8 +67,8 @@ public class DxDocUtil {
}
String name = dxDocumentVO.getName();
String containerName = dxDocumentVO.getDxContext().getName();
DxDocumentFolderVO dxDocumentFolder = dxDocumentVO.getDxDocumentFolder();
String folderPath = dxDocumentFolder == null?"/Default":dxDocumentFolder.getFullPath();
/*DxDocumentFolderVO dxDocumentFolder = dxDocumentVO.getDxDocumentFolder();
String folderPath = dxDocumentFolder == null?"/Default":dxDocumentFolder.getFullPath();*/
String lifecycleTemplateName = null;//TODO
String state = dxDocumentVO.getState();
......@@ -91,7 +91,7 @@ public class DxDocUtil {
WTContainerRef cref = WTContainerRef.newWTContainerRef(container);
doc.setContainerReference(cref);
CommonUtil.setFolder(cref, doc, folderPath);
//CommonUtil.setFolder(cref, doc, folderPath);
/*
* if(folderPath != null){ Folder folder = FolderHelper.service.getFolder(folderPath, cref);
* FolderHelper.assignLocation(doc, folder); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment