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
b588106a
Commit
b588106a
authored
Oct 12, 2024
by
wangyangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档 图册:回写ied计划状态
parent
ddc7d431
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
ExtAutoTaskServiceImpl.java
...cs/document/core/service/impl/ExtAutoTaskServiceImpl.java
+33
-5
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/impl/ExtAutoTaskServiceImpl.java
View file @
b588106a
...
@@ -228,6 +228,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -228,6 +228,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*
*
* @param documentVO
* @param documentVO
*/
*/
@SneakyThrows
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
extChangeDocState
(
DxDocumentVO
documentVO
,
String
state
)
{
public
void
extChangeDocState
(
DxDocumentVO
documentVO
,
String
state
)
{
...
@@ -239,9 +240,10 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -239,9 +240,10 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
List
<
ExtAtlasDrawingLinkVO
>
drawingLinks
=
this
.
recursionAtlasDoc
(
documentVO
.
getVersionId
());
List
<
ExtAtlasDrawingLinkVO
>
drawingLinks
=
this
.
recursionAtlasDoc
(
documentVO
.
getVersionId
());
String
docState
=
documentVO
.
getState
();
String
docState
=
documentVO
.
getState
();
String
finalState
=
state
;
String
finalState
=
state
;
drawingLinks
.
stream
().
forEach
(
item
->
{
List
<
ExtCatalogExcelVO
>
excelVOS
=
new
ArrayList
<>();
DxDocumentVO
doc
=
new
DxDocumentVO
();
for
(
int
i
=
0
;
i
<
drawingLinks
.
size
();
i
++)
{
BeanUtils
.
copyProperties
(
item
.
getTarget
(),
doc
);
ExtAtlasDrawingLinkVO
item
=
drawingLinks
.
get
(
i
);
DxDocumentVO
doc
=
item
.
getTarget
();
if
(
Constants
.
PENDING_REVIEW
.
equals
(
doc
.
getState
())
||
docState
.
equals
(
doc
.
getState
()))
{
if
(
Constants
.
PENDING_REVIEW
.
equals
(
doc
.
getState
())
||
docState
.
equals
(
doc
.
getState
()))
{
doc
.
setState
(
finalState
);
doc
.
setState
(
finalState
);
//设置修改人和时间不变
//设置修改人和时间不变
...
@@ -249,9 +251,35 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -249,9 +251,35 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
doc
.
markModifyTimeHold
();
doc
.
markModifyTimeHold
();
documentService
.
changeStatus
(
doc
);
documentService
.
changeStatus
(
doc
);
}
}
});
//TODO 收集图纸信息
ExtCatalogExcelVO
catalogExcelVO
=
new
ExtCatalogExcelVO
();
catalogExcelVO
.
setIndex
(
String
.
valueOf
(
i
+
1
));
catalogExcelVO
.
setName
(
doc
.
getName
());
catalogExcelVO
.
setVersionKey
(
doc
.
getVersionKey
());
catalogExcelVO
.
setDrawNumber
(
String
.
valueOf
(
doc
.
getDynamicAttrs
().
get
(
"drawNumber"
)));
catalogExcelVO
.
setPictureFrame
(
String
.
valueOf
(
doc
.
getDynamicAttrs
().
get
(
"pictureFrame"
)));
excelVOS
.
add
(
catalogExcelVO
);
}
//TODO 图册生成图纸信息
String
dir
=
ResourceHelper
.
createTemDir
().
getPath
();
String
filePath
=
dir
+
"\\图册.xlsx"
;
EasyExcel
.
write
(
filePath
,
ExtCatalogExcelVO
.
class
)
.
registerWriteHandler
(
new
LongestMatchColumnWidthStyleStrategy
())
.
sheet
(
"图册"
).
doWrite
(
excelVOS
);
//转pdf
String
pdfName
=
"图册.pdf"
;
String
filePdfPath
=
dir
+
File
.
separator
+
pdfName
;
ExcelUtils
.
Ex2PDF
(
filePath
,
filePdfPath
);
//上传文件到文件服务器
MultipartFile
multipartFile
=
null
;
multipartFile
=
new
MockMultipartFile
(
"file"
,
pdfName
,
com
.
yonde
.
dcs
.
plan
.
common
.
constants
.
Constants
.
CONTENT_TYPE_PDF
,
new
FileInputStream
(
filePdfPath
));
RepoFileVO
fileVO
=
fileManagerFeignService
.
uploadFile
(
multipartFile
,
CommonUtil
.
getBucketIdByAppName
(
com
.
yonde
.
dcs
.
document
.
core
.
constants
.
Constants
.
APPLICATION_DOC_INNER_NAME
));
ObjFileLinkUtil
.
addFile
(
documentVO
,
fileVO
,
com
.
yonde
.
dcs
.
plan
.
common
.
constants
.
Constants
.
ATTACH_FILE
);
documentVO
.
setOperator
(
OperatorType
.
MODIFY
);
documentVO
=
(
DxDocumentVO
)
documentService
.
saveRecursion
(
documentVO
);
FileUtil
.
del
(
dir
);
// generateCatalog(documentVO.getId());
//TODO 判断该文档关联IED计划下所有的文档状态是否为已完成,已完成则回写IED计划状态----一个IED计划对应一个图册,直接修改计划状态即可
//TODO 判断该文档关联IED计划下所有的文档状态是否为已完成,已完成则回写IED计划状态----一个IED计划对应一个图册,直接修改计划状态即可
generateCatalog
(
documentVO
.
getId
());
SearchQueryCondition
query
=
SearchUtil
.
buildQuery
(
"targetId"
,
SearchItem
.
Operator
.
EQ
,
documentVO
.
getId
());
SearchQueryCondition
query
=
SearchUtil
.
buildQuery
(
"targetId"
,
SearchItem
.
Operator
.
EQ
,
documentVO
.
getId
());
DxPageImpl
iedPage
=
extIEDPlanDocLinkServiceFeign
.
findRecursion
(
query
);
DxPageImpl
iedPage
=
extIEDPlanDocLinkServiceFeign
.
findRecursion
(
query
);
ExtIEDPlanDocLinkVO
extIEDPlanDocLinkVO
=
(
ExtIEDPlanDocLinkVO
)
iedPage
.
getContent
().
get
(
0
);
ExtIEDPlanDocLinkVO
extIEDPlanDocLinkVO
=
(
ExtIEDPlanDocLinkVO
)
iedPage
.
getContent
().
get
(
0
);
...
...
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