|
@@ -15,10 +15,13 @@ import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
+import com.ym.mec.common.entity.ImGroupMember;
|
|
|
+import com.ym.mec.common.entity.ImGroupModel;
|
|
|
import com.ym.mec.common.entity.ImResult;
|
|
|
import com.ym.mec.common.entity.ImUserModel;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
+import com.ym.mec.common.redis.service.RedisCache;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.im.ImFeignService;
|
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
@@ -48,15 +51,19 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
@Autowired
|
|
|
private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
|
|
|
@Autowired
|
|
|
+ private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
|
|
|
+ @Autowired
|
|
|
+ private ClassGroupRelationService classGroupRelationService;
|
|
|
+ @Autowired
|
|
|
+ private CourseScheduleService courseScheduleService;
|
|
|
+ @Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
@Autowired
|
|
|
- private ClassGroupDao classGroupDao;
|
|
|
+ private ClassGroupService classGroupDao;
|
|
|
@Autowired
|
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
|
@Autowired
|
|
|
- private ClassGroupStudentMapperDao classGroupStudentMapperDao;
|
|
|
- @Autowired
|
|
|
- private ClassGroupRelationDao classGroupRelationDao;
|
|
|
+ private ClassGroupStudentMapperService classGroupStudentMapperDao;
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
|
@Autowired
|
|
@@ -87,6 +94,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
private ClassGroupStudentMapperService classGroupStudentMapperService;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private RedisCache<String, Object> redisCache;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, StudentRegistration> getDAO() {
|
|
@@ -117,7 +126,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("获取用户信息失败");
|
|
|
}
|
|
|
//获取当前学员的当前声部
|
|
@@ -127,7 +136,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);
|
|
|
//修改专业已报名人数
|
|
@@ -137,8 +146,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;
|
|
|
}
|
|
@@ -183,7 +192,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public StudentRegistration addStudent(StudentRegistration studentRegistration) throws IOException {
|
|
|
+ public StudentRegistration addStudent(StudentRegistration studentRegistration) throws Exception {
|
|
|
+ String key = "_student_registration";
|
|
|
+ long threadId = Thread.currentThread().getId();
|
|
|
+ if (!redisCache.getLocked(key, threadId, 10)) {
|
|
|
+ throw new BizException("系统繁忙,请稍后再试");
|
|
|
+ }
|
|
|
Date date = new Date();
|
|
|
Integer userId = 0;
|
|
|
SysUser sysUser = studentRegistrationDao.getSysUserByPhone(studentRegistration.getParentsPhone());
|
|
@@ -196,7 +210,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());
|
|
@@ -218,8 +232,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentRegistration.setCreateTime(date);
|
|
|
studentRegistration.setUpdateTime(date);
|
|
|
studentRegistration.setUserId(sysUser.getId());
|
|
|
- studentRegistrationDao.updateCurrentClass(studentRegistration);
|
|
|
studentRegistrationDao.insert(studentRegistration);
|
|
|
+ studentRegistrationDao.updateCurrentClass(studentRegistration);
|
|
|
//增加报名学生数
|
|
|
musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId(), 1);
|
|
|
//报名成功后,发送短信
|
|
@@ -234,6 +248,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
MessageTypeEnum.SMS_APPLY_MESSAGE, map, null, 0, "",
|
|
|
studentRegistration.getParentsName(), subject.getName(), HttpUtil.getSortUrl(studentApplyUrl),
|
|
|
DateUtil.format(musicGroup.getApplyExpireDate(), DateUtil.DATE_FORMAT_MIN), serverPhone);
|
|
|
+
|
|
|
+ redisCache.releaseLocked(key, threadId);
|
|
|
return studentRegistration;
|
|
|
}
|
|
|
|
|
@@ -242,8 +258,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
return studentRegistrationDao.queryStudentInfo(userId);
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList) throws Exception {
|
|
|
Date date = new Date();
|
|
|
StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
@@ -319,18 +335,29 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
|
|
|
|
|
|
//增加缴费学生数
|
|
|
- MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
|
|
|
- int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
|
- musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
|
- if (studentRegistration.getTemporaryCourseFee() == null && musicOneSubjectClassPlan.getPaidStudentNum() > musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
- throw new BizException("乐团人数已满");
|
|
|
+ boolean updateFlag = false;
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
|
|
|
+ int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
|
+ musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
|
+ if (studentRegistration.getTemporaryCourseFee() == null && musicOneSubjectClassPlan.getPaidStudentNum() > musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
+ throw new BizException("乐团人数已满");
|
|
|
+ }
|
|
|
+ int count = musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
+ if (count >= 1) {
|
|
|
+ updateFlag = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
+ if (!updateFlag) {
|
|
|
+ throw new BizException("系统繁忙,更新缴费人数失败");
|
|
|
+ }
|
|
|
+
|
|
|
return studentPaymentOrder;
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public StudentPaymentOrder reAddOrder(Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, String musicGroupId, StudentPaymentOrder oldOrder) {
|
|
|
//关闭老订单
|
|
|
oldOrder.setStatus(DealStatusEnum.CLOSE);
|
|
@@ -413,11 +440,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public StudentRegistration queryByUserIdAndMusicGroupId(Integer userId, String musicGroupId) {
|
|
|
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;
|
|
|
}
|
|
|
|
|
@@ -477,8 +505,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();
|
|
@@ -497,13 +525,17 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
throw new Exception("班级不存在");
|
|
|
}
|
|
|
//新增班级学生关系(单技班)
|
|
|
- classGroupStudentMapperDao.insert(new ClassGroupStudentMapper(classGroupId, userId));
|
|
|
+// ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper(musicGroupId,userId,GroupType.MUSIC);
|
|
|
+// classGroupStudentMapper.setClassGroupId(classGroupId);
|
|
|
+// classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
//新增班级学生关系(合奏班)
|
|
|
- ClassGroupRelation classGroupRelation = classGroupRelationDao.findClassGroupRelation(classGroupId);
|
|
|
- classGroupStudentMapperDao.insert(new ClassGroupStudentMapper(classGroupRelation.getClassGroupId(), userId));
|
|
|
-
|
|
|
+// ClassGroupRelation classGroupRelation = classGroupRelationDao.findClassGroupRelation(classGroupId);
|
|
|
+// classGroupStudentMapper.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
+// classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
+ addStudents(classGroup, userId);
|
|
|
+ Date date = new Date();
|
|
|
//获取当前月
|
|
|
- Integer month = Integer.parseInt(DateUtil.getMonth(new Date()));
|
|
|
+ Integer month = Integer.parseInt(DateUtil.getMonth(date));
|
|
|
//获取下次缴费月份
|
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
|
|
|
List<Integer> months = musicGroupPaymentCalenders.stream().map(e -> e.getPaymentMonth()).collect(Collectors.toList());
|
|
@@ -543,10 +575,13 @@ 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);
|
|
|
+ studentPaymentOrder.setPayTime(date);
|
|
|
}
|
|
|
+ studentPaymentOrder.setExpectAmount(reduce);
|
|
|
studentRegistrationDao.insertBasic(studentRegistration);
|
|
|
studentPaymentOrderService.insert(studentPaymentOrder);
|
|
|
studentPaymentOrderDetails.forEach(e -> {
|
|
@@ -555,14 +590,95 @@ 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) {
|
|
|
+ Date nowDate = new Date();
|
|
|
+ //1、班级关系添加
|
|
|
+ List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
|
|
|
+ List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
+ Integer classGroupId = classGroup.getId();
|
|
|
+ ClassGroupRelation classGroupRelation = classGroupRelationService.findClassGroupRelation(classGroupId);
|
|
|
+
|
|
|
+ //校验是否存在历史记录
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId);
|
|
|
+ if (classGroupStudentMapper != null) {
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ } else {
|
|
|
+ classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroupId);
|
|
|
+ classGroupStudentMapper.setUserId(userId);
|
|
|
+ classGroupStudentMapper.setCreateTime(nowDate);
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
|
+ classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ }
|
|
|
+ //班级在合奏班中
|
|
|
+ if (classGroupRelation != null) {
|
|
|
+ classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
+ classGroupStudentMapper.setUserId(userId);
|
|
|
+ classGroupStudentMapper.setCreateTime(nowDate);
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
+ classGroupStudentMapper.setGroupType(GroupType.MUSIC);
|
|
|
+ classGroupStudentMappers.add(classGroupStudentMapper);
|
|
|
+ }
|
|
|
+ imGroupMemberList.add(new ImGroupMember(userId.toString()));
|
|
|
+ if (classGroupStudentMappers.size() > 0) {
|
|
|
+ classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加进IM群组
|
|
|
+ ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
|
+ imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
|
+
|
|
|
+ //2、班级人数调整
|
|
|
+ classGroupDao.updateClassStudentNum(classGroupId.longValue(), 1);
|
|
|
+
|
|
|
+ //3、学生加入新班级未开始课程
|
|
|
+ List<CourseSchedule> courseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupId);
|
|
|
+
|
|
|
+ //4、班级在合奏班、添加合奏课程
|
|
|
+ if (classGroupRelation != null) {
|
|
|
+ //合奏班增加人数
|
|
|
+ classGroupDao.updateClassStudentNum(classGroupRelation.getClassGroupId().longValue(), 1);
|
|
|
+ List<CourseSchedule> mixCourseScheduleList = courseScheduleService.findNoStartCoursesByClassGroupId(classGroupRelation.getClassGroupId());
|
|
|
+ courseScheduleList.addAll(mixCourseScheduleList);
|
|
|
+
|
|
|
+ //添加进合奏班IM群组
|
|
|
+ imFeignService.groupJoin(new ImGroupModel(classGroupRelation.getClassGroupId().toString(), imGroupMembers, null));
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal coursePrice = new BigDecimal("0");
|
|
|
+
|
|
|
+ List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
|
|
|
+ for (CourseSchedule courseSchedule : courseScheduleList) {
|
|
|
+ CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
|
|
|
+ courseScheduleStudentPayment.setGroupType(classGroup.getGroupType());
|
|
|
+ courseScheduleStudentPayment.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
+ courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
|
|
|
+ courseScheduleStudentPayment.setUserId(userId);
|
|
|
+ courseScheduleStudentPayment.setExpectPrice(coursePrice);
|
|
|
+ courseScheduleStudentPayment.setClassGroupId(classGroupId);
|
|
|
+ courseScheduleStudentPayment.setCreateTime(nowDate);
|
|
|
+ courseScheduleStudentPayment.setUpdateTime(nowDate);
|
|
|
+ courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (courseScheduleStudentPayments.size() == 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ courseScheduleStudentPaymentService.batchInsert(courseScheduleStudentPayments);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId) {
|
|
|
//获取所有声部
|
|
@@ -603,7 +719,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
waitPayOrder.setStatus(DealStatusEnum.CLOSE);
|
|
|
studentPaymentOrderService.update(waitPayOrder);
|
|
|
//添加学生
|
|
|
- classGroupStudentMapperService.addStudents(waitPayOrder.getClassGroupId(), studentRegistration.getUserId().toString(), GroupType.MUSIC);
|
|
|
+ //classGroupStudentMapperService.addStudents(waitPayOrder.getClassGroupId(), studentRegistration.getUserId().toString(), GroupType.MUSIC);
|
|
|
} else {
|
|
|
//获取当前月
|
|
|
Integer month = Integer.parseInt(DateUtil.getMonth(nowDate));
|
|
@@ -679,7 +795,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
//减去缴费人数
|
|
|
if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED)) {
|
|
|
musicOneSubjectClassPlan.setPaidStudentNum(musicOneSubjectClassPlan.getPaidStudentNum() - 1);
|
|
|
- musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
+ int updateCount = musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
+ if (updateCount <= 0) {
|
|
|
+ throw new BizException("减去缴费人数失败");
|
|
|
+ }
|
|
|
//发送缴费成功通知(短信 + push)
|
|
|
String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL + studentRegistration.getMusicGroupId());
|
|
|
|
|
@@ -788,7 +907,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);
|
|
|
}
|
|
|
}
|