|
@@ -6,19 +6,20 @@ import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.Iterator;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
-import com.ym.mec.biz.dal.dao.*;
|
|
|
-import com.ym.mec.biz.dal.entity.*;
|
|
|
-import com.ym.mec.biz.dal.enums.*;
|
|
|
-import com.ym.mec.biz.dal.dto.*;
|
|
|
-import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
|
|
|
-import com.ym.mec.biz.service.*;
|
|
|
-
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -35,13 +36,103 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
import com.ym.mec.auth.api.enums.CertificateTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
|
|
|
+import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
+import com.ym.mec.biz.dal.dao.GoodsDao;
|
|
|
+import com.ym.mec.biz.dal.dao.ImGroupDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
|
|
|
+import com.ym.mec.biz.dal.dao.OrganizationCloudTeacherFeeDao;
|
|
|
+import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentCourseFeeDetailDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentInstrumentDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
|
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SubjectChangeDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SubjectDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
|
+import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
|
+import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
+import com.ym.mec.biz.dal.dto.NoClassMusicStudentDto;
|
|
|
+import com.ym.mec.biz.dal.dto.PageInfoReg;
|
|
|
+import com.ym.mec.biz.dal.dto.RegisterDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentAddDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
|
|
|
-import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentInfo;
|
|
|
import com.ym.mec.biz.dal.dto.StudentMusicDetailDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentMusicGroupDto;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
+import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
|
|
|
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
|
|
|
+import com.ym.mec.biz.dal.entity.Goods;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
|
|
|
+import com.ym.mec.biz.dal.entity.Organization;
|
|
|
+import com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee;
|
|
|
+import com.ym.mec.biz.dal.entity.Student;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentCourseFeeDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentInstrument;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
|
|
|
+import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
+import com.ym.mec.biz.dal.entity.Subject;
|
|
|
+import com.ym.mec.biz.dal.entity.SubjectChange;
|
|
|
+import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
+import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
|
|
|
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.GoodsType;
|
|
|
+import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
+import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.RegistrationOrPreQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
|
|
|
+import com.ym.mec.biz.service.ClassGroupService;
|
|
|
+import com.ym.mec.biz.service.ClassGroupStudentMapperService;
|
|
|
+import com.ym.mec.biz.service.CloudTeacherOrderService;
|
|
|
+import com.ym.mec.biz.service.ContractService;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleService;
|
|
|
+import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
|
|
|
+import com.ym.mec.biz.service.ImGroupMemberService;
|
|
|
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
+import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
|
|
|
+import com.ym.mec.biz.service.SellOrderService;
|
|
|
+import com.ym.mec.biz.service.StudentInstrumentService;
|
|
|
+import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
|
|
|
+import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
|
+import com.ym.mec.biz.service.StudentRegistrationService;
|
|
|
+import com.ym.mec.biz.service.StudentService;
|
|
|
+import com.ym.mec.biz.service.SubjectService;
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
|
+import com.ym.mec.biz.service.SysMessageService;
|
|
|
+import com.ym.mec.biz.service.SysUserCashAccountDetailService;
|
|
|
+import com.ym.mec.biz.service.SysUserCashAccountService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
|
import com.ym.mec.common.entity.ImResult;
|
|
@@ -239,42 +330,59 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId) {
|
|
|
- StudentFeeDetailDto studentFeeDetailDto = new StudentFeeDetailDto();
|
|
|
- List<MusicalListDetailDto> musicalList = studentPaymentOrderDetailService.getMusicalListDetail(musicGroupId, studentId);
|
|
|
- if (musicalList.size() <= 0) {
|
|
|
- return studentFeeDetailDto;
|
|
|
- }
|
|
|
- MusicalListDetailDto detailDto = musicalList.get(0);
|
|
|
- studentFeeDetailDto.setTotalAmount(detailDto.getOrderAmount());
|
|
|
- studentFeeDetailDto.setCourseFee(detailDto.getCourseAmount());
|
|
|
- if (KitGroupPurchaseTypeEnum.LEASE.equals(detailDto.getKitGroupPurchaseTypeEnum())) {
|
|
|
- studentFeeDetailDto.setDepositFee(detailDto.getMusicalAmount());
|
|
|
- }
|
|
|
- List<StudentFeeDto> studentFeeDtos = new ArrayList<>();
|
|
|
- if (detailDto.getMusicalName() != null) {
|
|
|
- StudentFeeDto studentFeeDto = new StudentFeeDto();
|
|
|
- studentFeeDto.setGoodsName(detailDto.getMusicalName());
|
|
|
- studentFeeDto.setGoodsType("INSTRUMENT");
|
|
|
- studentFeeDto.setMusicalFee(detailDto.getMusicalAmount());
|
|
|
- studentFeeDtos.add(studentFeeDto);
|
|
|
- }
|
|
|
- if (detailDto.getAccessoriesName() != null) {
|
|
|
- StudentFeeDto studentFeeDto = new StudentFeeDto();
|
|
|
- studentFeeDto.setGoodsName(detailDto.getAccessoriesName());
|
|
|
- studentFeeDto.setGoodsType("ACCESSORIES");
|
|
|
- studentFeeDto.setMusicalFee(detailDto.getAccessoriesAmount());
|
|
|
- studentFeeDtos.add(studentFeeDto);
|
|
|
- }
|
|
|
- StudentFeeDto studentFeeDto = new StudentFeeDto();
|
|
|
- studentFeeDto.setGoodsType("COURSE");
|
|
|
- studentFeeDto.setMusicalFee(detailDto.getCourseAmount());
|
|
|
- studentFeeDtos.add(studentFeeDto);
|
|
|
- studentFeeDetailDto.setGoods(studentFeeDtos);
|
|
|
-
|
|
|
- return studentFeeDetailDto;
|
|
|
- //return studentRegistrationDao.queryFeeDetail(studentId, musicGroupId);
|
|
|
- }
|
|
|
+ public List<StudentPaymentOrderDetail> queryFeeDetail(Integer studentId, String musicGroupId) {
|
|
|
+
|
|
|
+ List<StudentPaymentOrder> studentPaymentOrderList = studentPaymentOrderService.queryByCondition(GroupType.MUSIC, musicGroupId, studentId,
|
|
|
+ DealStatusEnum.SUCCESS, OrderTypeEnum.APPLY);
|
|
|
+
|
|
|
+ List<Long> orderIdList = studentPaymentOrderList.stream().map(t -> t.getId()).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<StudentPaymentOrderDetail> studentPaymentOrderDetailList = studentPaymentOrderDetailService.getOrderDetail(orderIdList);
|
|
|
+
|
|
|
+ SubjectChange studentLastChange = subjectChangeDao.getStudentLastChange(studentId, musicGroupId);
|
|
|
+
|
|
|
+ if (studentLastChange != null) {
|
|
|
+ Iterator<StudentPaymentOrderDetail> iterator = studentPaymentOrderDetailList.iterator();
|
|
|
+ StudentPaymentOrderDetail spod = null;
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ spod = iterator.next();
|
|
|
+ if (spod.getType() == OrderDetailTypeEnum.ACCESSORIES || spod.getType() == OrderDetailTypeEnum.MUSICAL) {
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNoneBlank(studentLastChange.getChangeAccessories())) {
|
|
|
+ StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
|
|
|
+ detail.setGoodsIdList(studentLastChange.getChangeAccessories());
|
|
|
+ List<Goods> goods = goodsDao.findGoodsByIds(detail.getGoodsIdList());
|
|
|
+ if (goods != null && goods.size() > 0) {
|
|
|
+ detail.setName(goods.stream().map(t -> t.getName()).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ detail.setPaymentOrderId((long) studentLastChange.getOriginalOrderId());
|
|
|
+ detail.setPrice(studentLastChange.getChangeAccessoriesPrice());
|
|
|
+ detail.setType(OrderDetailTypeEnum.ACCESSORIES);
|
|
|
+ detail.setCreateTime(studentLastChange.getCreateTime());
|
|
|
+
|
|
|
+ studentPaymentOrderDetailList.add(detail);
|
|
|
+ }
|
|
|
+ if (studentLastChange.getChangeMusical() != null) {
|
|
|
+ StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
|
|
|
+ detail.setGoodsIdList(studentLastChange.getChangeMusical() + "");
|
|
|
+ List<Goods> goods = goodsDao.findGoodsByIds(detail.getGoodsIdList());
|
|
|
+ if (goods != null && goods.size() > 0) {
|
|
|
+ detail.setName(goods.stream().map(t -> t.getName()).collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
+ detail.setPaymentOrderId((long) studentLastChange.getOriginalOrderId());
|
|
|
+ detail.setPrice(studentLastChange.getChangeMusicalPrice());
|
|
|
+ detail.setType(OrderDetailTypeEnum.MUSICAL);
|
|
|
+ detail.setCreateTime(studentLastChange.getCreateTime());
|
|
|
+
|
|
|
+ studentPaymentOrderDetailList.add(detail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return studentPaymentOrderDetailList;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId) {
|
|
@@ -525,26 +633,30 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
//增加缴费学生数,0元订单不增加报名人数(没买云教练/云教练+的)
|
|
|
boolean paidZeroFlag = false;
|
|
|
- boolean firstPaidZeroFlag = false;
|
|
|
|
|
|
MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
- if (musicOneSubjectClassPlan.getPaidStudentNum() >= musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
- throw new BizException("乐团该声部人数暂时已满,请稍后再试");
|
|
|
- }
|
|
|
+
|
|
|
+ //判断之前是否已有订单
|
|
|
+ List<StudentPaymentOrder> oldStudentPaymentOrderList = studentPaymentOrderService.queryByCondition(GroupType.MUSIC, studentRegistration.getMusicGroupId(), studentRegistration.getUserId(),DealStatusEnum.SUCCESS , OrderTypeEnum.APPLY);
|
|
|
|
|
|
int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
|
|
|
int paidZeroNum = musicOneSubjectClassPlan.getPaidZeroNum() == null ? 0 : musicOneSubjectClassPlan.getPaidZeroNum();
|
|
|
if ((musicGroup.getCourseViewType().equals(CourseViewTypeEnum.MEMBER_FEE) && !buyCloudTeacher))
|
|
|
{
|
|
|
paidZeroFlag = true;
|
|
|
- if (studentRegistration.getNoneNeedCloudTeacher().equals(1)) {
|
|
|
+ if (studentRegistration.getNoneNeedCloudTeacher().equals(1) && (oldStudentPaymentOrderList == null || oldStudentPaymentOrderList.size() == 0)) {
|
|
|
musicOneSubjectClassPlan.setPaidZeroNum(paidZeroNum + 1);
|
|
|
musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
|
- firstPaidZeroFlag = true;
|
|
|
}
|
|
|
} else {
|
|
|
- musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
|
+ if (oldStudentPaymentOrderList == null || oldStudentPaymentOrderList.size() == 0) {
|
|
|
+ musicOneSubjectClassPlan.setPaidStudentNum(paidNum + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (musicOneSubjectClassPlan.getPaidStudentNum() > musicOneSubjectClassPlan.getExpectedStudentNum()) {
|
|
|
+ throw new BizException("乐团该声部人数暂时已满,请稍后再试");
|
|
|
}
|
|
|
+
|
|
|
int count = musicGroupSubjectPlanService.update(musicOneSubjectClassPlan);
|
|
|
if (count <= 0) {
|
|
|
throw new BizException("排队人数过多,请重试");
|
|
@@ -715,159 +827,127 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
StudentRegistration phoneAndMusicGroupId = studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, studentRegistration.getParentsPhone());
|
|
|
if (phoneAndMusicGroupId != null && phoneAndMusicGroupId.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT && phoneAndMusicGroupId.getMusicGroupStatus() != StudentMusicGroupStatusEnum.APPLY) {
|
|
|
throw new BizException("该学员已存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ SysUser sysUser = studentRegistrationDao.getSysUserByPhone(studentRegistration.getParentsPhone());
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
+ Integer userId;
|
|
|
+ if (sysUser == null) {
|
|
|
+ //新增user
|
|
|
+ sysUser = new SysUser();
|
|
|
+ sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
|
+// sysUser.setRealName(studentRegistration.getParentsName());
|
|
|
+ sysUser.setUsername(studentRegistration.getName());
|
|
|
+ sysUser.setGender(studentRegistration.getGender());
|
|
|
+ sysUser.setUserType("STUDENT");
|
|
|
+// sysUser.setIdCardNo(studentRegistration.getIdCardNo());
|
|
|
+ sysUser.setOrganId(musicGroup.getOrganId());
|
|
|
+ sysUser.setBirthdate(studentRegistration.getBirthdate());
|
|
|
+ teacherDao.addSysUser(sysUser);
|
|
|
+ userId = sysUser.getId();
|
|
|
+ studentDao.insert(new Student(userId, studentRegistration.getSubjectId().toString()));
|
|
|
+ //添加用户现金账户
|
|
|
+ sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
|
|
|
+ ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), null));
|
|
|
+ sysUser.setImToken(register.getToken());
|
|
|
+ teacherDao.updateUser(sysUser);
|
|
|
} else {
|
|
|
- SysUser sysUser = studentRegistrationDao.getSysUserByPhone(studentRegistration.getParentsPhone());
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
|
|
|
- Integer userId;
|
|
|
- if (sysUser == null) {
|
|
|
- //新增user
|
|
|
- sysUser = new SysUser();
|
|
|
- sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
|
-// sysUser.setRealName(studentRegistration.getParentsName());
|
|
|
- sysUser.setUsername(studentRegistration.getName());
|
|
|
- sysUser.setGender(studentRegistration.getGender());
|
|
|
- sysUser.setUserType("STUDENT");
|
|
|
-// sysUser.setIdCardNo(studentRegistration.getIdCardNo());
|
|
|
- sysUser.setOrganId(musicGroup.getOrganId());
|
|
|
- sysUser.setBirthdate(studentRegistration.getBirthdate());
|
|
|
- teacherDao.addSysUser(sysUser);
|
|
|
- userId = sysUser.getId();
|
|
|
- studentDao.insert(new Student(userId, studentRegistration.getSubjectId().toString()));
|
|
|
- //添加用户现金账户
|
|
|
- sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
|
|
|
- ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), null));
|
|
|
- sysUser.setImToken(register.getToken());
|
|
|
- teacherDao.updateUser(sysUser);
|
|
|
- } else {
|
|
|
- if(musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
- //该学员是否在其他的会员团
|
|
|
- boolean hasMemberGroup = studentRegistrationDao.checkHasMemberGroup(musicGroupId,sysUser.getId());
|
|
|
- if(hasMemberGroup){
|
|
|
- throw new BizException("操作失败:该学员已在其他系统收费乐团中,不可报名该乐团请联系教务老师");
|
|
|
- }
|
|
|
- }
|
|
|
- StudentRegistration oldReg = studentRegistrationDao.getByUserIdAndMusicGroupId(musicGroupId, sysUser.getId());
|
|
|
- if (oldReg != null && oldReg.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT && oldReg.getMusicGroupStatus() != StudentMusicGroupStatusEnum.APPLY) {
|
|
|
- throw new BizException("该学员已存在,原手机号为" + oldReg.getParentsPhone());
|
|
|
- }
|
|
|
- if (oldReg != null) {
|
|
|
- phoneAndMusicGroupId = oldReg;
|
|
|
+ if(musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE){
|
|
|
+ //该学员是否在其他的会员团
|
|
|
+ boolean hasMemberGroup = studentRegistrationDao.checkHasMemberGroup(musicGroupId,sysUser.getId());
|
|
|
+ if(hasMemberGroup){
|
|
|
+ throw new BizException("操作失败:该学员已在其他系统收费乐团中,不可报名该乐团请联系教务老师");
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(sysUser.getUsername())) {
|
|
|
- if (!sysUser.getUsername().equals(studentRegistration.getName())) {
|
|
|
- throw new BizException("操作失败:账户已被注册");
|
|
|
- }
|
|
|
- }
|
|
|
- if (!sysUser.getUserType().contains("STUDENT")) {
|
|
|
- sysUser.setUserType(sysUser.getUserType() + ",STUDENT");
|
|
|
+ }
|
|
|
+ StudentRegistration oldReg = studentRegistrationDao.getByUserIdAndMusicGroupId(musicGroupId, sysUser.getId());
|
|
|
+ if (oldReg != null && oldReg.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT && oldReg.getMusicGroupStatus() != StudentMusicGroupStatusEnum.APPLY) {
|
|
|
+ throw new BizException("该学员已存在,原手机号为" + oldReg.getParentsPhone());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(sysUser.getUsername())) {
|
|
|
+ if (!sysUser.getUsername().equals(studentRegistration.getName())) {
|
|
|
+ throw new BizException("操作失败:账户已被注册");
|
|
|
}
|
|
|
- sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
|
-// sysUser.setRealName(studentRegistration.getParentsName());
|
|
|
- sysUser.setUsername(studentRegistration.getName());
|
|
|
- sysUser.setGender(studentRegistration.getGender());
|
|
|
- sysUser.setOrganId(musicGroup.getOrganId());
|
|
|
- sysUser.setBirthdate(studentRegistration.getBirthdate());
|
|
|
- teacherDao.updateUser(sysUser);
|
|
|
- userId = sysUser.getId();
|
|
|
- Student student = studentDao.get(userId);
|
|
|
- if (student == null) {
|
|
|
- studentDao.insert(new Student(userId, studentRegistration.getSubjectId().toString()));
|
|
|
- } else if (StringUtils.isEmpty(student.getSubjectIdList())) {
|
|
|
- student.setSubjectIdList(studentRegistration.getSubjectId().toString());
|
|
|
+ }
|
|
|
+ if (!sysUser.getUserType().contains("STUDENT")) {
|
|
|
+ sysUser.setUserType(sysUser.getUserType() + ",STUDENT");
|
|
|
+ }
|
|
|
+ sysUser.setPhone(studentRegistration.getParentsPhone());
|
|
|
+// sysUser.setRealName(studentRegistration.getParentsName());
|
|
|
+ sysUser.setUsername(studentRegistration.getName());
|
|
|
+ sysUser.setGender(studentRegistration.getGender());
|
|
|
+ sysUser.setOrganId(musicGroup.getOrganId());
|
|
|
+ sysUser.setBirthdate(studentRegistration.getBirthdate());
|
|
|
+ teacherDao.updateUser(sysUser);
|
|
|
+ userId = sysUser.getId();
|
|
|
+ Student student = studentDao.get(userId);
|
|
|
+ if (student == null) {
|
|
|
+ studentDao.insert(new Student(userId, studentRegistration.getSubjectId().toString()));
|
|
|
+ } else if (StringUtils.isEmpty(student.getSubjectIdList())) {
|
|
|
+ student.setSubjectIdList(studentRegistration.getSubjectId().toString());
|
|
|
+ student.setUpdateTime(date);
|
|
|
+ studentDao.update(student);
|
|
|
+ } else if (StringUtils.isNotEmpty(student.getSubjectIdList())) {
|
|
|
+ String[] split = student.getSubjectIdList().split(",");
|
|
|
+ List<String> list = new ArrayList<>(Arrays.asList(split));
|
|
|
+ if (!list.contains(studentRegistration.getSubjectId().toString())) {
|
|
|
+ list.add(studentRegistration.getSubjectId().toString());
|
|
|
+ student.setSubjectIdList(StringUtils.join(list, ","));
|
|
|
student.setUpdateTime(date);
|
|
|
studentDao.update(student);
|
|
|
- } else if (StringUtils.isNotEmpty(student.getSubjectIdList())) {
|
|
|
- String[] split = student.getSubjectIdList().split(",");
|
|
|
- List<String> list = new ArrayList<>(Arrays.asList(split));
|
|
|
- if (!list.contains(studentRegistration.getSubjectId().toString())) {
|
|
|
- list.add(studentRegistration.getSubjectId().toString());
|
|
|
- student.setSubjectIdList(StringUtils.join(list, ","));
|
|
|
- student.setUpdateTime(date);
|
|
|
- studentDao.update(student);
|
|
|
- }
|
|
|
}
|
|
|
- imGroupDao.updateNickname(userId, sysUser.getUsername());
|
|
|
- imGroupDao.updateUserFriendNickname(userId, sysUser.getUsername());
|
|
|
- }
|
|
|
- MusicGroupStudentFee studentFeeDaoByUser = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
|
|
|
- if (studentFeeDaoByUser != null) {
|
|
|
- throw new BizException("该学员已存在");
|
|
|
}
|
|
|
- Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
- String studentGrade = studentService.getStudentGrade(organization.getGradeType(), studentRegistration.getCurrentGradeNum());
|
|
|
- studentRegistration.setCurrentGrade(studentGrade);
|
|
|
- studentRegistration.setActualSubjectId(studentRegistration.getSubjectId());
|
|
|
- studentRegistration.setUserId(userId);
|
|
|
- studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN);
|
|
|
- studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
|
|
|
- studentRegistration.setTemporaryCourseFee(studentAddDto.getTemporaryCourseFee());
|
|
|
- //学生报名表
|
|
|
- Set<Integer> roleIds = new HashSet<>(1);
|
|
|
- roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
- Set<Integer> integers = musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId());
|
|
|
- integers.add(musicGroup.getEducationalTeacherId());
|
|
|
- sysMessageService.batchSeoMessage(integers, MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_ADD_STUDENT, "", musicGroup.getName(), studentRegistration.getName());
|
|
|
- //增加报名学生数
|
|
|
- musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, studentRegistration.getSubjectId(), 1);
|
|
|
- //汇总金额
|
|
|
-
|
|
|
- MusicGroupStudentFee musicGroupStudentFee = new MusicGroupStudentFee(musicGroupId,
|
|
|
- userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
|
|
|
- null, studentAddDto.getTemporaryCourseFee(), null);
|
|
|
-
|
|
|
- /*if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() * 100 == 0) {
|
|
|
- musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
|
|
|
- }*/
|
|
|
- musicGroupStudentFeeDao.insert(musicGroupStudentFee);
|
|
|
-
|
|
|
- StudentPaymentOrder waitPayOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
|
|
|
+ imGroupDao.updateNickname(userId, sysUser.getUsername());
|
|
|
+ imGroupDao.updateUserFriendNickname(userId, sysUser.getUsername());
|
|
|
+ }
|
|
|
+ MusicGroupStudentFee studentFeeDaoByUser = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
|
|
|
+ if (studentFeeDaoByUser != null) {
|
|
|
+ throw new BizException("该学员已存在");
|
|
|
+ }
|
|
|
+ Organization organization = organizationDao.get(musicGroup.getOrganId());
|
|
|
+ String studentGrade = studentService.getStudentGrade(organization.getGradeType(), studentRegistration.getCurrentGradeNum());
|
|
|
+ studentRegistration.setCurrentGrade(studentGrade);
|
|
|
+ studentRegistration.setActualSubjectId(studentRegistration.getSubjectId());
|
|
|
+ studentRegistration.setUserId(userId);
|
|
|
+ studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN);
|
|
|
+ studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.APPLY);
|
|
|
+ studentRegistration.setTemporaryCourseFee(studentAddDto.getTemporaryCourseFee());
|
|
|
+ studentRegistration.setMusicGroupPaymentCalenderId(null);
|
|
|
+
|
|
|
+ //增加报名学生数
|
|
|
+ musicGroupSubjectPlanService.addApplyStudentNum(musicGroupId, studentRegistration.getSubjectId(), 1);
|
|
|
+ //汇总金额
|
|
|
|
|
|
- if (waitPayOrder != null) {
|
|
|
- waitPayOrder.setStatus(DealStatusEnum.CLOSE);
|
|
|
- studentPaymentOrderService.update(waitPayOrder);
|
|
|
- }
|
|
|
- //生成订单
|
|
|
- StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
|
- studentPaymentOrder.setUserId(userId);
|
|
|
- studentPaymentOrder.setGroupType(GroupType.MUSIC);
|
|
|
- studentPaymentOrder.setType(OrderTypeEnum.APPLY);
|
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.WAIT_PAY);
|
|
|
- studentPaymentOrder.setMusicGroupId(musicGroupId);
|
|
|
- studentPaymentOrder.setClassGroupId(studentAddDto.getSignClassId());
|
|
|
- studentPaymentOrder.setOrganId(musicGroup.getOrganId());
|
|
|
- studentPaymentOrder.setRoutingOrganId(musicGroup.getOrganId());
|
|
|
-
|
|
|
- //生成订单明细
|
|
|
- List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();
|
|
|
- if (studentPaymentOrderDetails == null) {
|
|
|
- studentPaymentOrderDetails = new ArrayList<>();
|
|
|
- }
|
|
|
- //汇总金额
|
|
|
+ MusicGroupStudentFee musicGroupStudentFee = new MusicGroupStudentFee(musicGroupId,
|
|
|
+ userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
|
|
|
+ null, studentAddDto.getTemporaryCourseFee(), null);
|
|
|
|
|
|
- BigDecimal reduce = studentPaymentOrderDetails.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if (reduce.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
- studentPaymentOrder.setActualAmount(reduce);
|
|
|
- studentPaymentOrder.setPayTime(date);
|
|
|
- }
|
|
|
- studentPaymentOrder.setExpectAmount(reduce);
|
|
|
- studentPaymentOrderService.insert(studentPaymentOrder);
|
|
|
+ /*if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() * 100 == 0) {
|
|
|
+ musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
|
|
|
+ }*/
|
|
|
+ musicGroupStudentFeeDao.insert(musicGroupStudentFee);
|
|
|
|
|
|
- //当前学员是否以前存在过当前乐团
|
|
|
- if (phoneAndMusicGroupId != null) {
|
|
|
- studentRegistration.setId(phoneAndMusicGroupId.getId());
|
|
|
- studentRegistrationDao.update(studentRegistration);
|
|
|
- } else {
|
|
|
- studentRegistrationDao.insertBasic(studentRegistration);
|
|
|
- }
|
|
|
- Student student = studentDao.get(userId);
|
|
|
- student.setCurrentGradeNum(studentRegistration.getCurrentGradeNum());
|
|
|
- student.setCurrentClass(studentRegistration.getCurrentClass());
|
|
|
- studentDao.update(student);
|
|
|
- //studentRegistrationDao.updateCurrentClass(studentRegistration);
|
|
|
- imFeignService.update(new ImUserModel(userId.toString(), sysUser.getUsername(), sysUser.getAvatar()));
|
|
|
- return userId;
|
|
|
+ //当前学员是否以前存在过当前乐团
|
|
|
+ if (phoneAndMusicGroupId != null) {
|
|
|
+ studentRegistration.setId(phoneAndMusicGroupId.getId());
|
|
|
+ studentRegistrationDao.update(studentRegistration);
|
|
|
+ } else {
|
|
|
+ studentRegistrationDao.insertBasic(studentRegistration);
|
|
|
}
|
|
|
+ Student student = studentDao.get(userId);
|
|
|
+ student.setCurrentGradeNum(studentRegistration.getCurrentGradeNum());
|
|
|
+ student.setCurrentClass(studentRegistration.getCurrentClass());
|
|
|
+ studentDao.update(student);
|
|
|
+ //studentRegistrationDao.updateCurrentClass(studentRegistration);
|
|
|
+ imFeignService.update(new ImUserModel(userId.toString(), sysUser.getUsername(), sysUser.getAvatar()));
|
|
|
+
|
|
|
+ //学生报名表
|
|
|
+ Set<Integer> roleIds = new HashSet<>(1);
|
|
|
+ roleIds.add(SysUserRole.SECTION_MANAGER);
|
|
|
+ Set<Integer> integers = musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId());
|
|
|
+ integers.add(musicGroup.getEducationalTeacherId());
|
|
|
+ sysMessageService.batchSeoMessage(integers, MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_ADD_STUDENT, "", musicGroup.getName(), studentRegistration.getName());
|
|
|
+
|
|
|
+ return userId;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -914,13 +994,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
//修改原有乐团注册信息
|
|
|
studentRegistrationDao.update(studentRegistration);
|
|
|
}
|
|
|
- Boolean orderFlag = true;
|
|
|
//用户是否在主乐团
|
|
|
StudentRegistration registration = studentRegistrationDao.getStudentRegister(newMusicGroupId, studentRegistration.getUserId());
|
|
|
if (registration != null) {
|
|
|
- if (registration.getMusicGroupStatus() == StudentMusicGroupStatusEnum.NORMAL) {
|
|
|
- orderFlag = false;
|
|
|
- }
|
|
|
//修改剩余课程余额
|
|
|
Date date = new Date();
|
|
|
registration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
@@ -947,28 +1023,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
musicGroupStudentFeeDao.insert(musicGroupStudentFee);
|
|
|
}
|
|
|
}
|
|
|
- StudentPaymentOrder waitPayOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(registration.getUserId(), studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
|
|
|
-
|
|
|
- if (waitPayOrder != null) {
|
|
|
- waitPayOrder.setStatus(DealStatusEnum.CLOSE);
|
|
|
- studentPaymentOrderService.update(waitPayOrder);
|
|
|
- }
|
|
|
- if (orderFlag) {
|
|
|
- //生成订单
|
|
|
- StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
|
|
|
- studentPaymentOrder.setUserId(registration.getUserId());
|
|
|
- studentPaymentOrder.setGroupType(GroupType.MUSIC);
|
|
|
- studentPaymentOrder.setType(OrderTypeEnum.APPLY);
|
|
|
- studentPaymentOrder.setMusicGroupId(registration.getMusicGroupId());
|
|
|
- studentPaymentOrder.setClassGroupId(registration.getClassGroupId());
|
|
|
- studentPaymentOrder.setOrganId(registration.getOrganId());
|
|
|
- studentPaymentOrder.setRoutingOrganId(registration.getOrganId());
|
|
|
- studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
|
|
|
- studentPaymentOrder.setActualAmount(BigDecimal.ZERO);
|
|
|
- studentPaymentOrder.setPayTime(new Date());
|
|
|
- studentPaymentOrder.setExpectAmount(BigDecimal.ZERO);
|
|
|
- studentPaymentOrderService.insert(studentPaymentOrder);
|
|
|
- }
|
|
|
//主班新增余额日志
|
|
|
if (amount.doubleValue() != 0d && masterTotalPrice.doubleValue() > 0d) {
|
|
|
StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
|
|
@@ -1084,15 +1138,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
Date nowDate = new Date();
|
|
|
|
|
|
//成功报名状态变更
|
|
|
- StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
|
|
|
+ StudentRegistration studentRegistration = studentRegistrationDao.lockWithUserAndMusic(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
|
|
|
|
|
|
- if (studentRegistration.getPaymentStatus().equals(YES)) {
|
|
|
- return studentPaymentOrder;
|
|
|
- }
|
|
|
MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
|
|
|
|
|
|
if (studentPaymentOrder.getStatus().equals(DealStatusEnum.SUCCESS)) {
|
|
|
- MusicGroup musicGroup = musicGroupDao.getLocked(studentRegistration.getMusicGroupId());
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
|
|
|
if (studentRegistration.getTemporaryCourseFee() != null) {
|
|
|
studentRegistration.setTemporaryCourseFee(new BigDecimal(0));
|
|
@@ -1105,7 +1156,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.getOrderDetail(studentPaymentOrder.getId());
|
|
|
|
|
|
- List<StudentPaymentOrderDetail> allDetails = studentPaymentOrderDetailDao.getOrderDetailByOrderId(studentPaymentOrder.getId());
|
|
|
+ List<Long> orderIdList = new ArrayList<Long>();
|
|
|
+ orderIdList.add(studentPaymentOrder.getId());
|
|
|
+ List<StudentPaymentOrderDetail> allDetails = studentPaymentOrderDetailDao.getOrderDetailByOrderId(orderIdList);
|
|
|
BigDecimal courseFee = allDetails.stream().filter(o -> !o.getType().getCode().equals("MUSICAL"))
|
|
|
.filter(o -> !o.getType().getCode().equals("ACCESSORIES"))
|
|
|
.filter(o -> !o.getType().getCode().equals("MAINTENANCE"))
|
|
@@ -1118,9 +1171,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
List<OrderDetailTypeEnum> orderTypeList = allDetails.stream().map(t -> t.getType()).collect(Collectors.toList());
|
|
|
|
|
|
if (musicGroup.getCourseViewType() == CourseViewTypeEnum.MEMBER_FEE) {
|
|
|
- if (studentRegistration.getNoneNeedCloudTeacher() == 1 || orderTypeList.contains(OrderDetailTypeEnum.CLOUD_TEACHER)
|
|
|
+
|
|
|
+ if(studentRegistration.getNoneNeedCloudTeacher() == 1){
|
|
|
+ studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (orderTypeList.contains(OrderDetailTypeEnum.CLOUD_TEACHER)
|
|
|
|| orderTypeList.contains(OrderDetailTypeEnum.CLOUD_TEACHER_PLUS)) {
|
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
|
+ studentRegistration.setNoneNeedCloudTeacher(1);
|
|
|
+ studentRegistration.setHasCloudTeacher(1);
|
|
|
}
|
|
|
} else {
|
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
@@ -1139,18 +1199,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
studentCourseFeeDetail.setOperator(studentPaymentOrder.getUserId());
|
|
|
studentCourseFeeDetailDao.insert(studentCourseFeeDetail);
|
|
|
|
|
|
- MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(studentRegistration.getUserId(), studentRegistration.getMusicGroupId());
|
|
|
- //进行中乐团加入学生缴费
|
|
|
- if (studentRegistration.getTemporaryCourseFee() != null) {
|
|
|
- //关闭待支付订单
|
|
|
- StudentPaymentOrder waitPayOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(studentRegistration.getUserId(), studentRegistration.getMusicGroupId(), DealStatusEnum.WAIT_PAY);
|
|
|
- waitPayOrder.setStatus(DealStatusEnum.CLOSE);
|
|
|
- studentPaymentOrderService.update(waitPayOrder);
|
|
|
- musicGroupStudentFee.setLatestPaidTime(nowDate);
|
|
|
- musicGroupStudentFee.setPaymentStatus(PAID_COMPLETED);
|
|
|
- musicGroupStudentFee.setTemporaryCourseFee(BigDecimal.ZERO);
|
|
|
- musicGroupStudentFee.setUpdateTime(nowDate);
|
|
|
- }
|
|
|
//插入交易明细
|
|
|
BigDecimal amount = studentPaymentOrder.getActualAmount();
|
|
|
SysUserCashAccount cashAccount = sysUserCashAccountService.get(studentRegistration.getUserId());
|
|
@@ -1239,7 +1287,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED)) {
|
|
|
MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
studentRegistration.setPayingStatus(0);
|
|
|
- studentRegistration.setHasCloudTeacher(0);
|
|
|
studentRegistrationDao.update(studentRegistration);
|
|
|
|
|
|
//减去缴费人数(器乐收费,0元时不减缴费人数)
|
|
@@ -1280,23 +1327,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
private boolean addCalenderDetail(StudentPaymentOrder studentPaymentOrder, StudentRegistration studentRegistration) {
|
|
|
Date nowDate = new Date();
|
|
|
- MusicGroupStudentFee musicGroupStudentFee = new MusicGroupStudentFee();
|
|
|
- musicGroupStudentFee.setLatestPaidTime(nowDate);
|
|
|
- musicGroupStudentFee.setPaymentStatus(PAID_COMPLETED);
|
|
|
- musicGroupStudentFee.setUpdateTime(nowDate);
|
|
|
- musicGroupStudentFee.setContinuousAbsenteeismTimes(0);
|
|
|
- musicGroupStudentFee.setSubjectId(studentRegistration.getActualSubjectId());
|
|
|
- musicGroupStudentFee.setIsLock(0);
|
|
|
- musicGroupStudentFee.setMusicGroupId(studentRegistration.getMusicGroupId());
|
|
|
- musicGroupStudentFee.setUserId(studentRegistration.getUserId());
|
|
|
|
|
|
String currentMusicGroupId = studentRegistration.getMusicGroupId();
|
|
|
|
|
|
//缴费详情 calender detail
|
|
|
MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(currentMusicGroupId);
|
|
|
if (musicGroupRegCalender == null) {
|
|
|
- musicGroupStudentFeeDao.insert(musicGroupStudentFee);
|
|
|
- return true;
|
|
|
+ throw new BizException("报名缴费信息查询失败");
|
|
|
}
|
|
|
|
|
|
String batchNo = musicGroupRegCalender.getBatchNo();
|
|
@@ -1304,12 +1341,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
|
|
|
List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
|
|
|
|
|
|
- if (musicGroupRegCalender.getIsGiveMusicNetwork() != null && musicGroupRegCalender.getIsGiveMusicNetwork()) {
|
|
|
- //赠送网管课
|
|
|
- musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + musicGroupPaymentCalenderList.size());
|
|
|
- }
|
|
|
- musicGroupStudentFeeDao.insert(musicGroupStudentFee);
|
|
|
-
|
|
|
for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenderList) {
|
|
|
if (currentPaymentCalenderId.longValue() == musicGroupPaymentCalender.getId()) {
|
|
|
// 更新实际缴费人数
|
|
@@ -1953,6 +1984,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
studentRegistration.setPayingStatus(0);
|
|
|
+ studentRegistration.setNoneNeedCloudTeacher(1);
|
|
|
studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
|
|
|
studentRegistrationDao.update(studentRegistration);
|
|
|
StudentPaymentOrder order = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(studentRegistration.getUserId(), studentRegistration.getMusicGroupId(), DealStatusEnum.SUCCESS);
|
|
@@ -1976,4 +2008,39 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
public StudentRegistration getStudentRegister(String musicGroupId, Integer studentId) {
|
|
|
return studentRegistrationDao.getStudentRegister(musicGroupId,studentId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean setCloudTeacherToFailed(StudentRegistration studentRegistration) {
|
|
|
+
|
|
|
+ if(studentRegistration.getPayingStatus() != 2){
|
|
|
+ throw new BizException("只有'审核中'的记录才能取消审核");
|
|
|
+ }
|
|
|
+
|
|
|
+ Date date = new Date();
|
|
|
+
|
|
|
+ studentRegistration.setPayingStatus(0);
|
|
|
+ studentRegistration.setUpdateTime(date);
|
|
|
+ update(studentRegistration);
|
|
|
+
|
|
|
+ List<StudentPaymentOrder> studentPaymentOrderList = studentPaymentOrderService.queryByCondition(GroupType.MUSIC, studentRegistration.getMusicGroupId(), studentRegistration.getUserId(), DealStatusEnum.ING, OrderTypeEnum.APPLY);
|
|
|
+
|
|
|
+ List<StudentPaymentOrder> updateList = new ArrayList<StudentPaymentOrder>();
|
|
|
+
|
|
|
+ if(studentPaymentOrderList != null && studentPaymentOrderList.size() > 0){
|
|
|
+ for(StudentPaymentOrder studentPaymentOrder : studentPaymentOrderList){
|
|
|
+ if(StringUtils.equals("205", studentPaymentOrder.getPaymentAccountNo())){
|
|
|
+ studentPaymentOrder.setStatus(DealStatusEnum.CLOSE);
|
|
|
+ studentPaymentOrder.setMemo("云教练审核拒绝");
|
|
|
+ updateList.add(studentPaymentOrder);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(updateList.size() > 0){
|
|
|
+ studentPaymentOrderService.batchUpdate(updateList);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|