|
@@ -646,27 +646,22 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher> implem
|
|
|
PageInfo<Teacher> pageInfo = queryPage(queryInfo);
|
|
|
List<Teacher> rows = pageInfo.getRows();
|
|
|
if (rows != null && rows.size() > 0) {
|
|
|
- if(rows.size() < 30){
|
|
|
- Set<Integer> teachers = rows.stream().map(e -> e.getId()).collect(Collectors.toSet());
|
|
|
- String teacherIds = StringUtils.join(teachers, ",");
|
|
|
- //获取小课数量
|
|
|
- Map<Integer, Integer> vipNumMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countTeacherVipNum(teacherIds))), HashMap.class);
|
|
|
- //获取试听课数量
|
|
|
- Map<Integer, Integer> demoNumMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(demoGroupDao.countTeacherDemoGroupNum(teacherIds))), HashMap.class);
|
|
|
-
|
|
|
- Set<Integer> organIds = rows.stream().map(e -> e.getTeacherOrganId()).collect(Collectors.toSet());
|
|
|
- Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMapList(organIds));
|
|
|
- for (Teacher e : rows) {
|
|
|
- e.setSubjectName(subjectDao.findBySubIds(e.getSubjectId()));
|
|
|
- e.setOrganName(organNames.get(e.getTeacherOrganId()));
|
|
|
- if (StringUtils.isNotEmpty(e.getSplitSubjectName())) {
|
|
|
- e.setSubjectName(Arrays.asList(e.getSplitSubjectName().split(",")));
|
|
|
- }
|
|
|
- Integer num = vipNumMap.get(e.getId());
|
|
|
- e.setVipNum(num == null ? 0 : num);
|
|
|
- Integer demoNum = demoNumMap.get(e.getId());
|
|
|
- e.setDemoNum(demoNum == null ? 0 : demoNum);
|
|
|
+ Set<Integer> teachers = rows.stream().map(e -> e.getId()).collect(Collectors.toSet());
|
|
|
+ //获取小课数量
|
|
|
+ Map<Integer, Integer> vipNumMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countTeacherVipNum(teachers))), HashMap.class);
|
|
|
+ //获取试听课数量
|
|
|
+ Map<Integer, Integer> demoNumMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(demoGroupDao.countTeacherDemoGroupNum(teachers))), HashMap.class);
|
|
|
+
|
|
|
+ Map<Integer, String> organNames = getMap("organization", "id_", "name_", false, 1, Integer.class, String.class);
|
|
|
+ for (Teacher e : rows) {
|
|
|
+ e.setOrganName(organNames.get(e.getTeacherOrganId()));
|
|
|
+ if (StringUtils.isNotEmpty(e.getSplitSubjectName())) {
|
|
|
+ e.setSubjectName(Arrays.asList(e.getSplitSubjectName().split(",")));
|
|
|
}
|
|
|
+ Integer num = vipNumMap.get(e.getId());
|
|
|
+ e.setVipNum(num == null ? 0 : num);
|
|
|
+ Integer demoNum = demoNumMap.get(e.getId());
|
|
|
+ e.setDemoNum(demoNum == null ? 0 : demoNum);
|
|
|
}
|
|
|
}
|
|
|
return pageInfo;
|