Browse Source

修复学生老师绑定

Eric 2 năm trước cách đây
mục cha
commit
fc6b1a4cd4

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserBindingTeacherServiceImpl.java

@@ -2,6 +2,7 @@ package com.yonge.cooleshow.biz.dal.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
 import com.yonge.cooleshow.biz.dal.dao.CourseScheduleDao;
 import com.yonge.cooleshow.biz.dal.dao.StudentDao;
 import com.yonge.cooleshow.biz.dal.dao.SubjectDao;
@@ -117,7 +118,10 @@ public class UserBindingTeacherServiceImpl extends ServiceImpl<UserBindingTeache
                 subjectIdList.add(aLong);
             }
         }
-        List<Subject> subjectList = subjectDao.findBySubjectIds(subjectIdList);
+        List<Subject> subjectList = Lists.newArrayList();
+        if (org.apache.commons.collections.CollectionUtils.isNotEmpty(subjectIdList)) {
+            subjectList.addAll(subjectDao.findBySubjectIds(subjectIdList));
+        }
         Map<Long, String> userIdSubjectMap = students.stream()
                 .filter(x -> StringUtils.isNotBlank(x.getSubjectId()))
                       .collect(Collectors.toMap(Student::getUserId,student -> subjectList.stream()