|
@@ -123,7 +123,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Integer batchUpdateSubject(Integer userId, Integer subId, String musicGroupId) throws Exception {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- if(sysUser == null){
|
|
|
+ if (sysUser == null) {
|
|
|
throw new BizException("获取用户信息失败");
|
|
|
}
|
|
|
//获取当前学员的当前声部
|
|
@@ -133,7 +133,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
//批量调剂(未缴费学员)
|
|
|
int i = studentRegistrationDao.batchUpdateSubject(userId, subId, musicGroupId);
|
|
|
- if(i > 0){
|
|
|
+ if (i > 0) {
|
|
|
//当前专业报名人数减一
|
|
|
musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, studentRegistration.getActualSubjectId(), -1);
|
|
|
//修改专业已报名人数
|
|
@@ -143,8 +143,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
roleIds.add(SysUserRole.OPERATION_EXECUTIVE);
|
|
|
|
|
|
- String[] organIds = { musicGroup.getOrganId() + "" };
|
|
|
- sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds,organIds), MessageTypeEnum.BACKSTAGE_STUDENT_SUBJECT_CHANGE, "", musicGroup.getName());
|
|
|
+ String[] organIds = {musicGroup.getOrganId() + ""};
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, organIds), MessageTypeEnum.BACKSTAGE_STUDENT_SUBJECT_CHANGE, "", musicGroup.getName());
|
|
|
}
|
|
|
return i;
|
|
|
}
|
|
@@ -202,7 +202,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
sysUser.setDelFlag(com.ym.mec.auth.api.enums.YesOrNoEnum.NO);
|
|
|
sysUser.setUserType(SysUserType.STUDENT);
|
|
|
sysUser.setGender(studentRegistration.getGender());
|
|
|
- if(studentRegistration.getOrganId() != null){
|
|
|
+ if (studentRegistration.getOrganId() != null) {
|
|
|
sysUser.setOrganId(studentRegistration.getOrganId());
|
|
|
}
|
|
|
sysUser.setRealName(studentRegistration.getParentsName());
|
|
@@ -331,7 +331,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if (studentRegistration.getTemporaryCourseFee() == null && musicOneSubjectClassPlan.getPaidStudentNum() > musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
throw new BizException("乐团人数已满");
|
|
|
}
|
|
|
- musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
+ int count = musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
+ if (count <= 0) {
|
|
|
+ throw new BizException("系统繁忙请重新");
|
|
|
+ }
|
|
|
return studentPaymentOrder;
|
|
|
}
|
|
|
|
|
@@ -424,7 +427,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
StudentRegistration registration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
|
|
|
SysUserCashAccount account = sysUserCashAccountDao.getLocked(userId);
|
|
|
registration.setBalance(account.getBalance());
|
|
|
- registration.setTransferStudent(registration.getTemporaryCourseFee() == null?0:1);
|
|
|
+ registration.setTransferStudent(registration.getTemporaryCourseFee() == null ? 0 : 1);
|
|
|
return registration;
|
|
|
}
|
|
|
|
|
@@ -484,8 +487,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
Set<Integer> roleIds = new HashSet<>(1);
|
|
|
roleIds.add(SysUserRole.OPERATION_EXECUTIVE);
|
|
|
|
|
|
- String[] organIds = { musicGroup.getOrganId() + "" };
|
|
|
- sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds,organIds), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_ADD_STUDENT, "", musicGroup.getName(), studentRegistration.getName());
|
|
|
+ String[] organIds = {musicGroup.getOrganId() + ""};
|
|
|
+ sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, organIds), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_ADD_STUDENT, "", musicGroup.getName(), studentRegistration.getName());
|
|
|
//增加报名学生数
|
|
|
musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, studentRegistration.getSubjectId(), 1);
|
|
|
Integer classGroupId = studentRegistration.getClassGroupId();
|
|
@@ -511,7 +514,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
// ClassGroupRelation classGroupRelation = classGroupRelationDao.findClassGroupRelation(classGroupId);
|
|
|
// classGroupStudentMapper.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
// classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
- addStudents(classGroup,userId);
|
|
|
+ addStudents(classGroup, userId);
|
|
|
Date date = new Date();
|
|
|
//获取当前月
|
|
|
Integer month = Integer.parseInt(DateUtil.getMonth(date));
|
|
@@ -554,7 +557,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetails.add(studentPaymentOrderDetail);
|
|
|
//汇总金额
|
|
|
BigDecimal reduce = studentPaymentOrderDetails.stream().map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if(reduce == BigDecimal.ZERO){
|
|
|
+ if (reduce == BigDecimal.ZERO) {
|
|
|
studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
|
|
|
studentPaymentOrder.setActualAmount(reduce);
|
|
@@ -569,15 +572,15 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetails);
|
|
|
}
|
|
|
studentRegistrationDao.updateCurrentClass(studentRegistration);
|
|
|
- Map<Integer,String> receivers = new HashMap<>(1);
|
|
|
- receivers.put(studentRegistration.getUserId(),studentRegistration.getParentsPhone());
|
|
|
- sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT,
|
|
|
- receivers,null,0,null,studentRegistration.getParentsName(),studentRegistration.getName(),musicGroup.getName());
|
|
|
+ Map<Integer, String> receivers = new HashMap<>(1);
|
|
|
+ receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT,
|
|
|
+ receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName());
|
|
|
return userId;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void addStudents(ClassGroup classGroup, Integer userId){
|
|
|
+ public void addStudents(ClassGroup classGroup, Integer userId) {
|
|
|
Date nowDate = new Date();
|
|
|
//1、班级关系添加
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
|
|
@@ -587,9 +590,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
//校验是否存在历史记录
|
|
|
ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
|
|
|
- if(classGroupStudentMapper != null){
|
|
|
+ if (classGroupStudentMapper != null) {
|
|
|
classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
classGroupStudentMapper.setClassGroupId(classGroupId);
|
|
@@ -883,7 +886,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findMusicGroupClassGroupByType(musicGroupId, type);
|
|
|
for (StudentRegistration student : students) {
|
|
|
for (ClassGroupStudentMapper classGroupStudentMapper : classGroupStudentMappers) {
|
|
|
- if(classGroupStudentMapper.getUserId().equals(student.getUserId())){
|
|
|
+ if (classGroupStudentMapper.getUserId().equals(student.getUserId())) {
|
|
|
students.remove(student);
|
|
|
}
|
|
|
}
|