|
@@ -92,6 +92,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
private MusicGroupService musicGroupService;
|
|
|
@Autowired
|
|
|
private SysConfigService sysConfigService;
|
|
|
+ @Autowired
|
|
|
+ private GroupDao groupDao;
|
|
|
|
|
|
private final Logger LOGGER = LoggerFactory
|
|
|
.getLogger(this.getClass());
|
|
@@ -1278,8 +1280,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
classStartDateAdjust(newCourseSchedules);
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void classStartDateAdjust(List<CourseSchedule> newCourseSchedules) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
List<Long> newCourseScheduleIds = newCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
@@ -2086,14 +2088,36 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
|
|
|
- List<CourseScheduleEndDto> result = new ArrayList<>();
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getSearch())){
|
|
|
+ List<Group> groups = groupDao.searchGroups(queryInfo.getSearch());
|
|
|
+ if(!CollectionUtils.isEmpty(groups)){
|
|
|
+ params.put("groups", groups);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<CourseScheduleEndDto> results = new ArrayList<>();
|
|
|
int count = courseScheduleDao.endCountCourseSchedules(params);
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
- result = courseScheduleDao.endFindCourseSchedules(params);
|
|
|
+ results = courseScheduleDao.endFindCourseSchedules(params);
|
|
|
+ List<Group> groups=new ArrayList<>();
|
|
|
+ groups.add(null);
|
|
|
+ for (CourseScheduleEndDto courseScheduleEndDto : results) {
|
|
|
+ Group group=new Group(courseScheduleEndDto.getMusicGroupId(),courseScheduleEndDto.getGroupType());
|
|
|
+ groups.add(group);
|
|
|
+ }
|
|
|
+ groups = groupDao.findByGroupIds(groups);
|
|
|
+ Map<String, Map<GroupType, List<Group>>> groupsGroupByGroup = groups.stream().collect(Collectors.groupingBy(Group::getId, Collectors.groupingBy(Group::getGroupType)));
|
|
|
+ results.forEach(result -> {
|
|
|
+ List<Group> groupTemps = groupsGroupByGroup.get(result.getMusicGroupId())
|
|
|
+ .get(result.getGroupType());
|
|
|
+ if(!CollectionUtils.isEmpty(groupTemps)){
|
|
|
+ result.setGroupName(groupTemps.get(0).getGroupName());
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- pageInfo.setRows(result);
|
|
|
+ pageInfo.setRows(results);
|
|
|
return pageInfo;
|
|
|
}
|
|
|
}
|