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
0c2d835b
Commit
0c2d835b
authored
Dec 16, 2019
by
高鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zyj-sendad' into 'master'
修改发广告小号+保存群发记录 See merge request rays/pcloud-book!278
parents
16155b94
2f5dc014
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
9 deletions
+45
-9
AdvertisingSpaceBizImpl.java
...ud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
+5
-6
SendSelfMsgTools.java
...in/java/com/pcloud/book/group/tools/SendSelfMsgTools.java
+33
-0
SelfPushBizImpl.java
...n/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
+7
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
View file @
0c2d835b
...
...
@@ -83,7 +83,6 @@ import com.pcloud.book.group.dto.ClassifyDTO;
import
com.pcloud.book.group.dto.GroupQrcodeInfo4Advertising
;
import
com.pcloud.book.group.dto.GroupQrcodeInfoDTO
;
import
com.pcloud.book.group.entity.BookGroup
;
import
com.pcloud.book.group.entity.BookGroupClassify
;
import
com.pcloud.book.group.entity.GroupQrcode
;
import
com.pcloud.book.group.vo.GroupQrcodeVO
;
import
com.pcloud.book.util.common.CommonUtils
;
...
...
@@ -582,8 +581,8 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
if
(
null
!=
wechatGroup
)
{
//机器人不存在,不投放广告
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
wechatGroup
.
getQrcodeId
());
if
(
null
!=
groupQrcode
)
{
String
altId
=
wechatGroupConsr
.
get
SendAdRobot
ByGroupId
(
groupQrcode
.
getWeixinGroupId
());
if
(
null
!=
groupQrcode
)
{
//取群里活跃的小号发送20191216
String
altId
=
wechatGroupConsr
.
get
RobotId
ByGroupId
(
groupQrcode
.
getWeixinGroupId
());
if
(
StringUtil
.
isEmpty
(
altId
))
{
LOGGER
.
info
(
"机器人不在微信群,广告投放失败"
+
wechatGroup
);
bookGroups
.
remove
(
wechatGroup
);
...
...
@@ -662,7 +661,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
group
.
getQrcodeId
());
String
groupId
=
groupQrcode
.
getWeixinGroupId
();
// 获取机器人微信号
String
altId
=
wechatGroupConsr
.
get
SendAdRobot
ByGroupId
(
groupId
);
String
altId
=
wechatGroupConsr
.
get
RobotId
ByGroupId
(
groupId
);
if
(
StringUtil
.
isEmpty
(
altId
))
{
continue
;
}
...
...
@@ -752,8 +751,8 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
}
try
{
Thread
.
sleep
(
10
000
);
LOGGER
.
info
(
"发送微信消息-线程休眠
10
秒"
);
Thread
.
sleep
(
5
000
);
LOGGER
.
info
(
"发送微信消息-线程休眠
5
秒"
);
}
catch
(
InterruptedException
e
)
{
LOGGER
.
error
(
"线程休眠失败"
+
e
.
getMessage
());
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendSelfMsgTools.java
View file @
0c2d835b
...
...
@@ -3,7 +3,9 @@ package com.pcloud.book.group.tools;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.wechatgroup.selfrobot.dto.SelfRobotMsgRecord
;
import
com.pcloud.wechatgroup.selfrobot.service.SelfRobotService
;
import
com.sdk.wxgroup.SendArticleMessageVO
;
import
com.sdk.wxgroup.SendGroupInviteVO
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
...
...
@@ -60,6 +62,37 @@ public class SendSelfMsgTools {
});
}
/**
* 发送链接
* @param sendArticleMessageVO
*/
public
static
void
sendArticleMessage
(
SendArticleMessageVO
sendArticleMessageVO
){
WxGroupSDK
.
sendArticleMessage
(
sendArticleMessageVO
);
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
SelfRobotMsgRecord
selfRobotMsgRecord
=
new
SelfRobotMsgRecord
();
selfRobotMsgRecord
.
setMessageType
(
11
);
//链接
selfRobotMsgRecord
.
setWxId
(
sendArticleMessageVO
.
getAltId
());
selfRobotMsgRecord
.
setWxUserId
(
sendArticleMessageVO
.
getWxGroupId
());
selfRobotMsgRecord
.
setTitle
(
sendArticleMessageVO
.
getTitle
());
selfRobotMsgRecord
.
setUrl
(
sendArticleMessageVO
.
getLinkUrl
());
insertMsg
(
selfRobotMsgRecord
);
});
}
/**
* 发送图片
*/
public
static
void
sendPicMessage
(
SendPicMessageVO
sendPicMessageVO
){
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
SelfRobotMsgRecord
selfRobotMsgRecord
=
new
SelfRobotMsgRecord
();
selfRobotMsgRecord
.
setMessageType
(
2
);
//图片
selfRobotMsgRecord
.
setWxId
(
sendPicMessageVO
.
getAltId
());
selfRobotMsgRecord
.
setWxUserId
(
sendPicMessageVO
.
getWxGroupId
());
selfRobotMsgRecord
.
setResourceUrl
(
sendPicMessageVO
.
getPicUrl
());
insertMsg
(
selfRobotMsgRecord
);
});
}
/**
* 保存发送记录
...
...
pcloud-service-book/src/main/java/com/pcloud/book/push/biz/impl/SelfPushBizImpl.java
View file @
0c2d835b
...
...
@@ -4,6 +4,7 @@ import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import
com.pcloud.book.group.dao.WeixinQrcodeGenerationDao
;
import
com.pcloud.book.group.entity.WeixinQrcodeGeneration
;
import
com.pcloud.book.group.set.GroupSet
;
import
com.pcloud.book.group.tools.SendSelfMsgTools
;
import
com.pcloud.book.group.vo.UserBookInfoVO
;
import
com.pcloud.book.push.biz.SelfPushBiz
;
import
com.pcloud.book.push.constant.PushConstant
;
...
...
@@ -200,7 +201,8 @@ public class SelfPushBizImpl implements SelfPushBiz {
sendTextMessageVO
.
setAltId
(
altId
);
sendTextMessageVO
.
setWxGroupId
(
userWxId
);
sendTextMessageVO
.
setIp
(
getIpByRobot
(
altId
));
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
SendSelfMsgTools
.
sendTextMessage
(
sendTextMessageVO
);
return
;
}
if
(
ItemTypeEnum
.
LINK
.
value
.
equals
(
itemType
))
{
SendArticleMessageVO
sendArticleMessageVO
=
new
SendArticleMessageVO
();
...
...
@@ -213,7 +215,8 @@ public class SelfPushBizImpl implements SelfPushBiz {
sendArticleMessageVO
.
setPicUrl
(
selfPushItem
.
getLinkImageUrl
());
sendArticleMessageVO
.
setTitle
(
selfPushItem
.
getLinkTitle
());
sendArticleMessageVO
.
setIp
(
getIpByRobot
(
altId
));
WxGroupSDK
.
sendArticleMessage
(
sendArticleMessageVO
);
SendSelfMsgTools
.
sendArticleMessage
(
sendArticleMessageVO
);
return
;
}
if
(
ItemTypeEnum
.
APP
.
value
.
equals
(
itemType
))
{
return
;
//应用类型不参与群发C1002029
...
...
@@ -225,7 +228,8 @@ public class SelfPushBizImpl implements SelfPushBiz {
sendPicMessageVO
.
setWxGroupId
(
userWxId
);
sendPicMessageVO
.
setPicUrl
(
selfPushItem
.
getImageUrl
());
sendPicMessageVO
.
setIp
(
getIpByRobot
(
altId
));
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
SendSelfMsgTools
.
sendPicMessage
(
sendPicMessageVO
);
return
;
}
}
...
...
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