|
@@ -1,6 +1,5 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import com.ym.mec.biz.dal.dao.IndexBaseMonthDataDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentBasicInfoDao;
|
|
|
import com.ym.mec.biz.dal.dao.StudentStatisticsDao;
|
|
|
import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
@@ -12,15 +11,15 @@ import com.ym.mec.biz.dal.page.StudentStatisticsQueryInfo;
|
|
|
import com.ym.mec.biz.service.StudentStatisticsService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
|
-import com.ym.mec.common.page.QueryInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
-import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class StudentStatisticsServiceImpl extends BaseServiceImpl<Integer, StudentStatistics> implements StudentStatisticsService {
|
|
@@ -62,7 +61,10 @@ public class StudentStatisticsServiceImpl extends BaseServiceImpl<Integer, Stude
|
|
|
PageInfo<StudentStatisticsDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
-
|
|
|
+ if(StringUtils.isNotEmpty(queryInfo.getOrganId())){
|
|
|
+ List<Integer> organIdList = Arrays.stream(queryInfo.getOrganId().split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ params.put("organIdList",organIdList);
|
|
|
+ }
|
|
|
List<StudentStatisticsDto> dataList = null;
|
|
|
int count = studentStatisticsDao.countStatistics(params);
|
|
|
if (count > 0) {
|
|
@@ -79,20 +81,28 @@ public class StudentStatisticsServiceImpl extends BaseServiceImpl<Integer, Stude
|
|
|
|
|
|
@Override
|
|
|
public StudentStatisticsSumDto studentSmallClassStatisticsSum(String groupType,String organId) {
|
|
|
- return studentStatisticsDao.studentSmallClassStatisticsSum(groupType,organId);
|
|
|
+ List<Integer> organIdList = new ArrayList<>();
|
|
|
+ if(StringUtils.isNotEmpty(organId)){
|
|
|
+ organIdList = Arrays.stream(organId.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return studentStatisticsDao.studentSmallClassStatisticsSum(groupType,organIdList);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public StudentStatisticsSumForDateDto studentSmallClassStatisticsSumForDate(String groupType, String startDate, String endDate,String organId) {
|
|
|
StudentStatisticsSumForDateDto sumForDateDto = new StudentStatisticsSumForDateDto();
|
|
|
+ List<Integer> organIdList = new ArrayList<>();
|
|
|
+ if(StringUtils.isNotEmpty(organId)){
|
|
|
+ organIdList = Arrays.stream(organId.split(",")).map(id -> Integer.valueOf(id)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
//获取流失人数
|
|
|
- sumForDateDto.setLostNum(studentStatisticsDao.countLostStudentNum(groupType,startDate,endDate,organId));
|
|
|
+ sumForDateDto.setLostNum(studentStatisticsDao.countLostStudentNum(groupType,startDate,endDate,organIdList));
|
|
|
//获取新增人数
|
|
|
- sumForDateDto.setAddNum(studentStatisticsDao.countAddStudentNum(groupType,startDate,endDate,organId));
|
|
|
+ sumForDateDto.setAddNum(studentStatisticsDao.countAddStudentNum(groupType,startDate,endDate,organIdList));
|
|
|
//获取续费人数
|
|
|
- sumForDateDto.setRenewNum(studentStatisticsDao.countRenewStudentNum(groupType,endDate,organId));
|
|
|
+ sumForDateDto.setRenewNum(studentStatisticsDao.countRenewStudentNum(groupType,endDate,organIdList));
|
|
|
//获取回访人数
|
|
|
- sumForDateDto.setVisitNum(studentStatisticsDao.countVisitNum(groupType,startDate,endDate,organId));
|
|
|
+ sumForDateDto.setVisitNum(studentStatisticsDao.countVisitNum(groupType,startDate,endDate,organIdList));
|
|
|
return sumForDateDto;
|
|
|
}
|
|
|
|