Explorar el Código

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan hace 5 años
padre
commit
4f97771936

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -96,9 +96,9 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     public boolean delClassGroupStudent(Integer userId, Integer classGroupId,Boolean quitMusicGroup) {
         ClassGroup classGroup = classGroupService.get(classGroupId);
         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupId);
-        if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
+        /*if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
             throw new BizException(classGroup.getName()+"(网络基础训练课班级)人数不能少于3,请调整");
-        }
+        }*/
 
         ClassGroupStudentMapper classStudentMapper = findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, "NORMAL");
         if (classStudentMapper == null) {

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -148,6 +148,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 					}
 				}
                 courseScheduleStudentPayment.setOriginalPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice());
+				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
 			}
 		}

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java

@@ -715,6 +715,8 @@ public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup>
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(order.getUserId());
             courseScheduleStudentPayment.setExpectPrice(singleCoursePrice);
+            courseScheduleStudentPayment.setOriginalPrice(singleCoursePrice);
+            courseScheduleStudentPayment.setActualPrice(singleCoursePrice);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayments.add(courseScheduleStudentPayment);
         }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -281,6 +281,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             throw new BizException("所在城市暂不参与此活动");
         }
         BigDecimal oneMonthPrice;
+        BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         if(practiceBuyActivityExpireDate.after(now)){
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceActivityPrice():practiceGroupSellPrice.getTwiceActivityPrice();
             if(!now.before(practicePromotionActivityStartDate)&&practiceGroupBuyParams.getBuyMonths()>=3&&studentExitChargePractices>0){
@@ -291,6 +292,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }else{
             oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
         }
+        BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&studentExitChargePractices<=0){
             amount= oneMonthPrice.multiply(new BigDecimal(1));
@@ -377,6 +379,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             teacherDefaultSalary=teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
         }
         BigDecimal studentSingleCourseCost=amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
@@ -398,6 +401,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
@@ -1078,6 +1083,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setActualPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setOriginalPrice(BigDecimal.ZERO);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OnlineMusicGroupServiceImpl.java

@@ -222,6 +222,8 @@ public class OnlineMusicGroupServiceImpl implements OnlineMusicGroupService {
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(onlineMusicGroupCourseInfo.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -2003,6 +2003,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroup.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setActualPrice(BigDecimal.ZERO);
+            courseScheduleStudentPayment.setOriginalPrice(BigDecimal.ZERO);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);
@@ -2992,6 +2994,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             teacherDefaultSalary = teacherDefaultPracticeGroupSalary.getMainTeacherSalary();
         }
         BigDecimal studentSingleCourseCost = amount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+
+        BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
+        BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
+        BigDecimal studentSingleCourseOriginalCost=originalAmount.divide(new BigDecimal(practiceCourses.size()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+
         for (CourseSchedule courseSchedule : practiceCourses) {
             //课程与老师薪水表
             CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
@@ -3013,6 +3020,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
             courseScheduleStudentPayment.setUserId(practiceGroupBuyParams.getStudentId());
             courseScheduleStudentPayment.setExpectPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setActualPrice(studentSingleCourseCost);
+            courseScheduleStudentPayment.setOriginalPrice(studentSingleCourseOriginalCost);
             courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
             courseScheduleStudentPayment.setCreateTime(now);
             courseScheduleStudentPayment.setUpdateTime(now);

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1955,6 +1955,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			courseScheduleStudentPayment.setCourseScheduleId(surplusCourseWithGroup.get(i).getId());
 			courseScheduleStudentPayment.setUserId(studentRecoverInfo.getUserId());
 			courseScheduleStudentPayment.setExpectPrice(coursePrices.get(i));
+			courseScheduleStudentPayment.setActualPrice(coursePrices.get(i));
+			courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(surplusCourseWithGroup.get(i))?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
 			courseScheduleStudentPayment.setCreateTime(now);
 			courseScheduleStudentPayment.setUpdateTime(now);
 			courseScheduleStudentPayment.setClassGroupId(classGroup.getId());
@@ -2836,8 +2838,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				courseScheduleStudentPayment.setUserId(studentId);
                 if(vipGroupCourseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)){
 					courseScheduleStudentPayment.setExpectPrice(vipGroup.getOfflineClassesUnitPrice());
+					courseScheduleStudentPayment.setOriginalPrice(vipGroup.getOfflineClassesUnitPrice());
                 }else if(vipGroupCourseSchedule.getTeachMode().equals(TeachModeEnum.ONLINE)){
 					courseScheduleStudentPayment.setExpectPrice(vipGroup.getOnlineClassesUnitPrice());
+					courseScheduleStudentPayment.setOriginalPrice(vipGroup.getOnlineClassesUnitPrice());
                 }
 				if(hasGiveClass
 						&&vipGroup.getGiveTeachMode() == vipGroupCourseSchedule.getTeachMode()){
@@ -2853,6 +2857,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				if(Objects.nonNull(discount)){
                     courseScheduleStudentPayment.setExpectPrice(courseScheduleStudentPayment.getExpectPrice().multiply(discount).setScale(CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP));
                 }
+				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
 				courseScheduleStudentPayment.setCreateTime(now);
 				courseScheduleStudentPayment.setUpdateTime(now);
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);