|
@@ -1,32 +1,24 @@
|
|
|
package com.ym.mec.web.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
-import com.ym.mec.common.page.QueryInfo;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.web.dal.dao.ClassGroupDao;
|
|
|
+import com.ym.mec.web.dal.dao.TeacherDao;
|
|
|
import com.ym.mec.web.dal.dto.HighClassGroup;
|
|
|
-import com.ym.mec.web.dal.entity.ClassGroup;
|
|
|
-import com.ym.mec.web.dal.entity.ClassGroupRelation;
|
|
|
-import com.ym.mec.web.dal.entity.ClassGroupStudentMapper;
|
|
|
-import com.ym.mec.web.dal.entity.ClassGroupTeacherMapper;
|
|
|
-import com.ym.mec.web.dal.entity.MusicGroup;
|
|
|
-import com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary;
|
|
|
+import com.ym.mec.web.dal.dto.TeacherMusicClassInfoDto;
|
|
|
+import com.ym.mec.web.dal.dto.TeacherVipClassInfoDto;
|
|
|
+import com.ym.mec.web.dal.entity.*;
|
|
|
import com.ym.mec.web.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
|
|
|
-import com.ym.mec.web.service.ClassGroupRelationService;
|
|
|
-import com.ym.mec.web.service.ClassGroupService;
|
|
|
-import com.ym.mec.web.service.ClassGroupStudentMapperService;
|
|
|
-import com.ym.mec.web.service.ClassGroupTeacherMapperService;
|
|
|
-import com.ym.mec.web.service.MusicGroupService;
|
|
|
-import com.ym.mec.web.service.TeacherDefaultMusicGroupSalaryService;
|
|
|
+import com.ym.mec.web.dal.page.VipClassQueryInfo;
|
|
|
+import com.ym.mec.web.service.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup> implements ClassGroupService {
|
|
@@ -34,6 +26,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
@Autowired
|
|
|
private ClassGroupDao classGroupDao;
|
|
|
@Autowired
|
|
|
+ private TeacherDao teacherDao;
|
|
|
+ @Autowired
|
|
|
private ClassGroupRelationService classGroupRelationService;
|
|
|
@Autowired
|
|
|
private ClassGroupStudentMapperService classGroupStudentMapperService;
|
|
@@ -173,18 +167,40 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
classGroupTeacherMapper.setCreateTime(date);
|
|
|
classGroupTeacherMapper.setUpdateTime(date);
|
|
|
classGroupTeacherMapperService.insert(classGroupTeacherMapper);
|
|
|
-
|
|
|
//3、插入班级排课信息
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
return highClassGroupList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Object getTeaCourseInfos(QueryInfo queryInfo) {
|
|
|
- classGroupDao.queryGroupCourses();
|
|
|
- return null;
|
|
|
+ public List<TeacherMusicClassInfoDto> getTeacherMusicClass(Integer teacherId) {
|
|
|
+ List<TeacherMusicClassInfoDto> teacherMusicClassInfoDtos = classGroupDao.queryGroupCourses(teacherId);
|
|
|
+ Teacher teacher = teacherDao.get(teacherId);
|
|
|
+ if(teacher == null){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ teacherMusicClassInfoDtos.forEach(e->{
|
|
|
+ e.setJobNature(teacher.getJobNature());
|
|
|
+ });
|
|
|
+ return teacherMusicClassInfoDtos;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public PageInfo<TeacherVipClassInfoDto> getTeacherVipClass(VipClassQueryInfo queryInfo) {
|
|
|
+ PageInfo<TeacherVipClassInfoDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+ List<TeacherVipClassInfoDto> dataList = null;
|
|
|
+ int count = classGroupDao.countTeacherVipClass(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = classGroupDao.getTeacherVipClass(params);
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|