|
@@ -1411,9 +1411,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
Map<Long, CourseSchedule> idCourseMap = courseSchedules.stream().collect(Collectors.toMap(CourseSchedule::getId, c -> c));
|
|
|
List<Long> courseIds = courseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
|
List<CourseSchedule> existCourses = courseScheduleDao.findByCourseScheduleIds(courseIds);
|
|
|
+ Date now = new Date();
|
|
|
+
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (null == sysUser) {
|
|
|
+ throw new BizException("获取用户信息失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取操作日志
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds,existCourses,sysUser.getId(),now);
|
|
|
|
|
|
- List<CourseScheduleModifyLog> scheduleModifyLogs = new ArrayList<>();
|
|
|
- Date now=new Date();
|
|
|
for (CourseSchedule existCours : existCourses) {
|
|
|
CourseSchedule ac = idCourseMap.get(existCours.getId());
|
|
|
|
|
@@ -1421,21 +1428,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
throw new BizException("课程调整时间不得小于当前时间");
|
|
|
}
|
|
|
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- scheduleModifyLog.setCourseScheduleId(existCours.getId());
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(existCours));
|
|
|
- scheduleModifyLog.setCreateTime(now);
|
|
|
- scheduleModifyLog.setOperatorId(operatorId);
|
|
|
-
|
|
|
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));
|
|
|
-
|
|
|
- scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(existCours));
|
|
|
- scheduleModifyLogs.add(scheduleModifyLog);
|
|
|
}
|
|
|
|
|
|
Date startDateTime = existCourses.stream().min(Comparator.comparing(CourseSchedule::getStartClassTime)).get().getStartClassTime();
|
|
@@ -1464,7 +1462,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
courseScheduleComplaintsDao.delByCourseScheduleIds(courseIds);
|
|
|
//清除考勤申述
|
|
|
teacherAttendanceDao.clearAttendanceComplaints(courseIds);
|
|
|
- courseScheduleModifyLogDao.batchInsert(scheduleModifyLogs);
|
|
|
+ //保存日志调整信息
|
|
|
+ saveModifyLog(modifyLogs,courseIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2494,6 +2493,39 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
+ public List<CourseScheduleModifyLog> getModifyLogs(List<Long> courseScheduleIds,List<CourseSchedule> courseSchedules,Integer userId,Date now){
|
|
|
+ List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<>();
|
|
|
+ //获取调整前助教信息
|
|
|
+ Map<Long, String> teachingTeacherMap = MapUtil.convertMybatisMap(courseScheduleTeacherSalaryDao.queryTeacherIdMap(courseScheduleIds,"TEACHING"));
|
|
|
+ for (CourseSchedule e : courseSchedules) {
|
|
|
+ // 调整日志
|
|
|
+ e.setTeachingTeacherIds(teachingTeacherMap.get(e.getId()));
|
|
|
+ CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
+ courseScheduleModifyLog.setCourseScheduleId(e.getId());
|
|
|
+ courseScheduleModifyLog.setCreateTime(now);
|
|
|
+ courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(e));
|
|
|
+ courseScheduleModifyLog.setOperatorId(userId);
|
|
|
+ insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
|
|
|
+ }
|
|
|
+ return insertCourseScheduleModifyLogList;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void saveModifyLog(List<CourseScheduleModifyLog> modifyLogs,List<Long> courseIds){
|
|
|
+ //保存日志调整信息
|
|
|
+ //获取调整后助教信息
|
|
|
+ Map<Long, String> newTeachingTeacherMap = MapUtil.convertMybatisMap(courseScheduleTeacherSalaryDao.queryTeacherIdMap(courseIds,"TEACHING"));
|
|
|
+ List<CourseSchedule> newCourseScheduleList = courseScheduleDao.findByCourseScheduleIds(courseIds);
|
|
|
+ Map<Long, List<CourseSchedule>> collect = newCourseScheduleList.stream().collect(Collectors.groupingBy(CourseSchedule::getId));
|
|
|
+ modifyLogs.forEach(e->{
|
|
|
+ CourseSchedule schedule = collect.get(e.getCourseScheduleId()).get(0);
|
|
|
+ schedule.setTeachingTeacherIds(newTeachingTeacherMap.get(schedule.getId()));
|
|
|
+ e.setCurrentCourseSchedule(JsonUtil.toJSONString(schedule));
|
|
|
+ });
|
|
|
+ if (modifyLogs.size() > 0) {
|
|
|
+ courseScheduleModifyLogDao.batchInsert(modifyLogs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
public void vipCourseAdjust(VipGroupCourseAdjustInfoDto vipGroupCourseAdjustInfo) {
|
|
@@ -2570,17 +2602,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
//所有的课程
|
|
|
List<CourseSchedule> courseSchedules = courseScheduleDao.findByCourseScheduleIds(courseScheduleIds);
|
|
|
courseSchedules.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
|
|
|
- //保存修改记录
|
|
|
- List<CourseScheduleModifyLog> scheduleModifyLogs = new ArrayList<>(courseSchedules.size());
|
|
|
- Date date = new Date();
|
|
|
- courseSchedules.forEach(e->{
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- scheduleModifyLog.setCourseScheduleId(e.getId());
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(e));
|
|
|
- scheduleModifyLog.setCreateTime(date);
|
|
|
- scheduleModifyLog.setOperatorId(user.getId());
|
|
|
- scheduleModifyLogs.add(scheduleModifyLog);
|
|
|
- });
|
|
|
+ //获取操作日志
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseScheduleIds, courseSchedules, user.getId(), now);
|
|
|
|
|
|
if (courseScheduleIds.size() != courseScheduleIds.size()) {
|
|
|
throw new BizException("部分课程不存在");
|
|
@@ -2732,12 +2755,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
teacherAttendanceDao.clearAttendanceComplaints(courseScheduleIds);
|
|
|
// vipGroupService.checkVipCourseIsInScore(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
|
|
|
// courseScheduleStudentPaymentService.updateVipGiveCourse(vipGroup.getId());
|
|
|
- if(scheduleModifyLogs.size() == courseSchedules.size()){
|
|
|
- for (int i = 0;i<courseSchedules.size();i++){
|
|
|
- scheduleModifyLogs.get(i).setCurrentCourseSchedule(JSONObject.toJSONString(courseSchedules.get(i)));
|
|
|
- }
|
|
|
- courseScheduleModifyLogDao.batchInsert(scheduleModifyLogs);
|
|
|
- }
|
|
|
+ //保存操作日志
|
|
|
+ saveModifyLog(modifyLogs,courseScheduleIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2763,6 +2782,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(CollectionUtils.isEmpty(classGroupCourseSchedulesWithDate)){
|
|
|
throw new BizException("选择的班级上在指定日期之后不存在需要调整的课程");
|
|
|
}
|
|
|
+ Date date = new Date();
|
|
|
+ List<Long> courseIds = classGroupCourseSchedulesWithDate.stream().map(e -> e.getId()).collect(Collectors.toList());
|
|
|
+ //获取修改日志
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds,classGroupCourseSchedulesWithDate,user.getId(),date);
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(coursePostPoneInfo.getRecoveryDate());
|
|
@@ -2778,17 +2801,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
classGroupCourseSchedulesWithDate.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
|
|
|
|
|
|
- List<CourseScheduleModifyLog> scheduleModifyLogs = new ArrayList<>(classGroupCourseSchedulesWithDate.size());
|
|
|
- Date date = new Date();
|
|
|
//保存修改记录
|
|
|
for (int i=0;i<classGroupCourseSchedulesWithDate.size();i++) {
|
|
|
CourseSchedule courseSchedule=classGroupCourseSchedulesWithDate.get(i);
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- scheduleModifyLog.setCourseScheduleId(courseSchedule.getId());
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(courseSchedule));
|
|
|
- scheduleModifyLog.setCreateTime(date);
|
|
|
- scheduleModifyLog.setOperatorId(user.getId());
|
|
|
-
|
|
|
calendar.setTime(courseSchedule.getClassDate());
|
|
|
calendar.add(Calendar.DATE, betweenDays);
|
|
|
|
|
@@ -2799,12 +2814,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
continue;
|
|
|
}
|
|
|
classGroupCourseSchedulesWithDate.get(i).setClassDate(calendar.getTime());
|
|
|
- scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(courseSchedule));
|
|
|
- scheduleModifyLogs.add(scheduleModifyLog);
|
|
|
}
|
|
|
checkNewCourseSchedules(classGroupCourseSchedulesWithDate,false);
|
|
|
courseScheduleDao.batchUpdate(classGroupCourseSchedulesWithDate);
|
|
|
- courseScheduleModifyLogDao.batchInsert(scheduleModifyLogs);
|
|
|
+ //保存操作日志
|
|
|
+ saveModifyLog(modifyLogs,courseIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -2941,6 +2955,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
//查询数据库中的课程信息
|
|
|
List<CourseSchedule> oldCourseScheduleList = courseScheduleDao.findByCourseScheduleIds(courseScheduleIds);
|
|
|
+ //记录操作日志
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (null == sysUser) {
|
|
|
+ throw new BizException("获取用户信息失败");
|
|
|
+ }
|
|
|
+ //获取修改日志
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseScheduleIds,oldCourseScheduleList,sysUser.getId(),date);
|
|
|
|
|
|
Map<Long, CourseSchedule> oldCourseScheduleMap = oldCourseScheduleList.stream().collect(Collectors.toMap(CourseSchedule::getId, c -> c));
|
|
|
|
|
@@ -3389,30 +3410,14 @@ 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);
|
|
|
}
|
|
|
|
|
|
+ //保存日志调整信息
|
|
|
+ saveModifyLog(modifyLogs,courseScheduleIds);
|
|
|
+
|
|
|
// 推送
|
|
|
try {
|
|
|
Set<Integer> teacherIds = newCourseSchedules.stream().map(e -> e.getActualTeacherId()).collect(Collectors.toSet());
|
|
@@ -3450,6 +3455,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
|
|
|
Date now = new Date();
|
|
|
+
|
|
|
+ //获取修改日志
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(newCourseScheduleIds,oldCourseScheduleList,sysUser.getId(),now);
|
|
|
//明天日期
|
|
|
// Date tomorrow = DateUtil.addDays1(now, 1);
|
|
|
|
|
@@ -3478,16 +3486,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds, ClassGroupStudentStatusEnum.NORMAL);
|
|
|
Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
|
|
|
|
|
|
- //记录调整日志
|
|
|
- List<CourseScheduleModifyLog> courseScheduleModifyLogs = new ArrayList<>(oldCourseScheduleList.size());
|
|
|
+
|
|
|
newCourseSchedules.forEach(newCourseSchedule -> {
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
CourseSchedule oldCourseSchedule = oldCourseScheduleMap.get(newCourseSchedule.getId()).get(0);
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(oldCourseSchedule));
|
|
|
- scheduleModifyLog.setCreateTime(now);
|
|
|
- scheduleModifyLog.setCourseScheduleId(oldCourseSchedule.getId());
|
|
|
- scheduleModifyLog.setOperatorId(sysUser.getId());
|
|
|
-
|
|
|
if (!sysUser.getUserType().contains("SYSTEM") && sysUser.getUserType().contains("TEACHER")) {
|
|
|
Long normalStudentNum = classGroupStudentNumMap.get(oldCourseSchedule.getClassGroupId());
|
|
|
Long courseLeaveStudentNum = courseLeaveStudentNumMap.get(newCourseSchedule.getId());
|
|
@@ -3647,8 +3648,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
throw new BizException("单节课时不允许跨天");
|
|
|
}
|
|
|
courseScheduleDao.update(oldCourseSchedule);
|
|
|
- scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(oldCourseSchedule));
|
|
|
- courseScheduleModifyLogs.add(scheduleModifyLog);
|
|
|
//删除被修改的教师课酬记录和考勤记录
|
|
|
if (!CollectionUtils.isEmpty(beReplaceTeacherIds)) {
|
|
|
// courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalary(newCourseSchedule.getId().intValue(),beReplaceTeacherIds);
|
|
@@ -3671,7 +3670,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
vipGroupService.checkVipCourseIsInScore(Long.valueOf(oldCourseScheduleList.get(0).getMusicGroupId()));
|
|
|
}
|
|
|
}
|
|
|
- courseScheduleModifyLogDao.batchInsert(courseScheduleModifyLogs);
|
|
|
+ //保存调整日志
|
|
|
+ saveModifyLog(modifyLogs,newCourseScheduleIds);
|
|
|
// if(oldCourseScheduleList.get(0).getGroupType().equals(GroupType.VIP)){
|
|
|
// courseScheduleStudentPaymentService.updateVipGiveCourse(Long.valueOf(oldCourseScheduleList.get(0).getMusicGroupId()));
|
|
|
// }
|
|
@@ -4489,13 +4489,15 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(teacherSalary != null && teacherSalary.getSettlementTime() != null){
|
|
|
throw new BizException("调整失败: 课程已结算");
|
|
|
}
|
|
|
-
|
|
|
- PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(oldCourseSchedule.getMusicGroupId()));
|
|
|
- CoursesGroupModifyLog coursesGroupModifyLog = new CoursesGroupModifyLog();
|
|
|
- coursesGroupModifyLog.setGroupId(oldCourseSchedule.getMusicGroupId());
|
|
|
- coursesGroupModifyLog.setGroupType(PRACTICE.getCode());
|
|
|
- coursesGroupModifyLog.setOperatorId(user.getId());
|
|
|
- coursesGroupModifyLog.setPreviousGroup(JSONObject.toJSONString(practiceGroup));
|
|
|
+ Date date = new Date();
|
|
|
+ //获取调整日志
|
|
|
+ List<Long> courseIds = new ArrayList<>();
|
|
|
+ courseIds.add(courseScheduleId);
|
|
|
+ List<CourseSchedule> courseSchedules1 = new ArrayList<>();
|
|
|
+ courseSchedules1.add(oldCourseSchedule);
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds, courseSchedules1, user.getId(), date);
|
|
|
+
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(oldCourseSchedule.getMusicGroupId()));
|
|
|
String classDate = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
|
String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
|
Date startDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
@@ -4512,12 +4514,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
DateUtil.stringToDate(DateUtil.format(endDateTime,DateUtil.DEFAULT_PATTERN),DateUtil.DEFAULT_PATTERN)) > 0){
|
|
|
throw new BizException("单节课时不允许跨天");
|
|
|
}
|
|
|
- //保存修改记录
|
|
|
- Date date = new Date();
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- scheduleModifyLog.setCourseScheduleId(courseScheduleId);
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(oldCourseSchedule));
|
|
|
- scheduleModifyLog.setCreateTime(date);
|
|
|
+
|
|
|
oldCourseSchedule.setUpdateTime(date);
|
|
|
|
|
|
if(DateUtil.minutesBetween(endDateTime,date) > 0){
|
|
@@ -4539,9 +4536,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
oldCourseSchedule.setStartClassTime(courseSchedule.getStartClassTime());
|
|
|
oldCourseSchedule.setEndClassTime(DateUtil.addMinutes(courseSchedule.getStartClassTime(),practiceCourseMinutes));
|
|
|
|
|
|
- scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(oldCourseSchedule));
|
|
|
- scheduleModifyLog.setOperatorId(user.getId());
|
|
|
-
|
|
|
List<CourseSchedule> courseSchedules=new ArrayList<>();
|
|
|
courseSchedules.add(oldCourseSchedule);
|
|
|
checkNewCourseSchedules(courseSchedules,false);
|
|
@@ -4559,15 +4553,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
//清除考勤申述
|
|
|
teacherAttendanceDao.clearAttendanceComplaint(courseScheduleId);
|
|
|
courseScheduleDao.update(oldCourseSchedule);
|
|
|
- courseScheduleModifyLogDao.insert(scheduleModifyLog);
|
|
|
if(practiceGroup.getType() == TRIAL){
|
|
|
practiceGroup.setCoursesStartDate(courseScheduleDao.getFirstTime(practiceGroup.getId(),PRACTICE.getCode()));
|
|
|
practiceGroup.setCoursesExpireDate(courseScheduleDao.getLastTime(practiceGroup.getId(),PRACTICE.getCode()));
|
|
|
practiceGroup.setUpdateTime(date);
|
|
|
practiceGroupDao.update(practiceGroup);
|
|
|
- coursesGroupModifyLog.setCurrentGroup(JSONObject.toJSONString(practiceGroup));
|
|
|
- coursesGroupModifyLogDao.insert(coursesGroupModifyLog);
|
|
|
}
|
|
|
+ //保存修改记录
|
|
|
+ saveModifyLog(modifyLogs,courseIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -4593,16 +4586,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(teacherId.equals(oldCourseSchedule.getActualTeacherId())){
|
|
|
throw new BizException("请选择不同的老师");
|
|
|
}
|
|
|
- //保存修改记录
|
|
|
Date date = new Date();
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- scheduleModifyLog.setCourseScheduleId(courseScheduleId);
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(oldCourseSchedule));
|
|
|
- scheduleModifyLog.setCreateTime(date);
|
|
|
+ //获取调整日志
|
|
|
+ List<Long> courseIds = new ArrayList<>();
|
|
|
+ courseIds.add(courseScheduleId);
|
|
|
+ List<CourseSchedule> courseSchedules1 = new ArrayList<>();
|
|
|
+ courseSchedules1.add(oldCourseSchedule);
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds, courseSchedules1, user.getId(), date);
|
|
|
+
|
|
|
oldCourseSchedule.setUpdateTime(date);
|
|
|
oldCourseSchedule.setActualTeacherId(teacherId);
|
|
|
- scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(oldCourseSchedule));
|
|
|
- scheduleModifyLog.setOperatorId(user.getId());
|
|
|
|
|
|
List<CourseSchedule> courseSchedules = new ArrayList<>();
|
|
|
courseSchedules.add(oldCourseSchedule);
|
|
@@ -4639,7 +4632,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
courseScheduleComplaintsDao.delByCourseScheduleIds(courseScheduleIds);
|
|
|
//清除考勤申述
|
|
|
teacherAttendanceDao.clearAttendanceComplaints(courseScheduleIds);
|
|
|
- courseScheduleModifyLogDao.insert(scheduleModifyLog);
|
|
|
+ //保存修改记录
|
|
|
+ saveModifyLog(modifyLogs,courseIds);
|
|
|
|
|
|
Map<Integer, String> map = new HashMap<>(2);
|
|
|
map.put(teacherId,teacherId.toString());
|
|
@@ -4667,12 +4661,13 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
if(courseSchedules != null && courseSchedules.size() > 0){
|
|
|
courseSchedules = courseSchedules.stream().filter(courseSchedule -> !courseSchedule.getActualTeacherId().equals(teacherId)).collect(Collectors.toList());
|
|
|
}
|
|
|
+ Date date = new Date();
|
|
|
+ List<Long> courseIds1 = courseSchedules.stream().map(e -> e.getId()).collect(Collectors.toList());
|
|
|
+ //获取修改日志
|
|
|
+ List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds1, courseSchedules, user.getId(), date);
|
|
|
+
|
|
|
PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(practiceGroupId));
|
|
|
- CoursesGroupModifyLog coursesGroupModifyLog = new CoursesGroupModifyLog();
|
|
|
- coursesGroupModifyLog.setGroupId(practiceGroupId);
|
|
|
- coursesGroupModifyLog.setGroupType(PRACTICE.getCode());
|
|
|
- coursesGroupModifyLog.setOperatorId(user.getId());
|
|
|
- coursesGroupModifyLog.setPreviousGroup(JSONObject.toJSONString(practiceGroup));
|
|
|
+
|
|
|
ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(practiceGroupId, PRACTICE.getCode());
|
|
|
if(Objects.nonNull(educationalTeacherId)&&!educationalTeacherId.equals(practiceGroup.getEducationalTeacherId())){
|
|
|
if(Objects.nonNull(practiceGroup.getEducationalTeacherId())){
|
|
@@ -4699,8 +4694,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
}
|
|
|
practiceGroup.setUserId(teacherId);
|
|
|
practiceGroupDao.update(practiceGroup);
|
|
|
- coursesGroupModifyLog.setCurrentGroup(JSONObject.toJSONString(practiceGroup));
|
|
|
- coursesGroupModifyLogDao.insert(coursesGroupModifyLog);
|
|
|
classGroupTeacherMapperService.updateTeacher(practiceGroupId,teacherId, PRACTICE.getCode());
|
|
|
classGroupTeacherSalaryDao.updateTeacher(practiceGroupId,teacherId, PRACTICE.getCode());
|
|
|
// practiceGroupDao.updateUserId(practiceGroupId,teacherId);
|
|
@@ -4710,20 +4703,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
|
|
|
Map<Integer, String> teacherIdMap = new HashMap<>(10);
|
|
|
teacherIdMap.put(teacherId,teacherId.toString());
|
|
|
- List<CourseScheduleModifyLog> scheduleModifyLogs = new ArrayList<>(courseSchedules.size());
|
|
|
- Date date = new Date();
|
|
|
+
|
|
|
courseSchedules.forEach(e->{
|
|
|
- //保存修改记录
|
|
|
- CourseScheduleModifyLog scheduleModifyLog = new CourseScheduleModifyLog();
|
|
|
- scheduleModifyLog.setCourseScheduleId(e.getId());
|
|
|
- scheduleModifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(e));
|
|
|
- scheduleModifyLog.setCreateTime(date);
|
|
|
teacherIdMap.put(e.getActualTeacherId(),e.getActualTeacherId().toString());
|
|
|
e.setUpdateTime(date);
|
|
|
e.setActualTeacherId(teacherId);
|
|
|
- scheduleModifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(e));
|
|
|
- scheduleModifyLog.setOperatorId(user.getId());
|
|
|
- scheduleModifyLogs.add(scheduleModifyLog);
|
|
|
});
|
|
|
checkNewCourseSchedules(courseSchedules,false);
|
|
|
courseScheduleDao.batchUpdate(courseSchedules);
|
|
@@ -4755,7 +4739,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
courseScheduleComplaintsDao.delByCourseScheduleIds(courseScheduleIds);
|
|
|
//清除考勤申述
|
|
|
teacherAttendanceDao.clearAttendanceComplaints(courseScheduleIds);
|
|
|
- courseScheduleModifyLogDao.batchInsert(scheduleModifyLogs);
|
|
|
+ //保存修改记录
|
|
|
+ saveModifyLog(modifyLogs,courseIds1);
|
|
|
|
|
|
if (teacherIdMap != null && teacherIdMap.size() > 0) {
|
|
|
sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_COURSE_SCHEDULE_CHANGE_RESULT,
|
|
@@ -5163,6 +5148,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
preAuditDetailDto.setActualTeacherName(actualTeacherMap.get(preAuditDetailDto.getActualTeacherId()));
|
|
|
preAuditDetailDto.setSchoolName(schoolMap.get(preAuditDetailDto.getSchoolId()));
|
|
|
preAuditDetailDto.setOperatorName(actualTeacherMap.get(modifyLog.getOperatorId()));
|
|
|
+ if(StringUtils.isNotEmpty(preAuditDetailDto.getTeachingTeacherIds())){
|
|
|
+ preAuditDetailDto.setTeachingTeacherNames(teacherDao.queryTeacherNameByTeacherIds(preAuditDetailDto.getTeachingTeacherIds()));
|
|
|
+ }
|
|
|
modifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(preAuditDetailDto));
|
|
|
|
|
|
CourseScheduleAuditDetailDto auditDetailDto = JSON.parseObject(modifyLog.getCurrentCourseSchedule(), CourseScheduleAuditDetailDto.class);
|
|
@@ -5170,6 +5158,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
auditDetailDto.setActualTeacherName(actualTeacherMap.get(auditDetailDto.getActualTeacherId()));
|
|
|
auditDetailDto.setSchoolName(schoolMap.get(auditDetailDto.getSchoolId()));
|
|
|
auditDetailDto.setOperatorName(actualTeacherMap.get(modifyLog.getOperatorId()));
|
|
|
+ if(StringUtils.isNotEmpty(auditDetailDto.getTeachingTeacherIds())){
|
|
|
+ auditDetailDto.setTeachingTeacherNames(teacherDao.queryTeacherNameByTeacherIds(auditDetailDto.getTeachingTeacherIds()));
|
|
|
+ }
|
|
|
modifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(auditDetailDto));
|
|
|
}
|
|
|
return scheduleModifyLogs;
|