|
@@ -24,10 +24,12 @@ import com.ym.mec.im.ImFeignService;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
|
+
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -2728,9 +2730,26 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ @Async
|
|
public boolean updateHistoryTeacherSalaryOfOnline() {
|
|
public boolean updateHistoryTeacherSalaryOfOnline() {
|
|
- //查询所有含有线上课的课程组,线上课节数,实付金额
|
|
|
|
|
|
+ // 查询所有含有线上课的课程组,线上课节数,实付金额
|
|
|
|
+ List<VipCourseStudentInfoDto> list = vipGroupDao.queryVipCourseStudentInfo();
|
|
|
|
+ Map<Long, VipCourseStudentInfoDto> map = list.stream().collect(Collectors.toMap(VipCourseStudentInfoDto::getMusicGroupId, e -> e));
|
|
|
|
+
|
|
|
|
+ VipCourseStudentInfoDto dto = null;
|
|
|
|
+ // 查询需要修改的课酬记录
|
|
|
|
+ List<CourseScheduleTeacherSalary> teacherSalaryList = courseScheduleTeacherSalaryDao.queryOnlineCourseByGroupType(GroupType.VIP);
|
|
|
|
+ for (CourseScheduleTeacherSalary ts : teacherSalaryList) {
|
|
|
|
+ dto = map.get(ts.getCourseScheduleId());
|
|
|
|
+ if (dto != null) {
|
|
|
|
+ ts.setExpectSalary(dto.getTotalAmount().divide(new BigDecimal((dto.getTotalCourseTimes() / dto.getStudentNum()))));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- return false;
|
|
|
|
|
|
+ if(teacherSalaryList.size() > 0){
|
|
|
|
+ courseScheduleTeacherSalaryDao.batchUpdateTeacherExpectSalarys(teacherSalaryList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
}
|
|
}
|