Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BasicAPI
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杜科
BasicAPI
Commits
3f020ba2
Commit
3f020ba2
authored
Apr 27, 2023
by
shyWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDM前端改造
对象创建文件夹优化
parent
ae6ca9d4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
31 deletions
+35
-31
DocUtil.java
src/com/yonde/common/DocUtil.java
+3
-11
DxDocUtil.java
src/com/yonde/common/DxDocUtil.java
+6
-6
DXFolder.java
src/com/yonde/common/entity/DXFolder.java
+24
-11
FolderUtil.java
src/com/yonde/common/util/FolderUtil.java
+2
-3
No files found.
src/com/yonde/common/DocUtil.java
View file @
3f020ba2
...
...
@@ -1250,18 +1250,10 @@ public class DocUtil implements RemoteAccess, Serializable {
document
.
setNumber
(
docNum
);
}
// Set Folder
if
(
docFold
==
null
)
{
docFold
=
FolderHelper
.
service
.
getFolder
(
"Default"
,
WTContainerRef
.
newWTContainerRef
(
container
));
/*
* if (folder == null || "".equals(folder)) {
* docFold = FolderHelper.service.getFolder("Default", WTContainerRef.newWTContainerRef(container));
* } else {
* docFold = FolderHelper.service.getFolder("Default/" + folder,
* WTContainerRef.newWTContainerRef(container));
* }
*/
}
if
(
docFold
!=
null
)
{
FolderHelper
.
assignLocation
((
FolderEntry
)
document
,
docFold
);
}
// Set Container
PersistenceHelper
.
manager
.
save
(
document
);
logger
.
debug
(
"=============create doc end============"
);
...
...
src/com/yonde/common/DxDocUtil.java
View file @
3f020ba2
...
...
@@ -4,6 +4,7 @@ import com.yonde.basedata.vo.DxDocumentFolderVO;
import
com.yonde.context.vo.DxContextVO
;
import
com.yonde.doc.vo.DxDocumentVO
;
import
com.yonde.part.vo.DxPartVO
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.log4j.Logger
;
import
wt.doc.WTDocument
;
import
wt.folder.Folder
;
...
...
@@ -50,22 +51,21 @@ public class DxDocUtil implements RemoteAccess, Serializable {
public
static
WTDocument
createDoc
(
DxDocumentVO
dxDocumentVO
)
throws
WTException
{
WTContainer
container
=
null
;
DxContextVO
dxContext
=
dxDocumentVO
.
getDxContext
();
logger
.
error
(
"dxContext Name======"
+
dxContext
);
if
(
ObjectsUtil
.
nonNull
(
dxContext
))
{
String
contextName
=
dxContext
.
getName
();
logger
.
error
(
"container Name======"
+
contextName
);
container
=
ContainerUtil
.
getContainerByName
(
contextName
);
logger
.
error
(
"container======"
+
container
);
}
if
(
ObjectsUtil
.
isNull
(
container
))
{
return
null
;
}
String
folderPath
=
null
;
Folder
folder
=
null
;
DxDocumentFolderVO
folderVO
=
dxDocumentVO
.
getDxDocumentFolder
();
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()
WTDocument
doc
=
DocUtil
.
createDoc
(
dxDocumentVO
.
getNumber
(),
dxDocumentVO
.
getName
(),
container
,
folder
,
null
);
...
...
src/com/yonde/common/entity/DXFolder.java
View file @
3f020ba2
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.List
;
public
class
DXFolder
{
public
class
DXFolder
extends
IdVO
{
//文件夹名称
private
String
name
=
""
;
...
...
@@ -18,10 +23,20 @@ public class DXFolder {
private
String
containerName
=
""
;
//容器oid
private
String
containerOid
=
""
;
//文件夹软类型全路径(本期项目文件夹有子类型)
private
String
fullType
=
""
;
private
Boolean
isLeaf
=
false
;
//子文件夹
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
()
{
return
name
;
}
...
...
@@ -58,18 +73,16 @@ public class DXFolder {
public
void
setContainerOid
(
String
containerOid
)
{
this
.
containerOid
=
containerOid
;
}
public
String
getFullType
()
{
return
fullType
;
}
public
void
setFullType
(
String
fullType
)
{
this
.
fullType
=
fullType
;
}
public
List
<
DXFolder
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
DXFolder
>
children
)
{
this
.
children
=
children
;
}
public
Boolean
getLeaf
()
{
return
isLeaf
;
}
public
void
setLeaf
(
Boolean
leaf
)
{
isLeaf
=
leaf
;
}
}
src/com/yonde/common/util/FolderUtil.java
View file @
3f020ba2
...
...
@@ -58,7 +58,7 @@ public class FolderUtil implements RemoteAccess {
dxFolder
.
setContainerOid
(
CommonUtil
.
getPersistableOid
((
WTObject
)
container
));
dxFolder
.
setCabinetOid
(
CommonUtil
.
getPersistableOid
(
cabinet
));
dxFolder
.
setFullType
(
CommonUtil
.
getType
((
WTObject
)
parentFolder
));
//
dxFolder.setFullType(CommonUtil.getType((WTObject)parentFolder));
dxFolder
.
setName
(
parentFolder
.
getName
());
dxFolder
.
setFullPath
(
parentFolder
.
getFolderPath
());
dxFolder
.
setOid
(
CommonUtil
.
getPersistableOid
((
WTObject
)
parentFolder
));
...
...
@@ -204,7 +204,6 @@ public class FolderUtil implements RemoteAccess {
public
static
Folder
getFolder
(
String
oid
)
throws
WTException
{
WTObject
obj
=
(
WTObject
)
CommonUtil
.
getPersistableByOid
(
oid
);
Folder
folder
=
null
;
if
(
obj
instanceof
WTContainer
){
WTContainerRef
containerRef
=
WTContainerRef
.
newWTContainerRef
((
WTContainer
)
obj
);
Cabinet
rootFolder
=
((
WTContainer
)
containerRef
.
getObject
()).
getDefaultCabinet
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment