Joburgess há 5 anos atrás
pai
commit
e3d99a1bc4

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -2360,6 +2360,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             if (Objects.isNull(newCourseSchedule.getGroupType())) {
                 newCourseSchedule.setGroupType(oldCourseSchedule.getGroupType());
             }
+
+            if(CourseStatusEnum.OVER.equals(oldCourseSchedule.getStatus())&&newCourseSchedule.getStartClassTime().compareTo(now)<0){
+            	throw new BizException("调整无效");
+			}
             
             //课程是否已结算
             int settlementNum = courseScheduleTeacherSalaryDao.checkCourseIsSettlement(oldCourseSchedule.getId().intValue());

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

@@ -1070,13 +1070,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		results.put("totalPrice",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
 
-		if(JobNatureEnum.PART_TIME.equals(teacher.getJobNature())||vipGroupCategory.getStudentNum()>1){
-			int normalStudentNum = 0;
+
+		int normalStudentNum = 0;
+		if(Objects.nonNull(vipGroup.getId())){
+			normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(GroupType.VIP, vipGroup.getId().toString());
+		}
+
+		if(JobNatureEnum.PART_TIME.equals(teacher.getJobNature())){
 			BigDecimal ots = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 			BigDecimal ofts = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
-			if(Objects.nonNull(vipGroup.getId())){
-				normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(GroupType.VIP, vipGroup.getId().toString());
-			}
 			if(normalStudentNum>0&&normalStudentNum!=vipGroupCategory.getStudentNum()){
 				ots = ots.divide(new BigDecimal(vipGroupCategory.getStudentNum()),CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
 				ofts = ofts.divide(new BigDecimal(vipGroupCategory.getStudentNum()),CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
@@ -1146,6 +1148,16 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			}
 		}
 
+		BigDecimal ots = results.get("onlineTeacherSalary");
+		BigDecimal ofts = results.get("offlineTeacherSalary");
+		if(normalStudentNum>0&&normalStudentNum!=vipGroupCategory.getStudentNum()){
+			ots = ots.divide(new BigDecimal(vipGroupCategory.getStudentNum()),CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+			ofts = ofts.divide(new BigDecimal(vipGroupCategory.getStudentNum()),CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(normalStudentNum)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+		}
+
+		results.put("onlineTeacherSalary", ots);
+		results.put("offlineTeacherSalary", ofts);
+
         return results;
     }