|
@@ -19,6 +19,7 @@ import com.ym.mec.biz.dal.wrapper.MusicGroupPaymentCalenderAddressWrapper;
|
|
|
import com.ym.mec.biz.event.source.GroupEventSource;
|
|
import com.ym.mec.biz.event.source.GroupEventSource;
|
|
|
import com.ym.mec.biz.event.source.SendSeoMessageSource;
|
|
import com.ym.mec.biz.event.source.SendSeoMessageSource;
|
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.biz.service.*;
|
|
|
|
|
+import com.ym.mec.biz.util.SpanGroupMergePaymentValidator;
|
|
|
import com.ym.mec.common.api.CommonResult;
|
|
import com.ym.mec.common.api.CommonResult;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
@@ -734,7 +735,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
adjust.getClassGroupStudents(), studentIdList);
|
|
adjust.getClassGroupStudents(), studentIdList);
|
|
|
List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
|
|
List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
|
|
|
|
|
|
|
|
- boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
|
|
|
|
|
|
|
+ boolean containsAll = SpanGroupMergePaymentValidator.validateSavedDetails(
|
|
|
|
|
+ musicGroupPaymentCalenderStudentDetails, calenderStudentDetails, studentIdList);
|
|
|
if (!containsAll) {
|
|
if (!containsAll) {
|
|
|
status = AUDITING;
|
|
status = AUDITING;
|
|
|
}
|
|
}
|
|
@@ -799,6 +801,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(), Map.class);
|
|
List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(), Map.class);
|
|
|
List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
|
|
List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
|
|
|
List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
|
|
List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
|
|
|
|
|
+ Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> studentDetails = calenderStudentDetails.stream()
|
|
|
|
|
+ .collect(Collectors.groupingBy(MusicGroupPaymentCalenderStudentDetail::getUserId));
|
|
|
|
|
+ for (Map<Integer, String> classGroupStudent : classGroupStudents) {
|
|
|
|
|
+ Integer classGroupId = classGroupStudent.keySet().iterator().next();
|
|
|
|
|
+ studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId),
|
|
|
|
|
+ musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroupId, studentDetails, batchNo);
|
|
|
|
|
+ }
|
|
|
classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
|
|
classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
|
|
|
, studentIdList, courseIds, classGroupStudents, allLockCourseIds, batchNo, adjust.getMasterTotalPrice());
|
|
, studentIdList, courseIds, classGroupStudents, allLockCourseIds, batchNo, adjust.getMasterTotalPrice());
|
|
|
}
|
|
}
|
|
@@ -1094,16 +1103,22 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
|
|
|
}
|
|
}
|
|
|
} else if (calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
|
|
} else if (calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
|
|
|
List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo);
|
|
List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo);
|
|
|
|
|
+ MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
|
|
+ if (adjust == null) {
|
|
|
|
|
+ throw new BizException("操作失败:合班申请不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
|
|
|
|
|
+ List<MusicGroupPaymentCalenderStudentDetail> verifiedDetails = classGroupService.queryStudentPaymentCalenders(
|
|
|
|
|
+ adjust.getMasterClassGroupId(), adjust.getClassGroupStudents(), studentIds);
|
|
|
|
|
+ SpanGroupMergePaymentValidator.validateSavedDetails(verifiedDetails, calenderStudentDetails, studentIds);
|
|
|
//将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
|
|
//将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
|
|
|
Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = calenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
|
|
Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = calenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
|
|
|
- MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
|
|
|
|
|
List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(), Map.class);
|
|
List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(), Map.class);
|
|
|
for (Map<Integer, String> classGroupStudent : classGroupStudents) {
|
|
for (Map<Integer, String> classGroupStudent : classGroupStudents) {
|
|
|
Integer classGroupId = classGroupStudent.keySet().iterator().next();
|
|
Integer classGroupId = classGroupStudent.keySet().iterator().next();
|
|
|
studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId), musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroup.getId(), collect,null);
|
|
studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId), musicGroupDao.findByClassGroupId(classGroupId).getId(), musicGroup.getId(), collect,null);
|
|
|
}
|
|
}
|
|
|
//删除和解冻班级,课程信息
|
|
//删除和解冻班级,课程信息
|
|
|
- List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
|
|
|
|
|
List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
|
|
List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
|
|
|
List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
|
|
List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
|
|
|
//如果是跨团班级合并,添加学员
|
|
//如果是跨团班级合并,添加学员
|