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
5c0cc697
Commit
5c0cc697
authored
Dec 23, 2022
by
hanson.yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert wtPart
parent
9e6ecfe2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
852 additions
and
36 deletions
+852
-36
IBAHelper.java
src/com/yonde/common/IBAHelper.java
+831
-0
PartUtil.java
src/com/yonde/common/PartUtil.java
+8
-17
PartService.java
src/com/yonde/part/service/PartService.java
+13
-8
DxPart.java
src/com/yonde/part/vo/DxPart.java
+0
-11
No files found.
src/com/yonde/common/IBAHelper.java
0 → 100644
View file @
5c0cc697
This diff is collapsed.
Click to expand it.
src/com/yonde/common/PartUtil.java
View file @
5c0cc697
...
...
@@ -30,6 +30,7 @@ import java.lang.reflect.InvocationTargetException;
import
java.rmi.RemoteException
;
import
java.text.DecimalFormat
;
import
java.util.HashMap
;
import
java.util.Hashtable
;
public
class
PartUtil
implements
RemoteAccess
{
private
static
Logger
logger
=
LogR
.
getLogger
(
PartUtil
.
class
.
getName
());
...
...
@@ -70,14 +71,6 @@ public class PartUtil implements RemoteAccess {
if
(
queryResult
.
hasMoreElements
())
{
part
=
(
WTPart
)
queryResult
.
nextElement
();
}
if
(
part
!=
null
){
System
.
out
.
println
(
"--------Part info-----"
);
System
.
out
.
println
(
"----partNumber-----"
+
part
.
getNumber
());
System
.
out
.
println
(
"----creatorName-----"
+
part
.
getCreatorName
());
System
.
out
.
println
(
"----------------------"
);
}
}
finally
{
SessionServerHelper
.
manager
.
setAccessEnforced
(
enforce
);
}
...
...
@@ -91,7 +84,6 @@ public class PartUtil implements RemoteAccess {
}
public
static
WTPart
createPart
(
String
number
,
String
name
,
HashMap
attributes
,
WTContainerRef
containerRef
)
{
try
{
if
(!
RemoteMethodServer
.
ServerFlag
)
{
...
...
@@ -314,8 +306,7 @@ public class PartUtil implements RemoteAccess {
return
(
TypeIdentifier
)
RemoteMethodServer
.
getDefault
().
invoke
(
"getWTObjectSubType"
,
PartUtil
.
class
.
getName
(),
null
,
new
Class
[]{
WTObject
.
class
},
new
Object
[]{
obj
});
}
else
{
// wt.doc.WTDocument|org.saacc.MEETINGSUGGESTION
TypeIdentifier
typeIdentifier
=
TypedUtility
.
getTypeIdentifier
(
obj
);
return
typeIdentifier
;
return
TypedUtility
.
getTypeIdentifier
(
obj
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -323,10 +314,10 @@ public class PartUtil implements RemoteAccess {
return
null
;
}
public
static
void
main
(
String
[]
args
)
throws
InvocationTargetException
,
RemoteException
{
if
(!
RemoteMethodServer
.
ServerFlag
)
{
RemoteMethodServer
.
getDefault
().
invoke
(
"getLatestPartByNumber"
,
PartUtil
.
class
.
getName
(),
null
,
new
Class
[]{
String
.
class
},
new
Object
[]{
args
[
0
]}
);
}
public
static
void
main
(
String
[]
args
)
throws
WTException
,
InvocationTargetException
,
RemoteException
{
WTPart
part
=
getPartByNumberAndView
(
args
[
0
],
args
[
1
],
false
);
System
.
out
.
println
(
"part number====>"
+
part
.
getNumber
());
Hashtable
hashtable
=
IBAHelper
.
getAllIBAValues
(
part
);
System
.
out
.
println
(
"hashtable====>"
+
hashtable
);
}
}
src/com/yonde/part/service/PartService.java
View file @
5c0cc697
package
com
.
yonde
.
part
.
service
;
import
com.yonde.common.DateTimeUtil
;
import
com.yonde.common.IBAHelper
;
import
com.yonde.common.PartUtil
;
import
com.yonde.part.vo.DxPart
;
import
org.springframework.stereotype.Service
;
...
...
@@ -13,16 +14,22 @@ import wt.type.ClientTypedUtility;
import
wt.util.WTException
;
import
wt.vc.wip.WorkInProgressHelper
;
import
java.lang.reflect.InvocationTargetException
;
import
java.rmi.RemoteException
;
import
java.util.Hashtable
;
import
java.util.Locale
;
@Service
public
class
PartService
{
public
static
DxPart
getPartByNumber
(
String
number
,
String
view
)
throws
WTException
,
RemoteException
{
public
static
DxPart
getPartByNumber
(
String
number
,
String
view
)
throws
WTException
,
RemoteException
,
InvocationTargetException
{
System
.
out
.
println
(
"-----getPartByNumber----"
);
boolean
accessControlled
=
false
;
DxPart
dxPart
=
new
DxPart
();
WTPart
wtPart
=
PartUtil
.
getPartByNumberAndView
(
number
,
view
,
accessControlled
);
System
.
out
.
println
(
"-----getPartByNumber----a"
);
Hashtable
hashtable
=
IBAHelper
.
getAllIBAValues
(
wtPart
);
System
.
out
.
println
(
"-----getPartByNumber----b"
);
if
(
wtPart
!=
null
)
{
WTUser
creat
=
((
WTUser
)
wtPart
.
getCreator
().
getObject
());
dxPart
.
setCreator
(
String
.
format
(
"%s(%s)"
,
creat
.
getFullName
(),
creat
.
getName
()));
...
...
@@ -40,9 +47,9 @@ public class PartService {
System
.
out
.
println
(
"-----getPartByNumber----5"
);
dxPart
.
setState
(
wtPart
.
getState
().
getState
().
getDisplay
(
Locale
.
SIMPLIFIED_CHINESE
));
String
wtType
=
ClientTypedUtility
.
getExternalTypeIdentifier
(
wtPart
);
wtType
=
wtType
.
substring
(
wtType
.
lastIndexOf
(
"."
)+
1
,
wtType
.
length
()
);
System
.
out
.
println
(
"--------wtType------"
+
wtType
);
String
wtType
=
ClientTypedUtility
.
getExternalTypeIdentifier
(
wtPart
);
wtType
=
wtType
.
substring
(
wtType
.
lastIndexOf
(
"|"
)
+
1
);
System
.
out
.
println
(
"--------wtType------"
+
wtType
);
// dxPart.setSubTypeName(PartUtil.getWTObjectSubType(wtPart).getTypename());
dxPart
.
setDefaultUnit
(
wtPart
.
getDefaultUnit
().
getDisplay
(
Locale
.
SIMPLIFIED_CHINESE
));
dxPart
.
setMasterId
(
new
ReferenceFactory
().
getReferenceString
(
ObjectReference
.
newObjectReference
((
wtPart
.
getMaster
().
getPersistInfo
().
getObjectIdentifier
()))));
...
...
@@ -70,9 +77,7 @@ public class PartService {
}
dxPart
.
setVersion
(
wtPart
.
getVersionIdentifier
().
getValue
());
dxPart
.
setIteration
(
wtPart
.
getIterationIdentifier
().
getValue
());
//dxPart.setSubTypeDisplayName(TypedUtility.getTypeIdentifier(wtPart).getTypename());
dxPart
.
setDynamicAttrs
(
hashtable
);
}
return
dxPart
;
}
...
...
src/com/yonde/part/vo/DxPart.java
View file @
5c0cc697
...
...
@@ -36,8 +36,6 @@ public class DxPart implements Serializable {
//todo dynamicAttrs subTypeDisplayName 无法获取
private
Map
<
String
,
Object
>
dynamicAttrs
;
private
String
subTypeDisplayName
;
public
DxPart
()
{
}
...
...
@@ -90,14 +88,6 @@ public class DxPart implements Serializable {
this
.
subTypeName
=
subTypeName
;
}
public
String
getSubTypeDisplayName
()
{
return
subTypeDisplayName
;
}
public
void
setSubTypeDisplayName
(
String
subTypeDisplayName
)
{
this
.
subTypeDisplayName
=
subTypeDisplayName
;
}
public
Map
<
String
,
Object
>
getDynamicAttrs
()
{
return
dynamicAttrs
;
}
...
...
@@ -202,7 +192,6 @@ public class DxPart implements Serializable {
this
.
checkOuted
=
checkOuted
;
}
public
String
getMasterId
()
{
return
masterId
;
}
...
...
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