|
@@ -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_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
|
|
|
+ totalPrice=totalPrice.multiply(discount).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(CommonConstants.DECIMAL_FINAL_PLACE,BigDecimal.ROUND_HALF_UP);
|
|
|
break;
|
|
|
case GIVE_CLASS:
|
|
|
if(totalClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))<0){
|
|
@@ -1564,6 +1564,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("请确定退费金额");
|
|
|
}
|
|
|
|
|
|
+ Map<String, BigDecimal> studentSurplusCourseFee = getStudentSurplusCourseFee(vipGroupId, studentId);
|
|
|
+ BigDecimal suplusCourseFee = studentSurplusCourseFee.get("suplusCourseFee");
|
|
|
+ if(suplusCourseFee.compareTo(amount)>0){
|
|
|
+ throw new BizException("学员最大可退费金额为{}元", suplusCourseFee.toString());
|
|
|
+ }
|
|
|
+
|
|
|
sysUserCashAccountService.updateBalance(studentId, amount);
|
|
|
SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentId);
|
|
|
SysUserCashAccountDetail sysUserCashAccountDetail = new SysUserCashAccountDetail();
|