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
744a359e
Commit
744a359e
authored
Jul 22, 2019
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
广告发送
parent
d06426dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
AdvertisingSpaceBizImpl.java
...ud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
+21
-13
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/advertising/biz/impl/AdvertisingSpaceBizImpl.java
View file @
744a359e
...
@@ -572,14 +572,26 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -572,14 +572,26 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
}
}
List
<
AdvertisingDistributionBook
>
list
=
new
ArrayList
<>();
List
<
AdvertisingDistributionBook
>
list
=
new
ArrayList
<>();
Map
<
Long
,
Long
>
agentIdMap
=
new
HashMap
<>();
Map
<
Long
,
Long
>
agentIdMap
=
new
HashMap
<>();
for
(
DistributionWechatGroup
group
:
bookGroups
)
{
//过滤无机器人的群
//机器人不存在,不投放广告
for
(
int
i
=
0
;
i
<
bookGroups
.
size
()
&&
null
!=
bookGroups
;
i
++)
{
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
group
.
getQrcodeId
());
DistributionWechatGroup
wechatGroup
=
bookGroups
.
get
(
i
);
String
altId
=
wechatGroupConsr
.
getSendAdRobotByGroupId
(
groupQrcode
.
getWeixinGroupId
());
if
(
null
!=
wechatGroup
)
{
if
(
StringUtil
.
isEmpty
(
altId
))
{
//机器人不存在,不投放广告
bookGroups
.
remove
(
group
);
GroupQrcode
groupQrcode
=
groupQrcodeDao
.
getById
(
wechatGroup
.
getQrcodeId
());
continue
;
if
(
null
!=
groupQrcode
)
{
String
altId
=
wechatGroupConsr
.
getSendAdRobotByGroupId
(
groupQrcode
.
getWeixinGroupId
());
if
(
StringUtil
.
isEmpty
(
altId
))
{
LOGGER
.
info
(
"机器人不在微信群,广告投放失败"
+
wechatGroup
);
bookGroups
.
remove
(
wechatGroup
);
}
}
}
}
}
if
(
ListUtils
.
isEmpty
(
bookGroups
)){
LOGGER
.
info
(
"微信群为空,广告投放失败"
);
return
;
}
for
(
DistributionWechatGroup
group
:
bookGroups
)
{
AdvertisingDistributionBook
distributionBook
=
new
AdvertisingDistributionBook
();
AdvertisingDistributionBook
distributionBook
=
new
AdvertisingDistributionBook
();
distributionBook
.
setAdId
(
book
.
getAdId
());
distributionBook
.
setAdId
(
book
.
getAdId
());
distributionBook
.
setBookId
(
group
.
getBookId
());
distributionBook
.
setBookId
(
group
.
getBookId
());
...
@@ -598,10 +610,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -598,10 +610,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
distributionBook
.
setIsBookGroup
(
true
);
distributionBook
.
setIsBookGroup
(
true
);
list
.
add
(
distributionBook
);
list
.
add
(
distributionBook
);
}
}
if
(
ListUtils
.
isEmpty
(
bookGroups
))
{
LOGGER
.
info
(
"微信群为空或机器人不在微信群,广告投放失败"
+
book
.
getGroups
());
return
;
}
advertisingDistributionBookDao
.
batchInsert
(
list
);
advertisingDistributionBookDao
.
batchInsert
(
list
);
//发送微信群消息
//发送微信群消息
SEND_MESSAGE_THREAD_POOL
.
execute
(()
->
{
SEND_MESSAGE_THREAD_POOL
.
execute
(()
->
{
...
@@ -719,8 +727,8 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
...
@@ -719,8 +727,8 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
}
}
try
{
try
{
Thread
.
sleep
(
1
000
);
Thread
.
sleep
(
4
000
);
LOGGER
.
info
(
"发送微信消息-线程休眠
1
秒"
);
LOGGER
.
info
(
"发送微信消息-线程休眠
4
秒"
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
LOGGER
.
error
(
"线程休眠失败"
+
e
.
getMessage
());
LOGGER
.
error
(
"线程休眠失败"
+
e
.
getMessage
());
}
}
...
...
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