|
@@ -19,6 +19,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -74,7 +75,7 @@ public class GroupClassServiceImpl implements GroupClassService {
|
|
|
@Autowired
|
|
|
private VipGroupCategoryDao vipGroupCategoryDao;
|
|
|
@Autowired
|
|
|
- private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
|
|
|
+ private VipGroupService vipGroupService;
|
|
|
@Autowired
|
|
|
private ImGroupMemberService imGroupMemberService;
|
|
|
@Autowired
|
|
@@ -300,7 +301,22 @@ public class GroupClassServiceImpl implements GroupClassService {
|
|
|
VipGroupCategory giveVipGroupCategory = vipGroupCategoryDao.get(giveVipGroup.getVipGroupCategoryId());
|
|
|
|
|
|
if(!giveVipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING) || (Objects.nonNull(giveVipGroupCategory) && giveVipGroupCategory.getMusicTheory())){
|
|
|
- courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(giveVipGroupId.intValue(), giveVipGroup.getUserId());
|
|
|
+ BigDecimal offlineTeacherSalary=BigDecimal.ZERO;
|
|
|
+
|
|
|
+ List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByGroupWithNotStart(giveVipGroupId.toString(), GroupType.VIP.getCode());
|
|
|
+ if(!CollectionUtils.isEmpty(courseScheduleTeacherSalaries)){
|
|
|
+ for(int i=0;i<courseScheduleTeacherSalaries.size();i++){
|
|
|
+ if(!courseScheduleTeacherSalaries.get(i).getEnableChangeSalary()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, BigDecimal> salary = vipGroupService.countVipGroupPredictFee1(giveVipGroup, giveVipGroup.getUserId(), courseScheduleTeacherSalaries.get(i).getCourseScheduleId());
|
|
|
+ if(Objects.nonNull(salary)){
|
|
|
+ offlineTeacherSalary = salary.get("giveOfflineTeacherSalary");
|
|
|
+ }
|
|
|
+ courseScheduleTeacherSalaries.get(i).setExpectSalary(offlineTeacherSalary);
|
|
|
+ }
|
|
|
+ courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalarys(courseScheduleTeacherSalaries);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
giveClassGroup.setStudentNum(giveClassGroup.getStudentNum() - 1);
|