3 Commits 95aaa8d7c7 ... 057eb985dd

Autore SHA1 Messaggio Data
  刘俊驰 057eb985dd fix 2 settimane fa
  刘俊驰 db0464deb5 退款 2 settimane fa
  刘俊驰 69848c24bb fix 2 settimane fa

+ 13 - 12
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseGroupServiceImpl.java

@@ -1560,6 +1560,9 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
                             .set(CourseSchedule::getStatus, CourseScheduleEnum.CANCEL.getCode())
                     );
 
+                    //退款
+                    this.refund(courseGroup);
+
                     // 小组课成课推送
                     if (courseGroup.getType().equals(CourseScheduleEnum.GROUP.getCode())) {
 
@@ -1573,8 +1576,6 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
                         this.sendStudentMessage(userIds, courseGroup);
                     }
 
-                    //退款
-                    this.refund(courseGroup);
                 }
                 courseGroup.setUpdatedTime(new Date());
                 this.updateById(courseGroup);
@@ -1598,17 +1599,17 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
         }
 
 
-        List<CourseScheduleStudentPayment> list = courseScheduleStudentPaymentService.list(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
-                .eq(CourseScheduleStudentPayment::getCourseGroupId, courseGroup.getId()));
-        Set<Long> userIds = list.stream().map(CourseScheduleStudentPayment::getUserId).collect(Collectors.toSet());
-        // 学生
-        Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> mapByIds = sysUserService.getMapByIds((List<Long>) userIds);
-
-        Map<Long, String> receivers = new HashMap<>();
-        for (com.yonge.cooleshow.biz.dal.entity.SysUser value : mapByIds.values()) {
-            receivers.put(value.getId(), value.getPhone());
-        }
         try {
+            List<CourseScheduleStudentPayment> list = courseScheduleStudentPaymentService.list(Wrappers.<CourseScheduleStudentPayment>lambdaQuery()
+                    .eq(CourseScheduleStudentPayment::getCourseGroupId, courseGroup.getId()));
+            Set<Long> userIds = list.stream().map(CourseScheduleStudentPayment::getUserId).collect(Collectors.toSet());
+            // 学生
+            Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> mapByIds = sysUserService.getMapByIds(new ArrayList<>( userIds));
+
+            Map<Long, String> receivers = new HashMap<>();
+            for (com.yonge.cooleshow.biz.dal.entity.SysUser value : mapByIds.values()) {
+                receivers.put(value.getId(), value.getPhone());
+            }
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, success?MessageTypeEnum.GROUP_SUCCESS_STUDENT:MessageTypeEnum.GROUP_FAIL_STUDENT,
                     receivers, null, 0, null, ClientEnum.STUDENT.getCode(), courseGroup.getName());
         } catch (Exception e) {