Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
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
shenjunjie
brandkbs2
Commits
590feb2f
Commit
590feb2f
authored
Aug 29, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
es-index 调整至线上配置
parent
83707cc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
+6
-2
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+21
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
View file @
590feb2f
...
@@ -15,8 +15,8 @@ public class GenericAttribute {
...
@@ -15,8 +15,8 @@ public class GenericAttribute {
* es index
* es index
*/
*/
public
static
final
String
ES_INDEX_PRE
=
"brandkbs2"
;
public
static
final
String
ES_INDEX_PRE
=
"brandkbs2"
;
public
static
final
String
ES_INDEX_TEST
=
"brandkbs2_test"
;
//
public static final String ES_INDEX_TEST = "brandkbs2_test";
//
public static final String ES_INDEX_TEST = "brandkbs2_2022";
public
static
final
String
ES_INDEX_TEST
=
"brandkbs2_2022"
;
public
static
final
String
ES_CHANNEL_INDEX_TEST
=
"brandkbs2_channel_record_test"
;
public
static
final
String
ES_CHANNEL_INDEX_TEST
=
"brandkbs2_channel_record_test"
;
/**
/**
* es ind_title
* es ind_title
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
View file @
590feb2f
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
com.zhiwei.brandkbs2.common.RedisKeyPrefix
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.EventDao
;
import
com.zhiwei.brandkbs2.dao.EventDao
;
import
com.zhiwei.brandkbs2.dao.EventDataDao
;
import
com.zhiwei.brandkbs2.dao.EventDataDao
;
import
com.zhiwei.brandkbs2.dao.EventDisseminationTrendDao
;
import
com.zhiwei.brandkbs2.dao.EventDisseminationTrendDao
;
...
@@ -22,7 +23,10 @@ import com.zhiwei.brandkbs2.enmus.EventTagEnum;
...
@@ -22,7 +23,10 @@ import com.zhiwei.brandkbs2.enmus.EventTagEnum;
import
com.zhiwei.brandkbs2.exception.ExceptionCast
;
import
com.zhiwei.brandkbs2.exception.ExceptionCast
;
import
com.zhiwei.brandkbs2.listener.ApplicationProjectListener
;
import
com.zhiwei.brandkbs2.listener.ApplicationProjectListener
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.EventData
;
import
com.zhiwei.brandkbs2.pojo.EventDisseminationTrend
;
import
com.zhiwei.brandkbs2.pojo.EventTopArticlesAnalysis
;
import
com.zhiwei.brandkbs2.pojo.dto.EventDataDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.EventDataDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.EventSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.EventSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.YqEventDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.YqEventDTO
;
...
@@ -632,7 +636,7 @@ public class EventServiceImpl implements EventService {
...
@@ -632,7 +636,7 @@ public class EventServiceImpl implements EventService {
boolean
highLight
=
null
==
aggTitle
||
Objects
.
equals
(
aggTitle
,
eventTopArticlesAnalysis
.
getAggTitle
());
boolean
highLight
=
null
==
aggTitle
||
Objects
.
equals
(
aggTitle
,
eventTopArticlesAnalysis
.
getAggTitle
());
return
new
EventTopArticlesAnalysisVO
(
eventTopArticlesAnalysis
,
highLight
);
return
new
EventTopArticlesAnalysisVO
(
eventTopArticlesAnalysis
,
highLight
);
}).
collect
(
Collectors
.
groupingBy
(
EventTopArticlesAnalysisVO:
:
getTimePoint
));
}).
collect
(
Collectors
.
groupingBy
(
EventTopArticlesAnalysisVO:
:
getTimePoint
));
res
.
put
(
"dataDay"
,
collect
);
res
.
put
(
"dataDay"
,
Tools
.
sortTimeKeyMap
(
collect
,
Constant
.
SPEC_DAY_FORMAT
,
false
)
);
res
.
put
(
"dataAmount"
,
null
);
res
.
put
(
"dataAmount"
,
null
);
return
res
;
return
res
;
case
"按数量"
:
case
"按数量"
:
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
590feb2f
...
@@ -37,6 +37,7 @@ import java.nio.ByteBuffer;
...
@@ -37,6 +37,7 @@ import java.nio.ByteBuffer;
import
java.nio.channels.Channels
;
import
java.nio.channels.Channels
;
import
java.nio.channels.ReadableByteChannel
;
import
java.nio.channels.ReadableByteChannel
;
import
java.nio.channels.WritableByteChannel
;
import
java.nio.channels.WritableByteChannel
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -877,6 +878,26 @@ public class Tools {
...
@@ -877,6 +878,26 @@ public class Tools {
return
new
JSONObject
();
return
new
JSONObject
();
}
}
public
static
<
T
>
Map
<
String
,
T
>
sortTimeKeyMap
(
Map
<
String
,
T
>
map
,
FastDateFormat
timePattern
,
boolean
isDesc
)
{
Map
<
String
,
T
>
res
=
new
LinkedHashMap
<>();
List
<
Map
.
Entry
<
String
,
T
>>
sortKey
=
map
.
entrySet
().
stream
().
sorted
((
x
,
y
)
->
{
try
{
long
xTime
=
timePattern
.
parse
(
x
.
getKey
()).
getTime
();
long
yTime
=
timePattern
.
parse
(
y
.
getKey
()).
getTime
();
if
(
isDesc
)
{
return
Long
.
compare
(
yTime
,
xTime
);
}
return
Long
.
compare
(
xTime
,
yTime
);
}
catch
(
ParseException
e
)
{
return
0
;
}
}).
collect
(
Collectors
.
toList
());
for
(
Map
.
Entry
<
String
,
T
>
longTEntry
:
sortKey
)
{
res
.
put
(
longTEntry
.
getKey
(),
longTEntry
.
getValue
());
}
return
res
;
}
public
static
<
T
>
Map
<
Long
,
T
>
sortTimeKeyMap
(
Map
<
Long
,
T
>
map
,
boolean
isDesc
)
{
public
static
<
T
>
Map
<
Long
,
T
>
sortTimeKeyMap
(
Map
<
Long
,
T
>
map
,
boolean
isDesc
)
{
Map
<
Long
,
T
>
res
=
new
LinkedHashMap
<>();
Map
<
Long
,
T
>
res
=
new
LinkedHashMap
<>();
List
<
Map
.
Entry
<
Long
,
T
>>
sortKey
=
map
.
entrySet
().
stream
().
sorted
((
x
,
y
)
->
{
List
<
Map
.
Entry
<
Long
,
T
>>
sortKey
=
map
.
entrySet
().
stream
().
sorted
((
x
,
y
)
->
{
...
...
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