Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
78600a8c
Commit
78600a8c
authored
Aug 20, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 群关键词列表bug
parent
bc14ac29
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+22
-7
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+10
-6
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
78600a8c
...
...
@@ -16,7 +16,6 @@ import com.pcloud.common.utils.ListUtils;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.sdk.wxgroup.ChangeNameVO
;
import
com.sdk.wxgroup.QrcodeVO
;
import
com.sdk.wxgroup.SendArticleMessageVO
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendPicMessageVO
;
...
...
@@ -27,7 +26,11 @@ import org.apache.commons.lang3.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @author lily
...
...
@@ -273,11 +276,25 @@ public class SendWeixinRequestTools {
return
resultUrl
;
}
@ParamLog
(
"欢迎语中推送关键词信息"
)
public
static
void
sendKeywordsInfo
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
toWxId
,
String
ip
){
@ParamLog
(
"群欢迎语中推送关键词信息"
)
public
static
void
sendKeywordsInfo
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
weixinGroupId
,
String
ip
){
if
(
ListUtils
.
isEmpty
(
keywords
))
{
return
;
}
final
String
content
=
processContent
(
keywords
,
robotId
,
weixinGroupId
,
ip
);
sendTextMessage
(
content
,
robotId
,
weixinGroupId
,
ip
);
}
@ParamLog
(
"个人欢迎语中推送关键词信息"
)
public
static
void
sendKeywordsInfoToSelf
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
toWxId
,
String
ip
){
if
(
ListUtils
.
isEmpty
(
keywords
))
{
return
;
}
final
String
content
=
processContent
(
keywords
,
robotId
,
toWxId
,
ip
);
sendTextMessageToSelf
(
content
,
robotId
,
toWxId
,
ip
);
}
private
static
String
processContent
(
List
<
KeywordDTO
>
keywords
,
String
robotId
,
String
toWxId
,
String
ip
)
{
StringBuilder
content
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
keywords
.
size
();
i
++)
{
KeywordDTO
keywordDTO
=
keywords
.
get
(
i
);
...
...
@@ -292,9 +309,7 @@ public class SendWeixinRequestTools {
content
.
append
(
"\n"
);
}
}
// 1001282-施总需求,群不推送关键词,个人欢迎语推送关键词
// sendTextMessage(content, robotId, weixinGroupId, ip);
sendTextMessageToSelf
(
content
.
toString
(),
robotId
,
toWxId
,
ip
);
return
content
.
toString
();
}
private
static
void
sendTextMessageToSelf
(
String
content
,
String
robotId
,
String
toWxId
,
String
ip
){
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
78600a8c
...
...
@@ -144,7 +144,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
//发主打资源
sendMainKeyword
(
keywords
,
agreeAddUserDTO
,
dto
,
wxGroupId
);
//发关键词列表
SendWeixinRequestTools
.
sendKeywordsInfo
(
keywords
,
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
SendWeixinRequestTools
.
sendKeywordsInfo
ToSelf
(
keywords
,
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
// 拉群
final
Integer
peopleCounts
=
WxGroupSDK
.
getPeopleCounts
(
wxGroupId
,
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getIp
());
// 邀请好友进群有次数限制,目前测试为每天只能拉30-40人就操作频繁,所以在此加判断,超过30人或者群人数超过30人就发送邀请链接
...
...
@@ -366,14 +366,16 @@ public class BookGuideBizImpl implements BookGuideBiz {
//获取公众号基本信息
AccountSettingDto
wechatInfo
=
qrcodeSceneConsr
.
getWechatInfo
(
classifyQrcodeInfo
.
getChannelId
());
//获取关键词信息(改成10个了) 刘娜需求 1001282 群不推送关键词
// List<KeywordDTO> keywords = bookKeywordBiz.listFiveKeyword(classifyQrcodeInfo.getClassifyId(), classifyQrcodeInfo.getBookGroupId());
// Boolean isHaveKeywords = !ListUtils.isEmpty(keywords);
List
<
KeywordDTO
>
keywords
=
bookKeywordBiz
.
listFiveKeyword
(
classifyQrcodeInfo
.
getClassifyId
(),
classifyQrcodeInfo
.
getBookGroupId
());
Boolean
isHaveKeywords
=
!
ListUtils
.
isEmpty
(
keywords
);
final
Boolean
groupRobot
=
wechatGroupConsr
.
isGroupRobot
(
robotId
);
log
.
info
(
"[wechatGroupConsr.isGroupRobot] robotId:{} groupRobot:{}"
,
robotId
,
groupRobot
);
if
(
ListUtils
.
isEmpty
(
replyMessages
))
{
//获取群名称
GroupQrcodeBaseInfoVO
groupInfo
=
groupQrcodeBiz
.
getBaseById
(
classifyQrcodeInfo
.
getGroupQrcodeId
());
//推送消息 刘娜需求 1001282 群不推送关键词
// SendWeixinRequestTools.sendDefaultMessage(groupInfo == null ? "" : groupInfo.getGroupName(), robotId, weixinGroupId, isHaveKeywords, pushAddUserMessageDTO.getIp());
SendWeixinRequestTools
.
sendDefaultMessage
(
groupInfo
==
null
?
""
:
groupInfo
.
getGroupName
(),
robotId
,
weixinGroupId
,
false
,
pushAddUserMessageDTO
.
getIp
());
// 若非之前的机器人则不回复普通关键词
SendWeixinRequestTools
.
sendDefaultMessage
(
groupInfo
==
null
?
""
:
groupInfo
.
getGroupName
(),
robotId
,
weixinGroupId
,
isHaveKeywords
,
pushAddUserMessageDTO
.
getIp
());
}
else
{
//处理链接
handleUrl
(
replyMessages
,
wechatInfo
,
classifyQrcodeInfo
);
...
...
@@ -383,7 +385,9 @@ public class BookGuideBizImpl implements BookGuideBiz {
addGuideAppTouchRecord
(
replyMessages
,
weixinGroupId
,
classifyQrcodeInfo
.
getBookGroupId
(),
classifyQrcodeInfo
.
getClassifyId
());
}
//获取关键词信息(改成10个了)刘娜需求 1001282 群不推送关键词
// SendWeixinRequestTools.sendKeywordsInfo(keywords, robotId, weixinGroupId, pushAddUserMessageDTO.getIp());
if
(
groupRobot
)
{
SendWeixinRequestTools
.
sendKeywordsInfo
(
keywords
,
robotId
,
weixinGroupId
,
pushAddUserMessageDTO
.
getIp
());
}
//如果设置了群学习报告,加一个群学习报告的关键词
pushLearningReport
(
classifyQrcodeInfo
,
robotId
,
weixinGroupId
,
pushAddUserMessageDTO
.
getIp
());
if
(
bookGuide
!=
null
&&
bookGuide
.
getIsRecommend
()
!=
null
&&
bookGuide
.
getIsRecommend
()
==
1
)
{
...
...
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