|  | @@ -6,6 +6,7 @@ import java.math.BigDecimal;
 | 
	
		
			
				|  |  |  import java.time.LocalDate;
 | 
	
		
			
				|  |  |  import java.util.ArrayList;
 | 
	
		
			
				|  |  |  import java.util.Arrays;
 | 
	
		
			
				|  |  | +import java.util.Calendar;
 | 
	
		
			
				|  |  |  import java.util.Collections;
 | 
	
		
			
				|  |  |  import java.util.Comparator;
 | 
	
		
			
				|  |  |  import java.util.Date;
 | 
	
	
		
			
				|  | @@ -20,20 +21,14 @@ import java.util.stream.Collectors;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import javax.annotation.PostConstruct;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -import com.ym.mec.biz.dal.entity.*;
 | 
	
		
			
				|  |  | -import com.ym.mec.common.entity.ImResult;
 | 
	
		
			
				|  |  | -import com.ym.mec.common.entity.ImUserModel;
 | 
	
		
			
				|  |  | -import com.ym.mec.im.ImFeignService;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.BeanUtils;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  | -import org.springframework.transaction.annotation.Isolation;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  import org.springframework.util.CollectionUtils;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONArray;
 | 
	
		
			
				|  |  | -import com.ym.mec.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.CloudTeacherDao;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.CloudTeacherOrderDao;
 | 
	
	
		
			
				|  | @@ -56,10 +51,22 @@ import com.ym.mec.biz.dal.dto.CloudTeacherActiveTargetDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.EduOrganStudentDataDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.EduOrganStudentListDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.EduOrganStudentListExportDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dto.IndexCloudStudyListDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.dto.Mapper;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.StatDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.StudentClassInfoDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.StudentCourseTimesDto;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dto.StudentTeacherCourseDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.BaseStudentDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.CooperationOrgan;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.CourseSchedule;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.MemberRankSetting;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.Organization;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.Student;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.StudentPreRegistration;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.SysUserCashAccount;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.FivePlusGradeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.GradeTypeEnum;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 | 
	
	
		
			
				|  | @@ -75,11 +82,13 @@ import com.ym.mec.biz.service.SysMessageService;
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.service.SysTenantConfigService;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.constant.CommonConstants;
 | 
	
		
			
				|  |  |  import com.ym.mec.common.dal.BaseDAO;
 | 
	
		
			
				|  |  | -import com.ym.mec.common.entity.HttpResponseResult;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.entity.ImResult;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.entity.ImUserModel;
 | 
	
		
			
				|  |  |  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.common.tenant.TenantContextHolder;
 | 
	
		
			
				|  |  | +import com.ym.mec.im.ImFeignService;
 | 
	
		
			
				|  |  |  import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.date.DateUtil;
 | 
	
	
		
			
				|  | @@ -1026,12 +1035,24 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public CloudStudyStudentDataDto getCloudStudyStudentOverView(List<Integer> organIds) {
 | 
	
		
			
				|  |  |          CloudStudyStudentDataDto result = new CloudStudyStudentDataDto();
 | 
	
		
			
				|  |  | -//        result.setTotalStudentNum(studentDao.getOrgansTotalStudentNum(organIds));
 | 
	
		
			
				|  |  | +        result.setTotalStudentNum(studentDao.getOrgansTotalStudentNum(organIds));
 | 
	
		
			
				|  |  |          result.setVipStudentNum(cloudTeacherDao.getOrgansTotalVipStudentNum(organIds));
 | 
	
		
			
				|  |  |  //        result.seteVipStudentNum(studentDao.getOrgansTotalEVipStudentNum(organIds));
 | 
	
		
			
				|  |  |          result.setCloudStudyUseStudentNum(studentDao.getOrgansTotalCloudStudyStudentNum(organIds));
 | 
	
		
			
				|  |  |          result.setCloudStudyTodayUseStudentNum(studentDao.getOrgansTodayTotalCloudStudyStudentNum(organIds));
 | 
	
		
			
				|  |  | -        result.setCloudStudyLivelyStudentNum(studentDao.getOrganTotalCloudStudyLivelyStudentNum(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());
 | 
	
	
		
			
				|  | @@ -1040,6 +1061,36 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | +	public List<IndexCloudStudyListDto> getCloudStudyStudentOverViewList(List<Integer> organIds) {
 | 
	
		
			
				|  |  | +    	
 | 
	
		
			
				|  |  | +    	List<IndexCloudStudyListDto> list = studentDao.getCloudStudyStudentOverViewList(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();
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        List<Mapper> mapperList = studentDao.getOrganActiveCloudStudyStudentNum(organIds, startTime, endTime);
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        Map<Integer, Integer> organActiveNum = new HashMap<Integer, Integer>();
 | 
	
		
			
				|  |  | +        for(Mapper mapper : mapperList){
 | 
	
		
			
				|  |  | +        	organActiveNum.put((Integer)mapper.getKey(), (Integer)mapper.getValue());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +        for(IndexCloudStudyListDto ics : list){
 | 
	
		
			
				|  |  | +        	ics.setActiveStudentNum(organActiveNum.get(ics.getOrganId()));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +		return list;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Override
 | 
	
		
			
				|  |  |      public void cleanStudentCloudStudySequenceDays() {
 | 
	
		
			
				|  |  |          studentDao.cleanStudentCloudStudySequenceDays();
 | 
	
		
			
				|  |  |      }
 |