Commit 4adeaf5a authored by hanson.yao's avatar hanson.yao

Merge branch 'master' into ywq-dev

parents 4323d8aa f089ffce
...@@ -7,8 +7,8 @@ import com.yonde.basedata.search.SearchQueryCondition; ...@@ -7,8 +7,8 @@ import com.yonde.basedata.search.SearchQueryCondition;
import com.yonde.basedata.service.BaseSearchService; import com.yonde.basedata.service.BaseSearchService;
import com.yonde.basedata.vo.IdVO; import com.yonde.basedata.vo.IdVO;
import com.yonde.basedata.vo.lc.LifecycleTemplateVO; import com.yonde.basedata.vo.lc.LifecycleTemplateVO;
import com.yonde.change.service.DXChangeOrderService;
import com.yonde.common.ObjectsUtil; import com.yonde.common.ObjectsUtil;
import com.yonde.common.entity.DXFolder;
import com.yonde.part.vo.DxPartDescribeLinkVO; import com.yonde.part.vo.DxPartDescribeLinkVO;
import com.yonde.part.vo.DxPartReferenceLinkVO; import com.yonde.part.vo.DxPartReferenceLinkVO;
import com.yonde.part.vo.DxUsageLinkVO; import com.yonde.part.vo.DxUsageLinkVO;
...@@ -116,6 +116,22 @@ public class AbstractBaseController { ...@@ -116,6 +116,22 @@ public class AbstractBaseController {
return list; return list;
} }
@GetMapping({"/folder/getFolderList"})
//@ApiOperation("获取副本")
public DXFolder getFolderList(@RequestParam String containerName, @RequestParam(value = "id", required = false) String id, HttpServletRequest request) {
DXFolder dxFolder = null;
try {
if (StringUtils.isEmpty(id)) {
dxFolder = BaseSearchService.getFolderList(containerName);
} else {
dxFolder = BaseSearchService.getFolderList(containerName, Long.valueOf(id));
}
} catch (Exception e) {
e.printStackTrace();
}
return dxFolder;
}
public SearchItems getPermSearchItems(BaseSearchCondition permSearchParams) { public SearchItems getPermSearchItems(BaseSearchCondition permSearchParams) {
SearchItems searchItems = new SearchItems(); SearchItems searchItems = new SearchItems();
searchItems.setOperator(SearchItems.BooleanOperator.AND); searchItems.setOperator(SearchItems.BooleanOperator.AND);
......
...@@ -44,7 +44,7 @@ public class SearchOperatorEnumUtil { ...@@ -44,7 +44,7 @@ public class SearchOperatorEnumUtil {
public static final String DX_CONTEXT_NAME = "dxContext-name"; public static final String DX_CONTEXT_NAME = "dxContext-name";
public static final String DX_FOLDER_ID = "folderName"; public static final String DX_FOLDER_ID = "folderId";
public static final String DX_SUBTYPE_NAME = "subTypeName"; public static final String DX_SUBTYPE_NAME = "subTypeName";
......
...@@ -13,6 +13,8 @@ import com.yonde.change.vo.ecn.DxChangeNoticeVo; ...@@ -13,6 +13,8 @@ import com.yonde.change.vo.ecn.DxChangeNoticeVo;
import com.yonde.change.vo.ecr.DxChangeRequestVo; import com.yonde.change.vo.ecr.DxChangeRequestVo;
import com.yonde.change.vo.pr.DxProblemReportVo; import com.yonde.change.vo.pr.DxProblemReportVo;
import com.yonde.common.*; import com.yonde.common.*;
import com.yonde.common.entity.DXFolder;
import com.yonde.common.util.FolderUtil;
import com.yonde.doc.vo.DxDocumentVO; import com.yonde.doc.vo.DxDocumentVO;
import com.yonde.part.vo.DxPartVO; import com.yonde.part.vo.DxPartVO;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -30,6 +32,9 @@ import wt.doc.WTDocument; ...@@ -30,6 +32,9 @@ import wt.doc.WTDocument;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.fc.PagingQueryResult; import wt.fc.PagingQueryResult;
import wt.fc.WTObject; import wt.fc.WTObject;
import wt.folder.Cabinet;
import wt.folder.Folder;
import wt.folder.SubFolder;
import wt.log4j.LogR; import wt.log4j.LogR;
import wt.method.RemoteAccess; import wt.method.RemoteAccess;
import wt.method.RemoteMethodServer; import wt.method.RemoteMethodServer;
...@@ -37,6 +42,7 @@ import wt.part.WTPart; ...@@ -37,6 +42,7 @@ import wt.part.WTPart;
import wt.session.SessionContext; import wt.session.SessionContext;
import wt.session.SessionHelper; import wt.session.SessionHelper;
import wt.session.SessionServerHelper; import wt.session.SessionServerHelper;
import wt.util.WTException;
import wt.util.WTProperties; import wt.util.WTProperties;
import wt.vc.baseline.ManagedBaseline; import wt.vc.baseline.ManagedBaseline;
import wt.vc.wip.WorkInProgressHelper; import wt.vc.wip.WorkInProgressHelper;
...@@ -311,4 +317,59 @@ public class BaseSearchService <V extends IdVO> implements RemoteAccess { ...@@ -311,4 +317,59 @@ public class BaseSearchService <V extends IdVO> implements RemoteAccess {
} }
} }
/**
* 获取文件件目录
* @param containerName
* @return
* @throws Exception
*/
public static DXFolder getFolderList(String containerName) throws Exception {
if (!RemoteMethodServer.ServerFlag) {
return (DXFolder)RemoteMethodServer.getDefault().invoke("getFolderList", BaseSearchService.class.getName(), null,
new Class[] { String.class },
new Object[] { containerName });
}
CommonUtil.initSessionContext(null);
Cabinet rootFolder = FolderUtil.getRootFolder(containerName);
return getDxFolder(rootFolder);
}
/**
* 获取子文件夹目录
* @param containerName
* @param id
* @return
* @throws Exception
*/
public static DXFolder getFolderList(String containerName, Long id) throws Exception {
if (!RemoteMethodServer.ServerFlag) {
return (DXFolder)RemoteMethodServer.getDefault().invoke("getFolderList", BaseSearchService.class.getName(), null,
new Class[] { String.class, Long.class },
new Object[] { containerName, id });
}
CommonUtil.initSessionContext(null);
Folder folder = FolderUtil.getFolder("OR:wt.folder.SubFolder:" + id);
if (ObjectsUtil.isNull(folder)) {
folder = FolderUtil.getRootFolder(containerName);
}
return getDxFolder(folder);
}
private static DXFolder getDxFolder(Folder folder) throws WTException {
DXFolder dxFolder = new DXFolder(folder);
List<SubFolder> subFolders = FolderUtil.getSubFolders(folder, false);
if (CollectionUtils.isNotEmpty(subFolders)) {
List<DXFolder> subList = new ArrayList<DXFolder>();
for (SubFolder subFolder : subFolders) {
subList.add(new DXFolder(subFolder));
}
dxFolder.setChildren(subList);
} else {
dxFolder.setLeaf(true);
}
return dxFolder;
}
} }
package com.yonde.basedata.vo; package com.yonde.basedata.vo;
import com.yonde.doc.vo.DxDocumentVO; import com.yonde.doc.vo.DxDocumentVO;
import wt.fc.PersistenceHelper;
import wt.folder.Folder;
import java.util.List; import java.util.List;
...@@ -8,10 +10,19 @@ public class DxDocumentFolderVO extends IdVO{ ...@@ -8,10 +10,19 @@ public class DxDocumentFolderVO extends IdVO{
private String fullPath; private String fullPath;
private String name; private String name;
private Boolean isLeaf; private Boolean isLeaf = true;
private List<DxDocumentVO> dxDocuments; private List<DxDocumentVO> dxDocuments;
public DxDocumentFolderVO() {
}
public DxDocumentFolderVO(Folder folder) {
this.id = PersistenceHelper.getObjectIdentifier(folder).getId();
this.name = folder.getName();
this.fullPath = folder.getFolderPath();
}
public String getFullPath() { public String getFullPath() {
return fullPath; return fullPath;
} }
......
...@@ -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();
......
...@@ -1250,18 +1250,10 @@ public class DocUtil implements RemoteAccess, Serializable { ...@@ -1250,18 +1250,10 @@ public class DocUtil implements RemoteAccess, Serializable {
document.setNumber(docNum); document.setNumber(docNum);
} }
// Set Folder // Set Folder
if (docFold == null) { if (docFold != null) {
docFold = FolderHelper.service.getFolder("Default", WTContainerRef.newWTContainerRef(container)); FolderHelper.assignLocation((FolderEntry) document, docFold);
/*
* if (folder == null || "".equals(folder)) {
* docFold = FolderHelper.service.getFolder("Default", WTContainerRef.newWTContainerRef(container));
* } else {
* docFold = FolderHelper.service.getFolder("Default/" + folder,
* WTContainerRef.newWTContainerRef(container));
* }
*/
} }
FolderHelper.assignLocation((FolderEntry) document, docFold);
// Set Container // Set Container
PersistenceHelper.manager.save(document); PersistenceHelper.manager.save(document);
logger.debug("=============create doc end============"); logger.debug("=============create doc end============");
......
...@@ -4,6 +4,7 @@ import com.yonde.basedata.vo.DxDocumentFolderVO; ...@@ -4,6 +4,7 @@ import com.yonde.basedata.vo.DxDocumentFolderVO;
import com.yonde.context.vo.DxContextVO; import com.yonde.context.vo.DxContextVO;
import com.yonde.doc.vo.DxDocumentVO; import com.yonde.doc.vo.DxDocumentVO;
import com.yonde.part.vo.DxPartVO; import com.yonde.part.vo.DxPartVO;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import wt.doc.WTDocument; import wt.doc.WTDocument;
import wt.folder.Folder; import wt.folder.Folder;
...@@ -50,22 +51,21 @@ public class DxDocUtil implements RemoteAccess, Serializable { ...@@ -50,22 +51,21 @@ public class DxDocUtil implements RemoteAccess, Serializable {
public static WTDocument createDoc(DxDocumentVO dxDocumentVO) throws WTException { public static WTDocument createDoc(DxDocumentVO dxDocumentVO) throws WTException {
WTContainer container = null; WTContainer container = null;
DxContextVO dxContext = dxDocumentVO.getDxContext(); DxContextVO dxContext = dxDocumentVO.getDxContext();
logger.error("dxContext Name======" + dxContext);
if (ObjectsUtil.nonNull(dxContext)) { if (ObjectsUtil.nonNull(dxContext)) {
String contextName = dxContext.getName(); String contextName = dxContext.getName();
logger.error("container Name======" + contextName);
container = ContainerUtil.getContainerByName(contextName); container = ContainerUtil.getContainerByName(contextName);
logger.error("container======" + container);
} }
if (ObjectsUtil.isNull(container)) { if (ObjectsUtil.isNull(container)) {
return null; return null;
} }
String folderPath = null; Folder folder = null;
DxDocumentFolderVO folderVO = dxDocumentVO.getDxDocumentFolder(); DxDocumentFolderVO folderVO = dxDocumentVO.getDxDocumentFolder();
if (ObjectsUtil.nonNull(folderVO)) { if (ObjectsUtil.nonNull(folderVO)) {
folderPath = folderVO.getFullPath(); String folderPath = folderVO.getFullPath();
if (StringUtils.isNotEmpty(folderPath)) {
folder = DxCommonUtils.makeFolder(folderPath, container.getContainerReference());
}
} }
Folder folder = DxCommonUtils.makeFolder(folderPath, container.getContainerReference());
//dxDocumentVO.getSubTypeName() //dxDocumentVO.getSubTypeName()
WTDocument doc = DocUtil.createDoc(dxDocumentVO.getNumber(), dxDocumentVO.getName(), WTDocument doc = DocUtil.createDoc(dxDocumentVO.getNumber(), dxDocumentVO.getName(),
container, folder, null); container, folder, null);
......
...@@ -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);
......
package com.yonde.common.entity; package com.yonde.common.entity;
import com.yonde.basedata.vo.IdVO;
import com.yonde.common.RfUtil;
import wt.fc.PersistenceHelper;
import wt.folder.Folder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class DXFolder { public class DXFolder extends IdVO {
//文件夹名称 //文件夹名称
private String name = ""; private String name = "";
...@@ -18,10 +23,20 @@ public class DXFolder { ...@@ -18,10 +23,20 @@ public class DXFolder {
private String containerName = ""; private String containerName = "";
//容器oid //容器oid
private String containerOid = ""; private String containerOid = "";
//文件夹软类型全路径(本期项目文件夹有子类型)
private String fullType = ""; private Boolean isLeaf = false;
//子文件夹 //子文件夹
private List<DXFolder> children = new ArrayList<DXFolder>(); private List<DXFolder> children = new ArrayList<DXFolder>();
public DXFolder() {
}
public DXFolder(Folder folder) {
this.id = PersistenceHelper.getObjectIdentifier(folder).getId();
this.name = folder.getName();
this.containerName = folder.getContainerName();
this.fullPath = folder.getFolderPath();
}
public String getName() { public String getName() {
return name; return name;
} }
...@@ -58,18 +73,16 @@ public class DXFolder { ...@@ -58,18 +73,16 @@ public class DXFolder {
public void setContainerOid(String containerOid) { public void setContainerOid(String containerOid) {
this.containerOid = containerOid; this.containerOid = containerOid;
} }
public String getFullType() {
return fullType;
}
public void setFullType(String fullType) {
this.fullType = fullType;
}
public List<DXFolder> getChildren() { public List<DXFolder> getChildren() {
return children; return children;
} }
public void setChildren(List<DXFolder> children) { public void setChildren(List<DXFolder> children) {
this.children = children; this.children = children;
} }
public Boolean getLeaf() {
return isLeaf;
}
public void setLeaf(Boolean leaf) {
isLeaf = leaf;
}
} }
...@@ -57,8 +57,8 @@ public class FolderUtil implements RemoteAccess { ...@@ -57,8 +57,8 @@ public class FolderUtil implements RemoteAccess {
dxFolder.setContainerName(container.getName()); dxFolder.setContainerName(container.getName());
dxFolder.setContainerOid(CommonUtil.getPersistableOid((WTObject)container)); dxFolder.setContainerOid(CommonUtil.getPersistableOid((WTObject)container));
dxFolder.setCabinetOid(CommonUtil.getPersistableOid(cabinet)); dxFolder.setCabinetOid(CommonUtil.getPersistableOid(cabinet));
dxFolder.setFullType(CommonUtil.getType((WTObject)parentFolder)); //dxFolder.setFullType(CommonUtil.getType((WTObject)parentFolder));
dxFolder.setName(parentFolder.getName()); dxFolder.setName(parentFolder.getName());
dxFolder.setFullPath(parentFolder.getFolderPath()); dxFolder.setFullPath(parentFolder.getFolderPath());
dxFolder.setOid(CommonUtil.getPersistableOid((WTObject)parentFolder)); dxFolder.setOid(CommonUtil.getPersistableOid((WTObject)parentFolder));
...@@ -204,7 +204,6 @@ public class FolderUtil implements RemoteAccess { ...@@ -204,7 +204,6 @@ public class FolderUtil implements RemoteAccess {
public static Folder getFolder(String oid) throws WTException { public static Folder getFolder(String oid) throws WTException {
WTObject obj = (WTObject) CommonUtil.getPersistableByOid(oid); WTObject obj = (WTObject) CommonUtil.getPersistableByOid(oid);
Folder folder = null;
if(obj instanceof WTContainer){ if(obj instanceof WTContainer){
WTContainerRef containerRef = WTContainerRef.newWTContainerRef((WTContainer)obj); WTContainerRef containerRef = WTContainerRef.newWTContainerRef((WTContainer)obj);
Cabinet rootFolder = ((WTContainer) containerRef.getObject()).getDefaultCabinet(); Cabinet rootFolder = ((WTContainer) containerRef.getObject()).getDefaultCabinet();
......
...@@ -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); }
......
...@@ -235,4 +235,17 @@ public class DxPartController extends AbstractBaseController { ...@@ -235,4 +235,17 @@ public class DxPartController extends AbstractBaseController {
} }
return resultList; return resultList;
} }
@GetMapping({"/pdmPlanning/search"})
//@ApiOperation("获取更改相关对象")
public DxPartVO getPdmPlanningPart(@RequestParam(value = "number") String number, @RequestParam(value = "version") String version, HttpServletRequest request) {
DxPartVO dxPartVO = null;
try {
//下游对等件
dxPartVO = DxPartService.getPlanningPart(number, version);
} catch (Exception e) {
e.printStackTrace();
}
return dxPartVO;
}
} }
...@@ -25,6 +25,7 @@ import wt.session.SessionContext; ...@@ -25,6 +25,7 @@ import wt.session.SessionContext;
import wt.session.SessionHelper; import wt.session.SessionHelper;
import wt.session.SessionServerHelper; import wt.session.SessionServerHelper;
import wt.util.WTException; import wt.util.WTException;
import wt.vc.VersionControlHelper;
import wt.vc.views.ViewHelper; import wt.vc.views.ViewHelper;
import wt.vc.wip.WorkInProgressHelper; import wt.vc.wip.WorkInProgressHelper;
...@@ -675,4 +676,33 @@ public class DxPartService implements RemoteAccess, Serializable { ...@@ -675,4 +676,33 @@ public class DxPartService implements RemoteAccess, Serializable {
} }
return resultList; return resultList;
} }
/**
* 获取planning
* @param number
* @return
* @throws Exception
*/
public static DxPartVO getPlanningPart(String number, String version) throws Exception {
if (!RemoteMethodServer.ServerFlag) {
return (DxPartVO) RemoteMethodServer.getDefault().invoke("getPlanningPart", DxPartService.class.getName(), null,
new Class[] { String.class, String.class },
new Object[] { number, version});
}
DxPartVO nextVersion = null;
CommonUtil.initSessionContext(null);
WTPart wtPart = DxPartUtil.getPartByNumberAndView(number, SearchOperatorEnumUtil.viewMap.get("2"), false);
if (ObjectsUtil.nonNull(wtPart)) {
QueryResult qr = VersionControlHelper.service.allVersionsOf(wtPart.getMaster());
while (qr.hasMoreElements()) {
wtPart = (WTPart) qr.nextElement();
if (wtPart.getViewName().equals(SearchOperatorEnumUtil.viewMap.get("2"))
&& wtPart.getVersionIdentifier().getValue().startsWith(version)) {
nextVersion = new DxPartVO(wtPart);
break;
}
}
}
return nextVersion;
}
} }
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