Browse Source

Merge remote-tracking branch 'origin/zx_online_update_1218' into zx_online_update_1218

zouxuan 1 day ago
parent
commit
1f51e77fed

+ 1 - 0
cooleshow-common/src/main/java/com/yonge/cooleshow/common/constant/SysConfigConstant.java

@@ -333,6 +333,7 @@ public interface SysConfigConstant {
      * vip课帐期
      */
     String VIP_COURSE_ACCOUNT_PERIOD = "vip_course_account_period";
+    String GROUP_COURSE_ACCOUNT_PERIOD = "group_course_account_period";
 
     /**
      * 直播课账期

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

@@ -22,7 +22,7 @@ public enum OrderTypeEnum implements BaseEnum<String, OrderTypeEnum> {
     TENANT_ALBUM("平台专辑"),
     VIP_COURSE("VIP定制课"),
     DISCOUNT("畅学卡"),
-    GROUP("小组课")
+    GROUP("小组课购买")
     ;
     @EnumValue
     private String code;

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

@@ -1949,12 +1949,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         LocalDateTime practiceMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PRACTICE_ROOM_MINUTE)));
         LocalDateTime vipMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_VIP_ROOM_MINUTE)));
         LocalDateTime pianoMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_PIANO_ROOM_MINUTE)));
+        LocalDateTime groupMinute = LocalDateTime.now().plusMinutes(Long.parseLong(sysConfigService.findConfigValue(SysConfigConstant.PRE_CREATE_GROUP_ROOM_MINUTE)));
 
         //课程开始(开课时间 ≤ (NOW + 提前进入房间时间(分)) && NOW ≤ 结束时间)
         List<CourseSchedule> liveStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
                 .eq(CourseSchedule::getLock, 0)
                 .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
-                .in(CourseSchedule::getType, CourseScheduleEnum.LIVE, CourseScheduleEnum.GROUP)
+                .in(CourseSchedule::getType, CourseScheduleEnum.LIVE)
                 .le(CourseSchedule::getStartTime, liveMinute)
                 .ge(CourseSchedule::getEndTime, LocalDateTime.now()));
         List<CourseSchedule> practiceStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
@@ -1976,6 +1977,13 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
                 .eq(CourseSchedule::getType, CourseScheduleEnum.PIANO_ROOM_CLASS)
                 .le(CourseSchedule::getStartTime, pianoMinute)
                 .ge(CourseSchedule::getEndTime, LocalDateTime.now()));
+
+        List<CourseSchedule> groupStart = baseMapper.selectList(Wrappers.<CourseSchedule>lambdaQuery()
+                .eq(CourseSchedule::getLock, 0)
+                .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
+                .eq(CourseSchedule::getType, CourseScheduleEnum.GROUP)
+                .le(CourseSchedule::getStartTime, groupMinute)
+                .ge(CourseSchedule::getEndTime, LocalDateTime.now()));
         if (CollectionUtils.isEmpty(liveStart)) {
             liveStart = new ArrayList<>();
         }
@@ -1988,7 +1996,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         if (CollectionUtils.isEmpty(pianoStart)) {
             pianoStart = new ArrayList<>();
         }
-        List<CourseSchedule> courseStart = Stream.of(liveStart, practiceStart, pianoStart,vipStart).flatMap(Collection::stream).collect(Collectors.toList());
+        if (CollectionUtils.isEmpty(groupStart)) {
+            groupStart = new ArrayList<>();
+        }
+        List<CourseSchedule> courseStart = Stream.of(liveStart, practiceStart, pianoStart,vipStart,groupStart).flatMap(Collection::stream).collect(Collectors.toList());
         if (CollectionUtils.isNotEmpty(courseStart)) {
             //课程状态更新为ING
             baseMapper.updateStartTime(courseStart);
@@ -1998,7 +2009,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         List<CourseScheduleStudentVo> userList = paymentDao.selectUser();
         if (CollectionUtils.isNotEmpty(userList)) {
             List<CourseScheduleStudentVo> practiceList = userList.stream()
-                    .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),CourseScheduleEnum.VIP.getCode()).contains(s.getType()))
+                    .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode()
+                            ,CourseScheduleEnum.VIP.getCode(),CourseScheduleEnum.GROUP.getCode()).contains(s.getType()))
                     .collect(Collectors.toList());
             if (CollectionUtils.isNotEmpty(practiceList)) {//趣纠课/vip课
                 //老师课酬状态改为待结算
@@ -2057,6 +2069,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             List<CourseScheduleStudentVo> courseList = userList.stream()
                     .filter(s -> Lists.newArrayList(CourseScheduleEnum.PRACTICE.getCode(),
                             CourseScheduleEnum.VIP.getCode(),
+                            CourseScheduleEnum.GROUP.getCode(),
                             CourseScheduleEnum.PIANO_ROOM_CLASS.getCode()).contains(s.getType()))
                     .collect(Collectors.toList());
 

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

@@ -439,6 +439,9 @@ public class ImGroupServiceImpl extends ServiceImpl<ImGroupDao, ImGroup> impleme
         imGroup.setName(courseGroup.getName());
         imGroup.setType(ImGroupType.COURSE);
         imGroup.setImg(sysConfigService.findConfigValue(SysConfigConstant.ICON_COURSE_GROUP_DEFAULT));
+        if (courseGroup.getType().equals(CourseScheduleEnum.GROUP.name())) {
+            imGroup.setImg(sysConfigService.findConfigValue(SysConfigConstant.GOOD_LOGO_GROUP));
+        }
         imGroup.setCreateTime(now);
         imGroup.setUpdateTime(now);
 //        String imGroupId = UUID.randomUUID() + imGroup.getType().getCode();

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

@@ -1486,6 +1486,8 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
             instance.add(Calendar.DAY_OF_MONTH, Integer.parseInt(sysConfigService.findConfigValue(SysConfigConstant.ACTI_REGIST_ACCOUNT_PERIOD)));
         } else if (GoodTypeEnum.VIP_COURSE.equals(goodType)) {
             instance.add(Calendar.DAY_OF_MONTH, Integer.parseInt(sysConfigService.findConfigValue(SysConfigConstant.VIP_COURSE_ACCOUNT_PERIOD)));
+        }else if (GoodTypeEnum.GROUP.equals(goodType)) {
+            instance.add(Calendar.DAY_OF_MONTH, Integer.parseInt(sysConfigService.findConfigValue(SysConfigConstant.GROUP_COURSE_ACCOUNT_PERIOD)));
         }
         return instance.getTime();
     }