Browse Source

消息推送

liujunchi 2 years ago
parent
commit
949335c351

+ 10 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseGroupServiceImpl.java

@@ -882,6 +882,14 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         //查询学生信息
         SysUser studentInfo = getSysUser(studentPayment.getUserId());
         try {
+
+            String payType = "";
+            if (studentPayment.getActualPrice().compareTo(BigDecimal.ZERO) >0) {
+                payType = "购买";
+            } else {
+                payType = "领取";
+            }
+
             //极光-消息推送-学生端-通知学生购买成功-跳转到APP
             MessageTypeEnum liveBuy = MessageTypeEnum.LIVE_BUY;
             //查询推送跳转的url
@@ -889,7 +897,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
             Map<Long, String> studentReceivers = new HashMap<>();
             studentReceivers.put(studentInfo.getId(), studentInfo.getPhone());
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, liveBuy,
-                    studentReceivers, null, 0, liveBuyUrl, ClientEnum.STUDENT.getCode(),
+                    studentReceivers, null, 0, liveBuyUrl, ClientEnum.STUDENT.getCode(),payType,
                     teacherInfo.getUsername(), courseGroup.getName());
             log.info("buyLiveCourseSuccess buyLiveSendMessage LIVE_BUY ok");
 
@@ -900,7 +908,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
             Map<Long, String> smsStudentReceivers = new HashMap<>();
             smsStudentReceivers.put(studentInfo.getId(), studentInfo.getPhone());
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, smsLiveBuy,
-                    smsStudentReceivers, null, 0, null, null,
+                    smsStudentReceivers, null, 0, null, null,payType,
                     teacherInfo.getUsername(), courseGroup.getName(), smsLiveBuyUrl);
             log.info("buyLiveCourseSuccess buyLiveSendMessage SMS_BUY_LIVE ok");
 

+ 10 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VideoLessonPurchaseRecordServiceImpl.java

@@ -236,10 +236,18 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
         }
 
         //学生端-购买视频课
+        String payType = "";
+        if (lesson.getLessonPrice().compareTo(BigDecimal.ZERO) >0) {
+            payType = "购买";
+        } else {
+            payType = "领取";
+        }
         try {
+
+
             String url = sysMessageService.selectConfigUrl(MessageTypeEnum.VIDEO_BUY.getCode(), lesson.getId());
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.VIDEO_BUY,
-                    studentReceivers, null, 0, url, ClientEnum.STUDENT.getCode(),
+                    studentReceivers, null, 0, url, ClientEnum.STUDENT.getCode(),payType,
                     teacher.getUsername(), lesson.getLessonName());
             log.info("send success {}", MessageTypeEnum.VIDEO_BUY);
         } catch (Exception e) {
@@ -250,7 +258,7 @@ public class VideoLessonPurchaseRecordServiceImpl extends ServiceImpl<VideoLesso
         //学生端-购买视频课(短信)
         try {
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.SMS_VIDEO_BUY,
-                    studentSMS, null, 0, null, null,
+                    studentSMS, null, 0, null, null,payType,
                     teacher.getUsername(), lesson.getLessonName());
             log.info("sms send success {}", MessageTypeEnum.SMS_VIDEO_BUY);
         } catch (Exception e) {