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
335fcf12
Commit
335fcf12
authored
Oct 09, 2024
by
wangyangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文档 图册:自动任务生成图册目录--调整
parent
b564dd87
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
11 deletions
+71
-11
ExtAutoTaskController.java
...e/dcs/document/core/controller/ExtAutoTaskController.java
+3
-3
ExtDxDocumentController.java
...ument/core/controller/expand/ExtDxDocumentController.java
+11
-6
ExtAutoTaskService.java
...m/yonde/dcs/document/core/service/ExtAutoTaskService.java
+10
-0
ExtAutoTaskServiceImpl.java
...cs/document/core/service/impl/ExtAutoTaskServiceImpl.java
+45
-0
ExtAutoTaskServiceFeign.java
...com/yonde/dcs/document/feign/ExtAutoTaskServiceFeign.java
+2
-2
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/controller/ExtAutoTaskController.java
View file @
335fcf12
...
...
@@ -63,10 +63,10 @@ public class ExtAutoTaskController {
private
ExtDxDocumentService
extDxDocumentService
;
@ApiOperation
(
"生成图册目录"
)
@ApiOperation
(
"生成图册目录
且修改图册已经图纸状态为发布
"
)
@GetMapping
({
"/catalog"
})
public
ApiResult
generateCatalog
(
@RequestParam
Long
docId
)
{
return
ApiResult
.
ok
(
extDxDocumentService
.
generateCatalog
(
docId
),
"查询成功"
);
public
void
generateCatalog
(
@RequestParam
Long
docId
)
{
autoTaskService
.
generateCatalog
(
docId
);
}
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/controller/expand/ExtDxDocumentController.java
View file @
335fcf12
...
...
@@ -35,12 +35,17 @@ public class ExtDxDocumentController<V extends DxDocumentVO, S extends ExtDxDocu
return
ApiResult
.
ok
(
service
.
getDocAndFolder
(
dxContextId
,
parentId
),
"查询成功"
);
}
@ApiOperation
(
"生成图册目录"
)
@GetMapping
({
"/catalog"
})
public
ApiResult
generateCatalog
(
@RequestParam
Long
docId
)
{
return
ApiResult
.
ok
(
service
.
generateCatalog
(
docId
),
"查询成功"
);
}
//
// /**
// * 自动任务 这块弃用
// * @param docId
// * @return
// */
// @ApiOperation("生成图册目录")
// @GetMapping({"/catalog"})
// public ApiResult generateCatalog(@RequestParam Long docId) {
// return ApiResult.ok(service.generateCatalog(docId), "查询成功");
// }
}
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/ExtAutoTaskService.java
View file @
335fcf12
...
...
@@ -19,6 +19,16 @@ import java.util.Map;
* @create: 2021-09-27 09:41
*/
public
interface
ExtAutoTaskService
extends
ExtAutoTaskServiceFeign
{
/**
* 生成图册目录
* @param docId
* @return
*/
void
generateCatalog
(
Long
docId
);
/**
* 客户化文档修改状态
*
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/impl/ExtAutoTaskServiceImpl.java
View file @
335fcf12
...
...
@@ -6,10 +6,13 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.extra.spring.SpringUtil
;
import
cn.hutool.http.ContentType
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yonde.dcs.document.common.vo.*
;
import
com.yonde.dcs.document.core.event.DocumentEvent
;
import
com.yonde.dcs.document.core.excel.ExtCatalogExcelVO
;
import
com.yonde.dcs.document.core.factory.*
;
import
com.yonde.dcs.document.core.service.*
;
import
com.yonde.dcs.document.core.util.*
;
...
...
@@ -153,6 +156,48 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Autowired
ExtAuditInterfLinkService
extAuditInterfLinkService
;
@SneakyThrows
@Override
public
void
generateCatalog
(
Long
docId
)
{
SearchQueryCondition
queryCondition
=
SearchUtil
.
buildQueryWithOpenAttr
(
"id"
,
SearchItem
.
Operator
.
EQ
,
docId
,
"targetExtAtlasDrawingLink.target"
);
DxPageImpl
<
DxDocumentVO
>
recursion
=
documentService
.
findRecursion
(
queryCondition
);
DxDocumentVO
dxDocumentVO
=
recursion
.
getContent
().
get
(
0
);
List
<
ExtAtlasDrawingLinkVO
>
targetExtAtlasDrawingLink
=
dxDocumentVO
.
getDxDocumentExpand
().
getTargetExtAtlasDrawingLink
();
if
(
CollectionUtil
.
isNotEmpty
(
targetExtAtlasDrawingLink
))
{
List
<
ExtCatalogExcelVO
>
excelVOS
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
targetExtAtlasDrawingLink
.
size
();
i
++)
{
DxDocumentVO
documentVO
=
targetExtAtlasDrawingLink
.
get
(
i
).
getTarget
();
ExtCatalogExcelVO
catalogExcelVO
=
new
ExtCatalogExcelVO
();
catalogExcelVO
.
setIndex
(
String
.
valueOf
(
i
+
1
));
catalogExcelVO
.
setName
(
documentVO
.
getName
());
catalogExcelVO
.
setVersionKey
(
documentVO
.
getVersionKey
());
catalogExcelVO
.
setDrawNumber
(
String
.
valueOf
(
documentVO
.
getDynamicAttrs
().
get
(
"drawNumber"
)));
catalogExcelVO
.
setPictureFrame
(
String
.
valueOf
(
documentVO
.
getDynamicAttrs
().
get
(
"pictureFrame"
)));
excelVOS
.
add
(
catalogExcelVO
);
}
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
(
dxDocumentVO
,
fileVO
,
com
.
yonde
.
dcs
.
plan
.
common
.
constants
.
Constants
.
ATTACH_FILE
);
dxDocumentVO
.
setOperator
(
OperatorType
.
MODIFY
);
dxDocumentVO
=
(
DxDocumentVO
)
documentService
.
saveRecursion
(
dxDocumentVO
);
FileUtil
.
del
(
dir
);
//TODO 设置图册图纸 状态为已发布 (客制化修改文档状态接口 已存在直接流程中配置即可 ExtAutoTaskService extChangeDocState)
//TODO 判断该文档关联IED计划下所有的文档状态是否为已完成,已完成则回写IED计划状态----后续补充
}
}
/**
* 客制化文档修改状态
*
...
...
dcs-doc-expand-feign/src/main/java/com/yonde/dcs/document/feign/ExtAutoTaskServiceFeign.java
View file @
335fcf12
...
...
@@ -27,9 +27,9 @@ import java.util.Map;
public
interface
ExtAutoTaskServiceFeign
{
@ApiOperation
(
"生成图册目录
"
)
@ApiOperation
(
value
=
"生成图册目录"
,
notes
=
"生成图册目录"
,
httpMethod
=
"GET
"
)
@GetMapping
({
"/catalog"
})
ApiResult
generateCatalog
(
@RequestParam
(
name
=
"docId"
)
Long
docId
);
void
generateCatalog
(
@RequestParam
(
name
=
"docId"
)
Long
docId
);
@ApiOperation
(
value
=
"客户化文档修改状态"
,
notes
=
"客户化文档修改状态"
,
httpMethod
=
"POST"
)
...
...
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