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
6600973a
Commit
6600973a
authored
Sep 15, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022/09/15 17:44
parent
3551ee37
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
6 deletions
+79
-6
src/main/java/com/zhiwei/brandkbs2/enmus/EmotionEnum.java
+4
-0
src/main/java/com/zhiwei/brandkbs2/enmus/response/EventCodeEnum.java
+3
-1
src/main/java/com/zhiwei/brandkbs2/enmus/response/ReportCodeEnum.java
+62
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
+3
-2
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+5
-1
No files found.
src/main/java/com/zhiwei/brandkbs2/enmus/EmotionEnum.java
View file @
6600973a
package
com
.
zhiwei
.
brandkbs2
.
enmus
;
package
com
.
zhiwei
.
brandkbs2
.
enmus
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
/**
/**
...
@@ -33,6 +35,8 @@ public enum EmotionEnum {
...
@@ -33,6 +35,8 @@ public enum EmotionEnum {
private
final
int
state
;
private
final
int
state
;
private
final
String
name
;
private
final
String
name
;
public
static
final
List
<
String
>
EMOTION_LIST
=
Arrays
.
asList
(
POSITIVE
.
getName
(),
NEUTRAL
.
getName
(),
NEGATIVE
.
getName
());
public
static
final
String
EMOTION_LABEL_KEY
=
"情感倾向"
;
public
static
final
String
EMOTION_LABEL_KEY
=
"情感倾向"
;
public
static
final
String
POSITIVE_LABEL
=
"正面"
;
public
static
final
String
POSITIVE_LABEL
=
"正面"
;
public
static
final
String
NEUTRAL_LABEL
=
"中性"
;
public
static
final
String
NEUTRAL_LABEL
=
"中性"
;
...
...
src/main/java/com/zhiwei/brandkbs2/
model
/EventCodeEnum.java
→
src/main/java/com/zhiwei/brandkbs2/
enmus/response
/EventCodeEnum.java
View file @
6600973a
package
com
.
zhiwei
.
brandkbs2
.
model
;
package
com
.
zhiwei
.
brandkbs2
.
enmus
.
response
;
import
com.zhiwei.brandkbs2.model.ResultCode
;
/**
/**
* @author lxj
* @author lxj
...
...
src/main/java/com/zhiwei/brandkbs2/enmus/response/ReportCodeEnum.java
0 → 100644
View file @
6600973a
package
com
.
zhiwei
.
brandkbs2
.
enmus
.
response
;
import
com.zhiwei.brandkbs2.model.ResultCode
;
/**
* @ClassName: ReportCodeEnum
* @Description ReportCodeEnum
* @author: sjj
* @date: 2022-09-15 14:13
*/
public
enum
ReportCodeEnum
implements
ResultCode
{
/**
* 该类型报告已存在
*/
REPORT_TYPE_EXIST_ERROR
(
false
,
1101
,
"该类型报告已存在"
,
200
);
/**
* 操作是否成功
*/
final
boolean
success
;
/**
* 操作代码
*/
final
int
code
;
/**
* 提示信息
*/
final
String
message
;
/**
* 聚合状态码
*/
final
int
aggCode
;
ReportCodeEnum
(
boolean
success
,
int
code
,
String
message
,
int
aggCode
)
{
this
.
success
=
success
;
this
.
code
=
code
;
this
.
message
=
message
;
this
.
aggCode
=
aggCode
;
}
@Override
public
boolean
success
()
{
return
success
;
}
@Override
public
int
code
()
{
return
code
;
}
@Override
public
String
message
()
{
return
message
;
}
@Override
public
int
aggCode
()
{
return
aggCode
;
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
6600973a
...
@@ -124,7 +124,7 @@ public class ChannelServiceImpl implements ChannelService {
...
@@ -124,7 +124,7 @@ public class ChannelServiceImpl implements ChannelService {
result
.
put
(
"source"
,
channel
.
getSource
());
result
.
put
(
"source"
,
channel
.
getSource
());
result
.
put
(
"articleCount"
,
channel
.
getArticleCount
());
result
.
put
(
"articleCount"
,
channel
.
getArticleCount
());
result
.
put
(
"eventCount"
,
channel
.
getEventCount
());
result
.
put
(
"eventCount"
,
channel
.
getEventCount
());
result
.
put
(
"emotion"
,
channel
.
getEmotion
(
));
result
.
put
(
"emotion"
,
EmotionEnum
.
state2Name
(
channel
.
getEmotion
()
));
result
.
put
(
"emotionIndex"
,
channel
.
getEmotionIndex
());
result
.
put
(
"emotionIndex"
,
channel
.
getEmotionIndex
());
result
.
put
(
"experienceLevel"
,
ExperienceEnum
.
getValueFromDataBaseName
(
channel
.
getExperienceLevel
()));
result
.
put
(
"experienceLevel"
,
ExperienceEnum
.
getValueFromDataBaseName
(
channel
.
getExperienceLevel
()));
result
.
put
(
"lastTime"
,
channel
.
getLastTime
());
result
.
put
(
"lastTime"
,
channel
.
getLastTime
());
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
View file @
6600973a
...
@@ -24,7 +24,7 @@ import com.zhiwei.brandkbs2.enmus.ImportantChannelEnum;
...
@@ -24,7 +24,7 @@ import com.zhiwei.brandkbs2.enmus.ImportantChannelEnum;
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.
model
.EventCodeEnum
;
import
com.zhiwei.brandkbs2.
enmus.response
.EventCodeEnum
;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.*
;
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
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
View file @
6600973a
...
@@ -12,6 +12,7 @@ import com.zhiwei.brandkbs2.dao.ReportDao;
...
@@ -12,6 +12,7 @@ import com.zhiwei.brandkbs2.dao.ReportDao;
import
com.zhiwei.brandkbs2.dao.ReportSettingsDao
;
import
com.zhiwei.brandkbs2.dao.ReportSettingsDao
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.enmus.ReportTypeEnum
;
import
com.zhiwei.brandkbs2.enmus.ReportTypeEnum
;
import
com.zhiwei.brandkbs2.enmus.response.ReportCodeEnum
;
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
;
...
@@ -95,7 +96,7 @@ public class ReportServiceImpl implements ReportService {
...
@@ -95,7 +96,7 @@ public class ReportServiceImpl implements ReportService {
}
}
ReportSettingsDTO
reportSettingsDTO
=
ReportSettingsDTO
.
createFromReportSettings
(
settings
);
ReportSettingsDTO
reportSettingsDTO
=
ReportSettingsDTO
.
createFromReportSettings
(
settings
);
if
(!
CollectionUtils
.
isEmpty
(
reportSettingsDTO
.
getContendIds
()))
{
if
(!
CollectionUtils
.
isEmpty
(
reportSettingsDTO
.
getContendIds
()))
{
reportSettingsDTO
.
setContendBrandNames
(
reportSettingsDTO
.
getContendIds
().
stream
().
map
(
contendId
->
projectService
.
getProjectBy
LinkedGroupId
(
contendId
).
getBrandName
()).
collect
(
Collectors
.
toList
()));
reportSettingsDTO
.
setContendBrandNames
(
reportSettingsDTO
.
getContendIds
().
stream
().
map
(
contendId
->
projectService
.
getProjectBy
ContendId
(
UserThreadLocal
.
getProjectId
(),
contendId
).
getBrandName
()).
collect
(
Collectors
.
toList
()));
}
}
res
.
put
(
key
,
reportSettingsDTO
);
res
.
put
(
key
,
reportSettingsDTO
);
}
}
...
@@ -116,7 +117,7 @@ public class ReportServiceImpl implements ReportService {
...
@@ -116,7 +117,7 @@ public class ReportServiceImpl implements ReportService {
// 已存在类型
// 已存在类型
if
(
originSettings
.
containsKey
(
type
))
{
if
(
originSettings
.
containsKey
(
type
))
{
if
(
null
==
reportSettings
.
getId
()
||
!
originSettings
.
get
(
type
).
getId
().
equals
(
reportSettings
.
getId
()))
{
if
(
null
==
reportSettings
.
getId
()
||
!
originSettings
.
get
(
type
).
getId
().
equals
(
reportSettings
.
getId
()))
{
ExceptionCast
.
cast
(
CommonCodeEnum
.
INVALID_PARAM
);
ExceptionCast
.
cast
(
ReportCodeEnum
.
REPORT_TYPE_EXIST_ERROR
);
}
}
reportSettingsDao
.
updateOne
(
reportSettings
);
reportSettingsDao
.
updateOne
(
reportSettings
);
return
;
return
;
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
6600973a
...
@@ -13,6 +13,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute;
...
@@ -13,6 +13,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute;
import
com.zhiwei.brandkbs2.common.GlobalPojo
;
import
com.zhiwei.brandkbs2.common.GlobalPojo
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.easyexcel.dto.UploadKeywordDTO
;
import
com.zhiwei.brandkbs2.easyexcel.dto.UploadKeywordDTO
;
import
com.zhiwei.brandkbs2.enmus.EmotionEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.BaseMap
;
import
com.zhiwei.brandkbs2.pojo.BaseMap
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
...
@@ -389,7 +390,10 @@ public class Tools {
...
@@ -389,7 +390,10 @@ public class Tools {
}
}
for
(
Map
<
String
,
Object
>
cacheMap
:
cacheMaps
)
{
for
(
Map
<
String
,
Object
>
cacheMap
:
cacheMaps
)
{
if
(
"情感倾向"
.
equals
(
String
.
valueOf
(
cacheMap
.
get
(
"group_name"
))))
{
if
(
"情感倾向"
.
equals
(
String
.
valueOf
(
cacheMap
.
get
(
"group_name"
))))
{
return
String
.
valueOf
(
cacheMap
.
get
(
"name"
));
String
emotionName
=
String
.
valueOf
(
cacheMap
.
get
(
"name"
));
if
(
EmotionEnum
.
EMOTION_LIST
.
contains
(
emotionName
))
{
return
emotionName
;
}
}
}
}
}
return
null
;
return
null
;
...
...
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