|
@@ -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;
|
|
|
}
|
|
|
|