Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit aa6b649d
authored
Sep 06, 2021
by
danmo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改字段名称
1 parent
87ea9c94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
linkwe-framework/src/main/java/com/linkwechat/framework/listener/ChatMsgCheckListener.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeChatContactSensitiveMsgVO.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeSensitiveServiceImpl.java
linkwe-framework/src/main/java/com/linkwechat/framework/listener/ChatMsgCheckListener.java
View file @
aa6b649
...
...
@@ -75,7 +75,7 @@ public class ChatMsgCheckListener implements MessageListener {
}
private
void
handleSensitiveHit
(
JSONObject
jsonObject
)
{
String
from
=
jsonObject
.
getString
(
"from"
);
String
from
Id
=
jsonObject
.
getString
(
"from"
);
String
msgId
=
jsonObject
.
getString
(
"msgid"
);
String
msgtype
=
jsonObject
.
getString
(
"msgtype"
);
StringBuilder
objectString
=
new
StringBuilder
(
jsonObject
.
getString
(
msgtype
));
...
...
@@ -96,15 +96,15 @@ public class ChatMsgCheckListener implements MessageListener {
allSensitiveRules
.
forEach
(
weSensitive
->
{
List
<
String
>
patternWords
=
Arrays
.
asList
(
weSensitive
.
getPatternWords
().
split
(
","
));
List
<
String
>
users
=
weSensitiveService
.
getScopeUsers
(
weSensitive
.
getAuditUserScope
());
log
.
info
(
"handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>>finalContent:{}, patternWords:{},users:{},from:{}"
,
finalContent
,
JSONObject
.
toJSONString
(
patternWords
),
JSONObject
.
toJSONString
(
users
),
from
);
log
.
info
(
"handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>>finalContent:{}, patternWords:{},users:{},from:{}"
,
finalContent
,
JSONObject
.
toJSONString
(
patternWords
),
JSONObject
.
toJSONString
(
users
),
from
Id
);
if
(
StringUtils
.
isNotBlank
(
finalContent
)
&&
!
CollectionUtils
.
isEmpty
(
users
)
&&
users
.
stream
().
anyMatch
(
from:
:
equals
))
{
WeChatContactSensitiveMsg
wccsm
=
hitSensitive
(
patternWords
,
from
,
finalContent
);
&&
users
.
stream
().
anyMatch
(
from
Id
:
:
equals
))
{
WeChatContactSensitiveMsg
wccsm
=
hitSensitive
(
patternWords
,
from
Id
,
finalContent
);
log
.
info
(
"handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>> wccsm:{}"
,
JSONObject
.
toJSONString
(
wccsm
));
if
(
wccsm
!=
null
)
{
wccsm
.
setMsgId
(
msgId
);
wccsm
.
setFrom
(
from
);
wccsm
.
setFrom
Id
(
fromId
);
wccsm
.
setMsgTime
(
new
Date
(
jsonObject
.
getLong
(
"msgtime"
)));
int
result
=
weChatContactSensitiveMsgMapper
.
insert
(
wccsm
);
if
(
result
>
0
)
{
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeChatContactSensitiveMsgVO.java
View file @
aa6b649
...
...
@@ -16,7 +16,7 @@ import java.util.Date;
@Data
public
class
WeChatContactSensitiveMsgVO
{
@ApiModelProperty
(
"发送人"
)
private
String
from
;
private
String
from
Id
;
@ApiModelProperty
(
"发送内容"
)
private
String
content
;
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeSensitiveServiceImpl.java
View file @
aa6b649
...
...
@@ -184,7 +184,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
}
LambdaQueryWrapper
<
WeChatContactSensitiveMsg
>
wrapper
=
new
LambdaQueryWrapper
<>();
if
(
CollectionUtil
.
isNotEmpty
(
userIds
)){
wrapper
.
in
(
WeChatContactSensitiveMsg:
:
getFrom
,
userIds
);
wrapper
.
in
(
WeChatContactSensitiveMsg:
:
getFrom
Id
,
userIds
);
}
if
(
StringUtils
.
isNotBlank
(
weSensitiveHitQuery
.
getKeyword
()))
{
wrapper
.
like
(
WeChatContactSensitiveMsg:
:
getPatternWords
,
weSensitiveHitQuery
.
getKeyword
());
...
...
@@ -200,7 +200,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
msgList
.
forEach
(
msg
->
{
WeChatContactSensitiveMsgVO
vo
=
new
WeChatContactSensitiveMsgVO
();
vo
.
setContent
(
msg
.
getContent
());
vo
.
setFrom
(
msg
.
getFrom
());
vo
.
setFrom
Id
(
msg
.
getFromId
());
vo
.
setMsgtime
(
msg
.
getMsgTime
());
vo
.
setStatus
(
msg
.
getSendStatus
().
toString
());
vo
.
setPatternWords
(
msg
.
getPatternWords
());
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment