Explorar o código

Merge branch 'online1' into master_teacherSalary_2020-12-11

Joburgess %!s(int64=4) %!d(string=hai) anos
pai
achega
185741680d

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1096,7 +1096,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         //如果学员已经在某些班级,
         Boolean isExistClassGroup = classGroupStudentMapperDao.existByClassGroupIds(classGroupIdListStr,studentId);
         if(isExistClassGroup){
-            throw new BizException("操作失败:学员已存在");
+            return true;
         }
 		List<ClassGroup> classGroupList = classGroupDao.findClassGroupByIds(classGroupIdListStr);
 		if (classGroupList == null || classGroupList.size() == 0) {

+ 28 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -425,6 +425,16 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
+		} else if (paymentType == ADD_STUDENT) {
+
+			if (status != AUDITING) {
+				// 学生加到班级
+				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
+				if (StringUtils.isNotBlank(classGroupIdStr)) {
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(musicGroupPaymentCalenderDto.getStudentIds()), classGroupIdStr,
+							batchNo, musicGroupPaymentCalenderCourseSettingsList);
+				}
+			}
 		}
 
 		if (status == AUDITING) {
@@ -711,6 +721,16 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
+		} else if (paymentType == ADD_STUDENT) {
+
+			if (status != AUDITING) {
+				// 学生加到班级
+				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
+				if (StringUtils.isNotBlank(classGroupIdStr)) {
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(musicGroupPaymentCalenderDto.getStudentIds()), classGroupIdStr,
+							batchNo, musicGroupPaymentCalenderCourseSettingsList);
+				}
+			}
 		}
 
 		if (status == AUDITING) {
@@ -795,12 +815,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				if(musicGroupPaymentStudentCourseDetailList.size() > 0){
 					musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
 				}
-
-				// 学生加到班级
-				String classGroupIdStr = musicGroupPaymentCalender.getAttribute1();
-				if(StringUtils.isNotBlank(classGroupIdStr)){
-					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(studentId), classGroupIdStr, musicGroupPaymentCalender.getBatchNo(), musicGroupPaymentCalenderCourseSettingsList);
-				}
 			}
 		}
 	}
@@ -1010,6 +1024,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				roleIds.add(SysUserRole.SECTION_MANAGER);
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 			}
+		} else if (calender.getPaymentType() == ADD_STUDENT) {
+
+			// 学生加到班级
+			String classGroupIdStr = calender.getAttribute1();
+			if (StringUtils.isNotBlank(classGroupIdStr)) {
+				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
+						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+			}
 		}
 		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		//如果是合班缴费