|
@@ -159,10 +159,12 @@ public class CourseScheduleConvertServiceImpl implements CourseScheduleConvertSe
|
|
|
CourseConvertLog courseConvertLog = courseConvertLogService.get(courseConvertId);
|
|
|
//校验是否可以还原
|
|
|
this.checkConvertRevoke(courseConvertLog);
|
|
|
- List<Long> newCourseIdList = Arrays.stream(courseConvertLog.getNewCourseIds().split(",")).map(e -> Long.parseLong(e)).collect(Collectors.toList());
|
|
|
- List<Integer> userIdList = Arrays.stream(courseConvertLog.getStudentIds().split(",")).map(e -> Integer.parseInt(e)).collect(Collectors.toList());
|
|
|
+ List<Long> newCourseIdList = Arrays.stream(courseConvertLog.getNewCourseIds().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
+ List<Integer> userIdList = Arrays.stream(courseConvertLog.getStudentIds().split(",")).map(Integer::parseInt).collect(Collectors.toList());
|
|
|
List<CourseSchedule> courseSchedules = JSONArray.parseArray(courseConvertLog.getOldCourseJson(), CourseSchedule.class);
|
|
|
// courseScheduleService.getDao().batchUpdateDelFlag(courseConvertLog.getOldCourseIds());
|
|
|
+ //清除课程编号
|
|
|
+ courseSchedules.forEach(e->e.setId(null));
|
|
|
courseScheduleService.getDao().batchInsert(courseSchedules);
|
|
|
|
|
|
String studentMapperJson = courseConvertLog.getOldCourseStudentMapperJson();
|
|
@@ -170,7 +172,7 @@ public class CourseScheduleConvertServiceImpl implements CourseScheduleConvertSe
|
|
|
//获取学员课程价值
|
|
|
List<CourseScheduleStudentPayment> paymentList = courseScheduleStudentPaymentService.getDao().findByCourseScheduleIds(newCourseIdList);
|
|
|
//获取现有所有学员列表
|
|
|
- List<Integer> currentUserIdList = paymentList.stream().map(e -> e.getUserId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Integer> currentUserIdList = paymentList.stream().map(CourseScheduleStudentPayment::getUserId).distinct().collect(Collectors.toList());
|
|
|
userIdList.removeAll(currentUserIdList);
|
|
|
if(!CollectionUtils.isEmpty(userIdList)){
|
|
|
studentPayments = studentPayments.stream().filter(e->!userIdList.contains(e.getUserId())).collect(Collectors.toList());
|