|
@@ -2,8 +2,7 @@ package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
import static com.ym.mec.biz.dal.enums.GroupType.VIP;
|
|
|
import static com.ym.mec.biz.dal.enums.SysUserRoleEnum.ORGAN_MANAGER;
|
|
|
-import static java.math.BigDecimal.ROUND_DOWN;
|
|
|
-import static java.math.BigDecimal.ZERO;
|
|
|
+import static java.math.BigDecimal.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
@@ -1966,6 +1965,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
VipGroupSalarySettlementTypeDto vipOfflineSalarySettlement = null;
|
|
|
VipGroupSalarySettlementTypeDto giveVipOfflineSalarySettlement = null;
|
|
|
+ BigDecimal onlineClassesUnitPrice = vipGroup.getOnlineClassesUnitPrice();
|
|
|
+ if (Objects.isNull(onlineClassesUnitPrice)) {
|
|
|
+ throw new BizException("课程单价异常");
|
|
|
+ }
|
|
|
+ BigDecimal offlineClassesUnitPrice = vipGroup.getOfflineClassesUnitPrice();
|
|
|
+ if (Objects.isNull(offlineClassesUnitPrice)) {
|
|
|
+ throw new BizException("课程单价异常");
|
|
|
+ }
|
|
|
BigDecimal discount = new BigDecimal(100);
|
|
|
if (vipGroup.getVipGroupActivityId() != null) {
|
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
|
|
@@ -1976,6 +1983,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
vipOfflineSalarySettlement = vipGroupSalarySettlementDto.getOfflineSalarySettlement();
|
|
|
giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
|
|
|
+ onlineClassesUnitPrice = onlineClassesUnitPrice.multiply(discount).divide(new BigDecimal(100), 0, ROUND_UP);
|
|
|
+ offlineClassesUnitPrice = offlineClassesUnitPrice.multiply(discount).divide(new BigDecimal(100), 0, ROUND_UP);
|
|
|
|
|
|
//是否是赠送课程
|
|
|
ActivityUserMapper activityUserMapper = activityUserMapperService.findVipUserMapper(vipGroup.getId(), "VIP", null);
|
|
@@ -1991,16 +2000,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
BigDecimal offlineClassNum = new BigDecimal(vipGroup.getOfflineClassesNum());
|
|
|
BigDecimal onlineClassNum = new BigDecimal(vipGroup.getOnlineClassesNum());
|
|
|
- BigDecimal onlineClassesUnitPrice = vipGroup.getOnlineClassesUnitPrice();
|
|
|
- if (Objects.isNull(onlineClassesUnitPrice)) {
|
|
|
- throw new BizException("课程单价异常");
|
|
|
- }
|
|
|
BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
|
|
|
|
|
|
- BigDecimal offlineClassesUnitPrice = vipGroup.getOfflineClassesUnitPrice();
|
|
|
- if (Objects.isNull(offlineClassesUnitPrice)) {
|
|
|
- throw new BizException("课程单价异常");
|
|
|
- }
|
|
|
BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
|
|
|
BigDecimal teacherOfflineSalary = BigDecimal.ZERO;
|
|
|
BigDecimal giveTeacherOfflineSalary = BigDecimal.ZERO;
|
|
@@ -2094,6 +2095,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
VipGroupSalarySettlementTypeDto vipOfflineSalarySettlement = null;
|
|
|
VipGroupSalarySettlementTypeDto giveVipOfflineSalarySettlement = null;
|
|
|
+ BigDecimal onlineClassesUnitPrice = vipGroup.getOnlineClassesUnitPrice();
|
|
|
+ if (Objects.isNull(onlineClassesUnitPrice)) {
|
|
|
+ throw new BizException("课程单价异常");
|
|
|
+ }
|
|
|
+ BigDecimal offlineClassesUnitPrice = vipGroup.getOfflineClassesUnitPrice();
|
|
|
+ if (Objects.isNull(offlineClassesUnitPrice)) {
|
|
|
+ throw new BizException("课程单价异常");
|
|
|
+ }
|
|
|
BigDecimal discount = new BigDecimal(100);
|
|
|
if (vipGroup.getVipGroupActivityId() != null) {
|
|
|
VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId());
|
|
@@ -2104,20 +2113,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
vipOfflineSalarySettlement = vipGroupSalarySettlementDto.getOfflineSalarySettlement();
|
|
|
giveVipOfflineSalarySettlement = vipGroupSalarySettlementDto.getGiveVipOfflineSalarySettlement();
|
|
|
+ onlineClassesUnitPrice = onlineClassesUnitPrice.multiply(discount).divide(new BigDecimal(100), 0, ROUND_UP);
|
|
|
+ offlineClassesUnitPrice = offlineClassesUnitPrice.multiply(discount).divide(new BigDecimal(100), 0, ROUND_UP);
|
|
|
}
|
|
|
|
|
|
BigDecimal offlineClassNum = new BigDecimal(vipGroup.getOfflineClassesNum());
|
|
|
BigDecimal onlineClassNum = new BigDecimal(vipGroup.getOnlineClassesNum());
|
|
|
- BigDecimal onlineClassesUnitPrice = vipGroup.getOnlineClassesUnitPrice();
|
|
|
- if (Objects.isNull(onlineClassesUnitPrice)) {
|
|
|
- throw new BizException("课程单价异常");
|
|
|
- }
|
|
|
BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
|
|
|
|
|
|
- BigDecimal offlineClassesUnitPrice = vipGroup.getOfflineClassesUnitPrice();
|
|
|
- if (Objects.isNull(offlineClassesUnitPrice)) {
|
|
|
- throw new BizException("课程单价异常");
|
|
|
- }
|
|
|
BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
|
|
|
BigDecimal teacherOfflineSalary = BigDecimal.ZERO;
|
|
|
BigDecimal giveTeacherOfflineSalary = BigDecimal.ZERO;
|