|
@@ -416,6 +416,32 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
List<MusicGroupStudentsDto> dataList = null;
|
|
|
+ List<StudentRegistration> studentRegistrations = studentRegistrationDao.getMusicGroupStu(queryInfo.getMusicGroupId());
|
|
|
+ if(studentRegistrations.size() == 0){
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+ List<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
+ if(queryInfo.getHasVip() != null){
|
|
|
+ //有剩余课程的学员
|
|
|
+ List<Integer> hasVipStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP");
|
|
|
+ if(queryInfo.getHasVip()){
|
|
|
+ userIds = hasVipStudent;
|
|
|
+ }else {
|
|
|
+ userIds.removeAll(hasVipStudent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(queryInfo.getHasPractice() != null && userIds.size() > 0){
|
|
|
+ List<Integer> hasPracticeStudent = courseScheduleDao.findHasCourseStudent(userIds,"PRACTICE");
|
|
|
+ if(queryInfo.getHasPractice()){
|
|
|
+ userIds = hasPracticeStudent;
|
|
|
+ }else {
|
|
|
+ userIds.removeAll(hasPracticeStudent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(userIds.size() == 0){
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+ params.put("userIds",userIds);
|
|
|
int count = studentManageDao.countMusicGroupStudent(params);
|
|
|
if (queryInfo.getIsExport() && count > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
@@ -437,7 +463,12 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ List<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
+ List<Integer> hasVipStudent = courseScheduleDao.findHasCourseStudent(collect,"VIP");
|
|
|
+ List<Integer> hasPracticeStudent = courseScheduleDao.findHasCourseStudent(collect,"PRACTICE");
|
|
|
dataList.forEach(e->{
|
|
|
+ e.setHasVip(hasVipStudent.contains(e.getUserId()));
|
|
|
+ e.setHasPractice(hasPracticeStudent.contains(e.getUserId()));
|
|
|
e.setNoPaymentAmount(totalAmountMap.get(e.getUserId()));
|
|
|
});
|
|
|
}
|
|
@@ -450,13 +481,35 @@ public class StudentManageServiceImpl implements StudentManageService {
|
|
|
|
|
|
@Override
|
|
|
public Object musicGroupStudentsSum(String musicGroupId) {
|
|
|
- Map<String, Integer> resultMap = new HashMap<>(3);
|
|
|
+ Map<String, Object> resultMap = new HashMap<>(3);
|
|
|
//乐团在读人数
|
|
|
resultMap.put("studying", studentManageDao.countStudyNum(musicGroupId));
|
|
|
//退团人数
|
|
|
resultMap.put("quit", studentManageDao.countQuitNum(musicGroupId));
|
|
|
//新增人数
|
|
|
resultMap.put("add", studentManageDao.countAddNum(musicGroupId));
|
|
|
+ //未完成vip、网管课学员数量/该乐团在读学员人数*100%
|
|
|
+ List<StudentRegistration> studentRegistrations = studentRegistrationDao.getMusicGroupStu(musicGroupId);
|
|
|
+ if(studentRegistrations.size() == 0){
|
|
|
+ resultMap.put("vipRate","0.00%");
|
|
|
+ resultMap.put("practiceRate","0.00%");
|
|
|
+ }
|
|
|
+ List<Integer> userIds = studentRegistrations.stream().map(e -> e.getUserId()).collect(Collectors.toList());
|
|
|
+ List<Integer> hasVipStudent = courseScheduleDao.findHasCourseStudent(userIds,"VIP");
|
|
|
+ double size = userIds.size()+0d;
|
|
|
+ if(hasVipStudent.size() == 0){
|
|
|
+ resultMap.put("vipRate","0.00%");
|
|
|
+ }else {
|
|
|
+ double d = (hasVipStudent.size() / size) * 100;
|
|
|
+ resultMap.put("vipRate",String.format("%.2f", d) + "%");
|
|
|
+ }
|
|
|
+ List<Integer> hasPracticeStudent = courseScheduleDao.findHasCourseStudent(userIds,"PRACTICE");
|
|
|
+ if(hasPracticeStudent.size() == 0){
|
|
|
+ resultMap.put("practiceRate","0.00%");
|
|
|
+ }else {
|
|
|
+ double d = (hasPracticeStudent.size() / size) * 100;
|
|
|
+ resultMap.put("practiceRate",String.format("%.2f", d) + "%");
|
|
|
+ }
|
|
|
return resultMap;
|
|
|
}
|
|
|
|