|
@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Isolation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
@@ -42,6 +43,7 @@ import com.ym.mec.biz.dal.dto.StudentMusicDetailDto;
|
|
import com.ym.mec.biz.dal.dto.StudentMusicGroupDto;
|
|
import com.ym.mec.biz.dal.dto.StudentMusicGroupDto;
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
|
+import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.ImResult;
|
|
import com.ym.mec.common.entity.ImResult;
|
|
import com.ym.mec.common.entity.ImUserModel;
|
|
import com.ym.mec.common.entity.ImUserModel;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
@@ -526,6 +528,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
boolean firstPaidZeroFlag = false;
|
|
boolean firstPaidZeroFlag = false;
|
|
|
|
|
|
MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
|
+ if (musicOneSubjectClassPlan.getPaidStudentNum() >= musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
|
+ throw new BizException("乐团该声部人数暂时已满,请稍后再试");
|
|
|
|
+ }
|
|
|
|
+
|
|
int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
int paidZeroNum = musicOneSubjectClassPlan.getPaidZeroNum() == null ? 0 : musicOneSubjectClassPlan.getPaidZeroNum();
|
|
int paidZeroNum = musicOneSubjectClassPlan.getPaidZeroNum() == null ? 0 : musicOneSubjectClassPlan.getPaidZeroNum();
|
|
if ((musicGroup.getCourseViewType().equals(CourseViewTypeEnum.MEMBER_FEE) && !buyCloudTeacher))
|
|
if ((musicGroup.getCourseViewType().equals(CourseViewTypeEnum.MEMBER_FEE) && !buyCloudTeacher))
|
|
@@ -539,9 +545,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
} else {
|
|
} else {
|
|
musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
}
|
|
}
|
|
- if (studentRegistration.getTemporaryCourseFee() == null && musicOneSubjectClassPlan.getPaidStudentNum() > musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
|
- throw new BizException("乐团该声部人数暂时已满,请稍后再试");
|
|
|
|
- }
|
|
|
|
int count = musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
int count = musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
if (count <= 0) {
|
|
if (count <= 0) {
|
|
throw new BizException("排队人数过多,请重试");
|
|
throw new BizException("排队人数过多,请重试");
|
|
@@ -1922,6 +1925,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if (studentRegistration.getNoneNeedCloudTeacher().equals(1)) {
|
|
if (studentRegistration.getNoneNeedCloudTeacher().equals(1)) {
|
|
throw new BizException("该学生已设置");
|
|
throw new BizException("该学生已设置");
|
|
}
|
|
}
|
|
|
|
+ studentRegistration.setPayingStatus(0);
|
|
studentRegistration.setNoneNeedCloudTeacher(1);
|
|
studentRegistration.setNoneNeedCloudTeacher(1);
|
|
if (studentRegistrationDao.update(studentRegistration) <= 0) {
|
|
if (studentRegistrationDao.update(studentRegistration) <= 0) {
|
|
throw new BizException("设置失败,请重试");
|
|
throw new BizException("设置失败,请重试");
|
|
@@ -1931,7 +1935,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public Boolean addPaidNum(Long id) {
|
|
|
|
|
|
+ public HttpResponseResult<Boolean> addPaidNum(Long id, boolean isContinue) {
|
|
StudentRegistration studentRegistration = studentRegistrationDao.get(id);
|
|
StudentRegistration studentRegistration = studentRegistrationDao.get(id);
|
|
if (!studentRegistration.getPayingStatus().equals(2)) {
|
|
if (!studentRegistration.getPayingStatus().equals(2)) {
|
|
throw new BizException("该学生不在审核");
|
|
throw new BizException("该学生不在审核");
|
|
@@ -1939,6 +1943,15 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if (!studentRegistration.getPaymentStatus().equals(YES)) {
|
|
if (!studentRegistration.getPaymentStatus().equals(YES)) {
|
|
throw new BizException("该学生状态已更新,请刷新查看");
|
|
throw new BizException("该学生状态已更新,请刷新查看");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
|
+
|
|
|
|
+ if(!isContinue){
|
|
|
|
+ if (musicOneSubjectClassPlan.getPaidStudentNum() >= musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
|
+ return new HttpResponseResult<Boolean>(true, HttpStatus.CONTINUE, null, "乐团该声部招生人数已满,是否继续操作?");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
studentRegistration.setPayingStatus(0);
|
|
studentRegistration.setPayingStatus(0);
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
studentRegistrationDao.update(studentRegistration);
|
|
studentRegistrationDao.update(studentRegistration);
|
|
@@ -1947,8 +1960,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if(studentPaymentOrderService.update(order)<=0){
|
|
if(studentPaymentOrderService.update(order)<=0){
|
|
throw new BizException("订单处理失败,请重试");
|
|
throw new BizException("订单处理失败,请重试");
|
|
}
|
|
}
|
|
-
|
|
|
|
- MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
|
|
|
+
|
|
int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
int paidZeroNum = musicOneSubjectClassPlan.getPaidZeroNum() == null ? 0 : musicOneSubjectClassPlan.getPaidZeroNum();
|
|
int paidZeroNum = musicOneSubjectClassPlan.getPaidZeroNum() == null ? 0 : musicOneSubjectClassPlan.getPaidZeroNum();
|
|
musicOneSubjectClassPlan.setPaidZeroNum(paidZeroNum + 1);
|
|
musicOneSubjectClassPlan.setPaidZeroNum(paidZeroNum + 1);
|
|
@@ -1957,7 +1969,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
if (count <= 0) {
|
|
if (count <= 0) {
|
|
throw new BizException("缴费人数更新失败,请重试");
|
|
throw new BizException("缴费人数更新失败,请重试");
|
|
}
|
|
}
|
|
- return true;
|
|
|
|
|
|
+ return new HttpResponseResult<Boolean>(true, HttpStatus.OK, null, null);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|