|
@@ -1456,8 +1456,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
|
|
|
// 小组课成课推送
|
|
|
if (courseGroup.getType().equals(CourseScheduleEnum.GROUP.getCode())) {
|
|
|
// 极光-消息推送-老师端-通知老师小组课程组成课
|
|
|
-
|
|
|
-
|
|
|
+ sendGroupSuccessMessage(courseGroup,true);
|
|
|
}
|
|
|
} else {
|
|
|
//人数未达标则修改课程组为取消状态
|
|
@@ -1467,11 +1466,19 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
|
|
|
.eq(CourseSchedule::getCourseGroupId, courseGroup.getId())
|
|
|
.set(CourseSchedule::getStatus, CourseScheduleEnum.CANCEL.getCode())
|
|
|
);
|
|
|
- // 老师直播课成课失败发送消息
|
|
|
- this.sendMessage(courseGroup);
|
|
|
|
|
|
- // 学生直播课成课失败发送消息
|
|
|
- this.sendStudentMessage(userIds,courseGroup);
|
|
|
+ // 小组课成课推送
|
|
|
+ if (courseGroup.getType().equals(CourseScheduleEnum.GROUP.getCode())) {
|
|
|
+
|
|
|
+ // 极光-消息推送-老师端-通知老师小组课程组成课
|
|
|
+ sendGroupSuccessMessage(courseGroup,false);
|
|
|
+ } else {
|
|
|
+ // 老师直播课成课失败发送消息
|
|
|
+ this.sendMessage(courseGroup);
|
|
|
+
|
|
|
+ // 学生直播课成课失败发送消息
|
|
|
+ this.sendStudentMessage(userIds, courseGroup);
|
|
|
+ }
|
|
|
|
|
|
//退款
|
|
|
this.refund(courseGroup);
|
|
@@ -1485,6 +1492,37 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private void sendGroupSuccessMessage(CourseGroup courseGroup,boolean success) {
|
|
|
+ // 老师
|
|
|
+ SysUser sysUser = sysUserService.getByUserId(courseGroup.getTeacherId());
|
|
|
+ try {
|
|
|
+ Map<Long, String> receivers = new HashMap<>();
|
|
|
+ receivers.put(sysUser.getId(), sysUser.getPhone());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, success?MessageTypeEnum.GROUP_SUCCESS_TEACHER:MessageTypeEnum.GROUP_FAIL_TEACHER,
|
|
|
+ receivers, null, 0, null, ClientEnum.TEACHER.getCode(), courseGroup.getName());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("小组课成课成功推送发送失败,{}", e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<CourseScheduleStudentPayment> list = courseScheduleStudentPaymentService.list(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
|
|
|
+ .eq(CourseScheduleStudentPayment::getCourseGroupId, courseGroup.getId()));
|
|
|
+ Set<Long> userIds = list.stream().map(CourseScheduleStudentPayment::getUserId).collect(Collectors.toSet());
|
|
|
+ // 学生
|
|
|
+ Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> mapByIds = sysUserService.getMapByIds((List<Long>) userIds);
|
|
|
+
|
|
|
+ Map<Long, String> receivers = new HashMap<>();
|
|
|
+ for (com.yonge.cooleshow.biz.dal.entity.SysUser value : mapByIds.values()) {
|
|
|
+ receivers.put(value.getId(), value.getPhone());
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, success?MessageTypeEnum.GROUP_SUCCESS_STUDENT:MessageTypeEnum.GROUP_FAIL_STUDENT,
|
|
|
+ receivers, null, 0, null, ClientEnum.STUDENT.getCode(), courseGroup.getName());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.warn("小组课成课成功推送发送失败,{}", e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void sendStudentMessage(Set<Long> userIds, CourseGroup courseGroup) {
|
|
|
for (Long userId : userIds) {
|
|
|
|