|
@@ -102,6 +102,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
private CourseScheduleRecordDao recordDao;
|
|
|
@Autowired
|
|
|
private ImGroupService imGroupService;
|
|
|
+ @Autowired
|
|
|
+ private ImUserFriendService imUserFriendService;
|
|
|
|
|
|
@Override
|
|
|
public CourseScheduleDao getDao() {
|
|
@@ -1027,6 +1029,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
BigDecimal practiceServiceRate = new BigDecimal(practiceServiceRateStr).divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP);
|
|
|
|
|
|
//写course_schedule_teacher_salary
|
|
|
+ Long teacherId = null;
|
|
|
+ Long studentId = null;
|
|
|
Date now = new Date();
|
|
|
List<CourseScheduleTeacherSalary> teacherSalaryList = new ArrayList<>();
|
|
|
for (CourseScheduleStudentPaymentVo payment : paymentList) {
|
|
@@ -1047,10 +1051,22 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
|
|
|
teacherSalary.setStatus(TeacherSalaryEnum.NOT_START.getCode());
|
|
|
teacherSalaryList.add(teacherSalary);
|
|
|
teacherSalary.setCreateTime(now);
|
|
|
+
|
|
|
+ teacherId=payment.getTeacherId();
|
|
|
+ studentId=payment.getUserId();
|
|
|
}
|
|
|
courseScheduleTeacherSalaryService.getDao().insertBatch(teacherSalaryList);
|
|
|
log.info("buyPracticeCourseSuccess ok");
|
|
|
|
|
|
+ Set<Long> studentIds=new HashSet();
|
|
|
+ studentIds.add(studentId);
|
|
|
+ try {
|
|
|
+ imUserFriendService.saveUserFriend(teacherId,studentIds);
|
|
|
+ log.info("保存用户通讯录成功,teacherId:{},studentIds:{}",teacherId,studentIds);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("保存用户通讯录失败,teacherId:{},studentIds:{},e:{}",teacherId,studentIds,e);
|
|
|
+ }
|
|
|
+
|
|
|
//消息推送
|
|
|
try {
|
|
|
practiceSend(paymentList.get(0).getTeacherId(), orderParam.getUserId(), paymentList.size() + "", orderNo);
|