|
@@ -4,8 +4,12 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
|
|
|
+import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.*;
|
|
|
import com.ym.mec.biz.service.StudentManageService;
|
|
@@ -33,12 +37,16 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
@Autowired
|
|
|
private StudentManageDao studentManageDao;
|
|
|
@Autowired
|
|
|
+ private OrganizationDao organizationDao;
|
|
|
+ @Autowired
|
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
|
@Autowired
|
|
|
private CourseScheduleStudentPaymentDao scheduleStudentPaymentDao;
|
|
|
@Autowired
|
|
|
private TeacherDao teacherDao;
|
|
|
@Autowired
|
|
|
+ private MusicGroupDao musicGroupDao;
|
|
|
+ @Autowired
|
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
|
@Autowired
|
|
|
private ImFeignService imFeignService;
|
|
@@ -54,7 +62,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
private SysUserCashAccountDao sysUserCashAccountDao;
|
|
|
|
|
|
@Override
|
|
|
- public PageInfo findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
|
|
|
+ public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
|
|
|
PageInfo<StudentManageListDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Boolean hasCourse = queryInfo.getHasCourse();
|
|
|
Boolean hasPracticeCourse = queryInfo.getHasPracticeCourse();
|
|
@@ -95,24 +103,54 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
if (count > 0) {
|
|
|
pageInfo.setTotal(count);
|
|
|
dataList = studentManageDao.findStudentsByOrganId(params);
|
|
|
- List<Integer> userIds = dataList.stream()
|
|
|
- .map(StudentManageListDto::getUserId).collect(Collectors.toList());
|
|
|
+ Set<Integer> userIds = dataList.stream().map(StudentManageListDto::getUserId).collect(Collectors.toSet());
|
|
|
+ Set<Integer> organIds = dataList.stream().map(StudentManageListDto::getOrganId).collect(Collectors.toSet());
|
|
|
List<SysUserCashAccount> byUserIds = sysUserCashAccountDao.findByUserIds(userIds);
|
|
|
-// Map<Integer,Long> hasCourseMap = MapUtil.convertIntegerMap(studentManageDao.queryStudentHasCourse(userIds));
|
|
|
Map<Integer, SysUserCashAccount> collect = byUserIds.stream()
|
|
|
.collect(Collectors.toMap(SysUserCashAccount::getUserId, sysUserCashAccount -> sysUserCashAccount));
|
|
|
Map<Integer,Integer> hasPracticeCourseMap = MapUtil.convertIntegerMap(studentManageDao.getHasPracticeCourse(userIds));
|
|
|
+ //获取用户分部
|
|
|
+ Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMapList(organIds));
|
|
|
+ //获取所在乐团
|
|
|
+ Map<Integer,String> musicGroupNames = MapUtil.convertMybatisMap(musicGroupDao.queryUserMusicNames(userIds));
|
|
|
+ //获取所在vip
|
|
|
+ Map<Integer,String> vipGroupNames = MapUtil.convertMybatisMap(vipGroupDao.queryUserVipNames(userIds));
|
|
|
+ //获取所在乐团状态
|
|
|
+ Map<Integer,String> musicGroupStatus = MapUtil.convertMybatisMap(musicGroupDao.queryUserMusicStatus(userIds));
|
|
|
+ //获取所在vip状态
|
|
|
+ Map<Integer,String> vipGroupStatus = MapUtil.convertMybatisMap(vipGroupDao.queryUserVipStatus(userIds));
|
|
|
+ //获取所在声部
|
|
|
+ Map<Integer,String> subjectNames = MapUtil.convertMybatisMap(studentManageDao.querySubjectNames(userIds));
|
|
|
dataList.forEach(e -> {
|
|
|
+ e.setOrganName(organNames.get(e.getOrganId()));
|
|
|
+ e.setMusicGroupName(musicGroupNames.get(e.getUserId()));
|
|
|
+ e.setVipGroupName(vipGroupNames.get(e.getUserId()));
|
|
|
+ e.setSubjectName(subjectNames.get(e.getUserId()));
|
|
|
+ String musicStatus = musicGroupStatus.get(e.getUserId());
|
|
|
+ if(StringUtils.isNotEmpty(musicStatus)){
|
|
|
+ String[] split = musicStatus.split(",");
|
|
|
+ for (int i = 0;i < split.length;i++){
|
|
|
+ e.setMusicGroupStatus(ClassGroupStudentStatusEnum.valueOf(split[i]).getMsg()+" ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String vipStatus = vipGroupStatus.get(e.getUserId());
|
|
|
+ if(StringUtils.isNotEmpty(vipStatus)){
|
|
|
+ String[] split = vipStatus.split(",");
|
|
|
+ for (int i = 0;i < split.length;i++){
|
|
|
+ e.setVipGroupStatus(ClassGroupStudentStatusEnum.valueOf(split[i]).getMsg()+" ");
|
|
|
+ }
|
|
|
+ }
|
|
|
if(hasCourse == null){
|
|
|
- e.setHasCourse(studentManageDao.getHasCourse(e.getUserId()));
|
|
|
+ Integer course = studentManageDao.getHasCourse(e.getUserId());
|
|
|
+ e.setHasCourse(course==null?YesOrNoEnum.NO:course==0?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
}else {
|
|
|
if(hasCourse){
|
|
|
- e.setHasCourse(1L);
|
|
|
+ e.setHasCourse(YesOrNoEnum.YES);
|
|
|
}else {
|
|
|
- e.setHasCourse(0L);
|
|
|
+ e.setHasCourse(YesOrNoEnum.NO);
|
|
|
}
|
|
|
}
|
|
|
- e.setHasPracticeCourse(hasPracticeCourseMap.get(e.getUserId()) == null? YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
+ e.setHasPracticeCourse(hasPracticeCourseMap.get(e.getUserId()) == null?YesOrNoEnum.NO:YesOrNoEnum.YES);
|
|
|
if(collect.get(e.getUserId()) != null){
|
|
|
e.setCourseBalance(collect.get(e.getUserId()).getCourseBalance());
|
|
|
}
|
|
@@ -378,7 +416,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
@Override
|
|
|
public List<StudentHasCourseDto> queryHasCourseStudent(String organId) {
|
|
|
List<StudentHasCourseDto> studentHasCourseDtos = studentManageDao.queryHasCourseStudent(organId);
|
|
|
- List<Integer> userIds = studentHasCourseDtos.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
+ Set<Integer> userIds = studentHasCourseDtos.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
Map<Integer,Integer> hasPracticeCourseMap = MapUtil.convertIntegerMap(studentManageDao.getHasPracticeCourse(userIds));
|
|
|
Map<Integer,Integer> isActiveMap = MapUtil.convertIntegerMap(studentManageDao.getIsActive(userIds));
|
|
|
Map<Integer,Integer> isMakeMap = MapUtil.convertIntegerMap(studentManageDao.getIsMake(userIds));
|