|
@@ -33,6 +33,7 @@ import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.page.*;
|
|
|
import org.apache.commons.collections.ListUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -82,43 +83,7 @@ import com.ym.mec.biz.dal.dao.TeacherDefaultVipGroupSalaryDao;
|
|
|
import com.ym.mec.biz.dal.dao.VipGroupActivityDao;
|
|
|
import com.ym.mec.biz.dal.dao.VipGroupCategoryDao;
|
|
|
import com.ym.mec.biz.dal.dao.VipGroupDao;
|
|
|
-import com.ym.mec.biz.dal.entity.ActivityUserMapper;
|
|
|
-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.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.MusicGroupTrainPlan;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupTrainPlanSaveDto;
|
|
|
-import com.ym.mec.biz.dal.entity.PracticeGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.PracticeGroupSellPrice;
|
|
|
-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.TenantConfig;
|
|
|
-import com.ym.mec.biz.dal.entity.TenantConfigDetail;
|
|
|
-import com.ym.mec.biz.dal.entity.VipGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.VipGroupActivity;
|
|
|
-import com.ym.mec.biz.dal.entity.VipGroupCategory;
|
|
|
import com.ym.mec.biz.dal.enums.AuditStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
@@ -1668,7 +1633,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
existCours.setUpdateTime(now);
|
|
|
existCours.setStartClassTime(ac.getStartClassTime());
|
|
|
existCours.setEndClassTime(DateUtil.addMinutes(existCours.getStartClassTime(), singleClassMinutes));
|
|
|
-
|
|
|
+
|
|
|
//课程结束时间必须在21:00之前
|
|
|
if(DateUtil.getHour(existCours.getEndClassTime()) > 20 && DateUtil.getMinute(existCours.getEndClassTime()) > 0){
|
|
|
throw new BizException("课程结束时间不能超过21:00,请重新调整上课时间");
|
|
@@ -3168,7 +3133,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if (!DateUtil.isSameDay(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime())) {
|
|
|
throw new BizException("上课时间不允许跨天,请重新调整上课时间");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)){
|
|
|
courseSchedule.setSchoolId(vipGroup.getTeacherSchoolId());
|
|
|
}
|
|
@@ -3299,7 +3264,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(newCourseSchedule.getStatus() == oldCourseSchedule.getStatus() && newCourseSchedule.getStatus() == CourseStatusEnum.OVER){
|
|
|
throw new BizException("已结束的课程需要调整课程状态");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/*if (oldCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.VIP)) {
|
|
|
VipGroup vipGroup = vipGroupDao.get(Long.valueOf(oldCourseSchedule.getMusicGroupId()));
|
|
|
if(Objects.isNull(vipGroup)){
|
|
@@ -3343,12 +3308,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
int minutes = DateUtil.minutesBetween(oldCourseSchedule.getStartClassTime(), oldCourseSchedule.getEndClassTime());
|
|
|
newCourseSchedule.setEndClassTime(DateUtil.addMinutes(newCourseSchedule.getStartClassTime(), minutes));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//课程结束时间必须在21:00之前
|
|
|
if(DateUtil.getHour(newCourseSchedule.getEndClassTime()) > 20 && DateUtil.getMinute(newCourseSchedule.getEndClassTime()) > 0){
|
|
|
throw new BizException("课程结束时间不能超过21:00,请重新调整上课时间");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//判断上课时间是否跨天
|
|
|
if (!DateUtil.isSameDay(newCourseSchedule.getStartClassTime(), newCourseSchedule.getEndClassTime())) {
|
|
|
throw new BizException("上课时间不允许跨天,请重新调整上课时间");
|
|
@@ -3523,13 +3488,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
if ((newCourseSchedule.getStatus() != oldCourseSchedule.getStatus() && newCourseSchedule.getStatus() == CourseStatusEnum.NOT_START)) {
|
|
|
-
|
|
|
+
|
|
|
// 清理课程作业
|
|
|
courseHomeworkService.delHomwworkByCourseScheduleId(courseScheduleId);
|
|
|
|
|
|
//删除申述
|
|
|
courseScheduleComplaintsDao.delByCourseScheduleId(courseScheduleId);
|
|
|
-
|
|
|
+
|
|
|
//删除评论
|
|
|
courseScheduleReviewDao.delByCourseScheduleId(courseScheduleId);
|
|
|
|
|
@@ -4679,35 +4644,48 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
//获取班级声部名称
|
|
|
List<Map<Integer, String>> classGroupSubjectNameMaps = classGroupDao.findClassGroupSubjectNameMaps(courseScheduleIds);
|
|
|
Map<Integer, String> classGroupSubjectNameMap = MapUtil.convertIntegerMap(classGroupSubjectNameMaps);
|
|
|
- Map<Long, String> eduName = null;
|
|
|
- if(queryInfo.getIsExport()){
|
|
|
- List<Long> musicCourseIds = results.stream().filter(e -> e.getGroupType() == MUSIC).map(CourseScheduleEndDto::getId).collect(Collectors.toList());
|
|
|
- eduName = new HashMap<>(courseScheduleIds.size());
|
|
|
- if(musicCourseIds != null && musicCourseIds.size() > 0){
|
|
|
- eduName.putAll(MapUtil.convertMybatisMap(musicGroupDao.queryEduNameMapByCourseId(musicCourseIds)));
|
|
|
- }
|
|
|
- List<Long> vipCourseIds = results.stream().filter(e -> e.getGroupType() == VIP).map(CourseScheduleEndDto::getId).collect(Collectors.toList());
|
|
|
- if(vipCourseIds != null && vipCourseIds.size() > 0){
|
|
|
- eduName.putAll(MapUtil.convertMybatisMap(vipGroupDao.queryEduNameMapByCourseId(vipCourseIds)));
|
|
|
- }
|
|
|
- List<Long> practiceCourseIds = results.stream().filter(e -> e.getGroupType() == PRACTICE).map(CourseScheduleEndDto::getId).collect(Collectors.toList());
|
|
|
- if(practiceCourseIds != null && practiceCourseIds.size() > 0){
|
|
|
- eduName.putAll(MapUtil.convertMybatisMap(practiceGroupDao.queryEduNameMapByCourseId(practiceCourseIds)));
|
|
|
- }
|
|
|
- }
|
|
|
- for (CourseScheduleEndDto result : results) {
|
|
|
- if(eduName != null){
|
|
|
- result.setEducationTeacherName(eduName.get(result.getId()));
|
|
|
- }
|
|
|
- result.setTeacher(null);
|
|
|
- result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
|
|
|
- result.setSubjectName(classGroupSubjectNameMap.get(result.getId()));
|
|
|
- result.setIsSettlement(Objects.isNull(result.getSettlementTime())?0:1);
|
|
|
- if(courseMergeCourseNumMap.containsKey(result.getId())){
|
|
|
- result.setBeMerged(courseMergeCourseNumMap.get(result.getId())>0?true:false);
|
|
|
- }
|
|
|
- result.setStudentNum(courseScheduleStudentNumMap.getOrDefault(result.getId(), 0));
|
|
|
- }
|
|
|
+ Map<Long, String> eduName = null;
|
|
|
+ Map<String, MusicGroupBasicDto> cooperationMap = new HashMap<>();
|
|
|
+ if (queryInfo.getIsExport()) {
|
|
|
+ List<Long> musicCourseIds = results.stream().filter(e -> e.getGroupType() == MUSIC).map(CourseScheduleEndDto::getId).collect(Collectors.toList());
|
|
|
+ eduName = new HashMap<>(courseScheduleIds.size());
|
|
|
+ if (musicCourseIds != null && musicCourseIds.size() > 0) {
|
|
|
+ eduName.putAll(MapUtil.convertMybatisMap(musicGroupDao.queryEduNameMapByCourseId(musicCourseIds)));
|
|
|
+ }
|
|
|
+ List<Long> vipCourseIds = results.stream().filter(e -> e.getGroupType() == VIP).map(CourseScheduleEndDto::getId).collect(Collectors.toList());
|
|
|
+ if (vipCourseIds != null && vipCourseIds.size() > 0) {
|
|
|
+ eduName.putAll(MapUtil.convertMybatisMap(vipGroupDao.queryEduNameMapByCourseId(vipCourseIds)));
|
|
|
+ }
|
|
|
+ List<Long> practiceCourseIds = results.stream().filter(e -> e.getGroupType() == PRACTICE).map(CourseScheduleEndDto::getId).collect(Collectors.toList());
|
|
|
+ if (practiceCourseIds != null && practiceCourseIds.size() > 0) {
|
|
|
+ eduName.putAll(MapUtil.convertMybatisMap(practiceGroupDao.queryEduNameMapByCourseId(practiceCourseIds)));
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取合作单位,只有groupType是 MUSIC 的才有合作单位
|
|
|
+ List<MusicGroupBasicDto> maps = musicGroupDao.findMusicByCourseIds(musicCourseIds);
|
|
|
+ for (MusicGroupBasicDto map : maps) {
|
|
|
+ cooperationMap.put(map.getId(), map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (CourseScheduleEndDto result : results) {
|
|
|
+ if (eduName != null) {
|
|
|
+ result.setEducationTeacherName(eduName.get(result.getId()));
|
|
|
+ }
|
|
|
+ result.setTeacher(null);
|
|
|
+ result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
|
|
|
+ result.setSubjectName(classGroupSubjectNameMap.get(result.getId()));
|
|
|
+ result.setIsSettlement(Objects.isNull(result.getSettlementTime()) ? 0 : 1);
|
|
|
+ if (courseMergeCourseNumMap.containsKey(result.getId())) {
|
|
|
+ result.setBeMerged(courseMergeCourseNumMap.get(result.getId()) > 0 ? true : false);
|
|
|
+ }
|
|
|
+ result.setStudentNum(courseScheduleStudentNumMap.getOrDefault(result.getId(), 0));
|
|
|
+
|
|
|
+ MusicGroupBasicDto musicGroupBasicDto = cooperationMap.get(result.getId().toString());
|
|
|
+ if(null != musicGroupBasicDto){
|
|
|
+ result.setCooperationOrgan(musicGroupBasicDto.getCooperationOrganName());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
pageInfo.setRows(results);
|
|
|
return pageInfo;
|
|
@@ -5846,15 +5824,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
@Override
|
|
|
public Object queryMusicCoursePlan(Integer userId, Date startDate, Date endDate) {
|
|
|
-
|
|
|
+
|
|
|
List<CourseSchedule> courseScheduleList = courseScheduleDao.findStudentCoursesWithIncludeDateRange(userId, GroupType.MUSIC, startDate, endDate);
|
|
|
-
|
|
|
+
|
|
|
List<CourseSchedulePlanDto> result = new ArrayList<CourseSchedulePlanDto>();
|
|
|
-
|
|
|
+
|
|
|
for(CourseSchedule courseSchedule : courseScheduleList){
|
|
|
CourseSchedulePlanDto dto = new CourseSchedulePlanDto();
|
|
|
dto.setCourseSchedule(courseSchedule);
|
|
|
-
|
|
|
+
|
|
|
//获取课程规划
|
|
|
MusicGroupTrainPlanSaveDto schoolTerm = musicGroupTrainPlanService.getSchoolTerm(courseSchedule);
|
|
|
int courseNumNo = courseScheduleDao.getCourseNumNo(schoolTerm);
|
|
@@ -5862,10 +5840,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(planList.size() >= courseNumNo){
|
|
|
dto.setMusicGroupTrainPlan(planList.get(courseNumNo - 1));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
result.add(dto);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|