Commit b138cff8 authored by shyWang's avatar shyWang

PDM前端改造

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