|
@@ -566,6 +566,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList1 = studentDao.queryCloudStudyStudentData(params);
|
|
|
List<Integer> studentIds = dataList1.stream().map(EduOrganStudentListDto::getStudentId).collect(Collectors.toList());
|
|
|
+ Set<Integer> organIds = dataList1.stream().map(EduOrganStudentListDto::getOrganId).collect(Collectors.toSet());
|
|
|
+ Map<Integer,String> organMap = MapUtil.convertMybatisMap(organizationDao.findOrganNameMapList(organIds));
|
|
|
|
|
|
List<Map<Integer, String>> studentGroupNamesMapList = studentRegistrationDao.queryStudentMusicGroupNamesMap(studentIds);
|
|
|
Map<Integer, String> studentGroupNamesMap = MapUtil.convertIntegerMap(studentGroupNamesMapList);
|
|
@@ -613,6 +615,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
for (EduOrganStudentListDto eduOrganStudentListDto : dataList1) {
|
|
|
EduOrganStudentListExportDto data = new EduOrganStudentListExportDto();
|
|
|
BeanUtils.copyProperties(eduOrganStudentListDto, data);
|
|
|
+ data.setOrganName(organMap.get(data.getOrganId()));
|
|
|
if (StringUtils.isNotEmpty(eduOrganStudentListDto.getCurrentGradeNum())) {
|
|
|
data.setCurrentGradeNum(eduOrganStudentListDto.getCurrentGradeNum());
|
|
|
String grade = gradeList.get(Integer.parseInt(eduOrganStudentListDto.getCurrentGradeNum()));
|
|
@@ -961,33 +964,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
@Override
|
|
|
public CloudStudyStudentDataDto getCloudStudyStudentOverView(List<Integer> organIds) {
|
|
|
CloudStudyStudentDataDto result = new CloudStudyStudentDataDto();
|
|
|
-
|
|
|
- /*IndexCloudStudyListDto dto = studentDao.getOrgansCloudTeacherStudent(organIds);
|
|
|
- result.setTotalStudentNum(dto.getTotalStudentNum());
|
|
|
- result.setEffectiveVipStudentNum(dto.getEffectiveVipStudentNum());
|
|
|
- result.setWaitActivateVipStudentNum(dto.getWaitActivateVipStudentNum());
|
|
|
-
|
|
|
- result.setVipStudentNum(cloudTeacherDao.getOrgansTotalVipStudentNum(organIds));*/
|
|
|
-// result.seteVipStudentNum(studentDao.getOrgansTotalEVipStudentNum(organIds));
|
|
|
- result.setCloudStudyUseStudentNum(studentDao.getOrgansTotalCloudStudyStudentNum(organIds));
|
|
|
+// result.setCloudStudyUseStudentNum(studentDao.getOrgansTotalCloudStudyStudentNum(organIds));
|
|
|
result.setCloudStudyTodayUseStudentNum(studentDao.getOrgansTodayTotalCloudStudyStudentNum(organIds));
|
|
|
-
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- cal.setTime(new Date());
|
|
|
- //cal.add(Calendar.WEEK_OF_YEAR, -1);// 一周
|
|
|
- cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
|
|
|
- Date endTime = cal.getTime();
|
|
|
-
|
|
|
- cal.setTime(new Date());
|
|
|
- cal.add(Calendar.WEEK_OF_YEAR, -4);// 一周
|
|
|
- cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
|
|
- Date startTime = cal.getTime();
|
|
|
-
|
|
|
- //result.setCloudStudyLivelyStudentNum(studentDao.getOrganTotalCloudStudyLivelyStudentNum(organIds, startTime, endTime));
|
|
|
- //result.setNewCloudStudyStudentNum(sysMusicCompareRecordDao.getOrgansTotalNewCloudStudyNum(organIds));
|
|
|
-// if(result.getVipStudentNum()>0&&result.getTotalStudentNum()>0){
|
|
|
-// result.setVipStudentDuty(new BigDecimal(result.getVipStudentNum()).divide(new BigDecimal(result.getTotalStudentNum()), 4, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).floatValue());
|
|
|
-// }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -1334,6 +1312,38 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
|
return cloudTeacherSumDtos;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<IndexCloudStudySumDto> getCloudStudyStudentOverViewList1(List<Integer> organIdsList) {
|
|
|
+ List<IndexCloudStudySumDto> list = studentDao.getCloudStudyStudentOverViewList1(organIdsList);
|
|
|
+ //获取待激活学员数
|
|
|
+ Map<Integer,Integer> waitMap = MapUtil.convertIntegerMap(cloudTeacherOrderDao.getWaitActivateMap(organIdsList));
|
|
|
+ //获取活跃学员数
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.setTime(new Date());
|
|
|
+ //cal.add(Calendar.WEEK_OF_YEAR, -1);// 一周
|
|
|
+ cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
|
|
|
+ Date endTime = cal.getTime();
|
|
|
+
|
|
|
+ cal.setTime(new Date());
|
|
|
+ cal.add(Calendar.WEEK_OF_YEAR, -4);// 一周
|
|
|
+ cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
|
|
|
+ Date startTime = cal.getTime();
|
|
|
+
|
|
|
+ Map<Integer,Integer> activeMap = MapUtil.convertIntegerMap(studentDao.getOrganActiveCloudStudyStudentNum1(organIdsList, startTime, endTime));
|
|
|
+ //获取重复购买人数
|
|
|
+ Map<Integer,Integer> againBuyMap = MapUtil.convertIntegerMap(studentDao.getAgainBuyNum(organIdsList));
|
|
|
+ for (IndexCloudStudySumDto dto : list) {
|
|
|
+ dto.setWaitActivateVipStudentNum(waitMap.get(dto.getOrganId()));
|
|
|
+ dto.setAgainBuyNum(againBuyMap.get(dto.getOrganId()));
|
|
|
+ dto.setActiveStudentNum(activeMap.get(dto.getOrganId()));
|
|
|
+ dto.setTotalStudentNum(dto.getWaitActivateVipStudentNum() + dto.getVipStudentNum());
|
|
|
+// double studentNum = (double)dto.getVipStudentNum();
|
|
|
+// dto.setVipStudentRate(studentNum / dto.getTotalStudentNum());
|
|
|
+// dto.setAgainBuyRate(dto.getAgainBuyNum() / studentNum);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public <T extends BaseStudentDto> void insertStudent(T baseStudent){
|
|
|
Student student = new Student();
|