浏览代码

Merge branch 'feature/1113-vipCourse' into test

刘俊驰 8 月之前
父节点
当前提交
199bec3342

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/course/CourseTypeEnum.java

@@ -1,6 +1,7 @@
 package com.yonge.cooleshow.biz.dal.enums.course;
 
 import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.yonge.cooleshow.common.constant.SysConfigConstant;
 import com.yonge.toolset.base.enums.BaseEnum;
 
 /**
@@ -16,7 +17,6 @@ public enum CourseTypeEnum implements BaseEnum<String, CourseTypeEnum> {
     VIDEO("视频课"),
     VIP("VIP定制课"),
     ;
-
     @EnumValue
     private String code;
     private String msg;

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

@@ -49,6 +49,7 @@ import com.yonge.toolset.utils.date.DateUtil;
 import com.yonge.toolset.utils.obj.ObjectUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.NotNull;
 import org.redisson.api.RLock;
 import org.redisson.api.RMap;
 import org.redisson.api.RedissonClient;
@@ -1027,6 +1028,16 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             }
         }
 
+        Map<String, String> sysConfig = getCourseJoinMap();
+
+        Map map = new HashMap();
+        map.put("sysConfig", sysConfig);
+        map.put("studentList", studentList);
+        return map;
+    }
+
+    @NotNull
+    private Map<String, String> getCourseJoinMap() {
         Map<String, String> sysConfig = new HashMap<>();
         //提前XX分钟创建/进入VIP课房间时间
         sysConfig.put("vipStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE));
@@ -1044,11 +1055,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         sysConfig.put("pianoStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PIANO_ROOM_MINUTE));
         //琴房课结束后,XX分钟关闭房间
         sysConfig.put("pianoEndTime", sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PIANO_ROOM_MINUTE));
-
-        Map map = new HashMap();
-        map.put("sysConfig", sysConfig);
-        map.put("studentList", studentList);
-        return map;
+        return sysConfig;
     }
 
     /**
@@ -1602,6 +1609,39 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                     coursesPractice.setCourseGroupName(coursesPractice.getCourseGroupName() + "-" + sysUser.getUsername());
                 }
             }
+
+        }
+
+
+        // 设置课程进入状态
+        if (homePage.getRecentCourses() != null) {
+
+            int start = 0;
+            Map<String, String> courseJoinMap = getCourseJoinMap();
+            StudentHomePage.RecentCourses recentCourses = homePage.getRecentCourses();
+            switch (recentCourses.getCourseType()) {
+                case "PRACTICE":
+                    start= Integer.parseInt(courseJoinMap.get("practiceStartTime"));
+                    break;
+                case "LIVE":
+                    start= Integer.parseInt(courseJoinMap.get("liveStartTime"));
+                    break;
+                case "PIANO_ROOM_CLASS":
+                    start= Integer.parseInt(courseJoinMap.get("pianoStartTime"));
+                    break;
+                case "VIP":
+                    start= Integer.parseInt(courseJoinMap.get("vipStartTime"));
+                    break;
+                default:
+                    break;
+            }
+            if (start >0 && recentCourses.getStatus().equals(CourseScheduleEnum.NOT_START.getCode()) && recentCourses.getCourseStartTime() != null) {
+                Date date = DateUtil.addMinutes(recentCourses.getCourseStartTime(), -start);
+                if (date.before(new Date())) {
+                    recentCourses.setStatus(CourseScheduleEnum.ING.getCode());
+                }
+            }
+
         }
         return homePage;
     }
@@ -1762,23 +1802,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
      * @Date: 2022/5/10
      */
     public Map<String, String> selectRoomConfig() {
-        Map<String, String> sysConfig = new HashMap<>();
-        //提前XX分钟创建/进入VIP课房间时间
-        sysConfig.put("vipStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE));
-        //VIP课结束后,XX分钟关闭房间
-        sysConfig.put("vipEndTime", sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_VIP_ROOM_MINUTE));
-        //提前XX分钟创建/进入陪练课房间时间
-        sysConfig.put("practiceStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE));
-        //趣纠课结束后,XX分钟关闭房间
-        sysConfig.put("practiceEndTime", sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PRACTICE_ROOM_MINUTE));
-        //提前XX分钟创建/进入直播房间的时间
-        sysConfig.put("liveStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_LIVE_ROOM_MINUTE));
-        //直播结束后,XX分钟关闭房间
-        sysConfig.put("liveEndTime", sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_LIVE_ROOM_MINUTE));
-        //提前XX分钟创建/进入琴房课房间时间
-        sysConfig.put("pianoStartTime", sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PIANO_ROOM_MINUTE));
-        //琴房课结束后,XX分钟关闭房间
-        sysConfig.put("pianoEndTime", sysConfigService.findConfigValue(SysConfigConstant.DESTROY_EXPIRED_PIANO_ROOM_MINUTE));
+        Map<String, String> sysConfig = getCourseJoinMap();
         return sysConfig;
     }
 

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

@@ -15,17 +15,8 @@ import com.yonge.cooleshow.biz.dal.entity.ImGroup;
 import com.yonge.cooleshow.biz.dal.entity.Teacher;
 import com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord;
 import com.yonge.cooleshow.biz.dal.entity.TeacherStyleVideo;
-import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
-import com.yonge.cooleshow.biz.dal.enums.AuthTypeEnum;
-import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
-import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
-import com.yonge.cooleshow.biz.dal.enums.TeacherTagEnum;
-import com.yonge.cooleshow.biz.dal.service.ImGroupService;
-import com.yonge.cooleshow.biz.dal.service.SysMessageService;
-import com.yonge.cooleshow.biz.dal.service.TeacherAuthEntryRecordService;
-import com.yonge.cooleshow.biz.dal.service.TeacherService;
-import com.yonge.cooleshow.biz.dal.service.TeacherStyleVideoService;
-import com.yonge.cooleshow.biz.dal.service.UserFirstTimeService;
+import com.yonge.cooleshow.biz.dal.enums.*;
+import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
 import com.yonge.cooleshow.biz.dal.vo.TeacherVo;
 import com.yonge.cooleshow.biz.dal.wrapper.im.ImGroupWrapper;
@@ -47,11 +38,7 @@ import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEntryRecordDao, TeacherAuthEntryRecord> implements TeacherAuthEntryRecordService {
@@ -115,10 +102,12 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
                 continue;
             }*/
             if (authOperaReq.getPass()) {
-                teacher.setSubjectId(build.getSubjectId());
-                teacher.setIntroduction(StringUtil.isEmpty(teacher.getIntroduction()) ? build.getIntroduction() : teacher.getIntroduction());
-                teacher.setGraduateSchool(StringUtil.isEmpty(teacher.getGraduateSchool()) ? build.getGraduateSchool() : teacher.getGraduateSchool());
-                teacher.setSubject(StringUtil.isEmpty(teacher.getSubject()) ? build.getSubject() : teacher.getSubject());
+                if(build.getTeacherAuthType() == AuthTypeEnum.ADD){
+                    teacher.setSubjectId(build.getSubjectId());
+                    teacher.setIntroduction(build.getIntroduction());
+                }
+                teacher.setSubject(build.getSubject());
+                teacher.setGraduateSchool(build.getGraduateSchool());
                 teacher.setGradCertificate( StringUtil.isEmpty(build.getGradCertificate())?"":build.getGradCertificate());
                 teacher.setDegreeCertificate(StringUtil.isEmpty( build.getDegreeCertificate())?"":build.getDegreeCertificate());
                 teacher.setTeacherCertificate( StringUtil.isEmpty(build.getTeacherCertificate())?"":build.getTeacherCertificate());

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserPaymentCoreServiceImpl.java

@@ -1680,7 +1680,7 @@ DISCOUNT("畅学卡")
         refundOrder.setUserId(paymentOrder.getUserId().toString());
         refundOrder.setMerOrderNo(orderRefundBill.getBillNo());
         refundOrder.setRefundAmount(orderRefundBill.getRefundAmt());
-        refundOrder.setOrderAmount(reduce);
+        refundOrder.setOrderAmount(paymentOrder.getActualPrice());
         refundOrder.setReason(reason);
         refundOrder.setTransNo(paymentOrder.getTransNo());
         refundOrder.setPaymentOrderNo(paymentOrder.getOrderNo());