|
@@ -7,10 +7,7 @@ import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
-import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentPayLogQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.VipClassQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.queryMusicGroupCourseScheduleQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.*;
|
|
|
import com.ym.mec.biz.service.*;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
@@ -106,6 +103,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
@Autowired
|
|
|
private SubjectDao subjectDao;
|
|
|
+ @Autowired
|
|
|
+ private GroupDao groupDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, ClassGroup> getDAO() {
|
|
@@ -2201,4 +2200,43 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
courseScheduleStudentPaymentDao.deleteByCourseSchedule(courseScheduleIds);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo endFindClassGroups(EndCourseScheduleQueryInfo queryInfo) {
|
|
|
+ PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ 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());
|
|
|
+ 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(results);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|