Joburgess há 5 anos atrás
pai
commit
8937b175a0

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

@@ -956,7 +956,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			case DISCOUNT:
 				BigDecimal discount=new BigDecimal(vipGroupActivity.getAttribute1());
 				totalPrice=onlineVipGroupCharge.add(offlineVipGroupCharge);
-				totalPrice=totalPrice.multiply(discount).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP);
+				totalPrice=totalPrice.multiply(discount).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
 				break;
 			case GIVE_CLASS:
 				if(totalClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))<0){
@@ -979,8 +979,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			default:
 				throw new BizException("活动类型错误!");
 		}
-		totalPrice=totalPrice.setScale(0,BigDecimal.ROUND_CEILING);
-		results.put("totalPrice",totalPrice);
+
+		results.put("totalPrice",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
 
 		//教师课酬线上单课酬计算
 		if(Objects.nonNull(vipGroupSalarySettlementDto.getOnlineSalarySettlement())){
@@ -1000,7 +1000,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 						results.put("onlineTeacherSalary",teacherOnlineSalary.setScale(0, BigDecimal.ROUND_HALF_UP));
 						break;
 					case RATIO_DISCOUNT:
-						results.put("onlineTeacherSalary",totalPrice.multiply(new BigDecimal(vipGroupCategory.getStudentNum())).divide(totalClassNum, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(0,BigDecimal.ROUND_HALF_UP));
+						results.put("onlineTeacherSalary",totalPrice.multiply(new BigDecimal(vipGroupCategory.getStudentNum()))
+								.divide(totalClassNum, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN)
+								.multiply(vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue())
+								.divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN)
+								.setScale(0,BigDecimal.ROUND_HALF_UP));
 
 						break;
 					case FIXED_SALARY:
@@ -1565,7 +1569,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		}
 
 		Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
-		BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseFee");
+		BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
 		if(amount.compareTo(suplusCourseFee)>0){
 			throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
 		}
@@ -1943,6 +1947,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId().intValue());
 
+		result.put("suplusCourseOriginalFee", bigDecimal);
+
 		if(vipGroupCategory.getStudentNum()<=1){
             bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
         }else{