Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-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
dcs-doc-expand
Commits
bb00b9c7
Commit
bb00b9c7
authored
Aug 16, 2024
by
xuzhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix][DOC]迁移类缺失问题修改
parent
5ae287fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
78 deletions
+88
-78
ExtDocUtil.java
...ore/src/main/java/com/yonde/dcs/core/util/ExtDocUtil.java
+6
-2
ExtWfcUtil.java
...ore/src/main/java/com/yonde/dcs/core/util/ExtWfcUtil.java
+48
-42
ProcessDataUtils.java
...c/main/java/com/yonde/dcs/core/util/ProcessDataUtils.java
+33
-33
WorkFlowUtil.java
...e/src/main/java/com/yonde/dcs/core/util/WorkFlowUtil.java
+1
-1
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/util/ExtDocUtil.java
View file @
bb00b9c7
...
...
@@ -16,7 +16,11 @@ 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.RepoFileVO
;
import
com.yonde.dex.dfs.vo.SiteCleanLogVO
;
import
com.yonde.dex.user.feign.DxUserInfoFeign
;
import
com.yonde.dex.utils.common.transfer.MinioTranser
;
import
com.yonde.dex.utils.common.transfer.properties.MinioProperties
;
import
com.yonde.dex.utils.common.utils.MinioUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -117,8 +121,8 @@ public class ExtDocUtil {
public
InputStream
obtainPrimaryFileInputStream
(
RepoFileVO
fileVO
)
{
InputStream
inputStream
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
fileVO
))
{
//
log.info("开始下载主内容======》" + fileVO.getId());
//
RepoFileVO fileEntity = this.fileService.findFileInfoById(fileVO.getId());
log
.
info
(
"开始下载主内容======》"
+
fileVO
.
getId
());
RepoFileVO
fileEntity
=
this
.
fileService
.
findFileInfoById
(
fileVO
.
getId
());
// Site siteEntity = this.siteService.findByIsDefault(true);
// if (Objects.isNull(fileEntity)) {
// log.error("下载主内容失败!====》" + DxValutErrorCodeData.FILE_NOT_EXISTS);
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/util/ExtWfcUtil.java
View file @
bb00b9c7
...
...
@@ -5,7 +5,11 @@ import cn.hutool.core.map.MapUtil;
import
com.yonde.dcs.core.constants.SignConstants
;
import
com.yonde.dex.dao.service.util.ApplicationContextUtil
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessVO
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
com.yonde.dex.wfc.feign.api.WfcTaskFeign
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.client.utils.CloneUtils
;
...
...
@@ -35,19 +39,18 @@ public class ExtWfcUtil {
*/
public
static
Map
<
String
,
String
>
getProcessTeam
(
Class
clsObj
,
Long
versionId
,
HashMap
<
String
,
String
>
signMap
)
{
//TODO
// IInstanceService processService = ApplicationContextUtil.getBean(IInstanceService.class);
// WfProcessInstSearchVO searchVO = new WfProcessInstSearchVO();
// searchVO.setPboId(versionId);
// searchVO.setPboClass(clsObj.getCanonicalName());
// Page<WfProcessInstVO> processList = processService.getProcessInstList(searchVO, 1, 100);
// if (Objects.isNull(processList) || CollectionUtils.isEmpty(processList.getContent())) {
// log.error("[EXT流程]:根据pbo的versionId和cls类型未获取到团队成员:{}", versionId + clsObj.getCanonicalName());
// return new HashMap<>();
// }
// WfProcessInstVO dxWfProcessVO = processList.getContent().get(0);
// String instId = dxWfProcessVO.getId();
// return getTaskParticipants(instId, clsObj, signMap);
return
null
;
WfcProcessFeign
processService
=
ApplicationContextUtil
.
getBean
(
WfcProcessFeign
.
class
);
DxWfProcessSearchVO
searchVO
=
new
DxWfProcessSearchVO
();
searchVO
.
setPboId
(
versionId
);
searchVO
.
setPboClass
(
clsObj
.
getCanonicalName
());
Page
<
DxWfProcessVO
>
processList
=
processService
.
getProcessList
(
searchVO
,
1
,
100
);
if
(
Objects
.
isNull
(
processList
)
||
CollectionUtils
.
isEmpty
(
processList
.
getContent
()))
{
log
.
error
(
"[EXT流程]:根据pbo的versionId和cls类型未获取到团队成员:{}"
,
versionId
+
clsObj
.
getCanonicalName
());
return
new
HashMap
<>();
}
DxWfProcessVO
dxWfProcessVO
=
processList
.
getContent
().
get
(
0
);
String
instId
=
dxWfProcessVO
.
getId
();
return
getTaskParticipants
(
instId
,
clsObj
,
signMap
);
}
...
...
@@ -60,24 +63,25 @@ public class ExtWfcUtil {
*/
public
static
Long
getProcessTiZiId
(
Class
clsObj
,
Long
versionId
)
{
//TODO
// IInstanceService processService = ApplicationContextUtil.getBean(IInstanceService
.class);
// WfProcessInstSearchVO searchVO = new WfProcessInst
SearchVO();
//
searchVO.setPboId(versionId);
//
searchVO.setPboClass(clsObj.getCanonicalName());
// Page<WfProcessInstVO> processList = processService.getProcessInst
List(searchVO, 1, 100);
//
if (Objects.isNull(processList) || CollectionUtils.isEmpty(processList.getContent())) {
//
log.error("[EXT流程]:根据pbo的versionId和cls类型未获取到团队成员:{}", versionId + clsObj.getCanonicalName());
//
return null;
//
}
// WfProcessInst
VO dxWfProcessVO = processList.getContent().get(0);
WfcProcessFeign
processService
=
ApplicationContextUtil
.
getBean
(
WfcProcessFeign
.
class
);
DxWfProcessSearchVO
searchVO
=
new
DxWfProcess
SearchVO
();
searchVO
.
setPboId
(
versionId
);
searchVO
.
setPboClass
(
clsObj
.
getCanonicalName
());
Page
<
DxWfProcessVO
>
processList
=
processService
.
getProcess
List
(
searchVO
,
1
,
100
);
if
(
Objects
.
isNull
(
processList
)
||
CollectionUtils
.
isEmpty
(
processList
.
getContent
()))
{
log
.
error
(
"[EXT流程]:根据pbo的versionId和cls类型未获取到团队成员:{}"
,
versionId
+
clsObj
.
getCanonicalName
());
return
null
;
}
DxWfProcess
VO
dxWfProcessVO
=
processList
.
getContent
().
get
(
0
);
// String instId = dxWfProcessVO.getId();
// DexWorkFlowService dexWorkFlowService = ApplicationContextUtil.getBean(DexWorkFlowService.class);
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(instId);
// List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo();
// DxWfProcessTaskVO resolver = activities.stream()
// .filter(wfProcessTaskVO -> wfProcessTaskVO.getName().equals("提资中") && ("通过".equals(wfProcessTaskVO.getResult()) || "提交审阅".equals(wfProcessTaskVO.getResult()) || "提交签审".equalsIgnoreCase(wfProcessTaskVO.getResult()))).findFirst().orElse(null);
// return Long.valueOf(resolver.getAssignee());
return
null
;
WfcTaskFeign
wfcTaskFeign
=
ApplicationContextUtil
.
getBean
(
WfcTaskFeign
.
class
);
List
<
DxWfProcessTaskVO
>
activities
=
wfcTaskFeign
.
getHisTaskList
(
dxWfProcessVO
.
getId
(),
null
,
1
,
Integer
.
MAX_VALUE
).
getContent
();
DxWfProcessTaskVO
resolver
=
activities
.
stream
()
.
filter
(
wfProcessTaskVO
->
wfProcessTaskVO
.
getName
().
equals
(
"提资中"
)
&&
(
"通过"
.
equals
(
wfProcessTaskVO
.
getResult
())
||
"提交审阅"
.
equals
(
wfProcessTaskVO
.
getResult
())
||
"提交签审"
.
equalsIgnoreCase
(
wfProcessTaskVO
.
getResult
()))).
findFirst
().
orElse
(
null
);
return
Long
.
valueOf
(
resolver
.
getAssignee
());
}
...
...
@@ -91,24 +95,26 @@ public class ExtWfcUtil {
@SneakyThrows
public
static
Map
<
String
,
String
>
getTaskParticipants
(
String
processId
,
Class
clsObj
,
HashMap
<
String
,
String
>
signMap
)
{
//TODO
//
Map<String, String> data = new HashMap<>();
Map
<
String
,
String
>
data
=
new
HashMap
<>();
// DexWorkFlowService dexWorkFlowService = ApplicationContextUtil.getBean(DexWorkFlowService.class);
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(processId);
// List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo();
// String dateStr = "";
// if (MapUtil.isEmpty(signMap)) {
// signMap = CloneUtils.cloneObject(SignConstants.SignNodeMap);
// }
// for (Map.Entry<String, String> entry : signMap.entrySet()) {
// dateStr = new StringBuffer(entry.getValue()).reverse().toString();
// //节点参与人
// data.put(entry.getValue(), getResolverName(activities, entry.getKey()));
// //节点时间
// data.put(dateStr, getResolverData(activities, entry.getKey()));
// }
// data.entrySet().removeIf(o -> org.springframework.util.StringUtils.isEmpty(o.getValue()));
// return data;
return
null
;
WfcTaskFeign
wfcTaskFeign
=
ApplicationContextUtil
.
getBean
(
WfcTaskFeign
.
class
);
List
<
DxWfProcessTaskVO
>
activities
=
wfcTaskFeign
.
getHisTaskList
(
processId
,
null
,
1
,
Integer
.
MAX_VALUE
).
getContent
();
String
dateStr
=
""
;
if
(
MapUtil
.
isEmpty
(
signMap
))
{
signMap
=
CloneUtils
.
cloneObject
(
SignConstants
.
SignNodeMap
);
}
for
(
Map
.
Entry
<
String
,
String
>
entry
:
signMap
.
entrySet
())
{
dateStr
=
new
StringBuffer
(
entry
.
getValue
()).
reverse
().
toString
();
//节点参与人
data
.
put
(
entry
.
getValue
(),
getResolverName
(
activities
,
entry
.
getKey
()));
//节点时间
data
.
put
(
dateStr
,
getResolverData
(
activities
,
entry
.
getKey
()));
}
data
.
entrySet
().
removeIf
(
o
->
org
.
springframework
.
util
.
StringUtils
.
isEmpty
(
o
.
getValue
()));
return
data
;
}
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/util/ProcessDataUtils.java
View file @
bb00b9c7
...
...
@@ -6,8 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.yonde.dcs.common.vo.ExtInterfaceInfoLinkVO
;
import
com.yonde.dcs.core.constants.Constants
;
import
com.yonde.dcs.core.factory.InternalInterfaceUtils
;
import
com.yonde.dcs.core.factory.OutdatedDocNotifyUtils
;
import
com.yonde.dcs.core.factory.*
;
import
com.yonde.dcs.core.service.ExtDocService
;
import
com.yonde.dcs.core.util.ExtDocUtil
;
import
com.yonde.dcs.core.util.FileUtils
;
...
...
@@ -15,6 +14,8 @@ import com.yonde.dcs.core.util.WorkFlowUtil;
import
com.yonde.dcs.core.word.ImportWordService
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessVO
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -46,8 +47,6 @@ public class ProcessDataUtils {
private
ExtDocUtil
extDocUtil
;
@Autowired
private
WorkFlowUtil
workFlowUtil
;
// @Autowired
// private DexWorkFlowService dexWorkFlowService;
/**
* 单独处理过时文件通知单数据
...
...
@@ -64,35 +63,36 @@ public class ProcessDataUtils {
public
void
processData
(
DxDocumentVO
documentVo
)
{
String
subTypeName
=
documentVo
.
getSubTypeName
();
//todo
// WfProcessInstVO DxWfProcessInstVO = workFlowUtil.getWfProcessInst(documentVo);
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(DxWfProcessInstVO.getId());
// switch (subTypeName) {
// case Constants.INTERNAL_INTERFACE:
// this.generateInterFaceWord(documentVo, new InterfaceInfoLinkVO(), wfProcessInfoVO);
// break;
// case Constants.CONTACTLIST:
// extDocService.getDocWord(documentVo, ContactListUtils.class, wfProcessInfoVO, "一");
// break;
// case Constants.WORK_CONTACTLIST:
// extDocService.getDocWord(documentVo, WorkContactListUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DESIGN_CHANGE:
// extDocService.getDocWord(documentVo, DesignChangeUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DESIGN_APPLICATION:
// extDocService.getDocWord(documentVo, DesignDocApplicatUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DESIGN_ENTER:
// extDocService.getDocWord(documentVo, DesignEnterUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.NCR:
// extDocService.getDocWord(documentVo, NCRUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DEN:
// //根据模板生成两张不同澄清单
// extDocService.getDocWord(documentVo, DENUtils.class, wfProcessInfoVO, "");
// break;
// }
DxWfProcessVO
dxWfProcessVO
=
workFlowUtil
.
getWfProcessInst
(
documentVo
);
DxWfProcessInfoVO
wfProcessInfoVO
=
workFlowUtil
.
getProcessInstDetail
(
dxWfProcessVO
);
// DxWfProcessInfoVO wfProcessInfoVO = wfcProcessFeign.getProcessInstDetailById(dxWfProcessVO.getId());
switch
(
subTypeName
)
{
case
Constants
.
INTERNAL_INTERFACE
:
this
.
generateInterFaceWord
(
documentVo
,
new
ExtInterfaceInfoLinkVO
(),
wfProcessInfoVO
);
break
;
case
Constants
.
CONTACTLIST
:
extDocService
.
getDocWord
(
documentVo
,
ContactListUtils
.
class
,
wfProcessInfoVO
,
"一"
);
break
;
case
Constants
.
WORK_CONTACTLIST
:
extDocService
.
getDocWord
(
documentVo
,
WorkContactListUtils
.
class
,
wfProcessInfoVO
,
""
);
break
;
case
Constants
.
DESIGN_CHANGE
:
extDocService
.
getDocWord
(
documentVo
,
DesignChangeUtils
.
class
,
wfProcessInfoVO
,
""
);
break
;
case
Constants
.
DESIGN_APPLICATION
:
extDocService
.
getDocWord
(
documentVo
,
DesignDocApplicatUtils
.
class
,
wfProcessInfoVO
,
""
);
break
;
case
Constants
.
DESIGN_ENTER
:
extDocService
.
getDocWord
(
documentVo
,
DesignEnterUtils
.
class
,
wfProcessInfoVO
,
""
);
break
;
case
Constants
.
NCR
:
extDocService
.
getDocWord
(
documentVo
,
NCRUtils
.
class
,
wfProcessInfoVO
,
""
);
break
;
case
Constants
.
DEN
:
//根据模板生成两张不同澄清单
extDocService
.
getDocWord
(
documentVo
,
DENUtils
.
class
,
wfProcessInfoVO
,
""
);
break
;
}
}
/**
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/util/WorkFlowUtil.java
View file @
bb00b9c7
...
...
@@ -99,7 +99,7 @@ public class WorkFlowUtil {
// TODO: xpc getProcessInstList方法不存在,根据逻辑改为getHisTaskList
// WfProcessInfoVO wfProcessInfo = this.instanceService.getProcessInstSimpleDetailById(wfProcessInstVO.getId());
// List<DxWfProcessTaskVO> historyInfoList = wfProcessInfo.getHistoryInfo();
Page
<
DxWfProcessTaskVO
>
taskList
=
wfcTaskFeign
.
getHisTaskList
(
wfProcessInstVO
.
getId
(),
null
,
1
,
Integer
.
MAX_VALUE
);
List
<
DxWfProcessTaskVO
>
taskList
=
wfcTaskFeign
.
getHisTaskList
(
wfProcessInstVO
.
getId
(),
null
,
1
,
Integer
.
MAX_VALUE
).
getContent
(
);
List
<
String
>
checkResult
=
Arrays
.
asList
(
"提交"
,
"通过"
);
Map
<
String
,
List
<
DxWfProcessTaskVO
>>
wfHistoryMap
=
taskList
.
stream
().
filter
(
p
->
TaskStateEnum
.
COMPLETE
.
name
().
equals
(
p
.
getState
())
&&
checkResult
.
contains
(
p
.
getResult
()))
.
sorted
(
Comparator
.
comparing
(
DxWfProcessTaskVO:
:
getEndTime
).
reversed
())
...
...
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