|
@@ -22,6 +22,7 @@ import java.util.stream.Collectors;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
|
+import com.ym.mec.biz.service.*;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -49,27 +50,6 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
|
|
import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
|
|
import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
|
|
import com.ym.mec.biz.event.source.GroupEventSource;
|
|
import com.ym.mec.biz.event.source.GroupEventSource;
|
|
-import com.ym.mec.biz.service.ClassGroupService;
|
|
|
|
-import com.ym.mec.biz.service.ClassGroupStudentMapperService;
|
|
|
|
-import com.ym.mec.biz.service.ContractService;
|
|
|
|
-import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
|
|
|
|
-import com.ym.mec.biz.service.GoodsService;
|
|
|
|
-import com.ym.mec.biz.service.ImGroupMemberService;
|
|
|
|
-import com.ym.mec.biz.service.ImGroupService;
|
|
|
|
-import com.ym.mec.biz.service.ImUserFriendService;
|
|
|
|
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
|
|
|
|
-import com.ym.mec.biz.service.MusicGroupService;
|
|
|
|
-import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
|
|
|
|
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
|
|
|
|
-import com.ym.mec.biz.service.PayService;
|
|
|
|
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
|
|
|
|
-import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
|
|
-import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
|
|
|
|
-import com.ym.mec.biz.service.StudentRegistrationService;
|
|
|
|
-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.dal.BaseDAO;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
import com.ym.mec.common.entity.ImGroupMember;
|
|
import com.ym.mec.common.entity.ImGroupMember;
|
|
@@ -237,7 +217,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
private StudentInstrumentDao studentInstrumentDao;
|
|
private StudentInstrumentDao studentInstrumentDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private CloudTeacherOrderDao cloudTeacherOrderDao;
|
|
|
|
|
|
+ private CloudTeacherOrderService cloudTeacherOrderService;
|
|
|
|
|
|
private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
|
|
private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
@@ -861,6 +841,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
orderAmount = orderAmount.add(maintenancePrice);
|
|
orderAmount = orderAmount.add(maintenancePrice);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
|
+ studentRegistration.setOrganId(musicGroup.getOrganId());
|
|
//云教练
|
|
//云教练
|
|
if (registerPayDto.getBuyCloudTeacher()) {
|
|
if (registerPayDto.getBuyCloudTeacher()) {
|
|
OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
|
|
OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
|
|
@@ -885,7 +867,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
|
|
|
|
BigDecimal balance = BigDecimal.ZERO;
|
|
BigDecimal balance = BigDecimal.ZERO;
|
|
- MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
|
|
|
|
if (registerPayDto.getIsUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
|
|
if (registerPayDto.getIsUseBalancePayment() && amount.compareTo(BigDecimal.ZERO) > 0) {
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.get(userId);
|
|
SysUserCashAccount userCashAccount = sysUserCashAccountService.get(userId);
|
|
if (userCashAccount == null) {
|
|
if (userCashAccount == null) {
|
|
@@ -2071,19 +2052,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
|
|
//退云教练费用
|
|
//退云教练费用
|
|
if (cloudTeacherAmount != null) {
|
|
if (cloudTeacherAmount != null) {
|
|
Date nowDate = new Date();
|
|
Date nowDate = new Date();
|
|
- CloudTeacherOrder studentCloudTeacherOrder = cloudTeacherOrderDao.getStudentCloudTeacherOrder(userId, musicGroupId);
|
|
|
|
|
|
+ CloudTeacherOrder studentCloudTeacherOrder = cloudTeacherOrderService.getStudentCloudTeacherOrder(userId, musicGroupId);
|
|
if (cloudTeacherAmount.compareTo(BigDecimal.ZERO) > 0) {
|
|
if (cloudTeacherAmount.compareTo(BigDecimal.ZERO) > 0) {
|
|
- if (studentCloudTeacherOrder == null || studentCloudTeacherOrder.getEndTime().compareTo(nowDate) <= 0) {
|
|
|
|
|
|
+ if (studentCloudTeacherOrder == null || (studentCloudTeacherOrder.getEndTime() != null && studentCloudTeacherOrder.getEndTime().compareTo(nowDate) <= 0)) {
|
|
throw new BizException("学生云教练已过有效期,不能退费");
|
|
throw new BizException("学生云教练已过有效期,不能退费");
|
|
}
|
|
}
|
|
if (cloudTeacherAmount.compareTo(studentCloudTeacherOrder.getAmount()) > 0) {
|
|
if (cloudTeacherAmount.compareTo(studentCloudTeacherOrder.getAmount()) > 0) {
|
|
- throw new BizException("退费金额不能大于原始订单金额");
|
|
|
|
|
|
+ throw new BizException("云教练退费金额不能大于原始订单金额");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
amount = amount.add(cloudTeacherAmount);
|
|
amount = amount.add(cloudTeacherAmount);
|
|
if (studentCloudTeacherOrder != null) {
|
|
if (studentCloudTeacherOrder != null) {
|
|
-// studentMaintenance.setDelFlag(1);
|
|
|
|
-// studentInstrumentDao.update(studentMaintenance);
|
|
|
|
|
|
+ cloudTeacherOrderService.quitCloudTeacherOrder(studentCloudTeacherOrder, cloudTeacherAmount);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|