|
@@ -3,6 +3,7 @@ package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -11,10 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.CourseScheduleDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.CourseScheduleRepliedDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.CourseScheduleStudentPaymentDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.dao.TeacherFreeTimeDao;
|
|
|
+import com.yonge.cooleshow.biz.dal.dao.*;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.PracticeScheduleDto;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.HomeworkSearch;
|
|
@@ -89,6 +87,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
private TeacherFreeTimeDao teacherFreeTimeDao;
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
|
+ @Autowired
|
|
|
+ private HolidaysFestivalsDao holidaysFestivalsDao;
|
|
|
|
|
|
@Override
|
|
|
public CourseScheduleDao getDao() {
|
|
@@ -970,9 +970,12 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
throw new BizException("订单不存在!");
|
|
|
}
|
|
|
|
|
|
- //course_schedule中lock_改为0
|
|
|
+ //lock_改为0,课程&组状态改为ING
|
|
|
List<Long> scheduleIds = paymentList.stream().map(CourseScheduleStudentPayment::getCourseId).collect(Collectors.toList());
|
|
|
baseMapper.updateLock(scheduleIds);
|
|
|
+ UpdateWrapper<CourseGroup> warp = new UpdateWrapper<>();
|
|
|
+ warp.set("status_","ING").eq("id_",paymentList.get(0).getCourseGroupId());
|
|
|
+ courseGroupService.update(warp);
|
|
|
|
|
|
//查询陪练课服务费
|
|
|
String practiceServiceRateStr = sysConfigService.findConfigValue(SysConfigConstant.PRACTICE_SERVICE_FEE);
|
|
@@ -1113,7 +1116,17 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
homePage.setRecentCourses(baseMapper.selectRecentCourses(studentId));
|
|
|
}
|
|
|
if (studentId == null) {
|
|
|
- homePage.setRecentCourses(baseMapper.selectRecentCoursesTeacher(teacherId));
|
|
|
+ StudentHomePage.RecentCourses coursesPractice = baseMapper.selectRecentCoursesPractice(teacherId);
|
|
|
+ StudentHomePage.RecentCourses coursesLive = baseMapper.selectRecentCoursesLive(teacherId);
|
|
|
+
|
|
|
+ Date practiceTime = coursesPractice.getCourseStartTime();
|
|
|
+ Date liveTime = coursesLive.getCourseStartTime();
|
|
|
+
|
|
|
+ if (practiceTime.compareTo(liveTime)==-1){
|
|
|
+ homePage.setRecentCourses(coursesPractice);
|
|
|
+ } else {
|
|
|
+ homePage.setRecentCourses(coursesLive);
|
|
|
+ }
|
|
|
}
|
|
|
return homePage;
|
|
|
}
|