zy 7 miesięcy temu
rodzic
commit
1fc73d0912

+ 4 - 0
bus-biz/src/main/java/bus/service/impl/BCoursePreServiceImpl.java

@@ -113,9 +113,13 @@ public class BCoursePreServiceImpl extends ServiceImpl<BCoursePreMapper, BCourse
     public List<BUserPreDetailDto> getPreUserByCourse(String courseId, String preId) {
         List<BUserPreDetailDto> ss = new ArrayList<>();
         QueryWrapper<BUserPrePo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("distinct user_id");
         queryWrapper.eq("pre_id",preId);
         queryWrapper.eq("course_id",courseId);
         List<BUserPrePo> list = bUserPreMapper.selectList(queryWrapper);
+        if(CollectionUtil.isEmpty(list)){
+         return CollectionUtil.newArrayList();
+        }
         List<String> userIdList = list.stream().map(BUserPrePo::getUserId).collect(Collectors.toList());
 
         QueryWrapper<WChatUserPo> queryWrapper1 = new QueryWrapper<>();