|
@@ -8,8 +8,10 @@ import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
|
|
|
+import com.ym.mec.biz.dal.page.*;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
|
|
|
+import com.ym.mec.common.page.QueryInfo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -40,14 +42,6 @@ import com.ym.mec.biz.dal.entity.SubjectChange;
|
|
|
import com.ym.mec.biz.dal.entity.SysUserCashAccount;
|
|
|
import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
-import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentManageCourseQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentManageVipClassQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentOperatingQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.StudentSignQueryInfo;
|
|
|
-import com.ym.mec.biz.dal.page.TeacherPaymentRecordInfo;
|
|
|
import com.ym.mec.biz.service.StudentManageService;
|
|
|
import com.ym.mec.biz.service.StudentService;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
@@ -68,7 +62,7 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
@Autowired
|
|
|
private StudentManageDao studentManageDao;
|
|
|
@Autowired
|
|
|
- private OrganizationDao organizationDao;
|
|
|
+ private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
|
|
|
@Autowired
|
|
|
private CourseScheduleStudentPaymentDao scheduleStudentPaymentDao;
|
|
|
@Autowired
|
|
@@ -416,18 +410,8 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
PageInfo<MusicGroupStudentsDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
-// if(StringUtils.isNotEmpty(queryInfo.getPaymentStatus())){
|
|
|
-// List<Integer> userIds;
|
|
|
-// if("NON_PAYMENT".equals(queryInfo.getPaymentStatus())){
|
|
|
-// userIds = musicGroupPaymentCalenderDao.queryUserByNoPayment(queryInfo.getClassGroupId());
|
|
|
-// }else {
|
|
|
-// userIds = musicGroupPaymentCalenderDao.queryUserByPayment(queryInfo.getClassGroupId());
|
|
|
-// }
|
|
|
-// if(userIds != null && userIds.size() > 0){
|
|
|
-// params.put("userIds",userIds);
|
|
|
-// }
|
|
|
-// }
|
|
|
List<MusicGroupStudentsDto> dataList = null;
|
|
|
+ String musicGroupId = queryInfo.getMusicGroupId();
|
|
|
int count = studentManageDao.countMusicGroupStudent(params);
|
|
|
if (queryInfo.getIsExport() && count > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
@@ -438,25 +422,18 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
dataList = studentManageDao.queryMusicGroupStudent(params);
|
|
|
//退团的学生
|
|
|
List<Integer> quitUserIds = dataList.stream().filter(e -> e.getStudentStatus().equals("QUIT")).map(MusicGroupStudentsDto::getUserId).collect(Collectors.toList());
|
|
|
-
|
|
|
+ Set<Integer> studentIds = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
+ Map<Integer,Integer> subTotalCourseTimeMap = MapUtil.convertIntegerMap(musicGroupPaymentStudentCourseDetailDao.queryStudentSubTotalCourseTime(studentIds,musicGroupId));
|
|
|
if (quitUserIds.size() > 0) {
|
|
|
List<MusicGroupQuit> quits = musicGroupQuitDao.getQuits(queryInfo.getMusicGroupId(), quitUserIds);
|
|
|
for (MusicGroupStudentsDto musicGroupStudentsDto : dataList) {
|
|
|
+ musicGroupStudentsDto.setSubTotalCourseTime(subTotalCourseTimeMap.get(musicGroupStudentsDto.getUserId()));
|
|
|
for (MusicGroupQuit quit : quits) {
|
|
|
if (!quit.getUserId().equals(musicGroupStudentsDto.getUserId())) continue;
|
|
|
musicGroupStudentsDto.setQuitReason(quit.getReason());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// Map<Integer,String> maps = MapUtil.convertIntegerMap(musicGroupStudentFeeDao.findPaymentStatusMap(queryInfo.getMusicGroupId()));
|
|
|
-// dataList.forEach(e->{
|
|
|
-// e.setPaymentStatus(maps.get(e.getUserId()));
|
|
|
-// Set<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
|
|
|
-// Map<Integer,String> paymentStatusMap = MapUtil.convertIntegerMap(
|
|
|
-// musicGroupPaymentCalenderDao.queryUserCoursePaymentStatus(collect,queryInfo.getMusicGroupId()));
|
|
|
-// dataList.forEach(e -> {
|
|
|
-// e.setPaymentStatus(paymentStatusMap.get(e.getUserId()));
|
|
|
-// });
|
|
|
}
|
|
|
if (count == 0) {
|
|
|
dataList = new ArrayList<>();
|
|
@@ -689,15 +666,37 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<BasicUserDto> queryGroupStudents(String groupType) {
|
|
|
+ public PageInfo<BasicUserDto> queryGroupStudents(StudentQueryInfo queryInfo) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if(sysUser == null || sysUser.getId() == null){
|
|
|
throw new BizException("用户信息获取失败");
|
|
|
}
|
|
|
- if("VIP".equals(groupType)){
|
|
|
- return studentManageDao.queryVipGroupStudents(sysUser.getId());
|
|
|
+ PageInfo<BasicUserDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ queryInfo.setUserId(sysUser.getId());
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ Integer count = 0;
|
|
|
+ if("VIP".equals(queryInfo.getGroupType())){
|
|
|
+ count = studentManageDao.countVipGroupStudents(params);
|
|
|
}else {
|
|
|
- return studentManageDao.queryPracticeGroupStudents(sysUser.getId());
|
|
|
+ count = studentManageDao.countPracticeGroupStudents(params);
|
|
|
}
|
|
|
+ List<BasicUserDto> dataList = new ArrayList<>();
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ if("VIP".equals(queryInfo.getGroupType())){
|
|
|
+ dataList = studentManageDao.queryVipGroupStudents(params);
|
|
|
+ }else {
|
|
|
+ dataList = studentManageDao.queryPracticeGroupStudents(params);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<Integer, Integer> queryStudentSubTotalCourseTimes(Integer userId,String musicGroupId) {
|
|
|
+ return MapUtil.convertIntegerMap(musicGroupPaymentStudentCourseDetailDao.queryStudentSubTotalCourseTimes(userId,musicGroupId));
|
|
|
}
|
|
|
}
|