|
@@ -18,6 +18,7 @@ import java.util.stream.Stream;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
@@ -42,36 +43,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseGenerateDto;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleAuditDetailDto;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleReview;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
|
|
|
-import com.ym.mec.biz.dal.entity.CoursesGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.CoursesGroupModifyLog;
|
|
|
-import com.ym.mec.biz.dal.entity.Group;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.PracticeGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.School;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentAttendance;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
|
|
|
-import com.ym.mec.biz.dal.entity.Subject;
|
|
|
-import com.ym.mec.biz.dal.entity.SysConfig;
|
|
|
-import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
-import com.ym.mec.biz.dal.entity.TeacherAttendance;
|
|
|
-import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
|
|
|
-import com.ym.mec.biz.dal.entity.TeacherDefaultPracticeGroupSalary;
|
|
|
-import com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary;
|
|
|
-import com.ym.mec.biz.dal.entity.VipGroup;
|
|
|
import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
|
|
@@ -180,6 +152,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
private StudentServeService studentServeService;
|
|
|
@Autowired
|
|
|
private EmployeeDao employeeDao;
|
|
|
+ @Autowired
|
|
|
+ private VipGroupActivityDao vipGroupActivityDao;
|
|
|
|
|
|
private final Logger LOGGER = LoggerFactory
|
|
|
.getLogger(this.getClass());
|
|
@@ -2652,6 +2626,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
Date coursesExpireDate = null;
|
|
|
Date coursesStartDate = null;
|
|
|
GroupType groupType = vipGroupCourseAdjustInfo.getGroupType();
|
|
|
+
|
|
|
+ VipGroup vipGroup=null;
|
|
|
+ VipGroupActivity vipGroupActivity = null;
|
|
|
+
|
|
|
+ if(groupType == VIP) {
|
|
|
+ vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
+ if(Objects.isNull(vipGroup)){
|
|
|
+ throw new BizException("课程组信息不存在");
|
|
|
+ }
|
|
|
+ vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
|
|
|
+ if(Objects.isNull(vipGroupActivity)){
|
|
|
+ throw new BizException("课程组信息异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
switch (vipGroupCourseAdjustInfo.getGroupType()){
|
|
|
case PRACTICE:
|
|
|
PracticeGroup practiceGroup = practiceGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
@@ -2664,7 +2653,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
coursesStartDate = practiceGroup.getCoursesStartDate();
|
|
|
break;
|
|
|
default:
|
|
|
- VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
|
throw new BizException("指定课程不存在");
|
|
|
}
|
|
@@ -2764,10 +2752,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
courseSchedules.get(courseStartDates.size() - 1).setStartClassTime(courseStartTime);
|
|
|
courseSchedules.get(courseStartDates.size() - 1).setEndClassTime(courseEndTime);
|
|
|
if (Objects.nonNull(vipGroupCourseAdjustInfo.getTeachMode())) {
|
|
|
- if(courseSchedules.get(courseStartDates.size() - 1).getTeachMode().equals(TeachModeEnum.ONLINE)
|
|
|
- &&vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)){
|
|
|
+ boolean onlineToOffline = courseSchedules.get(courseStartDates.size() - 1).getTeachMode().equals(TeachModeEnum.ONLINE)
|
|
|
+ &&vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE);
|
|
|
+ if(onlineToOffline&&!vipGroupActivity.getAllowOnlineToOffline()){
|
|
|
throw new BizException("VIP课不支持从线上调整到线下");
|
|
|
}
|
|
|
+ if(onlineToOffline&&Objects.isNull(vipGroupCourseAdjustInfo.getSchoolId())){
|
|
|
+ throw new BizException("请选择教学点");
|
|
|
+ }
|
|
|
courseSchedules.get(courseStartDates.size() - 1).setTeachMode(vipGroupCourseAdjustInfo.getTeachMode());
|
|
|
if (vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)) {
|
|
|
if(Objects.nonNull(vipGroupCourseAdjustInfo.getSchoolId())){
|
|
@@ -2809,8 +2801,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
}
|
|
|
if(groupType == VIP){
|
|
|
- VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
-
|
|
|
CourseSchedule courseSchedule = courseSchedules.stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
|
|
|
//
|
|
|
// BigDecimal teacherSalary=BigDecimal.ZERO;
|
|
@@ -3380,7 +3370,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
if (VIP.equals(newCourseSchedule.getGroupType())){
|
|
|
- if(TeachModeEnum.OFFLINE.equals(newCourseSchedule.getTeachMode())&&TeachModeEnum.ONLINE.equals(oldCourseSchedule.getTeachMode())){
|
|
|
+ VipGroup vipGroup = vipGroupDao.get(Long.valueOf(oldCourseSchedule.getMusicGroupId()));
|
|
|
+ if(Objects.isNull(vipGroup)){
|
|
|
+ throw new BizException("课程组信息不存在");
|
|
|
+ }
|
|
|
+ VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
|
|
|
+ if(Objects.isNull(vipGroupActivity)){
|
|
|
+ throw new BizException("课程组信息异常");
|
|
|
+ }
|
|
|
+ if(TeachModeEnum.OFFLINE.equals(newCourseSchedule.getTeachMode())&&TeachModeEnum.ONLINE.equals(oldCourseSchedule.getTeachMode())&&!vipGroupActivity.getAllowOnlineToOffline()){
|
|
|
throw new BizException("VIP课不支持从线上调整到线下");
|
|
|
}
|
|
|
}
|