|
@@ -20,7 +20,9 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
+import com.ym.mec.common.constant.CommonConstants;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -60,16 +62,6 @@ 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.StudentApplyInstrumentDto;
|
|
|
-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.dto.StudentRegisterInstrumentsDetailDto;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
|
|
@@ -329,7 +321,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
}
|
|
|
|
|
|
SubjectChange studentLastChange = subjectChangeDao.getStudentLastChange(studentId, musicGroupId);
|
|
|
-
|
|
|
+
|
|
|
if (studentLastChange != null) {
|
|
|
Iterator<StudentPaymentOrderDetail> iterator = studentPaymentOrderDetailList.iterator();
|
|
|
StudentPaymentOrderDetail spod = null;
|
|
@@ -392,12 +384,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if (detailList == null) {
|
|
|
detailList = new ArrayList<StudentPaymentOrderDetail>();
|
|
|
}
|
|
|
- map.put(OrderDetailTypeEnum.MUSICAL.getCode(), detailList.stream().map(StudentPaymentOrderDetail::getPrice)
|
|
|
- .reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ BigDecimal reduce = detailList.stream().map(StudentPaymentOrderDetail::getPrice)
|
|
|
+ .reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ map.put(OrderDetailTypeEnum.MUSICAL.getCode(),reduce.multiply(new BigDecimal(0.995)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
|
|
|
} else {
|
|
|
map.put(OrderDetailTypeEnum.MUSICAL.getCode(), BigDecimal.ZERO);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (detailMap.containsKey(OrderDetailTypeEnum.MAINTENANCE)) {
|
|
|
|
|
|
BigDecimal totalAmount = BigDecimal.ZERO;
|
|
@@ -409,11 +402,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
DealStatusEnum.SUCCESS);
|
|
|
|
|
|
if (studentPaymentOrderDetailList != null && studentPaymentOrderDetailList.size() > 0) {
|
|
|
-
|
|
|
+
|
|
|
Map<Long, StudentPaymentOrderDetail> maintenanceMap = studentPaymentOrderDetailList.stream()
|
|
|
.filter(t -> (t.getType() == OrderDetailTypeEnum.MAINTENANCE))
|
|
|
.collect(Collectors.toMap(t -> t.getStudentInstrumentId(), StudentPaymentOrderDetail -> StudentPaymentOrderDetail));
|
|
|
-
|
|
|
+
|
|
|
List<Long> instrumentIdList = new ArrayList<Long>(maintenanceMap.keySet());
|
|
|
if (instrumentIdList != null && instrumentIdList.size() > 0) {
|
|
|
List<StudentInstrument> studentInstrumentList = studentInstrumentDao.queryById(instrumentIdList);
|
|
@@ -439,8 +432,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if (detailList == null) {
|
|
|
detailList = new ArrayList<StudentPaymentOrderDetail>();
|
|
|
}
|
|
|
- map.put(OrderDetailTypeEnum.ACCESSORIES.getCode(),
|
|
|
- detailList.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ BigDecimal reduce = detailList.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ map.put(OrderDetailTypeEnum.ACCESSORIES.getCode(),
|
|
|
+ reduce.multiply(new BigDecimal(0.995)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
|
|
|
} else {
|
|
|
map.put(OrderDetailTypeEnum.ACCESSORIES.getCode(), BigDecimal.ZERO);
|
|
|
}
|
|
@@ -449,7 +443,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
|
|
|
if (studentRegistration == null) {
|
|
|
throw new BizException("学生报名信息查询失败");
|
|
|
}
|
|
|
- map.put(OrderDetailTypeEnum.COURSE.getCode(), studentRegistration.getSurplusCourseFee());
|
|
|
+ //未上课*0995手续费、以上课*0.98
|
|
|
+ List<StudentCourseInfoDto> history = courseScheduleDao.findUserCourseInfos(GroupType.MUSIC, musicGroupId, studentId, "history");
|
|
|
+ if(history == null || history.size() == 0){
|
|
|
+ map.put(OrderDetailTypeEnum.COURSE.getCode(), studentRegistration.getSurplusCourseFee().multiply(new BigDecimal(0.995)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
|
|
|
+ }else {
|
|
|
+ map.put(OrderDetailTypeEnum.COURSE.getCode(), studentRegistration.getSurplusCourseFee().multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP));
|
|
|
+ }
|
|
|
|
|
|
// 查询云教练订单
|
|
|
BigDecimal cloudAmount = BigDecimal.ZERO;
|