|
@@ -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:
|
|
@@ -1564,6 +1568,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("请确定退费金额");
|
|
|
}
|
|
|
|
|
|
+ Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
|
|
|
+ BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseOriginalFee");
|
|
|
+ if(amount.compareTo(suplusCourseFee)>0){
|
|
|
+ throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
|
|
|
+ }
|
|
|
+
|
|
|
sysUserCashAccountService.updateBalance(studentId, amount);
|
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
|
|
|
SysUserCashAccountDetail sysUserCashAccountDetail = new SysUserCashAccountDetail();
|
|
@@ -1900,6 +1910,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
|
|
|
throw new BizException("不能对已停止的课程进行退课操作");
|
|
|
}
|
|
|
+ Map<String,BigDecimal> result=new HashMap<>();
|
|
|
Date now = new Date();
|
|
|
BigDecimal bigDecimal;
|
|
|
List<StudentCourseInfoDto> userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.VIP, vipGroupId.toString(), studentId, null);
|
|
@@ -1910,6 +1921,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}else{
|
|
|
bigDecimal=studentPaymentOrder.getActualAmount();
|
|
|
}
|
|
|
+
|
|
|
+ result.put("suplusCourseOriginalFee", bigDecimal);
|
|
|
}else if(!CollectionUtils.isEmpty(userCourseInfos)){
|
|
|
BigDecimal historyPrice=new BigDecimal(0);
|
|
|
BigDecimal allPrice=new BigDecimal(0);
|
|
@@ -1923,10 +1936,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(bigDecimal.longValue()<0){
|
|
|
bigDecimal=new BigDecimal(0);
|
|
|
}
|
|
|
+ result.put("suplusCourseOriginalFee", allPrice);
|
|
|
}else{
|
|
|
bigDecimal=new BigDecimal(0);
|
|
|
+ result.put("suplusCourseOriginalFee", bigDecimal);
|
|
|
}
|
|
|
- Map<String,BigDecimal> result=new HashMap<>();
|
|
|
ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
if(Objects.isNull(classGroup)){
|
|
|
throw new BizException("未找到对应班级");
|