|
@@ -29,6 +29,7 @@ import java.util.TreeSet;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import org.apache.commons.collections.ListUtils;
|
|
@@ -74,6 +75,25 @@ import com.ym.mec.biz.dal.dao.TeacherDefaultMusicGroupSalaryDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDefaultPracticeGroupSalaryDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDefaultVipGroupSalaryDao;
|
|
|
import com.ym.mec.biz.dal.dao.VipGroupDao;
|
|
|
+import com.ym.mec.biz.dal.dto.BatchInsertCoursesDto;
|
|
|
+import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CoursePostponeDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseScheduleDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseScheduleRateDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseScheduleStudentDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CourseTimeDto;
|
|
|
+import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
|
|
|
+import com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto;
|
|
|
+import com.ym.mec.biz.dal.dto.Mapper;
|
|
|
+import com.ym.mec.biz.dal.dto.StudentNameAndPhoneDto;
|
|
|
+import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
|
|
|
+import com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto;
|
|
|
+import com.ym.mec.biz.dal.dto.TeacherRemarkCommitDto;
|
|
|
+import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
|
|
|
+import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
|
|
|
+import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
|
|
@@ -81,28 +101,6 @@ 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.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;
|
|
@@ -1432,6 +1430,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
int singleClassMinutes = DateUtil.minutesBetween(existCours.getStartClassTime(), existCours.getEndClassTime());
|
|
|
|
|
|
existCours.setClassDate(ac.getClassDate());
|
|
|
+ existCours.setUpdateTime(now);
|
|
|
existCours.setStartClassTime(ac.getStartClassTime());
|
|
|
existCours.setEndClassTime(DateUtil.addMinutes(existCours.getStartClassTime(), singleClassMinutes));
|
|
|
|
|
@@ -1901,6 +1900,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
|
|
|
}
|
|
|
}
|
|
|
+ if(CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())){
|
|
|
+ preCourseSchedule.setTeachingTeacherIdList(new ArrayList<>(Arrays.asList(preCourseSchedule.getActualTeacherId())));
|
|
|
+ }else{
|
|
|
+ preCourseSchedule.getTeachingTeacherIdList().add(preCourseSchedule.getActualTeacherId());
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())){
|
|
|
+ backCourseSchedule.setTeachingTeacherIdList(new ArrayList<>(Arrays.asList(backCourseSchedule.getActualTeacherId())));
|
|
|
+ }else{
|
|
|
+ backCourseSchedule.getTeachingTeacherIdList().add(backCourseSchedule.getActualTeacherId());
|
|
|
+ }
|
|
|
if (!CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())
|
|
|
&& !CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
|
|
|
List<Integer> repeatIds = preCourseSchedule.getTeachingTeacherIdList()
|
|
@@ -3104,8 +3113,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
Date entryDate = DateUtil.stringToDate(sysConfigDao.findByParamName(SysConfigService.TEACHER_ENTRY_DATE).getParanValue(), "yyyy-MM-dd");
|
|
|
|
|
|
- List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<CourseScheduleModifyLog>();
|
|
|
-
|
|
|
List<CourseScheduleStudentPayment> insertCourseScheduleStudentPaymentList = new ArrayList<CourseScheduleStudentPayment>();
|
|
|
|
|
|
for (CourseSchedule newCourseSchedule : newCourseSchedules) {
|
|
@@ -3362,23 +3369,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
insertCourseScheduleTeacherSalaryList.add(ts);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // 调整日志
|
|
|
- CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- courseScheduleModifyLog.setCourseScheduleId(courseScheduleId);
|
|
|
- courseScheduleModifyLog.setCreateTime(date);
|
|
|
- courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(newCourseSchedule));
|
|
|
- courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(oldCourseSchedule));
|
|
|
-
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if (null == sysUser) {
|
|
|
- throw new BizException("获取用户信息失败");
|
|
|
- }
|
|
|
-
|
|
|
- courseScheduleModifyLog.setOperatorId(sysUser.getId());
|
|
|
-
|
|
|
- insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (insertTeacherAttendanceList.size() > 0) {
|
|
@@ -3389,10 +3379,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
courseScheduleTeacherSalaryDao.batchInsert(insertCourseScheduleTeacherSalaryList);
|
|
|
}
|
|
|
|
|
|
- if (insertCourseScheduleModifyLogList.size() > 0) {
|
|
|
- courseScheduleModifyLogDao.batchInsert(insertCourseScheduleModifyLogList);
|
|
|
- }
|
|
|
-
|
|
|
if(newCourseSchedules.size() > 0){
|
|
|
courseScheduleDao.batchUpdate(newCourseSchedules);
|
|
|
List<Integer> classGroupIds = newCourseSchedules.stream().filter(courseSchedule -> Objects.nonNull(courseSchedule.getClassGroupId())).map(CourseSchedule::getClassGroupId).collect(Collectors.toList());
|
|
@@ -3400,6 +3386,25 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
classGroupService.updateClassGroupsCourseInfo(classGroupIds);
|
|
|
}
|
|
|
}
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (null == sysUser) {
|
|
|
+ throw new BizException("获取用户信息失败");
|
|
|
+ }
|
|
|
+ List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<>();
|
|
|
+ oldCourseScheduleList.forEach(e->{
|
|
|
+ // 调整日志
|
|
|
+ CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
+ courseScheduleModifyLog.setCourseScheduleId(e.getId());
|
|
|
+ courseScheduleModifyLog.setCreateTime(date);
|
|
|
+ courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(e));
|
|
|
+ courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(courseScheduleDao.get(e.getId())));
|
|
|
+ courseScheduleModifyLog.setOperatorId(sysUser.getId());
|
|
|
+ insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
|
|
|
+ });
|
|
|
+
|
|
|
+ if (insertCourseScheduleModifyLogList.size() > 0) {
|
|
|
+ courseScheduleModifyLogDao.batchInsert(insertCourseScheduleModifyLogList);
|
|
|
+ }
|
|
|
|
|
|
if(insertCourseScheduleStudentPaymentList.size() > 0){
|
|
|
courseScheduleStudentPaymentDao.batchInsert(insertCourseScheduleStudentPaymentList);
|
|
@@ -5123,6 +5128,52 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public List<CourseScheduleModifyLog> queryCourseAdjustDetail(Long courseScheduleId) {
|
|
|
+ //获取所有的更改记录
|
|
|
+ Map<String,Object> param = new HashMap(1);
|
|
|
+ param.put("courseScheduleId",courseScheduleId);
|
|
|
+ List<CourseScheduleModifyLog> scheduleModifyLogs = courseScheduleModifyLogDao.findAll(param);
|
|
|
+ List<CourseScheduleAuditDetailDto> courseSchedules = new ArrayList<>();
|
|
|
+ for (int i = scheduleModifyLogs.size() - 1; i >= 0; i--) {
|
|
|
+ CourseScheduleModifyLog modifyLog = scheduleModifyLogs.get(i);
|
|
|
+ CourseScheduleAuditDetailDto auditDetailDto = JSON.parseObject(modifyLog.getPreviousCourseSchedule(), CourseScheduleAuditDetailDto.class);
|
|
|
+ auditDetailDto.setOperatorId(modifyLog.getOperatorId());
|
|
|
+ courseSchedules.add(auditDetailDto);
|
|
|
+ CourseScheduleAuditDetailDto auditDetailDto1 = JSON.parseObject(modifyLog.getCurrentCourseSchedule(), CourseScheduleAuditDetailDto.class);
|
|
|
+ auditDetailDto1.setOperatorId(modifyLog.getOperatorId());
|
|
|
+ courseSchedules.add(auditDetailDto1);
|
|
|
+ }
|
|
|
+ if(courseSchedules.size() > 0){
|
|
|
+ Set<Integer> actualTeacherIds = courseSchedules.stream().map(e -> e.getActualTeacherId()).collect(Collectors.toSet());
|
|
|
+ actualTeacherIds.addAll(courseSchedules.stream().map(e -> e.getTeacherId()).collect(Collectors.toSet()));
|
|
|
+ actualTeacherIds.addAll(courseSchedules.stream().map(e -> e.getOperatorId()).collect(Collectors.toSet()));
|
|
|
+ Set<Integer> schoolIds = courseSchedules.stream().map(e -> e.getSchoolId()).collect(Collectors.toSet());
|
|
|
+ Map<Integer, String> actualTeacherMap = getMap("sys_user", "id_", "real_name_", actualTeacherIds, Integer.class, String.class);
|
|
|
+ Map<Integer, String> schoolMap = new HashMap<>();
|
|
|
+ if(schoolIds != null && schoolIds.size() > 0){
|
|
|
+ schoolMap = getMap("school", "id_", "name_", schoolIds, Integer.class, String.class);
|
|
|
+ }
|
|
|
+ for (CourseScheduleModifyLog modifyLog : scheduleModifyLogs) {
|
|
|
+ CourseScheduleAuditDetailDto preAuditDetailDto = JSON.parseObject(modifyLog.getPreviousCourseSchedule(), CourseScheduleAuditDetailDto.class);
|
|
|
+ preAuditDetailDto.setTeacherName(actualTeacherMap.get(preAuditDetailDto.getTeacherId()));
|
|
|
+ preAuditDetailDto.setActualTeacherName(actualTeacherMap.get(preAuditDetailDto.getActualTeacherId()));
|
|
|
+ preAuditDetailDto.setSchoolName(schoolMap.get(preAuditDetailDto.getSchoolId()));
|
|
|
+ preAuditDetailDto.setOperatorName(actualTeacherMap.get(modifyLog.getOperatorId()));
|
|
|
+ modifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(preAuditDetailDto));
|
|
|
+
|
|
|
+ CourseScheduleAuditDetailDto auditDetailDto = JSON.parseObject(modifyLog.getCurrentCourseSchedule(), CourseScheduleAuditDetailDto.class);
|
|
|
+ auditDetailDto.setTeacherName(actualTeacherMap.get(auditDetailDto.getTeacherId()));
|
|
|
+ auditDetailDto.setActualTeacherName(actualTeacherMap.get(auditDetailDto.getActualTeacherId()));
|
|
|
+ auditDetailDto.setSchoolName(schoolMap.get(auditDetailDto.getSchoolId()));
|
|
|
+ auditDetailDto.setOperatorName(actualTeacherMap.get(modifyLog.getOperatorId()));
|
|
|
+ modifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(auditDetailDto));
|
|
|
+ }
|
|
|
+ return scheduleModifyLogs;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public void courseRepeatCheck() {
|
|
|
List<CourseRepeatCheckDto> courseRepeatCheckInfos = courseScheduleDao.getCourseRepeatCheckInfos();
|
|
|
courseRepeatCheckInfos.sort(Comparator.comparing(CourseRepeatCheckDto::getStartClassTime));
|
|
@@ -5131,6 +5182,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
for (CourseRepeatCheckDto cs1 : courseRepeatCheckInfos) {
|
|
|
if(!courseRepeatIdMap.containsKey(cs1.getCourseId())){
|
|
|
courseRepeatIdMap.put(cs1.getCourseId(), new ArrayList<>());
|
|
|
+ courseRepeatIdMap.get(cs1.getCourseId()).add(cs1.getCourseId());
|
|
|
}else{
|
|
|
continue;
|
|
|
}
|
|
@@ -5142,8 +5194,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(cs2.getEndClassTime().compareTo(cs1.getStartClassTime())<=0){
|
|
|
continue;
|
|
|
}
|
|
|
+ if(courseRepeatIdMap.containsKey(cs2.getCourseId())&&courseRepeatIdMap.get(cs2.getCourseId()).contains(cs1.getCourseId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if(cs2.getStartClassTime().compareTo(cs1.getEndClassTime())>=0){
|
|
|
- if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))){
|
|
|
+ if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))||courseRepeatIdMap.get(cs1.getCourseId()).size()==1){
|
|
|
courseRepeatIdMap.remove(cs1.getCourseId());
|
|
|
}
|
|
|
break;
|
|
@@ -5151,20 +5206,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(cs1.getStartClassTime().compareTo(cs2.getEndClassTime())>=0||cs1.getEndClassTime().compareTo(cs2.getStartClassTime())<=0){
|
|
|
continue;
|
|
|
}
|
|
|
- long repeatTeacherNums = cs1.getTeacherIds().stream().filter(teacherId -> cs2.getTeacherIds().contains(teacherId)).count();
|
|
|
- if(repeatTeacherNums>0){
|
|
|
- System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
|
- courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
|
- continue;
|
|
|
- }
|
|
|
-// long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
|
|
|
-// if(repeatStudentNums>0){
|
|
|
+// long repeatTeacherNums = cs1.getTeacherIds().stream().filter(teacherId -> cs2.getTeacherIds().contains(teacherId)).count();
|
|
|
+// if(repeatTeacherNums>0){
|
|
|
// System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
|
// courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
|
// continue;
|
|
|
// }
|
|
|
+
|
|
|
+ long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
|
|
|
+ if(repeatStudentNums>0){
|
|
|
+ System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
|
|
|
+ courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
- if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))){
|
|
|
+ if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))||courseRepeatIdMap.get(cs1.getCourseId()).size()==1){
|
|
|
courseRepeatIdMap.remove(cs1.getCourseId());
|
|
|
}
|
|
|
}
|