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
1b2b8ca4
Commit
1b2b8ca4
authored
Mar 18, 2020
by
zhangkb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签分析接口逻辑修改,添加自定义标签分析结果
parent
8b544fd1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+26
-1
No files found.
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
1b2b8ca4
...
...
@@ -359,6 +359,10 @@ public class TagService {
List
<
Map
<
String
,
Object
>>
dimTagList
=
new
ArrayList
<>();
//定义存储自定义标签list<Map>
List
<
Map
<
String
,
Object
>>
perTagList
=
new
ArrayList
<>();
//author:zhangkb time:2020-3-18 desc:添加自定义listMap
List
<
Map
<
String
,
Object
>>
customList
=
new
ArrayList
<>();
//根据类型获取模型路径
switch
(
dataType
)
{
case
"0"
:
...
...
@@ -417,6 +421,8 @@ public class TagService {
tag
=
null
;
}
if
(
tag
!=
null
)
{
//如果是个人标签,加入统计
if
(
"0"
.
equals
(
tag
.
getDimensionType
())&&
"1"
.
equals
(
tag
.
getTagType
()))
{
tagMap
.
put
(
"total"
,
map
.
get
(
"total"
));
tagMap
.
put
(
"name"
,
tag
.
getName
());
tagMap
.
put
(
"EnName"
,
tag
.
getNameEn
());
...
...
@@ -424,6 +430,24 @@ public class TagService {
}
}
}
}
//自定义标签=维度标签+个人标签
customList
.
addAll
(
dimTagList
);
customList
.
addAll
(
perTagList
);
//排序自定义标签
if
(!
customList
.
isEmpty
())
{
Collections
.
sort
(
customList
,
new
Comparator
<
Map
<
String
,
Object
>>()
{
@Override
public
int
compare
(
Map
<
String
,
Object
>
o1
,
Map
<
String
,
Object
>
o2
)
{
int
total1
=
Integer
.
parseInt
(
o1
.
get
(
"total"
).
toString
());
int
total2
=
Integer
.
parseInt
(
o2
.
get
(
"total"
).
toString
());
return
total2
-
total1
;
}
});
}
//排序系统标签(降序)
if
(!
sysTagList
.
isEmpty
())
{
Collections
.
sort
(
sysTagList
,
new
Comparator
<
Map
<
String
,
Object
>>()
{
...
...
@@ -435,7 +459,7 @@ public class TagService {
}
});
}
//
配许
维度标签
//
排序
维度标签
if
(!
dimTagList
.
isEmpty
())
{
Collections
.
sort
(
dimTagList
,
new
Comparator
<
Map
<
String
,
Object
>>()
{
@Override
...
...
@@ -461,6 +485,7 @@ public class TagService {
result
.
put
(
"sysTag"
,
sysTagList
);
result
.
put
(
"dimTag"
,
dimTagList
);
result
.
put
(
"personalTag"
,
perTagList
);
result
.
put
(
"custom"
,
customList
);
return
result
;
}
...
...
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