Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inet-doc-expand
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
INET-TWO
server
inet-doc-expand
Commits
f1fd1dfb
Commit
f1fd1dfb
authored
Aug 01, 2024
by
pchxue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置文件修改
parent
4036e65d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
286 additions
and
121 deletions
+286
-121
jacob.jar
dcs-doc-core/lib/jacob.jar
+0
-0
pom.xml
dcs-doc-core/pom.xml
+29
-2
ProcessDataUtils.java
.../com/yonde/dcs/document/core/events/ProcessDataUtils.java
+2
-1
ExtAutoTaskServiceImpl.java
...cs/document/core/service/impl/ExtAutoTaskServiceImpl.java
+25
-10
CommonUtil.java
...ain/java/com/yonde/dcs/document/core/util/CommonUtil.java
+95
-0
ExtDocUtil.java
...ain/java/com/yonde/dcs/document/core/util/ExtDocUtil.java
+29
-24
FileUtils.java
...main/java/com/yonde/dcs/document/core/util/FileUtils.java
+7
-0
FreemarkerHandler.java
...a/com/yonde/dcs/document/core/util/FreemarkerHandler.java
+4
-1
Word2PdfJacobUtil.java
...a/com/yonde/dcs/document/core/util/Word2PdfJacobUtil.java
+2
-1
WorkFlowUtil.java
...n/java/com/yonde/dcs/document/core/util/WorkFlowUtil.java
+93
-82
No files found.
dcs-doc-core/lib/jacob.jar
0 → 100644
View file @
f1fd1dfb
File added
dcs-doc-core/pom.xml
View file @
f1fd1dfb
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<artifactId>
dcs-doc-entity
</artifactId>
<artifactId>
dcs-doc-entity
</artifactId>
<version>
4.1-RELEASE
</version>
<version>
4.1-RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.yonde.dex
</groupId>
<groupId>
com.yonde.dex
</groupId>
<artifactId>
dex-datacenter-globalsearch-listener
</artifactId>
<artifactId>
dex-datacenter-globalsearch-listener
</artifactId>
</dependency>
</dependency>
...
@@ -81,13 +81,40 @@
...
@@ -81,13 +81,40 @@
<dependency>
<dependency>
<groupId>
com.yonde.dex
</groupId>
<groupId>
com.yonde.dex
</groupId>
<artifactId>
dex-initialization-rule-runtime
</artifactId>
<artifactId>
dex-initialization-rule-runtime
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
<artifactId>
spring-test
</artifactId>
<version>
5.2.12.RELEASE
</version>
<version>
5.2.12.RELEASE
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.jacob
</groupId>
<artifactId>
jacob
</artifactId>
<version>
1.19
</version>
<scope>
system
</scope>
<systemPath>
${project.basedir}/lib/jacob.jar
</systemPath>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
3.15
</version>
</dependency>
<dependency>
<groupId>
org.apache.xmlbeans
</groupId>
<artifactId>
xmlbeans
</artifactId>
<version>
2.5.0
</version>
</dependency>
<dependency>
<groupId>
org.apache.pdfbox
</groupId>
<artifactId>
pdfbox
</artifactId>
<version>
2.0.24
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.freemarker
</groupId>
<artifactId>
freemarker
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/events/ProcessDataUtils.java
View file @
f1fd1dfb
...
@@ -15,6 +15,7 @@ import com.yonde.dcs.document.common.vo.DxDocumentVO;
...
@@ -15,6 +15,7 @@ import com.yonde.dcs.document.common.vo.DxDocumentVO;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.util.FileUtils
;
import
com.yonde.dcs.document.core.util.FileUtils
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessVO
;
import
com.yonde.dex.wfc.common.vo.WfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.WfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInstVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInstVO
;
import
com.yonde.dex.wfc.feign.api.DexWorkFlowService
;
import
com.yonde.dex.wfc.feign.api.DexWorkFlowService
;
...
@@ -67,7 +68,7 @@ public class ProcessDataUtils {
...
@@ -67,7 +68,7 @@ public class ProcessDataUtils {
*/
*/
public
void
processData
(
DxDocumentVO
documentVo
)
{
public
void
processData
(
DxDocumentVO
documentVo
)
{
String
subTypeName
=
documentVo
.
getSubTypeName
();
String
subTypeName
=
documentVo
.
getSubTypeName
();
WfProcessInst
VO
DxWfProcessInstVO
=
workFlowUtil
.
getWfProcessInst
(
documentVo
);
DxWfProcess
VO
DxWfProcessInstVO
=
workFlowUtil
.
getWfProcessInst
(
documentVo
);
DxWfProcessInfoVO
wfProcessInfoVO
=
dexWorkFlowService
.
getProcessInstDetailById
(
DxWfProcessInstVO
.
getId
());
DxWfProcessInfoVO
wfProcessInfoVO
=
dexWorkFlowService
.
getProcessInstDetailById
(
DxWfProcessInstVO
.
getId
());
switch
(
subTypeName
)
{
switch
(
subTypeName
)
{
case
Constants
.
INTERNAL_INTERFACE
:
case
Constants
.
INTERNAL_INTERFACE
:
...
...
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/service/impl/ExtAutoTaskServiceImpl.java
View file @
f1fd1dfb
...
@@ -10,12 +10,15 @@ import com.yonde.dcs.document.common.vo.*;
...
@@ -10,12 +10,15 @@ import com.yonde.dcs.document.common.vo.*;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.events.DocBeforeCreateEvent
;
import
com.yonde.dcs.document.core.events.DocBeforeCreateEvent
;
import
com.yonde.dcs.document.core.events.ProcessDataUtils
;
import
com.yonde.dcs.document.core.events.ProcessDataUtils
;
import
com.yonde.dcs.document.core.factory.NCRSCUtils
;
import
com.yonde.dcs.document.core.factory.TechnicalFileUtils
;
import
com.yonde.dcs.document.core.factory.TechnicalFileUtils
;
import
com.yonde.dcs.document.core.service.*
;
import
com.yonde.dcs.document.core.service.*
;
import
com.yonde.dcs.document.core.util.ExtDocUtil
;
import
com.yonde.dcs.document.core.util.ExtDocUtil
;
import
com.yonde.dcs.document.core.util.FileUtils
;
import
com.yonde.dcs.document.core.util.FileUtils
;
import
com.yonde.dcs.document.core.util.WorkFlowUtil
;
import
com.yonde.dcs.document.core.util.WorkFlowUtil
;
import
com.yonde.dcs.document.core.word.ImportWordService
;
import
com.yonde.dcs.document.core.word.ImportWordService
;
import
com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign
;
import
com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign
;
import
com.yonde.dcs.plan.feign.ExtPlanDocLinkServiceFeign
;
import
com.yonde.dcs.plan.feign.ExtPlanDocLinkServiceFeign
;
import
com.yonde.dcs.plan.feign.ExtPlanServiceFeign
;
import
com.yonde.dcs.plan.feign.ExtPlanServiceFeign
;
...
@@ -221,7 +224,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -221,7 +224,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//得到souceId获取计划,更新计划状态
//得到souceId获取计划,更新计划状态
ExtPlanVO
source
=
planDocLinkVO
.
getSource
();
ExtPlanVO
source
=
planDocLinkVO
.
getSource
();
source
.
setTaskState
(
Constants
.
COMPLETED
);
source
.
setTaskState
(
Constants
.
COMPLETED
);
extPlanService
.
saveAndChangeState
(
source
);
// TODO: 2024/8/1 extPlanService.saveOrUpdate这个方法不存在
// extPlanService.saveOrUpdate(source);
}
}
}
}
documentVO
.
setState
(
state
);
documentVO
.
setState
(
state
);
...
@@ -416,7 +420,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -416,7 +420,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/
*/
@Override
@Override
public
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
)
{
public
List
<
DxOrganizationVO
>
searchOrgNameByUserId
(
Long
userId
,
String
code
)
{
return
extPlanService
.
searchOrgNameByUserId
(
userId
,
code
);
// TODO: 2024/8/1 searchOrgNameByUserId这个方法不存在
// return extPlanService.searchOrgNameByUserId(userId, code);
return
null
;
}
}
/**
/**
...
@@ -595,7 +601,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -595,7 +601,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
doc
.
setDynamicAttrs
(
map
);
doc
.
setDynamicAttrs
(
map
);
doc
.
setState
(
extPlanVO
.
getPhaseState
());
doc
.
setState
(
extPlanVO
.
getPhaseState
());
//查询文档分类
//查询文档分类
this
.
extPlanService
.
searchFileType
(
extPlanVO
.
getFileType
(),
doc
);
// TODO: 2024/8/1 extPlanService.searchFileT这个方法不存在
// this.extPlanService.searchFileType(extPlanVO.getFileType(), doc);
doc
.
markCreatorIdHold
();
doc
.
markCreatorIdHold
();
doc
.
markModifyIdHold
();
doc
.
markModifyIdHold
();
//设置文档创建者
//设置文档创建者
...
@@ -605,12 +612,14 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -605,12 +612,14 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//绑定计划和文档的link
//绑定计划和文档的link
ExtPlanDocLinkVO
planDocLinkVO
=
new
ExtPlanDocLinkVO
();
ExtPlanDocLinkVO
planDocLinkVO
=
new
ExtPlanDocLinkVO
();
planDocLinkVO
.
setSource
(
extPlanVO
);
planDocLinkVO
.
setSource
(
extPlanVO
);
planDocLinkVO
.
setTarget
(
dxDocumentVO
);
// TODO: 2024/8/1 DxDocumentVO参数类型不匹对
// planDocLinkVO.setTarget(dxDocumentVO);
planDocLinkService
.
save
(
planDocLinkVO
);
planDocLinkService
.
save
(
planDocLinkVO
);
}
}
if
(
"计划反馈类"
.
equals
(
extPlanVO
.
getFeedbackType
()))
{
if
(
"计划反馈类"
.
equals
(
extPlanVO
.
getFeedbackType
()))
{
//向计划执行人分发通知
//向计划执行人分发通知
this
.
extPlanService
.
generatePlanDistributeRecord
(
extPlanVO
);
// TODO: 2024/8/1 extPlanService.generatePlanDistributeRecord方法不存在
// this.extPlanService.generatePlanDistributeRecord(extPlanVO);
}
}
}
}
...
@@ -637,12 +646,16 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -637,12 +646,16 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
String
filePath
=
Constants
.
JD_BEFORE_MERGER_PATH
+
documentVO
.
getSubTypeName
()
+
"/"
+
documentVO
.
getNumber
()
+
"/"
+
Constants
.
MERGER_SOURCE
;
String
filePath
=
Constants
.
JD_BEFORE_MERGER_PATH
+
documentVO
.
getSubTypeName
()
+
"/"
+
documentVO
.
getNumber
()
+
"/"
+
Constants
.
MERGER_SOURCE
;
String
fileInputName
=
Constants
.
BEFORE_MERGER_PATH
+
documentVO
.
getSubTypeName
()
+
"/"
+
documentVO
.
getNumber
()
+
"/"
+
Constants
.
MERGER_TARGET
+
"/"
+
Constants
.
MERGER_FILE_NAME
;
String
fileInputName
=
Constants
.
BEFORE_MERGER_PATH
+
documentVO
.
getSubTypeName
()
+
"/"
+
documentVO
.
getNumber
()
+
"/"
+
Constants
.
MERGER_TARGET
+
"/"
+
Constants
.
MERGER_FILE_NAME
;
List
<
ExtInterfaceInfoLinkVO
>
interfaceInfoLinkVOS
=
this
.
recursionInterfaceInfoLinks
(
documentVO
.
getVersionId
());
List
<
ExtInterfaceInfoLinkVO
>
interfaceInfoLinkVOS
=
this
.
recursionInterfaceInfoLinks
(
documentVO
.
getVersionId
());
DxWfProcessVO
wfProcessInstVO
=
workFlowUtil
.
getWfProcessInst
(
documentVO
);
DxWfProcessVO
wfProcessInfoVO
=
dexWorkFlowService
.
getProcessDetail
(
wfProcessInstVO
.
getId
());
// TODO: 2024/8/1 getWfProcessInst返回属性不匹对
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// DxWfProcessVO wfProcessInfoVO = dexWorkFlowService.getProcessDetail(wfProcessInstVO.getId());
if
(!
CollectionUtils
.
isEmpty
(
interfaceInfoLinkVOS
))
{
if
(!
CollectionUtils
.
isEmpty
(
interfaceInfoLinkVOS
))
{
//1、先根据提资记录生成多个文档
//1、先根据提资记录生成多个文档
interfaceInfoLinkVOS
.
stream
().
forEach
(
item
->
{
interfaceInfoLinkVOS
.
stream
().
forEach
(
item
->
{
docBeforeCreateEvent
.
generateAutoInterFaceWord
(
docObjFile
,
item
,
wfProcessInfoVO
);
// TODO: 2024/8/1 generateAutoInterFaceWord入参不匹对
// docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO);
});
});
try
{
try
{
//2、合并生成好的文档
//2、合并生成好的文档
...
@@ -871,7 +884,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -871,7 +884,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//深度查询展开ObjLink
//深度查询展开ObjLink
DxDocumentVO
documentVO
=
extDocUtil
.
findDocObjFileLinks
(
documentVo
.
getId
());
DxDocumentVO
documentVO
=
extDocUtil
.
findDocObjFileLinks
(
documentVo
.
getId
());
log
.
info
(
"自动任务======生成word签名开始"
);
log
.
info
(
"自动任务======生成word签名开始"
);
DxWfProcessVO
wfProcessInstVO
=
workFlowUtil
.
getWfProcessInst
(
documentVO
);
// TODO: 2024/7/31 4.1返回对象不匹对 WfProcessInstVO
// WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: 2024/7/31 4.1此方法不存在 getProcessInstDetailById(processId)
// TODO: 2024/7/31 4.1此方法不存在 getProcessInstDetailById(processId)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
String
subTypeName
=
documentVO
.
getSubTypeName
();
String
subTypeName
=
documentVO
.
getSubTypeName
();
...
@@ -1042,7 +1056,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -1042,7 +1056,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Override
@Override
public
void
generateQHTechDoc
(
DxDocumentVO
documentVO
,
Map
<
String
,
Object
>
wfTaskContext
)
{
public
void
generateQHTechDoc
(
DxDocumentVO
documentVO
,
Map
<
String
,
Object
>
wfTaskContext
)
{
if
((
Constants
.
TECHNICAL_FILE
.
equals
(
documentVO
.
getOneLevCategory
())))
{
if
((
Constants
.
TECHNICAL_FILE
.
equals
(
documentVO
.
getOneLevCategory
())))
{
DxWfProcessVO
wfProcessInstVO
=
workFlowUtil
.
getWfProcessInst
(
documentVO
);
//TODO: 2024/7/31 4.1 不存在这个方法getWfProcessInst
// DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: 2024/7/31 4.1 不存在这个方法getProcessInstDetailById
// TODO: 2024/7/31 4.1 不存在这个方法getProcessInstDetailById
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// //深度查询展开objFileLink
// //深度查询展开objFileLink
...
...
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/util/CommonUtil.java
0 → 100644
View file @
f1fd1dfb
package
com
.
yonde
.
dcs
.
document
.
core
.
util
;
import
com.yonde.dex.bmodel.common.entity.vo.ModelDefinitionVO
;
import
com.yonde.dex.dao.service.util.ApplicationContextUtil
;
import
com.yonde.dex.dict.feign.DictDataFeignService
;
import
com.yonde.dex.dict.service.vo.DictDataVO
;
import
org.apache.logging.log4j.util.Strings
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
public
class
CommonUtil
{
/**
* 获取字典中文密级
*
* @param key
* @return
*/
public
static
String
getSecretCode
(
String
key
)
{
if
(
Strings
.
isEmpty
(
key
))
{
return
""
;
}
DictDataFeignService
dictService
=
ApplicationContextUtil
.
getBean
(
DictDataFeignService
.
class
);
String
secretKey
=
"SecretCode"
;
List
<
DictDataVO
>
dictData
=
dictService
.
getDictDatas
(
secretKey
);
Map
<
String
,
String
>
dictMap
=
new
HashMap
<>();
for
(
DictDataVO
dict
:
dictData
)
{
dictMap
.
put
(
dict
.
getDictKey
(),
dict
.
getDictValue
());
}
return
dictMap
.
get
(
key
);
}
/**
* 获取字典中文值
*
* @param key
* @return
*/
public
static
String
getCode
(
String
key
,
String
dictCode
)
{
if
(
Strings
.
isEmpty
(
key
))
{
return
""
;
}
DictDataFeignService
dictService
=
ApplicationContextUtil
.
getBean
(
DictDataFeignService
.
class
);
String
secretKey
=
dictCode
;
List
<
DictDataVO
>
dictData
=
dictService
.
getDictDatas
(
secretKey
);
Map
<
String
,
String
>
dictMap
=
new
HashMap
<>();
for
(
DictDataVO
dict
:
dictData
)
{
dictMap
.
put
(
dict
.
getDictKey
(),
dict
.
getDictValue
());
}
return
dictMap
.
get
(
key
);
}
/**
* 根据value升序排序
*
* @param aMap
* @param <K>
* @param <V>
* @return
*/
public
static
<
K
extends
Comparable
,
V
extends
Comparable
>
LinkedHashMap
<
K
,
V
>
sortMapByValues
(
Map
<
K
,
V
>
aMap
)
{
LinkedHashMap
<
K
,
V
>
finalOut
=
new
LinkedHashMap
<>();
aMap
.
entrySet
()
.
stream
()
.
sorted
((
p1
,
p2
)
->
p1
.
getValue
().
compareTo
(
p2
.
getValue
()))
.
collect
(
Collectors
.
toList
()).
forEach
(
ele
->
finalOut
.
put
(
ele
.
getKey
(),
ele
.
getValue
()));
return
finalOut
;
}
/**
* 根据key降序排序
*
* @param aMap
* @param <K>
* @param <V>
* @return
*/
public
static
<
K
extends
Comparable
,
V
extends
Comparable
>
LinkedHashMap
<
K
,
V
>
sortMapByKeys
(
Map
<
K
,
V
>
aMap
)
{
LinkedHashMap
<
K
,
V
>
finalOut
=
new
LinkedHashMap
<>();
aMap
.
entrySet
()
.
stream
()
.
sorted
((
p1
,
p2
)
->
p2
.
getKey
().
compareTo
(
p1
.
getKey
()))
.
collect
(
Collectors
.
toList
()).
forEach
(
ele
->
finalOut
.
put
(
ele
.
getKey
(),
ele
.
getValue
()));
return
finalOut
;
}
}
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/util/ExtDocUtil.java
View file @
f1fd1dfb
...
@@ -6,12 +6,14 @@ import com.yonde.dcs.document.common.vo.DxDocumentVO;
...
@@ -6,12 +6,14 @@ import com.yonde.dcs.document.common.vo.DxDocumentVO;
import
com.yonde.dcs.document.common.vo.ExtObsoleteDocLinkVO
;
import
com.yonde.dcs.document.common.vo.ExtObsoleteDocLinkVO
;
import
com.yonde.dcs.document.common.vo.ObsoleteDocLinkVO
;
import
com.yonde.dcs.document.common.vo.ObsoleteDocLinkVO
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.service.DxDocumentService
;
import
com.yonde.dcs.document.core.service.ExtObsoleteDocLinkService
;
import
com.yonde.dcs.document.core.service.ExtObsoleteDocLinkService
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItem
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
import
com.yonde.dex.basedata.data.search.SearchItems
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.data.search.SearchQueryCondition
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.basedata.entity.data.DxPageImpl
;
import
com.yonde.dex.dao.service.util.DxPageUtils
;
import
com.yonde.dex.dao.service.util.DxPageUtils
;
import
com.yonde.dex.dfs.feign.FileManagerFeignService
;
import
com.yonde.dex.dfs.vo.ObjFileLinkVO
;
import
com.yonde.dex.dfs.vo.ObjFileLinkVO
;
import
com.yonde.dex.dfs.vo.RepoFileVO
;
import
com.yonde.dex.dfs.vo.RepoFileVO
;
import
com.yonde.dex.user.feign.DxUserInfoFeign
;
import
com.yonde.dex.user.feign.DxUserInfoFeign
;
...
@@ -41,13 +43,15 @@ public class ExtDocUtil {
...
@@ -41,13 +43,15 @@ public class ExtDocUtil {
public
static
Map
<
String
,
RequestAttributes
>
requestAttributes
=
new
HashMap
<>();
public
static
Map
<
String
,
RequestAttributes
>
requestAttributes
=
new
HashMap
<>();
@Autowired
@Autowired
D
ocCenterFeign
Service
docCenterFeignService
;
D
xDocument
Service
docCenterFeignService
;
@Autowired
@Autowired
private
FileService
fileService
;
private
FileManagerFeignService
fileService
;
@Autowired
// TODO: 2024/8/1 MinioFileStoreService这个类不存在了
private
MinioFileStoreService
minioFileStoreService
;
// @Autowired
@Autowired
// private MinioFileStoreService minioFileStoreService;
private
SiteService
siteService
;
// TODO: 2024/8/1 SiteService这个类不存在了
// @Autowired
// private SiteService siteService;
@Autowired
@Autowired
private
DxUserInfoFeign
userService
;
private
DxUserInfoFeign
userService
;
@Autowired
@Autowired
...
@@ -95,8 +99,8 @@ public class ExtDocUtil {
...
@@ -95,8 +99,8 @@ public class ExtDocUtil {
* @param objFileLinks
* @param objFileLinks
* @return
* @return
*/
*/
public
Papers
VO
obtainPrimaryFile
(
List
<
ObjFileLinkVO
>
objFileLinks
)
{
public
RepoFile
VO
obtainPrimaryFile
(
List
<
ObjFileLinkVO
>
objFileLinks
)
{
Papers
VO
fileVO
=
null
;
RepoFile
VO
fileVO
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
objFileLinks
))
{
if
(!
CollectionUtils
.
isEmpty
(
objFileLinks
))
{
fileVO
=
objFileLinks
.
stream
().
filter
(
objFileLinkVO
->
Constants
.
MASTER_FILE
.
equals
(
objFileLinkVO
.
getContentType
())).
map
(
ObjFileLinkVO:
:
getTarget
)
fileVO
=
objFileLinks
.
stream
().
filter
(
objFileLinkVO
->
Constants
.
MASTER_FILE
.
equals
(
objFileLinkVO
.
getContentType
())).
map
(
ObjFileLinkVO:
:
getTarget
)
.
findFirst
().
orElse
(
null
);
.
findFirst
().
orElse
(
null
);
...
@@ -109,22 +113,23 @@ public class ExtDocUtil {
...
@@ -109,22 +113,23 @@ public class ExtDocUtil {
*
*
* @param fileVO
* @param fileVO
*/
*/
public
InputStream
obtainPrimaryFileInputStream
(
PapersVO
fileVO
)
{
// TODO: 2024/8/1 minioFileStoreService不存在
InputStream
inputStream
=
null
;
// public InputStream obtainPrimaryFileInputStream(RepoFileVO fileVO) {
if
(!
ObjectUtils
.
isEmpty
(
fileVO
))
{
// InputStream inputStream = null;
log
.
info
(
"开始下载主内容======》"
+
fileVO
.
getId
());
// if (!ObjectUtils.isEmpty(fileVO)) {
Papers
fileEntity
=
this
.
fileService
.
findById
(
fileVO
.
getId
());
// log.info("开始下载主内容======》" + fileVO.getId());
Site
siteEntity
=
this
.
siteService
.
findByIsDefault
(
true
);
// RepoFileVO fileEntity = this.fileService.findFileInfoById(fileVO.getId());
if
(
Objects
.
isNull
(
fileEntity
))
{
// Site siteEntity = this.siteService.findByIsDefault(true);
log
.
error
(
"下载主内容失败!====》"
+
DxValutErrorCodeData
.
FILE_NOT_EXISTS
);
// if (Objects.isNull(fileEntity)) {
}
else
{
// log.error("下载主内容失败!====》" + DxValutErrorCodeData.FILE_NOT_EXISTS);
inputStream
=
this
.
minioFileStoreService
.
download
(
fileEntity
.
getBucketName
(),
fileEntity
.
getMinioFileName
(),
fileEntity
.
getSecretKey
(),
siteEntity
);
// } else {
}
// inputStream = this.minioFileStoreService.download(fileEntity.getBucketName(), fileEntity.getMinioFileName(), fileEntity.getSecretKey(), siteEntity);
}
else
{
// }
log
.
error
(
"下载主内容失败======》fileVO为空!"
);
// } else {
}
// log.error("下载主内容失败======》fileVO为空!");
return
inputStream
;
// }
}
// return inputStream;
// }
/**
/**
* 通过id查询文档附件
* 通过id查询文档附件
...
...
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/util/FileUtils.java
View file @
f1fd1dfb
...
@@ -3,14 +3,21 @@ package com.yonde.dcs.document.core.util;
...
@@ -3,14 +3,21 @@ package com.yonde.dcs.document.core.util;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.io.IoUtil
;
import
com.jacob.activeX.ActiveXComponent
;
import
com.jacob.com.Dispatch
;
import
com.jacob.com.Variant
;
import
com.yonde.dcs.document.common.vo.DxDocumentVO
;
import
com.yonde.dcs.document.common.vo.DxDocumentVO
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dex.basedata.entity.data.OperatorType
;
import
com.yonde.dex.basedata.entity.data.OperatorType
;
import
com.yonde.dex.basedata.entity.vo.IdVO
;
import
com.yonde.dex.basedata.entity.vo.IdVO
;
import
com.yonde.dex.dfs.handler.ContentHolder
;
import
com.yonde.dex.dfs.vo.ObjFileLinkVO
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.pdfbox.io.MemoryUsageSetting
;
import
org.apache.pdfbox.multipdf.PDFMergerUtility
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/util/FreemarkerHandler.java
View file @
f1fd1dfb
package
com
.
yonde
.
dcs
.
document
.
core
.
util
;
package
com
.
yonde
.
dcs
.
document
.
core
.
util
;
import
freemarker.core.XMLOutputFormat
;
import
freemarker.template.Configuration
;
import
freemarker.template.Template
;
import
freemarker.template.TemplateException
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
sun.misc.BASE64Encoder
;
import
sun.misc.BASE64Encoder
;
import
java.io.*
;
import
java.io.*
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
...
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/util/Word2PdfJacobUtil.java
View file @
f1fd1dfb
package
com
.
yonde
.
dcs
.
document
.
core
.
util
;
package
com
.
yonde
.
dcs
.
document
.
core
.
util
;
import
com.inet.pdm.word.DocumentDispatch
;
import
com.jacob.activeX.ActiveXComponent
;
import
com.jacob.activeX.ActiveXComponent
;
import
com.jacob.com.ComThread
;
import
com.jacob.com.ComThread
;
import
com.jacob.com.Dispatch
;
import
com.jacob.com.Dispatch
;
import
com.jacob.com.Variant
;
import
com.jacob.com.Variant
;
import
com.yonde.dcs.document.core.word.DocumentDispatch
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
/**
/**
...
...
dcs-doc-core/src/main/java/com/yonde/dcs/document/core/util/WorkFlowUtil.java
View file @
f1fd1dfb
This diff is collapsed.
Click to expand it.
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