|
@@ -3693,7 +3693,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
public void spanGroupMergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
//缴费项目
|
|
|
- List<MusicGroupPaymentCalenderDto> paymentCalenderDtos = mergeClassSplitClassAffirmDto.getMusicGroupPaymentCalenderDtos();
|
|
|
+ MusicGroupPaymentCalenderDto paymentCalenderDto = mergeClassSplitClassAffirmDto.getMusicGroupPaymentCalenderDtos().get(0);
|
|
|
//主班
|
|
|
Integer masterClassGroupId = mergeClassSplitClassAffirmDto.getMasterClassGroupId();
|
|
|
//学员列表
|
|
@@ -3713,70 +3713,60 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
studentIds);
|
|
|
//创建缴费项目
|
|
|
MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
|
|
|
- MusicGroupPaymentCalender.PaymentCalenderStatusEnum status = null;
|
|
|
- StringBuffer batchNos = new StringBuffer();
|
|
|
- List<String> batchNoList = new ArrayList<>();
|
|
|
- if (paymentCalenderDtos != null && paymentCalenderDtos.size() > 0) {
|
|
|
- BigDecimal masterTotalPrice = getMasterTotalPrice(masterClassGroupId);
|
|
|
- //是否有需要审核的缴费项目
|
|
|
- for (MusicGroupPaymentCalenderDto calenderDto : paymentCalenderDtos) {
|
|
|
- //将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
|
|
|
- studentRegistrationService.insertStudent(calenderDto.getStudentIds(),calenderDto.getMusicGroupId(),musicGroup.getId(),masterTotalPrice);
|
|
|
- calenderDto.setMusicGroupId(musicGroup.getId());
|
|
|
- List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = calenderDto.getMusicGroupPaymentCalenderStudentDetails();
|
|
|
- boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
|
|
|
- if(!containsAll){
|
|
|
- calenderDto.setStatus(AUDITING);
|
|
|
- }else {
|
|
|
- calenderDto.setStatus(NO);
|
|
|
- }
|
|
|
- calenderDto.setPaymentType(SPAN_GROUP_CLASS_ADJUST);
|
|
|
- //生成缴费项目
|
|
|
- calenderDto.setMasterTotalPrice(masterTotalPrice);
|
|
|
- musicGroupPaymentCalenderService.create(calenderDto);
|
|
|
- if (batchNos.length() > 0) {
|
|
|
- batchNos.append(",");
|
|
|
- }
|
|
|
- batchNoList.add(calenderDto.getBatchNo());
|
|
|
- batchNos.append(calenderDto.getBatchNo());
|
|
|
- if (status == null || status != AUDITING) {
|
|
|
- if(!containsAll){
|
|
|
- status = AUDITING;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //记录申请信息
|
|
|
- MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = new MusicGroupStudentClassAdjust();
|
|
|
- musicGroupStudentClassAdjust.setMasterClassGroupId(masterClassGroupId);
|
|
|
- musicGroupStudentClassAdjust.setBatchNo(batchNos.toString());
|
|
|
- musicGroupStudentClassAdjust.setMusicGroupId(musicGroup.getId());
|
|
|
- musicGroupStudentClassAdjust.setOperatorId(sysUser.getId());
|
|
|
- musicGroupStudentClassAdjust.setClassGroupIds(JSON.toJSONString(classGroupIds));
|
|
|
- musicGroupStudentClassAdjust.setStudentIds(JSON.toJSONString(studentIds));
|
|
|
- if (classGroupStudents != null && classGroupStudents.size() > 0) {
|
|
|
- musicGroupStudentClassAdjust.setClassGroupStudents(JSON.toJSONString(mergeClassSplitClassAffirmDto.getClassGroupStudents()));
|
|
|
- }
|
|
|
- //获取需要删除的学员关联的课程
|
|
|
- List<Long> courseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
|
|
|
- musicGroupStudentClassAdjust.setSubLockCourseIds(JSON.toJSONString(courseIds));
|
|
|
- //获取关联的学员缴费信息
|
|
|
- List<Long> studentPaymentIds = courseScheduleStudentPaymentDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
|
|
|
- musicGroupStudentClassAdjust.setStudentPaymentIds(JSON.toJSONString(studentPaymentIds));
|
|
|
- //获取需要冻结的课程
|
|
|
- classGroupIds.add(masterClassGroupId);
|
|
|
- List<Long> allLockCourseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, null);
|
|
|
- musicGroupStudentClassAdjust.setAllLockCourseIds(JSON.toJSONString(allLockCourseIds));
|
|
|
- musicGroupStudentClassAdjustDao.insert(musicGroupStudentClassAdjust);
|
|
|
- //没有需要审核的缴费项目
|
|
|
- if (status == null) {
|
|
|
- spanGroupClassAdjustPass(masterClassGroupId,studentIds,courseIds,classGroupStudents);
|
|
|
- }else {
|
|
|
+ BigDecimal masterTotalPrice = getMasterTotalPrice(masterClassGroupId);
|
|
|
+ //是否有需要审核的缴费项目
|
|
|
+ //将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
|
|
|
+ for (Map<Integer, String> classGroupStudent : classGroupStudents) {
|
|
|
+ Integer classGroupId = classGroupStudent.keySet().iterator().next();
|
|
|
+ studentRegistrationService.insertStudent(classGroupStudent.get(classGroupId),musicGroupDao.findByClassGroupId(classGroupId).getId(),musicGroup.getId(),masterTotalPrice);
|
|
|
+ }
|
|
|
+
|
|
|
+ paymentCalenderDto.setMusicGroupId(musicGroup.getId());
|
|
|
+ List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = paymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
|
|
|
+ boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
|
|
|
+ if(!containsAll){
|
|
|
+ paymentCalenderDto.setStatus(AUDITING);
|
|
|
+ }else {
|
|
|
+ paymentCalenderDto.setStatus(NO);
|
|
|
+ }
|
|
|
+ paymentCalenderDto.setPayUserType(MusicGroupPaymentCalender.PayUserType.STUDENT);
|
|
|
+ paymentCalenderDto.setPaymentType(SPAN_GROUP_CLASS_ADJUST);
|
|
|
+ //生成缴费项目
|
|
|
+ paymentCalenderDto.setMasterTotalPrice(masterTotalPrice);
|
|
|
+ paymentCalenderDto.setStudentIds(StringUtils.join(studentIds,","));
|
|
|
+ musicGroupPaymentCalenderService.create(paymentCalenderDto);
|
|
|
+ //记录申请信息
|
|
|
+ MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = new MusicGroupStudentClassAdjust();
|
|
|
+ musicGroupStudentClassAdjust.setMasterClassGroupId(masterClassGroupId);
|
|
|
+ musicGroupStudentClassAdjust.setBatchNo(paymentCalenderDto.getBatchNo());
|
|
|
+ musicGroupStudentClassAdjust.setMusicGroupId(musicGroup.getId());
|
|
|
+ musicGroupStudentClassAdjust.setOperatorId(sysUser.getId());
|
|
|
+ musicGroupStudentClassAdjust.setClassGroupIds(JSON.toJSONString(classGroupIds));
|
|
|
+ musicGroupStudentClassAdjust.setStudentIds(JSON.toJSONString(studentIds));
|
|
|
+ if (classGroupStudents != null && classGroupStudents.size() > 0) {
|
|
|
+ musicGroupStudentClassAdjust.setClassGroupStudents(JSON.toJSONString(mergeClassSplitClassAffirmDto.getClassGroupStudents()));
|
|
|
+ }
|
|
|
+ //获取需要删除的学员关联的课程
|
|
|
+ List<Long> courseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
|
|
|
+ musicGroupStudentClassAdjust.setSubLockCourseIds(JSON.toJSONString(courseIds));
|
|
|
+ //获取关联的学员缴费信息
|
|
|
+ List<Long> studentPaymentIds = courseScheduleStudentPaymentDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
|
|
|
+ musicGroupStudentClassAdjust.setStudentPaymentIds(JSON.toJSONString(studentPaymentIds));
|
|
|
+ //获取需要冻结的课程
|
|
|
+ classGroupIds.add(masterClassGroupId);
|
|
|
+ List<Long> allLockCourseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, null);
|
|
|
+ musicGroupStudentClassAdjust.setAllLockCourseIds(JSON.toJSONString(allLockCourseIds));
|
|
|
+ musicGroupStudentClassAdjustDao.insert(musicGroupStudentClassAdjust);
|
|
|
+ //没有需要审核的缴费项目
|
|
|
+ if (paymentCalenderDto.getStatus() != AUDITING) {
|
|
|
+ spanGroupClassAdjustPass(masterClassGroupId,studentIds,courseIds,classGroupStudents);
|
|
|
+ }else {
|
|
|
// 冻结班级
|
|
|
- classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds, 1);
|
|
|
+ classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds, 1);
|
|
|
// 冻结所选班级的课程
|
|
|
- courseScheduleDao.batchUpdateLockByCourseIds(allLockCourseIds, 1);
|
|
|
- }
|
|
|
+ courseScheduleDao.batchUpdateLockByCourseIds(allLockCourseIds, 1);
|
|
|
}
|
|
|
+ int i = 1/0;
|
|
|
}
|
|
|
|
|
|
public void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<Integer, String>> classGroupStudents){
|