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
f77f2d5d
Commit
f77f2d5d
authored
Aug 10, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'dev'
Feature See merge request
!18
parents
2dca5346
64993ad5
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
210 additions
and
20 deletions
+210
-20
src/main/java/com/zhiwei/brandkbs2/controller/app/AppEventController.java
+68
-0
src/main/java/com/zhiwei/brandkbs2/dao/impl/EventDaoImpl.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/Channel.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/pojo/dto/MarkSearchDTO.java
+6
-0
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+6
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+76
-14
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+25
-0
src/main/resources/application-dev.properties
+7
-0
src/main/resources/application-local.properties
+7
-0
src/main/resources/application-prod.properties
+7
-0
No files found.
src/main/java/com/zhiwei/brandkbs2/controller/app/AppEventController.java
View file @
f77f2d5d
package
com
.
zhiwei
.
brandkbs2
.
controller
.
app
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.controller.BaseController
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
...
...
@@ -7,7 +9,11 @@ import com.zhiwei.brandkbs2.model.ResponseResult;
import
com.zhiwei.brandkbs2.service.EventService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.client.RestTemplate
;
/**
* @Description: 前台事件库
...
...
@@ -19,6 +25,23 @@ import org.springframework.web.bind.annotation.*;
@Api
(
tags
=
"前台事件库"
,
description
=
"提供前台事件相关信息展示"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
class
AppEventController
extends
BaseController
{
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${ef.search.url}"
)
private
String
getEfSearchUrl
;
@Value
(
"${ef.searchCriteria.url}"
)
private
String
getEfSearchCriteriaUrl
;
@Value
(
"${ef.filterNew.url}"
)
private
String
getFilterNewUrl
;
@Value
(
"${ef.captcha.url}"
)
private
String
efCaptchaUrl
;
@Value
(
"${ef.checkCaptcha.url}"
)
private
String
efCheckCaptchaUrl
;
private
final
EventService
eventService
;
...
...
@@ -75,4 +98,49 @@ public class AppEventController extends BaseController {
return
ResponseResult
.
success
(
eventService
.
getEventTopArticlesAnalysis
(
id
,
type
,
emotion
,
aggTitle
));
}
@ApiOperation
(
"前台事件库-全网事件库-搜索"
)
@GetMapping
(
"/getWholeNetworkEvents"
)
public
ResponseResult
getWholeNetworkEvents
(
@RequestParam
(
"keyword"
)
String
keyword
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
){
String
name
=
keyword
.
trim
();
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getEfSearchUrl
,
String
.
class
,
name
,
page
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
return
ResponseResult
.
success
(
jsonObject
);
}
@ApiOperation
(
"前台事件库-全网事件库-搜索条件"
)
@GetMapping
(
"/getWholeNetworkSearchCriteria"
)
public
ResponseResult
getWholeNetworkSearchCriteria
(){
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getEfSearchCriteriaUrl
,
String
.
class
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
return
ResponseResult
.
success
(
jsonObject
);
}
@ApiOperation
(
"前台事件库-全网事件库-列表"
)
@GetMapping
(
"/getWholeNetworkEventsList"
)
public
ResponseResult
getWholeNetworkEventsList
(
@RequestParam
(
value
=
"firstType"
,
required
=
false
,
defaultValue
=
""
)
String
firstType
,
@RequestParam
(
value
=
"start"
,
required
=
false
,
defaultValue
=
"0"
)
long
start
,
@RequestParam
(
value
=
"end"
,
required
=
false
,
defaultValue
=
"0"
)
long
end
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
){
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
getFilterNewUrl
,
String
.
class
,
firstType
,
start
,
end
,
page
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
return
ResponseResult
.
success
(
jsonObject
);
}
@ApiOperation
(
"前台事件库-全网事件库-得到验证码"
)
@GetMapping
(
"/getWholeNetworkCaptcha"
)
public
ResponseResult
getWholeNetworkCaptcha
(){
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
efCaptchaUrl
,
String
.
class
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
return
ResponseResult
.
success
(
jsonObject
);
}
@ApiOperation
(
"前台事件库-全网事件库-校验验证码"
)
@GetMapping
(
"/checkWholeNetworkCaptcha"
)
public
ResponseResult
checkWholeNetworkCaptcha
(
@RequestParam
(
value
=
"id"
,
required
=
false
,
defaultValue
=
""
)
String
id
,
@RequestParam
(
value
=
"captcha"
,
required
=
false
,
defaultValue
=
""
)
String
captcha
){
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
getForEntity
(
efCheckCaptchaUrl
,
String
.
class
,
id
,
captcha
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
responseEntity
.
getBody
());
return
ResponseResult
.
success
(
jsonObject
);
}
}
src/main/java/com/zhiwei/brandkbs2/dao/impl/EventDaoImpl.java
View file @
f77f2d5d
...
...
@@ -77,6 +77,7 @@ public class EventDaoImpl extends BaseMongoDaoImpl<Event> implements EventDao {
Aggregation
.
group
(
"patternDate"
).
count
().
as
(
"eventCount"
));
AggregationResults
<
JSONObject
>
aggregate
=
mongoTemplate
.
aggregate
(
agg
,
getAggreeCollection
(),
JSONObject
.
class
);
List
<
JSONObject
>
mappedResults
=
aggregate
.
getMappedResults
();
// TODO
return
new
HashMap
<>();
}
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/Channel.java
View file @
f77f2d5d
...
...
@@ -92,6 +92,7 @@ public class Channel extends ChannelIndex {
channel
.
setCTime
(
new
Date
().
getTime
());
channel
.
setProjectId
(
channelIndex
.
getProjectId
());
channel
.
setLinkedGroupId
(
channelIndex
.
getLinkedGroupId
());
channel
.
setContendId
(
channelIndex
.
getContendId
());
channel
.
setPlatform
(
channelIndex
.
getPlatform
());
channel
.
setRealSource
(
channelIndex
.
getRealSource
());
channel
.
setSource
(
channelIndex
.
getSource
());
...
...
src/main/java/com/zhiwei/brandkbs2/pojo/dto/MarkSearchDTO.java
View file @
f77f2d5d
...
...
@@ -40,6 +40,12 @@ public class MarkSearchDTO {
private
String
linkedGroupId
;
/**
* 竞品id,主品牌默认0
*/
@ApiModelProperty
(
value
=
"竞品id"
)
private
String
contendId
=
"0"
;
/**
* 时间类型
*/
@ApiModelProperty
(
"时间类型"
)
...
...
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
f77f2d5d
...
...
@@ -219,4 +219,10 @@ public interface ChannelService {
* @return 稿件信息
*/
List
<
ExportAppChannelArticleDTO
>
downloadArticlesByTime
(
Long
startTime
,
Long
endTime
,
String
channelId
,
String
contendId
);
/**
* 计算渠道倾向及指数
* @param channelId 渠道ID
*/
void
calculateChannelEmotionIndex
(
String
channelId
);
}
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
f77f2d5d
...
...
@@ -668,6 +668,37 @@ public class ChannelServiceImpl implements ChannelService {
return
futureList
.
stream
().
map
(
CompletableFuture:
:
join
).
collect
(
Collectors
.
toList
());
}
@Override
public
void
calculateChannelEmotionIndex
(
String
channelId
)
{
try
{
Channel
channel
=
channelDao
.
findOneById
(
channelId
);
// 数据格式变化未含有contendId部分
if
(
null
==
channel
.
getContendId
())
{
channel
.
setContendId
(
"0"
);
}
if
(
hasEmotion
(
channel
))
{
//该渠道发布正面稿件
Long
positiveCount
=
markCountByEmotion
(
channel
,
EmotionEnum
.
POSITIVE
.
getName
());
//该渠道发布中性稿件
Long
neutralCount
=
markCountByEmotion
(
channel
,
EmotionEnum
.
NEUTRAL
.
getName
());
//该渠道发布负面稿件
Long
negativeCount
=
markCountByEmotion
(
channel
,
EmotionEnum
.
NEGATIVE
.
getName
());
//是否友好渠道
boolean
isPositive
=
false
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"calculateChannelEmotionIndex-"
,
e
);
}
}
private
Long
markCountByEmotion
(
Channel
channel
,
String
emotion
)
throws
IOException
{
BoolQueryBuilder
postFilter
=
MarkDataServiceImpl
.
projectLinkedGroupContendIdQuery
(
channel
.
getProjectId
(),
channel
.
getLinkedGroupId
(),
channel
.
getContendId
());
postFilter
.
must
(
QueryBuilders
.
termQuery
(
"brandkbs_mark_cache_maps.name.keyword"
,
emotion
));
return
esClientDao
.
count
(
postFilter
);
}
private
Map
<
String
,
List
<
ChannelIndex
.
Article
>>
getSourceContendMap
(
String
channelId
,
Collection
<
String
>
contendIds
,
String
platform
,
String
keyword
,
Long
startTime
,
Long
endTime
)
{
try
{
String
projectId
=
UserThreadLocal
.
getProjectId
();
...
...
@@ -704,9 +735,8 @@ public class ChannelServiceImpl implements ChannelService {
res
.
put
(
"negativeCount"
,
negativeCount
);
res
.
put
(
"articleTotal"
,
total
);
// 做分母时不能为0
total
=
0
==
total
?
1
:
total
;
res
.
put
(
"positivePercent"
,
new
BigDecimal
((
double
)
positiveCount
*
100
/
total
).
setScale
(
1
,
RoundingMode
.
UP
));
res
.
put
(
"negativePercent"
,
new
BigDecimal
((
double
)
negativeCount
*
100
/
total
).
setScale
(
1
,
RoundingMode
.
UP
));
res
.
put
(
"positivePercent"
,
BigDecimal
.
valueOf
((
double
)
positiveCount
*
100
/
(
0
==
total
?
1
:
total
)).
setScale
(
1
,
RoundingMode
.
UP
));
res
.
put
(
"negativePercent"
,
BigDecimal
.
valueOf
((
double
)
negativeCount
*
100
/
(
0
==
total
?
1
:
total
)).
setScale
(
1
,
RoundingMode
.
UP
));
return
Pair
.
of
(
total
,
res
);
}
...
...
@@ -743,23 +773,21 @@ public class ChannelServiceImpl implements ChannelService {
private
List
<
JSONObject
>
spreadingTendData
(
Long
startTime
,
Long
endTime
,
List
<
ChannelIndex
.
Article
>
articleList
,
String
timePattern
)
{
// 按日分组并根据id去重保留最近标注时间
Map
<
Long
,
List
<
ChannelIndex
.
Article
>>
dateListMap
=
partition
(
startTime
,
endTime
,
timePattern
,
articleList
);
List
<
JSONObject
>
collect
=
dateListMap
.
entrySet
().
stream
().
sorted
(
Comparator
.
comparingLong
(
Map
.
Entry
::
getKey
)).
map
(
e
->
{
return
dateListMap
.
entrySet
().
stream
().
sorted
(
Comparator
.
comparingLong
(
Map
.
Entry
::
getKey
)).
map
(
e
->
{
JSONObject
spreadJson
=
new
JSONObject
();
spreadJson
.
put
(
"time"
,
e
.
getKey
());
spreadJson
.
put
(
"sum"
,
e
.
getValue
().
size
());
return
spreadJson
;
}).
collect
(
Collectors
.
toList
());
Collections
.
reverse
(
collect
);
return
collect
;
}
private
List
<
JSONObject
>
spreadingTendEvent
(
Long
startTime
,
Long
endTime
,
Channel
channel
,
String
projectId
,
String
contendId
,
String
timePattern
)
{
String
linkedGroupId
=
projectService
.
getProjectByContendId
(
contendId
).
getBrandLinkedGroupId
();
Map
<
Long
,
List
<
Event
>>
eventCount
;
Map
<
Long
,
List
<
Event
>>
eventCount
=
completeTimes
(
startTime
,
endTime
,
timePattern
)
;
if
(
Constant
.
MONTH_PATTERN
.
equals
(
timePattern
))
{
eventCount
=
eventDao
.
getEventMonth
(
new
ChannelIndex
(
projectId
,
linkedGroupId
,
channel
),
startTime
,
endTime
);
eventCount
.
putAll
(
eventDao
.
getEventMonth
(
new
ChannelIndex
(
projectId
,
linkedGroupId
,
channel
),
startTime
,
endTime
)
);
}
else
{
eventCount
=
eventDao
.
getEventDay
(
new
ChannelIndex
(
projectId
,
linkedGroupId
,
channel
),
startTime
,
endTime
);
eventCount
.
putAll
(
eventDao
.
getEventDay
(
new
ChannelIndex
(
projectId
,
linkedGroupId
,
channel
),
startTime
,
endTime
)
);
}
return
eventCount
.
entrySet
().
stream
().
sorted
(
Comparator
.
comparingLong
(
Map
.
Entry
::
getKey
)).
map
(
e
->
{
JSONObject
spreadJson
=
new
JSONObject
();
...
...
@@ -804,11 +832,7 @@ public class ChannelServiceImpl implements ChannelService {
* @return
*/
private
Map
<
Long
,
List
<
ChannelIndex
.
Article
>>
partition
(
Long
startTime
,
Long
endTime
,
String
timePattern
,
List
<
ChannelIndex
.
Article
>
articles
)
{
Map
<
Long
,
List
<
ChannelIndex
.
Article
>>
res
=
new
LinkedHashMap
<>();
// 自动补全时间段
for
(
Long
timeKey
:
Tools
.
parseToDayList
(
startTime
,
endTime
))
{
res
.
put
(
timeKey
,
Lists
.
newArrayList
());
}
Map
<
Long
,
List
<
ChannelIndex
.
Article
>>
res
=
completeTimes
(
startTime
,
endTime
,
timePattern
);
for
(
ChannelIndex
.
Article
article
:
articles
)
{
// 按日分组
long
key
=
Tools
.
truncDate
(
new
Date
(
article
.
getTime
()),
timePattern
).
getTime
();
...
...
@@ -899,4 +923,42 @@ public class ChannelServiceImpl implements ChannelService {
return
new
String
[]{
null
,
null
};
}
private
boolean
hasEmotion
(
Channel
channel
)
{
if
(
"0"
.
equals
(
channel
.
getContendId
()))
{
return
true
;
}
AbstractProject
project
=
projectService
.
getProjectByContendId
(
channel
.
getContendId
());
if
(
project
instanceof
Contend
)
{
//有情感倾向更新渠道指数
return
((
Contend
)
project
).
isHasEmotion
();
}
return
project
instanceof
Project
;
}
/**
* 自动补全时间段
*
* @param startTime
* @param endTime
* @param timePattern
* @return
*/
private
<
T
>
Map
<
Long
,
List
<
T
>>
completeTimes
(
Long
startTime
,
Long
endTime
,
String
timePattern
)
{
Map
<
Long
,
List
<
T
>>
res
=
new
LinkedHashMap
<>();
if
(
Constant
.
DAY_PATTERN
.
equals
(
timePattern
))
{
for
(
Long
timeKey
:
Tools
.
parseToDayList
(
startTime
,
endTime
))
{
res
.
put
(
timeKey
,
Lists
.
newArrayList
());
}
}
else
if
(
Constant
.
MONTH_PATTERN
.
equals
(
timePattern
))
{
for
(
Long
timeKey
:
Tools
.
parseToMonthList
(
startTime
,
endTime
))
{
res
.
put
(
timeKey
,
Lists
.
newArrayList
());
}
}
return
res
;
}
private
long
judgeSpecEventCount
(
String
channelId
,
List
<
Integer
>
eventEmotions
,
int
articleEmotion
)
{
return
0
;
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
f77f2d5d
...
...
@@ -64,7 +64,6 @@ import org.springframework.stereotype.Service;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
...
...
@@ -358,7 +357,7 @@ public class MarkDataServiceImpl implements MarkDataService {
result
.
put
(
"negTopTitle"
,
topTitle
);
List
<
JSONObject
>
articlePlatformProportion
=
getMarkPlatformProportion
(
startTime
,
endTime
,
projectId
,
linkedGroupId
,
true
);
result
.
put
(
"platformRank"
,
articlePlatformProportion
.
stream
().
filter
(
articlePlatform
->
articlePlatform
.
getLongValue
(
"count"
)
>
0
).
sorted
((
o1
,
o2
)
->
o2
.
getLong
(
"count"
).
compareTo
(
o1
.
getLong
(
"count"
))).
collect
(
Collectors
.
toList
()));
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
)
,
1
,
TimeUnit
.
HOURS
);
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
));
return
result
;
}
catch
(
IOException
e
)
{
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
.
message
(
"es查询异常"
),
e
);
...
...
@@ -404,7 +403,7 @@ public class MarkDataServiceImpl implements MarkDataService {
result
.
put
(
"lastPosCount"
,
oldEmotions
.
get
(
0
).
getLongValue
(
"count"
));
result
.
put
(
"lastNeuCount"
,
oldEmotions
.
get
(
1
).
getLongValue
(
"count"
));
result
.
put
(
"lastNegCount"
,
oldEmotions
.
get
(
2
).
getLongValue
(
"count"
));
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
)
,
1
,
TimeUnit
.
HOURS
);
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
));
return
result
;
}
catch
(
IOException
e
)
{
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
.
message
(
"es查询异常"
),
e
);
...
...
@@ -433,6 +432,7 @@ public class MarkDataServiceImpl implements MarkDataService {
}
catch
(
IOException
e
)
{
ExceptionCast
.
cast
(
CommonCodeEnum
.
FAIL
.
message
(
"es查询异常"
));
}
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
));
return
result
;
}
...
...
@@ -753,7 +753,7 @@ public class MarkDataServiceImpl implements MarkDataService {
line
.
put
(
"time"
,
day
.
getLongValue
(
"date"
));
lineList
.
add
(
line
);
});
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
lineList
),
1
,
TimeUnit
.
HOURS
);
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
result
)
);
return
lineList
;
}
...
...
@@ -946,7 +946,7 @@ public class MarkDataServiceImpl implements MarkDataService {
List
<
JSONObject
>
platformsCount
=
getPlatformsCount
(
startTime
,
endTime
,
null
,
null
,
projectId
,
linkedGroupId
,
platformList
);
long
articlesCount
=
platformsCount
.
stream
().
mapToLong
(
platform
->
platform
.
getLongValue
(
"count"
)).
sum
();
List
<
JSONObject
>
resultList
=
platformsCount
.
stream
().
peek
(
platform
->
platform
.
put
(
"proportion"
,
0
==
articlesCount
?
0
:
platform
.
getLongValue
(
"count"
)
*
1.0
/
articlesCount
)).
collect
(
Collectors
.
toList
());
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
resultList
)
,
1
,
TimeUnit
.
HOURS
);
redisUtil
.
setExpire
(
redisKey
,
JSON
.
toJSONString
(
resultList
));
return
resultList
;
}
...
...
@@ -1076,7 +1076,7 @@ public class MarkDataServiceImpl implements MarkDataService {
return
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.project_id.keyword"
,
projectId
)).
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.linked_group_id.keyword"
,
linkedGroupId
));
}
pr
ivate
static
BoolQueryBuilder
projectLinkedGroupContendIdQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
)
{
pr
otected
static
BoolQueryBuilder
projectLinkedGroupContendIdQuery
(
String
projectId
,
String
linkedGroupId
,
String
contendId
)
{
return
QueryBuilders
.
boolQuery
().
must
(
QueryBuilders
.
termQuery
(
"brandkbs_cache_maps.key.keyword"
,
Tools
.
concat
(
projectId
,
linkedGroupId
,
contendId
)));
}
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
f77f2d5d
...
...
@@ -674,6 +674,31 @@ public class Tools {
* @param endTime 结束时间
* @return 按日分割的map集合
*/
public
static
List
<
Long
>
parseToMonthList
(
Long
startTime
,
Long
endTime
)
{
Date
start
=
new
Date
(
startTime
);
Date
end
=
new
Date
(
endTime
);
start
=
Tools
.
truncDate
(
start
,
MONTH_PATTERN
);
end
=
Tools
.
truncDate
(
end
,
MONTH_PATTERN
);
Period
periodDays
=
new
Period
(
start
.
getTime
(),
end
.
getTime
(),
PeriodType
.
months
());
int
months
=
periodDays
.
getMonths
();
if
(
months
<
0
)
{
return
Collections
.
emptyList
();
}
List
<
Long
>
resList
=
new
ArrayList
<>(
months
);
for
(
int
i
=
0
;
i
<=
months
;
i
++)
{
resList
.
add
(
DateUtils
.
addMonths
(
start
,
i
).
getTime
());
}
Collections
.
reverse
(
resList
);
return
resList
;
}
/**
* 解析时间转换成按日的集合
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return 按日分割的map集合
*/
public
static
List
<
Map
<
String
,
String
>>
parseToDays
(
Long
startTime
,
Long
endTime
)
{
FastDateFormat
df
=
DAY_FORMAT
;
Date
start
=
Tools
.
truncDate
(
new
Date
(
startTime
),
Constant
.
DAY_PATTERN
);
...
...
src/main/resources/application-dev.properties
View file @
f77f2d5d
...
...
@@ -68,3 +68,9 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url
=
https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url
=
https://ef.zhiweidata.com/index/getSearchKey.do
ef.filterNew.url
=
https://ef.zhiweidata.com/filterNew.do?firstType={1}&start={2}&end={3}&page={4}
ef.captcha.url
=
https://ef.zhiweidata.com/captchaApi/getNewCaptcha.do.do?type=test
ef.checkCaptcha.url
=
https://ef.zhiweidata.com/captchaApi/checkeCaptcha.do.do?id={1}&captcha={2}&type=test
\ No newline at end of file
src/main/resources/application-local.properties
View file @
f77f2d5d
...
...
@@ -70,3 +70,9 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url
=
https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url
=
https://ef.zhiweidata.com/index/getSearchKey.do
ef.filterNew.url
=
https://ef.zhiweidata.com/filterNew.do?firstType={1}&start={2}&end={3}&page={4}
ef.captcha.url
=
https://ef.zhiweidata.com/captchaApi/getNewCaptcha.do.do?type=test
ef.checkCaptcha.url
=
https://ef.zhiweidata.com/captchaApi/checkeCaptcha.do.do?id={1}&captcha={2}&type=test
\ No newline at end of file
src/main/resources/application-prod.properties
View file @
f77f2d5d
...
...
@@ -69,3 +69,9 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
trends.longTimeInListSearchByInner.url
=
https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
trends.findHotSearchESDataInTimeByInner.url
=
https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url
=
https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url
=
https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url
=
https://ef.zhiweidata.com/index/getSearchKey.do
ef.filterNew.url
=
https://ef.zhiweidata.com/filterNew.do?firstType={1}&start={2}&end={3}&page={4}
ef.captcha.url
=
https://ef.zhiweidata.com/captchaApi/getNewCaptcha.do.do?type=test
ef.checkCaptcha.url
=
https://ef.zhiweidata.com/captchaApi/checkeCaptcha.do.do?id={1}&captcha={2}&type=test
\ No newline at end of file
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