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
ee6bf74d
Commit
ee6bf74d
authored
Jul 14, 2023
by
hanson.yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
develop 3d view
parent
9a2c6e4b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
176 additions
and
196 deletions
+176
-196
CatiaTransfer.properties
codebase/com/yonde/config/cadpro/CatiaTransfer.properties
+1
-1
DICOpenChecker.java
src/com/yonde/cadpro/checker/impl/DICOpenChecker.java
+0
-4
NewOpenChecker.java
src/com/yonde/cadpro/checker/impl/NewOpenChecker.java
+0
-3
CadFTPConfig.java
src/com/yonde/cadpro/config/CadFTPConfig.java
+0
-25
CadCheckService.java
src/com/yonde/cadpro/service/CadCheckService.java
+0
-2
ModelService.java
src/com/yonde/cadpro/service/ModelService.java
+24
-10
PartVisService.java
src/com/yonde/cadpro/service/PartVisService.java
+10
-15
CADProUtil.java
src/com/yonde/cadpro/util/CADProUtil.java
+0
-3
DBUtil.java
src/com/yonde/cadpro/util/DBUtil.java
+112
-109
AssembleTransformUtil.java
...com/yonde/cadpro/visualization/AssembleTransformUtil.java
+8
-4
AssembleTransformSnapshot.java
...o/visualization/coordinate/AssembleTransformSnapshot.java
+11
-0
VisualizationService.java
...nde/cadpro/visualization/facade/VisualizationService.java
+10
-20
No files found.
codebase/com/yonde/config/cadpro/CatiaTransfer.properties
View file @
ee6bf74d
...
...
@@ -9,7 +9,7 @@ Catia.Transfer.B3d.port=8081
Catia.Transfer.B3d.targetNameSpace
=
www.ptc.com/ws
Catia.Transfer.B3d.serviceName
=
ConvertModel2B3dService
#For FTP Config
Catia.ftp.host
=
192.168.1.
235
Catia.ftp.host
=
192.168.1.
177
Catia.ftp.port
=
21
Catia.ftp.username
=
ftpuser
Catia.ftp.password
=
Aa12345678!
...
...
src/com/yonde/cadpro/checker/impl/DICOpenChecker.java
View file @
ee6bf74d
...
...
@@ -3,17 +3,13 @@ package com.yonde.cadpro.checker.impl;
import
com.yonde.cadpro.checker.AbstractCADProChecker
;
import
com.yonde.cadpro.config.CADProConfigPropertiesUtil
;
import
com.yonde.cadpro.util.CADProUtil
;
import
org.apache.log4j.Logger
;
import
wt.fc.WTObject
;
import
wt.log4j.LogR
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
DICOpenChecker
extends
AbstractCADProChecker
{
private
static
final
Logger
log
=
LogR
.
getLogger
(
DICOpenChecker
.
class
.
getName
());
@Override
public
List
<
WTObject
>
check
(
List
<
String
>
ids
)
throws
Exception
{
//必选校验
...
...
src/com/yonde/cadpro/checker/impl/NewOpenChecker.java
View file @
ee6bf74d
...
...
@@ -5,10 +5,8 @@ import com.yonde.cadpro.checker.AbstractCADProChecker;
import
com.yonde.cadpro.config.CADProConfigPropertiesUtil
;
import
com.yonde.cadpro.util.EPMUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.log4j.Logger
;
import
wt.epm.EPMDocument
;
import
wt.fc.WTObject
;
import
wt.log4j.LogR
;
import
wt.part.WTPart
;
import
wt.util.WTException
;
...
...
@@ -16,7 +14,6 @@ import java.util.ArrayList;
import
java.util.List
;
public
class
NewOpenChecker
extends
AbstractCADProChecker
{
private
static
final
Logger
log
=
LogR
.
getLogger
(
NewOpenChecker
.
class
.
getName
());
@Override
public
List
<
WTObject
>
check
(
List
<
String
>
ids
)
throws
Exception
{
...
...
src/com/yonde/cadpro/config/CadFTPConfig.java
deleted
100644 → 0
View file @
9a2c6e4b
package
com
.
yonde
.
cadpro
.
config
;
/**
* Created on 2023/5/5 0005
* <p>
* * #For FTP Config
*
* @author
*/
public
class
CadFTPConfig
{
public
static
final
String
HOST
=
"192.168.1.240"
;
public
static
final
Integer
PORT
=
21
;
public
static
final
String
USERNAME
=
"ftpuser"
;
public
static
final
String
PASSWORD
=
"Aa12345678!"
;
public
static
final
String
REMOTEPATH
=
"/"
;
public
static
final
String
ROOTPATH
=
"D:/Inetpub/ftproot"
;
public
static
final
String
VISUALIZATIONPATH
=
"D:/Inetpub/ftproot/Visualization"
;
public
static
final
String
TRANSFERRESULTPATH
=
"D:/Inetpub/ftproot/3D_transfer_result"
;
}
src/com/yonde/cadpro/service/CadCheckService.java
View file @
ee6bf74d
...
...
@@ -536,7 +536,6 @@ public class CadCheckService implements RemoteAccess {
searchUtil
.
setConfigSpec
(
new
LatestConfigSpec
());
QueryResult
epmQr
=
searchUtil
.
queryObjects
();
//epmQr = filterIterationsByModifyTime(epmQr);
if
(
epmQr
!=
null
&&
epmQr
.
hasMoreElements
())
{
epm
=
(
EPMDocument
)
epmQr
.
nextElement
();
}
...
...
@@ -558,7 +557,6 @@ public class CadCheckService implements RemoteAccess {
}
if
(!
isIngoreUpdate
)
{
//已存在,校验EPM是否被当前用户检出
System
.
out
.
println
(
"EPM已经存在"
);
if
(
CommonUtil
.
isCheckedOut
(
epm
))
{
if
(!
CommonUtil
.
isCheckedOut
(
epm
,
null
))
{
WTPrincipal
checkoutUser
=
null
;
...
...
src/com/yonde/cadpro/service/ModelService.java
View file @
ee6bf74d
...
...
@@ -7,7 +7,6 @@ import com.yonde.cadpro.bean.MBDAttribute;
import
com.yonde.cadpro.bean.MBDAttributes
;
import
com.yonde.cadpro.bean.MaterialUsedRDefinitionBean
;
import
com.yonde.cadpro.bean.ModelBaseInfo
;
import
com.yonde.cadpro.config.CadFTPConfig
;
import
com.yonde.cadpro.config.CatiaClientConfig
;
import
com.yonde.cadpro.config.CatiaInteConfigPropertiesUtil
;
import
com.yonde.cadpro.util.*
;
...
...
@@ -1160,8 +1159,12 @@ public class ModelService {
remotePath
=
remotePath
.
substring
(
0
,
remotePath
.
lastIndexOf
(
"/"
));
System
.
out
.
println
(
"remotePath : "
+
remotePath
);
ExtProperties
catiaTransferConfig
=
VisualizationFacade
.
catiaTransferConfig
;
FTPOperation
ftpOperation
=
new
FTPOperation
();
boolean
connect
=
ftpOperation
.
connect
(
CadFTPConfig
.
HOST
,
CadFTPConfig
.
PORT
,
CadFTPConfig
.
USERNAME
,
CadFTPConfig
.
PASSWORD
);
boolean
connect
=
ftpOperation
.
connect
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_HOST
),
Integer
.
valueOf
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PORT
)),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_USERNAME
),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PASSWORD
));
if
(!
connect
)
{
throw
new
WTException
(
"FTP连接失败,请重试或联系系统管理员。"
);
}
...
...
@@ -2676,9 +2679,12 @@ public class ModelService {
String
remotePath
=
FilenameUtils
.
getFullPath
(
modelFileUri
);
System
.
out
.
println
(
"remotePath : "
+
remotePath
);
ExtProperties
catiaTransferConfig
=
VisualizationFacade
.
catiaTransferConfig
;
FTPOperation
ftpOperation
=
new
FTPOperation
();
boolean
connect
=
ftpOperation
.
connect
(
CadFTPConfig
.
HOST
,
CadFTPConfig
.
PORT
,
CadFTPConfig
.
USERNAME
,
CadFTPConfig
.
PASSWORD
);
boolean
connect
=
ftpOperation
.
connect
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_HOST
),
Integer
.
valueOf
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PORT
)),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_USERNAME
),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PASSWORD
));
if
(!
connect
)
{
throw
new
WTException
(
"FTP连接失败,请重试或联系系统管理员。"
);
...
...
@@ -2734,10 +2740,12 @@ public class ModelService {
throw
new
WTException
(
"modelFileUri["
+
modelFileUri
+
"] must catzip format"
);
}
ExtProperties
catiaTransferConfig
=
VisualizationFacade
.
catiaTransferConfig
;
FTPOperation
ftpOperation
=
new
FTPOperation
();
boolean
connect
=
ftpOperation
.
connect
(
CadFTPConfig
.
HOST
,
CadFTPConfig
.
PORT
,
CadFTPConfig
.
USERNAME
,
CadFTPConfig
.
PASSWORD
);
boolean
connect
=
ftpOperation
.
connect
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_HOST
),
Integer
.
valueOf
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PORT
)),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_USERNAME
),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PASSWORD
));
if
(!
connect
)
{
throw
new
WTException
(
"FTP连接失败,请重试或联系系统管理员。"
);
}
...
...
@@ -2792,7 +2800,9 @@ public class ModelService {
String
remotePath
=
FilenameUtils
.
getFullPath
(
modelFileUri
);
System
.
out
.
println
(
"remotePath : "
+
remotePath
);
String
absoluteRootPath
=
CadFTPConfig
.
ROOTPATH
;
String
absoluteRootPath
=
CatiaInteConfigPropertiesUtil
.
getFtpRootPath
();;
absoluteRootPath
=
absoluteRootPath
.
replace
(
"\\"
,
"/"
);
if
(
absoluteRootPath
.
endsWith
(
"/"
))
{
absoluteRootPath
.
substring
(
0
,
absoluteRootPath
.
length
()
-
1
);
...
...
@@ -2890,8 +2900,12 @@ public class ModelService {
modelThumbnailName
=
modelThumbnailName
+
"."
+
extension
;
}
ExtProperties
catiaTransferConfig
=
VisualizationFacade
.
catiaTransferConfig
;
FTPOperation
ftpOperation
=
new
FTPOperation
();
boolean
connect
=
ftpOperation
.
connect
(
CadFTPConfig
.
HOST
,
CadFTPConfig
.
PORT
,
CadFTPConfig
.
USERNAME
,
CadFTPConfig
.
PASSWORD
);
boolean
connect
=
ftpOperation
.
connect
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_HOST
),
Integer
.
valueOf
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PORT
)),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_USERNAME
),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PASSWORD
));
if
(!
connect
)
{
...
...
@@ -2930,7 +2944,7 @@ public class ModelService {
String
remotePath
=
FilenameUtils
.
getFullPath
(
modelFileUri
);
System
.
out
.
println
(
"remotePath : "
+
remotePath
);
String
absoluteRootPath
=
Ca
dFTPConfig
.
ROOTPATH
;
String
absoluteRootPath
=
Ca
tiaInteConfigPropertiesUtil
.
getFtpRootPath
();
;
absoluteRootPath
=
absoluteRootPath
.
replace
(
"\\"
,
"/"
);
if
(
absoluteRootPath
.
endsWith
(
"/"
))
{
absoluteRootPath
.
substring
(
0
,
absoluteRootPath
.
length
()
-
1
);
...
...
src/com/yonde/cadpro/service/PartVisService.java
View file @
ee6bf74d
...
...
@@ -100,10 +100,12 @@ public class PartVisService implements RemoteAccess {
*/
public
static
DxCADBomVo
expandCADBom
(
String
oid
,
String
userName
)
throws
Exception
{
if
(!
RemoteMethodServer
.
ServerFlag
)
{
return
(
DxCADBomVo
)
RemoteMethodServer
.
getDefault
().
invoke
(
"expandCADBom"
,
PartVisService
.
class
.
getName
(),
null
,
Object
obj
=
RemoteMethodServer
.
getDefault
().
invoke
(
"expandCADBom"
,
PartVisService
.
class
.
getName
(),
null
,
new
Class
[]{
String
.
class
,
String
.
class
},
new
Object
[]{
oid
,
userName
});
return
obj
==
null
?
null
:
(
DxCADBomVo
)
obj
;
}
else
{
DxCADBomVo
rootVo
=
null
;
oid
=
WTPARTIDPREFIX
+
oid
;
System
.
out
.
println
(
">>>expandCADBom oid:"
+
oid
+
" userName:"
+
userName
);
boolean
enforced
=
true
;
...
...
@@ -121,7 +123,6 @@ public class PartVisService implements RemoteAccess {
}
else
if
(
per
instanceof
EPMDocument
)
{
rootEPM
=
(
EPMDocument
)
per
;
}
DxCADBomVo
rootVo
=
null
;
if
(
rootEPM
!=
null
)
{
System
.
out
.
println
(
"process rootEPM : "
+
rootEPM
.
getDisplayIdentifier
());
Matrix4d
rootMatrix
=
calculateMatrixByAssembleTransformInfo2
(
null
,
null
);
...
...
@@ -132,11 +133,11 @@ public class PartVisService implements RemoteAccess {
rootVo
.
setTransform
(
trans
);
}
}
return
rootVo
;
}
catch
(
Exception
e
)
{
throw
new
WTException
(
e
);
e
.
printStackTrace
(
);
}
finally
{
SessionServerHelper
.
manager
.
setAccessEnforced
(
enforced
);
return
rootVo
;
}
}
}
...
...
@@ -158,8 +159,7 @@ public class PartVisService implements RemoteAccess {
EPMDocConfigSpec
epmDocConfigSpec
=
new
EPMDocConfigSpec
();
epmDocConfigSpec
.
setLatestActive
();
QueryResult
qr
=
StructHelper
.
service
.
navigateUsesToIteration
(
epmDoc
,
EPMMemberLink
.
class
,
false
,
epmDocConfigSpec
);
QueryResult
qr
=
StructHelper
.
service
.
navigateUsesToIteration
(
epmDoc
,
EPMMemberLink
.
class
,
false
,
epmDocConfigSpec
);
if
(
qr
!=
null
)
{
while
(
qr
.
hasMoreElements
())
{
Persistable
[]
pp
=
(
Persistable
[])
qr
.
nextElement
();
...
...
@@ -167,15 +167,13 @@ public class PartVisService implements RemoteAccess {
Persistable
per
=
pp
[
1
];
if
(
per
instanceof
EPMDocument
)
{
EPMDocument
childEPM
=
(
EPMDocument
)
per
;
System
.
out
.
println
(
"put memberLink["
+
memberLink
+
"] = childEPM["
+
childEPM
.
getDisplayIdentity
()
+
"] to allChildsWithLink..."
);
System
.
out
.
println
(
"put memberLink["
+
memberLink
+
"] = childEPM["
+
childEPM
.
getDisplayIdentity
()
+
"] to allChildsWithLink..."
);
childEPM
=
assemblyOriginal
(
childEPM
);
allChildsWithLink
.
put
(
memberLink
,
childEPM
);
if
(!
allChilds
.
contains
(
childEPM
))
{
System
.
out
.
println
(
"add childEPM["
+
childEPM
.
getDisplayIdentity
()
+
"] to allChilds..."
);
System
.
out
.
println
(
"add childEPM["
+
childEPM
.
getDisplayIdentity
()
+
"] to allChilds..."
);
allChilds
.
add
(
childEPM
);
}
}
else
if
(
per
instanceof
EPMDocumentMaster
)
{
...
...
@@ -195,14 +193,12 @@ public class PartVisService implements RemoteAccess {
appendEPMInfo
(
cadStructureBuilder
,
childEPM
);
}
String
cadStructureKey
=
cadStructureBuilder
.
toString
();
AssembleTransformSnapshot
snapshot
=
getAssembleTransformSnapshotByStructure
(
cadStructureKey
,
epmDoc
);
AssembleTransformSnapshot
snapshot
=
getAssembleTransformSnapshotByStructure
(
cadStructureKey
,
epmDoc
);
Set
<
EPMMemberLink
>
allMemberlinks
=
allChildsWithLink
.
keySet
();
for
(
EPMMemberLink
epmMemberLink
:
allMemberlinks
)
{
EPMDocument
linkedChildEPM
=
allChildsWithLink
.
get
(
epmMemberLink
);
System
.
out
.
println
(
"process epmMemberLink : "
+
epmMemberLink
+
", linkedChildEPM : "
+
linkedChildEPM
);
System
.
out
.
println
(
"process epmMemberLink : "
+
epmMemberLink
+
", linkedChildEPM : "
+
linkedChildEPM
);
DxCADBomVo
childVo
=
null
;
Matrix4d
calculateMatrix
=
null
;
...
...
@@ -463,7 +459,6 @@ public class PartVisService implements RemoteAccess {
try
{
int
structureKeyHash
=
cadStructureKey
.
hashCode
();
System
.
out
.
println
(
"structureKeyHash : "
+
structureKeyHash
);
assembleTransformSnapshot
=
AssembleTransformUtil
.
findAssembleTransformSnapshot
(
EPMUtil
.
getOROid
(
parentEPM
),
structureKeyHash
);
System
.
out
.
println
(
"assembleTransformSnapshot by structureKeyHash["
+
structureKeyHash
+
"]:"
+
assembleTransformSnapshot
);
...
...
src/com/yonde/cadpro/util/CADProUtil.java
View file @
ee6bf74d
...
...
@@ -443,12 +443,9 @@ public class CADProUtil {
*/
public
static
Map
<
String
,
String
>
getCADProIbaMapping
()
{
try
{
String
mappingFile
=
CADProConstants
.
wthome
+
CAD_PRO_IBA_MAPPING_FILE
;
log
.
debug
(
"mappingFile : "
+
mappingFile
);
String
jsonStr
=
FileUtils
.
readFileToString
(
new
File
(
mappingFile
),
"UTF-8"
);
return
(
Map
<
String
,
String
>)
JSONObject
.
parseObject
(
jsonStr
,
Map
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"getCADProIbaMapping error..."
,
e
);
}
...
...
src/com/yonde/cadpro/util/DBUtil.java
View file @
ee6bf74d
This diff is collapsed.
Click to expand it.
src/com/yonde/cadpro/visualization/AssembleTransformUtil.java
View file @
ee6bf74d
...
...
@@ -11,6 +11,7 @@ import wt.util.WTException;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
...
...
@@ -33,16 +34,19 @@ public class AssembleTransformUtil {
}
StringBuffer
sql
=
new
StringBuffer
(
"select * from ASSEMBLETRANSFORMSNAPSHOT ast where 1 =1 "
);
if
(
StringUtils
.
isNotBlank
(
parentId
))
{
sql
.
append
(
"and PARENTID =
"
+
parentId
);
sql
.
append
(
"and PARENTID =
'"
+
parentId
+
"' "
);
}
if
(
snapshotHash
!=
0
)
{
sql
.
append
(
"and SNAPSHOTHASH = '"
+
snapshotHash
+
"' "
);
sql
.
append
(
"and SNAPSHOTHASH = '"
+
snapshotHash
+
"' "
);
}
System
.
out
.
println
(
">>>findAssembleTransformSnapshot sql:"
+
sql
);
Object
obj
=
DBUtil
.
queryForObject
(
sql
.
toString
(),
AssembleTransformSnapshot
.
class
);
Object
obj
=
DBUtil
.
queryForMap
(
sql
.
toString
());
if
(
obj
!=
null
)
{
return
(
AssembleTransformSnapshot
)
obj
;
System
.
out
.
println
(
">>>findAssembleTransformSnapshot map:"
+
obj
);
return
new
AssembleTransformSnapshot
((
Map
<
String
,
Object
>)
obj
);
}
else
{
System
.
out
.
println
(
">>>findAssembleTransformSnapshot map is null"
);
return
null
;
}
}
...
...
src/com/yonde/cadpro/visualization/coordinate/AssembleTransformSnapshot.java
View file @
ee6bf74d
package
com
.
yonde
.
cadpro
.
visualization
.
coordinate
;
import
java.io.Serializable
;
import
java.util.Map
;
/**
* @description: 装配矩阵关系对象,用于保存装配的装配关系各模型版本快照
...
...
@@ -22,6 +23,16 @@ public class AssembleTransformSnapshot implements Serializable {
*/
private
String
snapshotHash
;
public
AssembleTransformSnapshot
(
Map
<
String
,
Object
>
map
)
{
if
(!
map
.
isEmpty
()){
this
.
id
=
String
.
valueOf
(
map
.
get
(
"id"
));
this
.
parentId
=
String
.
valueOf
(
map
.
get
(
"parentId"
));
this
.
snapshotHash
=
String
.
valueOf
(
map
.
get
(
"snapshotHash"
));
}
else
{
new
AssembleTransformSnapshot
();
}
}
public
String
getId
()
{
return
id
;
}
...
...
src/com/yonde/cadpro/visualization/facade/VisualizationService.java
View file @
ee6bf74d
...
...
@@ -10,7 +10,6 @@ import com.yonde.cadpro.visualization.catia.xmlb3dbean.B3dRoot;
import
com.yonde.cadpro.visualization.catia.xmlb3dbean.B3dStructer
;
import
com.yonde.cadpro.visualization.coordinate.AssembleTransformInfo
;
import
com.yonde.cadpro.visualization.coordinate.AssembleTransformSnapshot
;
import
com.yonde.common.CommonUtil
;
import
com.yonde.common.RfUtil
;
import
com.yonde.doc.entity.WsResult
;
import
org.apache.commons.io.FileUtils
;
...
...
@@ -96,17 +95,15 @@ public class VisualizationService {
//1. 下载文件至临时目录
String
uuidStr
=
UUID
.
randomUUID
().
toString
();
//pdm临时目录
String
tempFolderPath
=
CADProConstants
.
wttemp
+
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_TEMPFOLDERPATH
)
+
uuidStr
+
"/"
;
tempFolderPath
=
tempFolderPath
.
replace
(
"\\"
,
"/"
);
System
.
out
.
println
(
"tempFolderPath : "
+
tempFolderPath
);
File
tempFolder
=
new
File
(
tempFolderPath
);
if
(!
tempFolder
.
exists
())
{
tempFolder
.
mkdirs
();
}
File
appDataFile
=
ContentUtil
.
downloadApplicationData
(
appData
,
tempFolderPath
,
""
,
contentHolder
);
System
.
out
.
println
(
"appDataFile : "
+
appDataFile
);
List
<
File
>
uploadFiles
=
new
ArrayList
<
File
>();
if
(!
transferModel
)
{
...
...
@@ -119,38 +116,30 @@ public class VisualizationService {
retriveChildrenAppDataFiles
(
rootEpm
,
childrenAppDataFiles
,
tempFolderPath
);
uploadFiles
.
addAll
(
childrenAppDataFiles
);
}
System
.
out
.
println
(
"uploadFiles : "
+
uploadFiles
);
//2. 上传至FTP目录
//2. 上传
worker机
至FTP目录
FtpUtil
ftpUtil
=
new
FtpUtil
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_HOST
),
Integer
.
valueOf
(
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PORT
)),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_USERNAME
),
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PASSWORD
));
if
(!
ftpUtil
.
connectServer
())
{
throw
new
WTException
(
"FTP连接失败,请重试或联系系统管理员。"
);
}
String
ftpRemoteFolder
=
""
;
if
(
transferModel
)
{
ftpRemoteFolder
=
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_TEMPFOLDERPATH
)
+
uuidStr
+
"/"
;
}
ftpRemoteFolder
=
ftpRemoteFolder
.
replace
(
"\\"
,
"/"
);
System
.
out
.
println
(
"ftpRemoteFolder : "
+
ftpRemoteFolder
);
ftpUtil
.
uploadFile
(
ftpRemoteFolder
,
uploadFiles
);
ftpUtil
.
closeServer
();
String
remoteFilePath
=
ftpRemoteFolder
+
appDataFile
.
getName
();
remoteFilePath
=
remoteFilePath
.
replace
(
"\\"
,
"/"
);
System
.
out
.
println
(
"remoteFilePath :"
+
remoteFilePath
);
//此处的文件路径为worker机catia.zip的路径
//3. 调用转可视化服务
//3. 调用
worker机
转可视化服务
WsResult
wsResult
=
null
;
if
(
contentHolder
instanceof
EPMDocument
)
{
//处理三维可视化
wsResult
=
new
ConvertCatia2B3dUtil
(
catiaTransferConfig
).
convert
(
remoteFilePath
);
}
...
...
@@ -161,7 +150,6 @@ public class VisualizationService {
if
(
wsResult
.
isResult
())
{
transformedFileRemotePath
=
wsResult
.
getInfo
();
transformedFileRemotePath
=
transformedFileRemotePath
.
replace
(
"\\"
,
"/"
);
System
.
out
.
println
(
"transformedFileRemotePath :"
+
transformedFileRemotePath
);
String
transformedFtpFullPath
=
""
;
if
(!
transferModel
)
{
...
...
@@ -174,7 +162,6 @@ public class VisualizationService {
}
}
transformedFtpFullPath
=
transformedFtpFullPath
.
replace
(
"\\"
,
"/"
);
System
.
out
.
println
(
"transformedFtpFullPath :"
+
transformedFtpFullPath
);
if
(
StringUtils
.
isBlank
(
transformedFtpFullPath
))
{
throw
new
WTException
(
"获取可视化转换文件失败"
);
...
...
@@ -190,7 +177,7 @@ public class VisualizationService {
}
System
.
out
.
println
(
"transformedFtpPath :"
+
transformedFtpPath
);
System
.
out
.
println
(
"transformedFileName :"
+
transformedFileName
);
//woker机b3d转换完成后将文件通过ftp下载到pdm codebase/tempDownload/时间戳/ 文件夹下
//wo
r
ker机b3d转换完成后将文件通过ftp下载到pdm codebase/tempDownload/时间戳/ 文件夹下
ftpUtil
=
new
FtpUtil
(
VisualizationFacade
.
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_HOST
),
Integer
.
valueOf
(
VisualizationFacade
.
catiaTransferConfig
.
getValueByKey
(
CADProConstants
.
CONFIG_KEY_CATIA_FTP_PORT
)),
...
...
@@ -255,10 +242,8 @@ public class VisualizationService {
String
b3dFilePath
=
part
.
getFilePath
();
b3dFilePath
=
tempFolderPath
+
b3dFilePath
;
System
.
out
.
println
(
"b3dFilePath : "
+
b3dFilePath
);
String
transform
=
StringUtils
.
trimToEmpty
(
part
.
getRelativeTransform
());
System
.
out
.
println
(
"transform : "
+
transform
);
Set
<
String
>
b3ds
=
numberVisMap
.
get
(
cadNumber
);
if
(
b3ds
==
null
)
{
b3ds
=
new
HashSet
<
String
>();
...
...
@@ -407,7 +392,7 @@ public class VisualizationService {
}
}
if
(
snapshot
==
null
)
{
snapshot
=
AssembleTransformUtil
.
newAssembleTransformSnapshot
(
CommonUtil
.
getPersistableOid
(
rootCAD
),
cadStructureKey
);
snapshot
=
AssembleTransformUtil
.
newAssembleTransformSnapshot
(
EPMUtil
.
getOROid
(
rootCAD
),
String
.
valueOf
(
structureKeyHash
)
);
}
if
(
snapshot
!=
null
)
{
Set
<
EPMMemberLink
>
allMembership
=
memberLinkWithTrasform
...
...
@@ -582,6 +567,11 @@ public class VisualizationService {
try
{
FileUtils
.
cleanDirectory
(
tempFolder
);
FileUtils
.
deleteQuietly
(
tempFolder
);
File
xmlFile
=
new
File
(
downloadFile
);
if
(
xmlFile
.
exists
()){
FileUtils
.
cleanDirectory
(
xmlFile
.
getParentFile
());
FileUtils
.
deleteQuietly
(
xmlFile
.
getParentFile
());
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"Delete tempFolder["
+
tempFolder
+
"] error..."
,
e
);
}
...
...
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