5 Commits cfc75781fe ... 5b89646de0

Author SHA1 Message Date
  刘俊驰 5b89646de0 Merge branch 'zx_online_update_1218' into develop-new 2 days ago
  刘俊驰 9d0b418039 Merge branch 'zx_online_update_1218' of http://git.dayaedu.com/yonge/cooleshow into zx_online_update_1218 2 days ago
  刘俊驰 f84a283b4f 收支 2 days ago
  zouxuan c6446a3497 小组课 2 days ago
  zouxuan 3ed1f6a882 小组课 2 days ago

+ 2 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/website/controller/WebCourseScheduleController.java

@@ -5,6 +5,7 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.search.MyCourseSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.CourseScheduleService;
 import com.yonge.cooleshow.biz.dal.service.HolidaysFestivalsService;
 import com.yonge.cooleshow.biz.dal.vo.ArrangeCourseVo;
@@ -67,6 +68,7 @@ public class WebCourseScheduleController extends BaseController {
     @ApiOperation("老师端-首页-我的课程-直播课")
     @PostMapping("/queryTeacherLiveCourse")
     public HttpResponseResult<PageInfo<TeacherLiveCourseInfoVo>> queryTeacherLiveCourse(@RequestBody Map<String, Object> param) {
+        param.put("type",param.get("courseType") == null? CourseScheduleEnum.LIVE.getCode():param.get("courseType").toString());
         return succeed(courseScheduleService.queryTeacherLiveCourse(param));
     }
 

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

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

@@ -1115,6 +1115,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     public PageInfo<CourseStudent> queryStudentLiveCourse(Map<String, Object> param) {
         //本月的最后一天
         param.put("orderState", OrderStatusEnum.PAID.getCode());
+        param.put("groupState", String.join(",", CourseGroupEnum.ING.getCode(), CourseGroupEnum.COMPLETE.getCode()));
         Page<CourseStudent> pageInfo = PageUtil.getPageInfo(param);
         return PageUtil.pageInfo(baseMapper.queryStudentLiveCourse(pageInfo, param));
     }
@@ -1442,8 +1443,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         CourseSchedule schedule = baseMapper.selectOne(Wrappers.<CourseSchedule>lambdaQuery()
                 .eq(CourseSchedule::getId, courseId)
                 .eq(CourseSchedule::getLock, 0)
-                .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START)
-                .in(CourseSchedule::getType, CourseScheduleEnum.PRACTICE, CourseScheduleEnum.VIP));
+                .eq(CourseSchedule::getStatus, CourseScheduleEnum.NOT_START));
         if (ObjectUtil.isEmpty(schedule)) {
             throw new BizException("无法调整该课程,课程不存在");
         }
@@ -1460,8 +1460,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
 
         //查询是否有人购买
         CourseScheduleStudentPayment studentPayment = paymentDao.selectOne(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
-                .eq(CourseScheduleStudentPayment::getCourseId, courseId)
-                .in(CourseScheduleStudentPayment::getCourseType, CourseScheduleEnum.PRACTICE,CourseScheduleEnum.VIP));
+                .eq(CourseScheduleStudentPayment::getCourseId, courseId));
         if (ObjectUtil.isEmpty(studentPayment)) {
             throw new BizException("课程无人购买");
         }
@@ -1950,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()
@@ -1977,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<>();
         }
@@ -1989,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);
@@ -1999,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课
                 //老师课酬状态改为待结算
@@ -2058,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());
 

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

@@ -1503,6 +1503,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();
     }

+ 3 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -601,6 +601,9 @@
             <if test="param.subjectId != null">
                 AND g.subject_id_ = #{param.subjectId}
             </if>
+            <if test="param.groupState !=null and param.groupState !=''">
+                AND find_in_set(cg.status_, #{param.groupState})
+            </if>
             <if test="param.courseState != null">
                 <if test="param.courseState == 'COMPLETE'">
                     AND g.status_ = 'COMPLETE'