|
@@ -21,6 +21,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.enums.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -46,24 +47,6 @@ import com.ym.mec.biz.dal.dto.SubjectRegisterDto;
|
|
|
import com.ym.mec.biz.dal.dto.UpdateExpectedNumDto;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
|
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
|
-import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.FivePlusGradeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.GoodsType;
|
|
|
-import com.ym.mec.biz.dal.enums.GradeTypeEnum;
|
|
|
-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.SixPlusGradeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
|
|
|
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
|
|
|
import com.ym.mec.biz.event.source.GroupEventSource;
|
|
|
import com.ym.mec.biz.service.ClassGroupService;
|
|
@@ -244,6 +227,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
@Autowired
|
|
|
private StudentPreRegistrationDao studentPreRegistrationDao;
|
|
|
+ @Autowired
|
|
|
+ private OrganizationCloudTeacherFeeDao organizationCloudTeacherFeeDao;
|
|
|
|
|
|
@Autowired
|
|
|
private GroupEventSource groupEventSource;
|
|
@@ -714,6 +699,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
orderAmount = orderAmount.add(maintenancePrice);
|
|
|
}
|
|
|
|
|
|
+ //云教练
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
+ studentRegistration.setOrganId(musicGroup.getOrganId());
|
|
|
+ if(registerPayDto.getBuyCloudTeacher()){
|
|
|
+ OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
|
|
|
+ BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
|
|
|
+ orderAmount = orderAmount.add(cloudTeacherPrice);
|
|
|
+ }
|
|
|
+
|
|
|
if (amount.compareTo(orderAmount) != 0) {
|
|
|
throw new BizException("商品价格不符");
|
|
|
}
|
|
@@ -725,12 +719,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
String channelType = "";
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance());
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance(), registerPayDto.getBuyCloudTeacher());
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
|
|
|
Date date = new Date();
|
|
|
BigDecimal balance = BigDecimal.ZERO;
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
if (registerPayDto.getIsUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
|
|
|
if (userCashAccount == null) {
|
|
@@ -865,6 +858,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
orderAmount = orderAmount.add(maintenancePrice);
|
|
|
}
|
|
|
|
|
|
+ //云教练
|
|
|
+ if(registerPayDto.getBuyCloudTeacher()){
|
|
|
+ OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
|
|
|
+ BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
|
|
|
+ orderAmount = orderAmount.add(cloudTeacherPrice);
|
|
|
+ }
|
|
|
+
|
|
|
if (amount.compareTo(orderAmount) != 0) {
|
|
|
throw new BizException("商品价格不符");
|
|
|
}
|
|
@@ -877,7 +877,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
String channelType = "";
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, studentRegistration.getMusicGroupId(), ApplyOrder, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance());
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentRegistrationService.reAddOrder(userId, amount, orderNo, channelType, courseFee, goodsGroups, studentRegistration.getMusicGroupId(), ApplyOrder, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance(), registerPayDto.getBuyCloudTeacher());
|
|
|
studentPaymentOrder.setVersion(0);
|
|
|
Date date = new Date();
|
|
|
|
|
@@ -1783,9 +1783,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
BigDecimal amount = new BigDecimal(0);
|
|
|
|
|
|
- // 判断乐器是否是租赁
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
+ BigDecimal orderExpectAmount = studentPaymentOrder == null ? BigDecimal.ZERO : studentPaymentOrder.getExpectAmount();
|
|
|
+
|
|
|
+ // 缴费人数更新
|
|
|
MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
|
|
|
- if (musicGroupSubjectPlan != null) {
|
|
|
+ if (musicGroupSubjectPlan != null && (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.COURSE_lIST) || orderExpectAmount.compareTo(BigDecimal.ZERO) > 0)) {
|
|
|
musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
@@ -1805,8 +1808,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount = amount.add(surplusCourseFee);
|
|
|
}
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
-
|
|
|
if (studentPaymentOrder != null) {
|
|
|
List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
|
|
|
|
|
@@ -1987,9 +1988,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
|
|
|
BigDecimal amount = new BigDecimal(0);
|
|
|
|
|
|
+ StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
+ BigDecimal orderExpectAmount = studentPaymentOrder == null ? BigDecimal.ZERO : studentPaymentOrder.getExpectAmount();
|
|
|
+
|
|
|
// 判断乐器是否是租赁
|
|
|
MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, studentRegistration.getActualSubjectId());
|
|
|
- if (musicGroupSubjectPlan != null) {
|
|
|
+ if (musicGroupSubjectPlan != null && (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.COURSE_lIST) || orderExpectAmount.compareTo(BigDecimal.ZERO) > 0)) {
|
|
|
musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
|
|
|
musicGroupSubjectPlan.setUpdateTime(date);
|
|
|
musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
|
|
@@ -2009,8 +2013,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
|
amount = amount.add(surplusCourseFee);
|
|
|
}
|
|
|
|
|
|
- StudentPaymentOrder studentPaymentOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, musicGroupId, SUCCESS);
|
|
|
-
|
|
|
if (studentPaymentOrder != null) {
|
|
|
List<StudentPaymentOrderDetail> orderDetailList = studentPaymentOrderDetailDao.findApplyOrderGoods(studentPaymentOrder.getId());
|
|
|
|