|
@@ -1075,7 +1075,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
classGroup.setStudentNum(classGroup.getStudentNum()+num);
|
|
|
}
|
|
|
|
|
|
- Integer studentPaymentNum=studentPaymentOrderDao.countStudentPaymentNum(vipGroupId.toString());
|
|
|
+// Integer studentPaymentNum=studentPaymentOrderDao.countStudentPaymentNum(vipGroupId.toString());
|
|
|
+
|
|
|
+ Integer studentPaymentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
|
|
|
if(studentPaymentNum.equals(classGroup.getExpectStudentNum())&&updateVipStatus){
|
|
|
classGroup.setStudentNum(studentPaymentNum);
|
|
@@ -1528,6 +1530,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
|
studentPauseInfoDao.deleteUserPauseInfoWithGroup(GroupType.VIP, vipGroupId.toString(), studentId);
|
|
|
+
|
|
|
+ classGroup.setStudentNum(classGroup.getStudentNum()-1);
|
|
|
+ classGroupDao.update(classGroup);
|
|
|
return;
|
|
|
}
|
|
|
if(Objects.isNull(amount)){
|
|
@@ -1559,6 +1564,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroupId.intValue(), vipGroup.getUserId());
|
|
|
}
|
|
|
|
|
|
+ classGroup.setStudentNum(classGroup.getStudentNum()-1);
|
|
|
+
|
|
|
+ classGroupDao.update(classGroup);
|
|
|
+
|
|
|
//学员退出班级群
|
|
|
ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(studentId.toString())};
|
|
|
imFeignService.groupQuit(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, null));
|
|
@@ -1574,11 +1583,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(Objects.isNull(vipGroup)){
|
|
|
throw new BizException("指定的课程不存在");
|
|
|
}
|
|
|
- if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
|
|
|
- throw new BizException("不能对已停止的课程进行此操作");
|
|
|
- }
|
|
|
- if(vipGroup.getStatus().equals(VipGroupStatusEnum.FINISHED)){
|
|
|
- throw new BizException("此课程已结束");
|
|
|
+ if(!VipGroupStatusEnum.PROGRESS.equals(vipGroup.getStatus())){
|
|
|
+ throw new BizException("当前课程组状态非进行中,无法进行该操作");
|
|
|
}
|
|
|
List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
|
|
|
if(!CollectionUtils.isEmpty(studentApplyRefunds)){
|
|
@@ -2465,12 +2471,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("未找到指定的vip课程");
|
|
|
}
|
|
|
|
|
|
- if(!VipGroupStatusEnum.PROGRESS.equals(vipGroup.getStatus())){
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+
|
|
|
+ if(!VipGroupStatusEnum.PROGRESS.equals(vipGroup.getStatus())&&classGroup.getExpectStudentNum()>1){
|
|
|
throw new BizException("VIP课程组尚未成立,无法添加学员,请走学员购买流程!");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
-
|
|
|
Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
if(studentNum.compareTo(classGroup.getExpectStudentNum())>=0){
|
|
|
throw new BizException("该班级人数已达上限");
|
|
@@ -2535,6 +2541,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(!CollectionUtils.isEmpty(classGroupStudentMappers)){
|
|
|
classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
|
|
|
}
|
|
|
+
|
|
|
+ Integer currentStudentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
+ if((!vipGroup.getStatus().equals(VipGroupStatusEnum.FINISHED)
|
|
|
+ ||!vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL))
|
|
|
+ &¤tStudentNum.compareTo(classGroup.getExpectStudentNum())>=0){
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
|
+ vipGroupDao.update(vipGroup);
|
|
|
+ }
|
|
|
+ classGroup.setStudentNum(currentStudentNum);
|
|
|
+ classGroup.setDelFlag(0);
|
|
|
+ classGroupDao.update(classGroup);
|
|
|
+
|
|
|
try {
|
|
|
ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
|
// 创建群组
|
|
@@ -2698,12 +2716,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
VipGroupStatusEnum vipGroupStatus = vipGroup.getStatus();
|
|
|
|
|
|
Integer currentStudentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
- if((!vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE)
|
|
|
+ if((!vipGroup.getStatus().equals(VipGroupStatusEnum.FINISHED)
|
|
|
||!vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL))
|
|
|
&¤tStudentNum.compareTo(classGroup.getExpectStudentNum())>=0){
|
|
|
vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
|
vipGroupDao.update(vipGroup);
|
|
|
}
|
|
|
+ classGroup.setStudentNum(currentStudentNum);
|
|
|
classGroup.setDelFlag(0);
|
|
|
classGroupDao.update(classGroup);
|
|
|
classGroupService.updateClassGroupInfo(classGroup.getId());
|