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
23f315ac
Commit
23f315ac
authored
Nov 17, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'dev'
切换brandkbs_channel_record表 See merge request
!97
parents
04208cf2
cba7eb07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/es/ChannelEsDao.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+1
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/common/GenericAttribute.java
View file @
23f315ac
...
...
@@ -18,6 +18,7 @@ public class GenericAttribute {
// public static final String ES_INDEX_TEST = "brandkbs2_test";
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_PREFIX
=
"brandkbs2_channel_record_"
;
/**
* es ind_title
**/
...
...
src/main/java/com/zhiwei/brandkbs2/es/ChannelEsDao.java
View file @
23f315ac
...
...
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -109,13 +110,12 @@ public class ChannelEsDao extends EsClientDao {
public
String
getChannelRecordIndex
()
{
// if (test) {
return
GenericAttribute
.
ES_CHANNEL_INDEX_TEST
;
//
return GenericAttribute.ES_CHANNEL_INDEX_TEST;
// }
// // 近1年数据库 TODO
// Calendar date = Calendar.getInstance();
// int year = date.get(Calendar.YEAR);
// res.add(GenericAttribute.ES_CHANNEL_INDEX_TEST);
// return res.toArray(new String[0]);
// 近1年数据库
Calendar
date
=
Calendar
.
getInstance
();
int
year
=
date
.
get
(
Calendar
.
YEAR
);
return
GenericAttribute
.
ES_CHANNEL_INDEX_PREFIX
+
year
;
}
private
BoolQueryBuilder
channelUniqueBool
(
String
fid
)
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
23f315ac
...
...
@@ -751,7 +751,7 @@ public class ChannelServiceImpl implements ChannelService {
boolean
isPositive
=
false
;
boolean
isNegative
=
false
;
long
specNegativeCount
=
eventDao
.
getEventCount
(
new
ChannelIndex
(
channel
),
Arrays
.
asList
(
EmotionEnum
.
POSITIVE
.
getName
(),
EmotionEnum
.
NEUTRAL
.
getName
()),
EmotionEnum
.
NEGATIVE
.
getName
());
long
specPositiveCount
=
eventDao
.
getEventCount
(
new
ChannelIndex
(
channel
),
Arrays
.
asList
(
EmotionEnum
.
NEGATIVE
.
getName
(),
EmotionEnum
.
POSI
TIVE
.
getName
()),
EmotionEnum
.
POSITIVE
.
getName
());
long
specPositiveCount
=
eventDao
.
getEventCount
(
new
ChannelIndex
(
channel
),
Collections
.
singletonList
(
EmotionEnum
.
NEGA
TIVE
.
getName
()),
EmotionEnum
.
POSITIVE
.
getName
());
// 特殊情况:若皆有发布过反常稿件
if
(
specNegativeCount
>
0
&&
specPositiveCount
>
0
)
{
//正面稿件数>负面稿件数,为正面
...
...
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