|
@@ -5,19 +5,19 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.auth.api.entity.SysUserRole;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
-import com.ym.mec.biz.dal.dto.IndexBaseDto;
|
|
|
-import com.ym.mec.biz.dal.dto.IndexErrorDataExportDto;
|
|
|
-import com.ym.mec.biz.dal.dto.OrganVipGroupCategoryCourseNumDto;
|
|
|
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
|
|
|
+import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.IndexDataQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.OrganCloudStudyStudentDataQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.page.OrganizationQueryInfo;
|
|
|
import com.ym.mec.biz.service.EmployeeService;
|
|
|
import com.ym.mec.biz.service.StudentExtracurricularExercisesSituationService;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.common.constant.CommonConstants;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
+import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
@@ -1221,4 +1221,103 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
|
|
|
|
|
|
return resultMap;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<EduOrganStudentDataDto> organStudentOverView(List<Integer> organIds, OrganCloudStudyStudentDataQueryInfo queryInfo) {
|
|
|
+ PageInfo<EduOrganStudentDataDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ List<Organization> organs = organizationDao.getOrgans(organIds);
|
|
|
+ pageInfo.setTotal(organs.size());
|
|
|
+
|
|
|
+ if(CollectionUtils.isEmpty(organs)){
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+ Set<String> dataTypes = new HashSet<String>(){{
|
|
|
+ add(CLOUD_STUDY_LIVELY_STUDENT_NUM.getCode());add(MEMBER_STUDENT_NUM.getCode());add(EXPERIENCE_MEMBER_STUDENT_NUM.getCode());
|
|
|
+ add(NEW_MEMBER_STUDENT_NUM.getCode());add(ORGAN_TOTAL_STUDENT_NUM.getCode());}};
|
|
|
+
|
|
|
+
|
|
|
+ List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getIndexBaseData(new HashSet<>(organIds), dataTypes, queryInfo.getDate(), queryInfo.getDate());
|
|
|
+
|
|
|
+ Map<Integer, Integer> organsStudentNumMap = indexBaseDatas.stream().filter(i->ORGAN_TOTAL_STUDENT_NUM.equals(i.getDataType())).collect(Collectors.toMap(IndexBaseMonthData::getOrganId, i->i.getActivateNum().intValue(), (i1, i2)->i1));
|
|
|
+
|
|
|
+ Map<Integer, Integer> organsVipStudentNumMap = indexBaseDatas.stream().filter(i->MEMBER_STUDENT_NUM.equals(i.getDataType())).collect(Collectors.toMap(IndexBaseMonthData::getOrganId, i->i.getActivateNum().intValue(), (i1, i2)->i1));
|
|
|
+
|
|
|
+ Map<Integer, Integer> organsEVipStudentNumMap = indexBaseDatas.stream().filter(i->EXPERIENCE_MEMBER_STUDENT_NUM.equals(i.getDataType())).collect(Collectors.toMap(IndexBaseMonthData::getOrganId, i->i.getActivateNum().intValue(), (i1, i2)->i1));
|
|
|
+
|
|
|
+ Map<Integer, Integer> organCloudStudyLivelyStudentNumMap =indexBaseDatas.stream().filter(i->CLOUD_STUDY_LIVELY_STUDENT_NUM.equals(i.getDataType())).collect(Collectors.toMap(IndexBaseMonthData::getOrganId, i->i.getActivateNum().intValue(), (i1, i2)->i1));
|
|
|
+
|
|
|
+ Map<Integer, Integer> organsNewMemberStudentNumMap = indexBaseDatas.stream().filter(i->NEW_MEMBER_STUDENT_NUM.equals(i.getDataType())).collect(Collectors.toMap(IndexBaseMonthData::getOrganId, i->i.getActivateNum().intValue(), (i1, i2)->i1));
|
|
|
+
|
|
|
+ List<EduOrganStudentDataDto> result = new ArrayList<>();
|
|
|
+
|
|
|
+ for (Organization organ : organs) {
|
|
|
+ EduOrganStudentDataDto organStudentVipData = new EduOrganStudentDataDto();
|
|
|
+ organStudentVipData.setOrganId(organ.getId());
|
|
|
+ organStudentVipData.setOrganName(organ.getName());
|
|
|
+ if(organsStudentNumMap.containsKey(organ.getId())){
|
|
|
+ organStudentVipData.setTotalStudentNum(organsStudentNumMap.get(organ.getId()));
|
|
|
+ }
|
|
|
+ if(organsVipStudentNumMap.containsKey(organ.getId())){
|
|
|
+ organStudentVipData.setVipStudentNum(organsVipStudentNumMap.get(organ.getId()));
|
|
|
+ }
|
|
|
+ if(organsEVipStudentNumMap.containsKey(organ.getId())){
|
|
|
+ organStudentVipData.seteVipStudentNum(organsEVipStudentNumMap.get(organ.getId()));
|
|
|
+ }
|
|
|
+ if(organCloudStudyLivelyStudentNumMap.containsKey(organ.getId())){
|
|
|
+ organStudentVipData.setCloudStudyLivelyStudentNum(organCloudStudyLivelyStudentNumMap.get(organ.getId()));
|
|
|
+ }
|
|
|
+ if(organsNewMemberStudentNumMap.containsKey(organ.getId())){
|
|
|
+ organStudentVipData.setCloudStudyLivelyStudentNum(organsNewMemberStudentNumMap.get(organ.getId()));
|
|
|
+ }
|
|
|
+ if(organStudentVipData.getCloudStudyLivelyStudentNum()>0&&organStudentVipData.getTotalStudentNum()>0){
|
|
|
+ organStudentVipData.setCloudStudyLivelyStudentDuty(new BigDecimal(organStudentVipData.getCloudStudyLivelyStudentNum()).divide(new BigDecimal(organStudentVipData.getTotalStudentNum()), 4, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).floatValue());
|
|
|
+ }
|
|
|
+ result.add(organStudentVipData);
|
|
|
+ }
|
|
|
+
|
|
|
+ Comparator<EduOrganStudentDataDto> comparing = null;
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getCloudStudyLivelyStudentNum())){
|
|
|
+ if(Objects.isNull(comparing)){
|
|
|
+ comparing = Comparator.comparing(EduOrganStudentDataDto::getCloudStudyLivelyStudentNum, "ASC".equals(queryInfo.getCloudStudyLivelyStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }else{
|
|
|
+ comparing.thenComparing(EduOrganStudentDataDto::getCloudStudyLivelyStudentNum, "ASC".equals(queryInfo.getCloudStudyLivelyStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getVipStudentNum())){
|
|
|
+ if(Objects.isNull(comparing)){
|
|
|
+ comparing = Comparator.comparing(EduOrganStudentDataDto::getVipStudentNum, "ASC".equals(queryInfo.getVipStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }else{
|
|
|
+ comparing.thenComparing(EduOrganStudentDataDto::getVipStudentNum, "ASC".equals(queryInfo.getVipStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.geteVipStudentNum())){
|
|
|
+ if(Objects.isNull(comparing)){
|
|
|
+ comparing = Comparator.comparing(EduOrganStudentDataDto::geteVipStudentNum, "ASC".equals(queryInfo.geteVipStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }else{
|
|
|
+ comparing.thenComparing(EduOrganStudentDataDto::geteVipStudentNum, "ASC".equals(queryInfo.geteVipStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getNewMemberStudentNum())){
|
|
|
+ if(Objects.isNull(comparing)){
|
|
|
+ comparing = Comparator.comparing(EduOrganStudentDataDto::getNewMemberStudentNum, "ASC".equals(queryInfo.getNewMemberStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }else{
|
|
|
+ comparing.thenComparing(EduOrganStudentDataDto::getNewMemberStudentNum, "ASC".equals(queryInfo.getNewMemberStudentNum())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(queryInfo.getCloudStudyLivelyStudentDuty())){
|
|
|
+ if(Objects.isNull(comparing)){
|
|
|
+ comparing = Comparator.comparing(EduOrganStudentDataDto::getCloudStudyLivelyStudentDuty, "ASC".equals(queryInfo.getCloudStudyLivelyStudentDuty())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }else{
|
|
|
+ comparing.thenComparing(EduOrganStudentDataDto::getCloudStudyLivelyStudentDuty, "ASC".equals(queryInfo.getCloudStudyLivelyStudentDuty())?Comparator.naturalOrder():Comparator.reverseOrder());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(Objects.isNull(comparing)){
|
|
|
+ comparing = Comparator.comparing(EduOrganStudentDataDto::getOrganId);
|
|
|
+ }
|
|
|
+
|
|
|
+ result = result.stream().skip(pageInfo.getOffset()).limit(pageInfo.getLimit()).sorted(comparing).collect(Collectors.toList());
|
|
|
+ pageInfo.setRows(result);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|