Sfoglia il codice sorgente

Merge branch 'feature/1113-vipCourse' of http://git.dayaedu.com/yonge/cooleshow into feature/1113-vipCourse

刘俊驰 4 mesi fa
parent
commit
007d790dbc

+ 9 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/MessageTypeEnum.java

@@ -29,8 +29,11 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     SMS_STUDENT_BUY_MUSIC_SHEET_SUCCESS("学员购买乐谱(短信)"),
 
     TEACHER_DECORATE_HOMEWORK("老师布置作业"),
+    TEACHER_DECORATE_HOMEWORK_VIP("老师布置作业"),
     TEACHER_REVIEW_HOMEWORK("老师点评作业"),
+    TEACHER_REVIEW_HOMEWORK_VIP("老师点评作业"),
     STUDENT_SUBMIT_HOMEWORK("学员提交作业"),
+    STUDENT_SUBMIT_HOMEWORK_VIP("学员提交作业"),
 
     TEACHER_AUTH_PASS("达人认证通过"),
     SMS_TEACHER_AUTH_PASS("达人认证通过(短信)"),
@@ -54,11 +57,14 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     LIVE_COMPLETION_FAIL("直播课成课失败"),
     TOMORROW_COURSE_REMINDER("明日课程提醒(每晚9点)"),
     STUDENT_PRACTICE_REMINDER("趣纠课提醒(趣纠课开始前20分钟)"),
+    STUDENT_VIP_REMINDER("VIP课提醒(VIP课开始前20分钟)"),
     LIVE_REMINDER("直播课提醒(直播课开始前20分钟)"),
     COURSE_SETTLEMENT("课酬结算(每晚9点)"),
     NOT_EVALUATE_STUDENT_PRACTICE("当日趣纠课未评价/布置作业(每晚9点30,已评价/已布置不发)"),
     STUDENT_EVALUATE_TEACHER_PRACTICE("学员对老师评价"),
     TEACHER_EVALUATE_STUDENT_PRACTICE("老师对学员评价"),
+    STUDENT_EVALUATE_TEACHER_VIP("学员对老师评价"),
+    TEACHER_EVALUATE_STUDENT_VIP("老师对学员评价"),
     WITHDRAWAL_SUCCESS("结算成功"),
     STUDENT_JOIN_FANSGROUP("学员申请加入粉丝群"),
     STUDENT_AUTOJOIN_FANSGROUP("学员自动加入粉丝群"),
@@ -91,6 +97,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     SMS_VIDEO_BUY("视频课购买(短信)"),
 
     PRACTICE_REMIND("趣纠课提醒(趣纠课开始前20分钟)"),
+    VIP_REMIND("VIP课提醒(VIP课开始前20分钟)"),
     LIVE_REMIND("直播课提醒(直播课开始前20分钟)"),
     NOT_EVALUATE_TEACHER_PRACTICE("当日趣纠课未对老师评价(每晚9点,已评价不发)"),
     FANSGROUP_APPLY_SUCCESS("粉丝群申请通过"),
@@ -117,6 +124,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
 
     PIANO_ROOM_ADJUST("琴房课调整"),
     PRACTICE_ADJUST("趣纠课调整"),
+    VIP_ADJUST("VIP课调整"),
     ACTIVITY_WIN("获奖消息"),
     PLATFORM_ADD_VIP("会员赠送"),
     PLATFORM_ADD_SVIP("会员赠送"),
@@ -161,6 +169,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     STUDENT_BUY_VIP_COURSE_TO_STUDENT("vip课约课成功"),
     //老师修改课程规划
     TEACHER_UPDATE_COURSE_PLAN("老师修改课程规划"),
+    TEACHER_UPDATE_COURSE_PLAN_VIP("老师修改课程规划"),
     ;
 
     MessageTypeEnum(String msg) {

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

@@ -520,15 +520,18 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
                 List<Long> userIds = studentPayments.stream().map(CourseScheduleStudentPayment::getUserId).collect(Collectors.toList());
                 Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> userMap = sysUserService.getMapByIds(userIds);
                 Map<Long,String> receiverMap = userMap.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,e->e.getValue().getPhone()));
+                MessageTypeEnum messageType = MessageTypeEnum.TEACHER_UPDATE_COURSE_PLAN;
+                if(CourseTypeEnum.valueOf(courseGroup.getType()) == CourseTypeEnum.VIP){
+                    messageType = MessageTypeEnum.TEACHER_UPDATE_COURSE_PLAN_VIP;
+                }
                 sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                        MessageTypeEnum.TEACHER_UPDATE_COURSE_PLAN,
+                        messageType,
                         receiverMap,
                         new String[]{groupId.toString()},
                         null,
                         0,
                         ClientEnum.STUDENT.getCode(),
-                        user.getUsername(),
-                        CourseTypeEnum.valueOf(courseGroup.getType()));
+                        user.getUsername());
             }
         }
     }

+ 15 - 9
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseHomeworkServiceImpl.java

@@ -20,15 +20,15 @@ import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
 import com.yonge.cooleshow.biz.dal.enums.course.CourseTypeEnum;
 import com.yonge.cooleshow.biz.dal.service.*;
-import com.yonge.cooleshow.biz.dal.wordfilter.WordFilter;
-import com.yonge.cooleshow.common.constant.SysConfigConstant;
-import com.yonge.cooleshow.common.enums.YesOrNoEnum;
-import com.yonge.toolset.mybatis.support.PageUtil;
 import com.yonge.cooleshow.biz.dal.vo.CourseHomeworkDetailVo;
 import com.yonge.cooleshow.biz.dal.vo.CourseHomeworkVo;
 import com.yonge.cooleshow.biz.dal.vo.CourseScheduleHomeworkVo;
 import com.yonge.cooleshow.biz.dal.vo.StudentHomeworkVo;
+import com.yonge.cooleshow.biz.dal.wordfilter.WordFilter;
+import com.yonge.cooleshow.common.constant.SysConfigConstant;
+import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.exception.BizException;
+import com.yonge.toolset.mybatis.support.PageUtil;
 import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,7 +39,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
-import java.text.MessageFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -272,6 +271,10 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
         if (paymentList.isEmpty()) {
             return;
         }
+        MessageTypeEnum messageType = MessageTypeEnum.TEACHER_DECORATE_HOMEWORK;
+        if(CourseTypeEnum.valueOf(courseSchedule.getType()) == CourseTypeEnum.VIP){
+            messageType = MessageTypeEnum.TEACHER_DECORATE_HOMEWORK_VIP;
+        }
         SysUser teacher = sysUserFeignService.queryUserById(courseSchedule.getTeacherId());
 //        String url = sysMessageService.selectConfigUrl(MessageTypeEnum.TEACHER_DECORATE_HOMEWORK.getCode(),courseSchedule.getId());
         for (CourseScheduleStudentPayment courseScheduleStudentPayment : paymentList) {
@@ -281,14 +284,13 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
 
             try {
                 sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                        MessageTypeEnum.TEACHER_DECORATE_HOMEWORK,
+                        messageType,
                         studentReceivers,
                         new String[]{courseSchedule.getId().toString()},
                         null,
                         0 ,
                         ClientEnum.STUDENT.getCode(),
-                        teacher.getUsername(),
-                        CourseTypeEnum.valueOf(courseSchedule.getType()).getMsg());
+                        teacher.getUsername());
             } catch (Exception e) {
                 log.warn("老师布置作业消息发送失败  学生id:{}",student.getId());
             }
@@ -350,10 +352,14 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
         SysUser student = sysUserFeignService.queryUserById(courseHomeworkDetailVo.getStudentId());
         SysUser teacher = sysUserFeignService.queryUserById(courseHomeworkDetailVo.getTeacherId());
         Map<Long,String> studentReceivers = new HashMap<>();
+        MessageTypeEnum messageType = MessageTypeEnum.TEACHER_REVIEW_HOMEWORK;
+        if(courseHomeworkDetailVo.getCourseType() == CourseScheduleEnum.VIP){
+            messageType = MessageTypeEnum.TEACHER_REVIEW_HOMEWORK_VIP;
+        }
         studentReceivers.put(student.getId(), student.getPhone());
 //        String url = sysMessageService.selectConfigUrl(MessageTypeEnum.TEACHER_REVIEW_HOMEWORK.getCode(),reviewDto.getCourseScheduleId());
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                MessageTypeEnum.TEACHER_REVIEW_HOMEWORK,
+                messageType,
                 studentReceivers,
                 new String[]{reviewDto.getCourseScheduleId().toString()},
                 null,

+ 15 - 11
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseRepliedServiceImpl.java

@@ -127,26 +127,31 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
 
             Map<Long, String> teacherReceivers = new HashMap<>();
             teacherReceivers.put(studentId, student.getPhone());
-
+            MessageTypeEnum messageType = MessageTypeEnum.TEACHER_EVALUATE_STUDENT_PRACTICE;
+            if(courseTypeEnum == CourseTypeEnum.VIP){
+                messageType = MessageTypeEnum.TEACHER_EVALUATE_STUDENT_VIP;
+            }
 //            String url = sysMessageService.selectConfigUrl(MessageTypeEnum.TEACHER_EVALUATE_STUDENT_PRACTICE.getCode());
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                    MessageTypeEnum.TEACHER_EVALUATE_STUDENT_PRACTICE,
+                    messageType,
                     teacherReceivers,
                     new String[]{courseSchedule.getId().toString(),studentId.toString()},
                     null,
                     0,
                     ClientEnum.STUDENT.getCode(),
-                    teacher.getUsername(),
-                    courseTypeEnum.getMsg());
-            log.info("send success {}", MessageTypeEnum.TEACHER_EVALUATE_STUDENT_PRACTICE);
+                    teacher.getUsername());
+            log.info("send success {}", messageType.getCode());
         } catch (Exception e) {
-            log.error("send fail {}", MessageTypeEnum.TEACHER_EVALUATE_STUDENT_PRACTICE);
             e.printStackTrace();
         }
     }
 
     public void repliedSend(CourseSchedule courseSchedule, Long studentId) {
         CourseTypeEnum courseTypeEnum = CourseTypeEnum.valueOf(courseSchedule.getType());
+        MessageTypeEnum messageType = MessageTypeEnum.STUDENT_EVALUATE_TEACHER_PRACTICE;
+        if(courseTypeEnum == CourseTypeEnum.VIP){
+            messageType = MessageTypeEnum.STUDENT_EVALUATE_TEACHER_VIP;
+        }
         try {
             SysUser student = sysUserFeignService.queryUserById(studentId);
             SysUser teacher = sysUserFeignService.queryUserById(courseSchedule.getTeacherId());
@@ -156,17 +161,16 @@ public class CourseRepliedServiceImpl extends ServiceImpl<CourseScheduleRepliedD
 
 //            String url = sysMessageService.selectConfigUrl(MessageTypeEnum.STUDENT_EVALUATE_TEACHER_PRACTICE.getCode());
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                    MessageTypeEnum.STUDENT_EVALUATE_TEACHER_PRACTICE,
+                    messageType,
                     teacherReceivers,
                     new String[]{courseSchedule.getId().toString(),studentId.toString()},
                     null,
                     0,
                     ClientEnum.TEACHER.getCode(),
-                    student.getUsername(),
-                    courseTypeEnum.getMsg());
-            log.info("send success {}", MessageTypeEnum.STUDENT_EVALUATE_TEACHER_PRACTICE);
+                    student.getUsername());
+            log.info("send success {}", messageType);
         } catch (Exception e) {
-            log.error("send fail {}", MessageTypeEnum.STUDENT_EVALUATE_TEACHER_PRACTICE);
+            log.error("send fail {}", messageType);
             e.printStackTrace();
         }
     }

+ 17 - 11
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -1510,12 +1510,15 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
 
             String oldDateString = oldStartTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().format(
                     DateTimeFormatter.ofPattern("MM-dd HH:mm:ss"));
-
+            MessageTypeEnum messageType = MessageTypeEnum.PRACTICE_ADJUST;
+            if(CourseTypeEnum.valueOf(courseGroup.getType()) == CourseTypeEnum.VIP){
+                messageType = MessageTypeEnum.VIP_ADJUST;
+            }
             Map<Long, String> receivers = new HashMap<>();
             receivers.put(studentId, student.getPhone());
 //            String url = sysMessageService.selectConfigUrl(MessageTypeEnum.PRACTICE_ADJUST.getCode(),courseSchedule.getId());
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                    MessageTypeEnum.PRACTICE_ADJUST,
+                    messageType,
                     receivers,
                     new String[]{courseSchedule.getId().toString()},
                     null,
@@ -1523,7 +1526,6 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                     ClientEnum.STUDENT.getCode(),
                     teacher.getUsername(),
                     oldDateString,
-                    CourseTypeEnum.valueOf(courseGroup.getType()).getMsg(),
                     dateString);
 
         } catch (Exception e) {
@@ -3010,34 +3012,38 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
 
     private void sendStartRemind(CourseScheduleEnum courseScheduleEnum, Map<Long, String> teacherMap, List<CourseSchedule> courseList) {
         courseList.forEach(courseSchedule -> {
+            MessageTypeEnum messageType = MessageTypeEnum.STUDENT_PRACTICE_REMINDER;
+            if(courseScheduleEnum == CourseScheduleEnum.VIP){
+                messageType = MessageTypeEnum.STUDENT_VIP_REMINDER;
+            }
             Map<Long, String> sendTeacherMap = new HashMap<>();
             sendTeacherMap.put(courseSchedule.getTeacherId(),teacherMap.get(courseSchedule.getTeacherId()));
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                    MessageTypeEnum.STUDENT_PRACTICE_REMINDER,
+                    messageType,
                     sendTeacherMap,
                     new String[]{courseSchedule.getId().toString()},
                     null,
                     0,
-                    ClientEnum.TEACHER.getCode(),
-                    courseScheduleEnum.getMsg());
+                    ClientEnum.TEACHER.getCode());
         });
-        log.info("send success {}",MessageTypeEnum.STUDENT_PRACTICE_REMINDER);
     }
 
     private void sendStartRemind(CourseScheduleEnum courseScheduleEnum, List<CourseScheduleStudentPayment> studentPayments, Map<Long, String> studentMap) {
         studentPayments.forEach(courseSchedule -> {
+            MessageTypeEnum messageType = MessageTypeEnum.PRACTICE_REMIND;
+            if(courseScheduleEnum == CourseScheduleEnum.VIP){
+                messageType = MessageTypeEnum.VIP_REMIND;
+            }
             Map<Long, String> sendTeacherMap = new HashMap<>(1);
             sendTeacherMap.put(courseSchedule.getUserId(),studentMap.get(courseSchedule.getUserId()));
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                    MessageTypeEnum.PRACTICE_REMIND,
+                    messageType,
                     sendTeacherMap,
                     new String[]{courseSchedule.getCourseId().toString()},
                     null,
                     0,
-                    ClientEnum.STUDENT.getCode(),
-                    courseScheduleEnum.getMsg());
+                    ClientEnum.STUDENT.getCode());
         });
-        log.info("send success {}",MessageTypeEnum.PRACTICE_REMIND);
     }
 
     private UserOrderDetail buyPracticeCourseTranV2(UserPaymentOrderWrapper.OrderGoodsInfo orderGoodsInfo) {

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

@@ -1112,8 +1112,8 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
     public StudentIndexWrapper.SummaryDto indexSummary(Long userId) {
         Date now = new Date();
         //获取学员本周练习时长
-        Date monday = DateUtil.getNextWeekMonday(now);
-        Date sunday = DateUtil.getNextWeekSunday(now);
+        Date monday = DateUtil.getWeekDayWithDate(now,1);
+        Date sunday = DateUtil.getWeekDayWithDate(now,7);
         StudentIndexWrapper.SummaryDto summaryDto = new StudentIndexWrapper.SummaryDto();
         //统计学员本周练习时长
         summaryDto.setRecordTime(sysMusicCompareRecordService.getDao().countStudentPracticeTime(userId, monday, sunday));