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