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
ad0a3465
Commit
ad0a3465
authored
Sep 29, 2019
by
裴大威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix del start live
parent
c61f5c80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
36 deletions
+39
-36
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+2
-1
WxLiveBroadcastReminderListener.java
...pcloud/book/mq/topic/WxLiveBroadcastReminderListener.java
+37
-35
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
ad0a3465
...
...
@@ -101,6 +101,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
...
...
@@ -184,7 +185,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
BookGroupClassify
bookGroupClassify
=
new
BookGroupClassify
();
BeanUtils
.
copyProperties
(
addClassifyVO
,
bookGroupClassify
);
QrcodeNameAndProIdDTO
qrcodeNameAndProId
=
bookGroupBiz
.
getQrcodeNameAndProId
(
addClassifyVO
.
getBookGroupId
());
if
(
qrcodeNameAndProId
==
null
)
{
if
(
Objects
.
isNull
(
qrcodeNameAndProId
)
||
Objects
.
isNull
(
qrcodeNameAndProId
.
getProductId
())
)
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"请先填写社群码信息!"
);
}
bookGroupClassify
.
setProductId
(
qrcodeNameAndProId
.
getProductId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/WxLiveBroadcastReminderListener.java
View file @
ad0a3465
...
...
@@ -57,40 +57,42 @@ public class WxLiveBroadcastReminderListener {
@ParamLog
(
"直播开播提醒"
)
@RabbitHandler
public
void
onMessage
(
LiveCourseDetailInfoDto
liveCourse
)
throws
BizException
{
if
(
Objects
.
isNull
(
liveCourse
)
||
CollectionUtils
.
isEmpty
(
liveCourse
.
getTableDetailDtos
()))
{
return
;
}
Map
<
Long
,
Long
>
collect
=
liveCourse
.
getTableDetailDtos
().
stream
().
collect
(
Collectors
.
toMap
(
TableDetailDto:
:
getOriginId
,
TableDetailDto:
:
getTableId
));
final
List
<
GroupQrcodeServerDTO
>
wxGroups
=
groupQrcodeBiz
.
getWxGroupIdByServerId
(
Lists
.
newArrayList
(
collect
.
keySet
()));
log
.
info
(
"[直播开播提醒] : liveCourse :{} wxGroups:{}"
,
liveCourse
,
wxGroups
);
if
(
CollectionUtils
.
isEmpty
(
wxGroups
))
{
return
;
}
final
Map
<
Long
,
AccountSettingDto
>
accountMap
=
Maps
.
newHashMap
();
List
<
String
>
wxGroupIds
=
wxGroups
.
stream
().
map
(
GroupQrcodeServerDTO:
:
getWxGroupId
).
collect
(
Collectors
.
toList
());
Map
<
String
,
BookWxQrcodeDTO
>
groupVersion
=
weixinQrcodeBiz
.
getGroupVersion
(
wxGroupIds
);
final
List
<
GroupQrcodeServerDTO
>
wxGroups2
=
wxGroups
.
stream
().
collect
(
Collectors
.
collectingAndThen
(
Collectors
.
toCollection
(()
->
new
TreeSet
<>(
Comparator
.
comparing
(
GroupQrcodeServerDTO:
:
getWxGroupId
))),
ArrayList:
:
new
)
);
for
(
GroupQrcodeServerDTO
dto
:
wxGroups2
)
{
// 避免重复挂服务调用性能损耗
AccountSettingDto
accountSettingDto
=
accountMap
.
get
(
dto
.
getChannelId
());
if
(
Objects
.
isNull
(
accountSettingDto
))
{
accountSettingDto
=
qrcodeSceneConsr
.
getWechatInfo
(
dto
.
getChannelId
());
accountMap
.
put
(
dto
.
getChannelId
(),
accountSettingDto
);
}
String
linkUrl
=
SendWeixinRequestTools
.
splitUrlNew
(
accountSettingDto
,
dto
.
getLinkUrl
(),
dto
.
getBookGroupId
(),
dto
.
getClassifyId
(),
dto
.
getGroupQrcodeId
());
// 定位到具体课程
String
liveInfo
=
linkUrl
.
replace
(
"liveinfo?"
,
"lesson/"
+
liveCourse
.
getLessonId
()
+
"?tableId="
+
collect
.
get
(
dto
.
getServeId
())
+
"&"
);
String
shortUrl4Own
=
UrlUtils
.
getShortUrl4Own
(
liveInfo
);
SendTextMessageVO
vo
=
new
SendTextMessageVO
();
vo
.
setContent
(
"【"
+
liveCourse
.
getTitle
()
+
"】即将开播啦,感兴趣的同学们可以开始进入啦。猛戳直播链接:"
+
shortUrl4Own
);
vo
.
setWxGroupId
(
dto
.
getWxGroupId
());
// 负载均衡会根据群获取该群活跃小号,所以传什么都不重要,写死为“我为你笑着”
vo
.
setAltId
(
Optional
.
ofNullable
(
groupVersion
.
get
(
dto
.
getWxGroupId
())).
orElse
(
new
BookWxQrcodeDTO
()).
getRobotWxId
());
vo
.
setIp
(
Optional
.
ofNullable
(
groupVersion
.
get
(
dto
.
getWxGroupId
())).
orElse
(
new
BookWxQrcodeDTO
()).
getWechatGroupIp
());
WxGroupSDK
.
sendTextMessage
(
vo
);
}
// 20190929 消息量大,重复消息多,导致小号闪退或者崩溃,暂时屏蔽掉
log
.
info
(
"[直播开播提醒] liveCourse:{}"
,
liveCourse
);
// if (Objects.isNull(liveCourse) || CollectionUtils.isEmpty(liveCourse.getTableDetailDtos())) {
// return;
// }
// Map<Long, Long> collect = liveCourse.getTableDetailDtos().stream().collect(Collectors.toMap(TableDetailDto::getOriginId, TableDetailDto::getTableId));
// final List<GroupQrcodeServerDTO> wxGroups = groupQrcodeBiz.getWxGroupIdByServerId(Lists.newArrayList(collect.keySet()));
// log.info("[直播开播提醒] : liveCourse :{} wxGroups:{}", liveCourse, wxGroups);
// if (CollectionUtils.isEmpty(wxGroups)) {
// return;
// }
// final Map<Long, AccountSettingDto> accountMap = Maps.newHashMap();
// List<String> wxGroupIds = wxGroups.stream().map(GroupQrcodeServerDTO::getWxGroupId).collect(Collectors.toList());
// Map<String, BookWxQrcodeDTO> groupVersion = weixinQrcodeBiz.getGroupVersion(wxGroupIds);
// final List<GroupQrcodeServerDTO> wxGroups2 = wxGroups.stream().collect(
// Collectors. collectingAndThen(
// Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(GroupQrcodeServerDTO::getWxGroupId))), ArrayList::new)
// );
// for (GroupQrcodeServerDTO dto : wxGroups2) {
// // 避免重复挂服务调用性能损耗
// AccountSettingDto accountSettingDto = accountMap.get(dto.getChannelId());
// if (Objects.isNull(accountSettingDto)) {
// accountSettingDto = qrcodeSceneConsr.getWechatInfo(dto.getChannelId());
// accountMap.put(dto.getChannelId(), accountSettingDto);
// }
// String linkUrl = SendWeixinRequestTools.splitUrlNew(accountSettingDto, dto.getLinkUrl(), dto.getBookGroupId(), dto.getClassifyId(), dto.getGroupQrcodeId());
// // 定位到具体课程
// String liveInfo = linkUrl.replace("liveinfo?", "lesson/" + liveCourse.getLessonId() + "?tableId=" + collect.get(dto.getServeId()) + "&");
// String shortUrl4Own = UrlUtils.getShortUrl4Own(liveInfo);
// SendTextMessageVO vo = new SendTextMessageVO();
// vo.setContent("【" + liveCourse.getTitle() + "】即将开播啦,感兴趣的同学们可以开始进入啦。猛戳直播链接:" + shortUrl4Own);
// vo.setWxGroupId(dto.getWxGroupId());
// // 负载均衡会根据群获取该群活跃小号,所以传什么都不重要,写死为“我为你笑着”
// vo.setAltId(Optional.ofNullable(groupVersion.get(dto.getWxGroupId())).orElse(new BookWxQrcodeDTO()).getRobotWxId());
// vo.setIp(Optional.ofNullable(groupVersion.get(dto.getWxGroupId())).orElse(new BookWxQrcodeDTO()).getWechatGroupIp());
// WxGroupSDK.sendTextMessage(vo);
// }
}
}
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