zouxuan 5 years ago
parent
commit
0c0d9dd83b

+ 8 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -24,6 +24,7 @@ import com.ym.mec.im.ImFeignService;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import io.swagger.models.auth.In;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -45,6 +46,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
     @Autowired
     private SubjectDao subjectDao;
     @Autowired
+    private OrganizationDao organizationDao;
+    @Autowired
     private TeacherService teacherService;
     @Autowired
     private EmployeeDao employeeDao;
@@ -1353,6 +1356,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             dataList = practiceGroupDao.findAllByOrgan(params);
             if(dataList != null && dataList.size() > 0){
                 List<Integer> subjectIds = dataList.stream().map(practiceGroup -> practiceGroup.getSubjectId()).distinct().collect(Collectors.toList());
+                List<Integer> organIds = dataList.stream().map(practiceGroup -> practiceGroup.getOrganId()).distinct().collect(Collectors.toList());
                 List<String> practiceGroupIds = dataList.stream().map(e -> String.valueOf(e.getId())).distinct().collect(Collectors.toList());
 
                 List<ClassGroup> classGroupsByVipGroups = classGroupDao
@@ -1364,10 +1368,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 Map<String,Long> totalClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalCourseScheduleNum(practiceGroupIds,GroupType.PRACTICE.getCode()));
                 Map<String,Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(practiceGroupIds,GroupType.PRACTICE.getCode()));
                 //声部名称列表
-                List<Map<Long, String>> subjectNames = subjectDao.findBySubjecIds(StringUtils.join(subjectIds, ","));
-                Map<Long, String> map = MapUtil.convertMybatisMap(subjectNames);
+                Map<Long, String> subjectNames = MapUtil.convertMybatisMap(subjectDao.findBySubjecIds(StringUtils.join(subjectIds, ",")));
+                Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds, ",")));
                 dataList.forEach(e -> {
-                    e.setSubjectName(map.get(e.getSubjectId().intValue()));
+                    e.setSubjectName(subjectNames.get(e.getSubjectId().intValue()));
+                    e.setOrganName(organNames.get(e.getOrganName()));
                     ClassGroup classGroup = vipGroupClassGroupMap.get(e.getId().toString());
                     if(Objects.nonNull(classGroup)){
                         e.setStudentNum(classGroup.getStudentNum());

+ 0 - 1
mec-im/src/main/java/com/ym/job/ScheduleManager.java

@@ -88,7 +88,6 @@ public class ScheduleManager implements SchedulingConfigurer {
                 ScheduledTask task = roomCacheTasks.remove(roomId);
                 task.cancel();
                 roomService.destroyRoom(roomId);
-
             }
         }, roomProperties.getRoomTtl() * 10, roomProperties.getRoomTtl(), null));
         roomCacheTasks.put(roomId, task);