Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tagManager
Overview
Overview
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
lanmw
tagManager
Commits
b02d7b5e
Commit
b02d7b5e
authored
Feb 12, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改标签导出,增加系统和维度单独导出功能
parent
c1722b1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
TagFileCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagFileCtrl.java
+5
-2
TagFileService.java
...java/com/keymobile/tagmanager/service/TagFileService.java
+9
-2
No files found.
src/main/java/com/keymobile/tagmanager/api/TagFileCtrl.java
View file @
b02d7b5e
...
@@ -46,10 +46,13 @@ public class TagFileCtrl {
...
@@ -46,10 +46,13 @@ public class TagFileCtrl {
return
tagExportService
.
exportTagMetadataExcel
(
idPath
,
dimensionType
,
tagType
,
response
);
return
tagExportService
.
exportTagMetadataExcel
(
idPath
,
dimensionType
,
tagType
,
response
);
}
}
@ApiOperation
(
value
=
"(2020-2-12)导出标签excel文件(isSys:0 系统 1 维度)"
,
notes
=
"(2020-2-12)导出标签excel文件(isSys:0 系统 1 维度)"
)
@GetMapping
(
"/exportTag"
)
@GetMapping
(
"/exportTag"
)
public
int
export
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
,
value
=
"deptIdPath"
)
String
deptIdPath
)
{
public
int
export
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
,
value
=
"deptIdPath"
)
String
deptIdPath
,
@RequestParam
(
required
=
false
,
value
=
"isSys"
)
String
isSys
)
{
deptIdPath
=
/**UserInfoUtils.getDataRoleOrg()*/
String
.
valueOf
(
GrantedAuthHelper
.
getUserOrg
());
deptIdPath
=
/**UserInfoUtils.getDataRoleOrg()*/
String
.
valueOf
(
GrantedAuthHelper
.
getUserOrg
());
return
tagExportService
.
exportExcel
(
deptIdPath
,
response
);
return
tagExportService
.
exportExcel
(
deptIdPath
,
isSys
,
response
);
}
}
@PostMapping
(
"/importTag"
)
@PostMapping
(
"/importTag"
)
...
...
src/main/java/com/keymobile/tagmanager/service/TagFileService.java
View file @
b02d7b5e
...
@@ -153,9 +153,16 @@ public class TagFileService {
...
@@ -153,9 +153,16 @@ public class TagFileService {
return
toExportTagMeta
.
size
();
return
toExportTagMeta
.
size
();
}
}
public
int
exportExcel
(
String
dept
,
HttpServletResponse
response
)
{
public
int
exportExcel
(
String
dept
,
String
isSys
,
HttpServletResponse
response
)
{
List
<
Tag
>
toExportTags
=
mongoOperations
.
find
(
Query
.
query
(
Criteria
.
where
(
"dept"
).
is
(
dept
)
List
<
Tag
>
toExportTags
=
null
;
if
(
StringUtils
.
isBlank
(
isSys
))
{
toExportTags
=
mongoOperations
.
find
(
Query
.
query
(
Criteria
.
where
(
"dept"
).
is
(
dept
)
.
and
(
"dimensionType"
).
is
(
Constants
.
TAG_DIMENSION_TRUE
)),
Tag
.
class
);
.
and
(
"dimensionType"
).
is
(
Constants
.
TAG_DIMENSION_TRUE
)),
Tag
.
class
);
}
else
{
toExportTags
=
mongoOperations
.
find
(
Query
.
query
(
Criteria
.
where
(
"dept"
).
is
(
dept
)
.
and
(
"dimensionType"
).
is
(
Constants
.
TAG_DIMENSION_TRUE
).
and
(
"tagType"
).
is
(
isSys
)),
Tag
.
class
);
}
// 导出操作
// 导出操作
ExcelUtils
.
exportExcel
(
toExportTags
,
null
,
"sheet1"
,
Tag
.
class
,
"标签.xlsx"
,
response
);
ExcelUtils
.
exportExcel
(
toExportTags
,
null
,
"sheet1"
,
Tag
.
class
,
"标签.xlsx"
,
response
);
return
toExportTags
.
size
();
return
toExportTags
.
size
();
...
...
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