|
@@ -13,6 +13,7 @@ import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Map.Entry;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
@@ -41,6 +42,7 @@ import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
import com.ym.mec.biz.dal.dao.PracticeGroupDao;
|
|
import com.ym.mec.biz.dal.dao.PracticeGroupDao;
|
|
import com.ym.mec.biz.dal.dao.StudentDao;
|
|
import com.ym.mec.biz.dal.dao.StudentDao;
|
|
import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
|
+import com.ym.mec.biz.dal.dao.StudentStatisticsDao;
|
|
import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
import com.ym.mec.biz.dal.dao.SysConfigDao;
|
|
import com.ym.mec.biz.dal.dao.SysMusicCompareRecordDao;
|
|
import com.ym.mec.biz.dal.dao.SysMusicCompareRecordDao;
|
|
import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
|
|
@@ -56,6 +58,7 @@ import com.ym.mec.biz.dal.dto.Mapper;
|
|
import com.ym.mec.biz.dal.dto.StatDto;
|
|
import com.ym.mec.biz.dal.dto.StatDto;
|
|
import com.ym.mec.biz.dal.dto.StudentClassInfoDto;
|
|
import com.ym.mec.biz.dal.dto.StudentClassInfoDto;
|
|
import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
|
|
import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
|
|
|
|
+import com.ym.mec.biz.dal.dto.StudentOrganDto;
|
|
import com.ym.mec.biz.dal.dto.StudentTeacherCourseDto;
|
|
import com.ym.mec.biz.dal.dto.StudentTeacherCourseDto;
|
|
import com.ym.mec.biz.dal.entity.BaseStudentDto;
|
|
import com.ym.mec.biz.dal.entity.BaseStudentDto;
|
|
import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
|
|
import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
|
|
@@ -105,6 +108,8 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
@Autowired
|
|
@Autowired
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
private StudentRegistrationDao studentRegistrationDao;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private StudentStatisticsDao studentStatisticsDao;
|
|
|
|
+ @Autowired
|
|
private MusicGroupDao musicGroupDao;
|
|
private MusicGroupDao musicGroupDao;
|
|
@Autowired
|
|
@Autowired
|
|
private PracticeGroupDao practiceGroupDao;
|
|
private PracticeGroupDao practiceGroupDao;
|
|
@@ -1036,14 +1041,15 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
public CloudStudyStudentDataDto getCloudStudyStudentOverView(List<Integer> organIds) {
|
|
public CloudStudyStudentDataDto getCloudStudyStudentOverView(List<Integer> organIds) {
|
|
CloudStudyStudentDataDto result = new CloudStudyStudentDataDto();
|
|
CloudStudyStudentDataDto result = new CloudStudyStudentDataDto();
|
|
|
|
|
|
- IndexCloudStudyListDto dto = studentDao.getOrgansCloudTeacherStudent(organIds);
|
|
|
|
|
|
+ /*IndexCloudStudyListDto dto = studentDao.getOrgansCloudTeacherStudent(organIds);
|
|
result.setTotalStudentNum(dto.getTotalStudentNum());
|
|
result.setTotalStudentNum(dto.getTotalStudentNum());
|
|
result.setEffectiveVipStudentNum(dto.getEffectiveVipStudentNum());
|
|
result.setEffectiveVipStudentNum(dto.getEffectiveVipStudentNum());
|
|
result.setWaitActivateVipStudentNum(dto.getWaitActivateVipStudentNum());
|
|
result.setWaitActivateVipStudentNum(dto.getWaitActivateVipStudentNum());
|
|
- result.setVipStudentNum(cloudTeacherDao.getOrgansTotalVipStudentNum(organIds));
|
|
|
|
|
|
+
|
|
|
|
+ result.setVipStudentNum(cloudTeacherDao.getOrgansTotalVipStudentNum(organIds));*/
|
|
// result.seteVipStudentNum(studentDao.getOrgansTotalEVipStudentNum(organIds));
|
|
// result.seteVipStudentNum(studentDao.getOrgansTotalEVipStudentNum(organIds));
|
|
result.setCloudStudyUseStudentNum(studentDao.getOrgansTotalCloudStudyStudentNum(organIds));
|
|
result.setCloudStudyUseStudentNum(studentDao.getOrgansTotalCloudStudyStudentNum(organIds));
|
|
- //result.setCloudStudyTodayUseStudentNum(studentDao.getOrgansTodayTotalCloudStudyStudentNum(organIds));
|
|
|
|
|
|
+ result.setCloudStudyTodayUseStudentNum(studentDao.getOrgansTodayTotalCloudStudyStudentNum(organIds));
|
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
Calendar cal = Calendar.getInstance();
|
|
cal.setTime(new Date());
|
|
cal.setTime(new Date());
|
|
@@ -1092,10 +1098,43 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
|
|
for(Mapper mapper : organCloudTeacherStudentNum){
|
|
for(Mapper mapper : organCloudTeacherStudentNum){
|
|
organCloudTeacherStudentNumMap.put(Integer.parseInt(mapper.getKey().toString()), Integer.parseInt(mapper.getValue().toString()));
|
|
organCloudTeacherStudentNumMap.put(Integer.parseInt(mapper.getKey().toString()), Integer.parseInt(mapper.getValue().toString()));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ List<StudentOrganDto> set1 = studentRegistrationDao.queryEffectiveStudent(organIds);
|
|
|
|
+ List<StudentOrganDto> set2 = courseScheduleStudentPaymentDao.queryRemainCourseStudent(organIds);
|
|
|
|
+ List<StudentOrganDto> set3 = studentStatisticsDao.queryNoScheduleNumStudent(organIds);
|
|
|
|
+
|
|
|
|
+ Map<Integer,Set<Integer>> map1= set1.stream().collect(Collectors.groupingBy(StudentOrganDto :: getOrganId, Collectors.mapping(StudentOrganDto :: getUserId, Collectors.toSet())));
|
|
|
|
+ Map<Integer,Set<Integer>> map2= set2.stream().collect(Collectors.groupingBy(StudentOrganDto :: getOrganId, Collectors.mapping(StudentOrganDto :: getUserId, Collectors.toSet())));
|
|
|
|
+ Map<Integer,Set<Integer>> map3= set3.stream().collect(Collectors.groupingBy(StudentOrganDto :: getOrganId, Collectors.mapping(StudentOrganDto :: getUserId, Collectors.toSet())));
|
|
|
|
+
|
|
|
|
+ Map<Integer,Set<Integer>> organStudentMap = new HashMap<Integer, Set<Integer>>(map1);
|
|
|
|
+ Set<Integer> temp = null;
|
|
|
|
+ for(Entry<Integer, Set<Integer>> entry : map2.entrySet()){
|
|
|
|
+ temp = organStudentMap.get(entry.getKey());
|
|
|
|
+ if(temp == null){
|
|
|
|
+ organStudentMap.put(entry.getKey(), entry.getValue());
|
|
|
|
+ }else{
|
|
|
|
+ temp.addAll(entry.getValue());
|
|
|
|
+ organStudentMap.put(entry.getKey(), temp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for(Entry<Integer, Set<Integer>> entry : map3.entrySet()){
|
|
|
|
+ temp = organStudentMap.get(entry.getKey());
|
|
|
|
+ if(temp == null){
|
|
|
|
+ organStudentMap.put(entry.getKey(), entry.getValue());
|
|
|
|
+ }else{
|
|
|
|
+ temp.addAll(entry.getValue());
|
|
|
|
+ organStudentMap.put(entry.getKey(), temp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
for(IndexCloudStudyListDto ics : list){
|
|
for(IndexCloudStudyListDto ics : list){
|
|
- ics.setActiveStudentNum(organActiveNum.get(ics.getOrganId()));
|
|
|
|
- ics.setVipStudentNum(organCloudTeacherStudentNumMap.get(ics.getOrganId()));
|
|
|
|
|
|
+ ics.setActiveStudentNum(organActiveNum.get(ics.getOrganId()) == null ? 0 : organActiveNum.get(ics.getOrganId()));
|
|
|
|
+ ics.setVipStudentNum(organCloudTeacherStudentNumMap.get(ics.getOrganId()) == null ? 0 : organCloudTeacherStudentNumMap.get(ics.getOrganId()));
|
|
|
|
+ ics.setEffectiveStudentNum(organStudentMap.get(ics.getOrganId()) == null ? 0 : organStudentMap.get(ics.getOrganId()).size());
|
|
|
|
+ if(ics.getEffectiveStudentNum() > 0){
|
|
|
|
+ ics.setVipStudentRate(ics.getVipStudentNum() * 100d / ics.getEffectiveStudentNum());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return list;
|
|
return list;
|