刘俊驰 před 1 dnem
rodič
revize
f84a283b4f

+ 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";
 
     /**
      * 直播课账期

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

@@ -1950,12 +1950,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()
@@ -1977,6 +1978,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<>();
         }
@@ -1989,7 +1997,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);
@@ -1999,7 +2010,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课
                 //老师课酬状态改为待结算
@@ -2058,6 +2070,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());
 

+ 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();
     }