派生自 projectDept/qhighschool

EricsHu
2022-12-05 068fc7f2e81178e55fa191a13709af64b1a163f6
src/main/java/com/qxueyou/scc/school/service/impl/StudyReportService.java
@@ -40,7 +40,7 @@
import com.qxueyou.scc.user.model.UserRegistration;
/**
 * 学习报告查询及生成接口,如果存在,则直接查询,否则根据各类数据生成
 * 学习报告查询及生成接口,如果存在,则直接查询,否则根据各类数据生成
 * @author xiadehu
 *
 */
@@ -76,8 +76,8 @@
   }
   /**
    * 创建新的学习报告
    * 汇聚各类数据
    * 创建新的学习报告
    * 汇聚各类数据
    * 
    * @return
    */
@@ -118,14 +118,14 @@
   }
   /**
    * 统计出用户集中学习的时间段,选取排名靠前的三个时间段(每个时间段1小时)进行显示
    * 统计出用户集中学习的时间段,选取排名靠前的三个时间段(每个时间段1小时)进行显示
    * @param report
    */
   private void setStudyTime(SchStudyReport report) {
      
      List<Map<String, Object>> result = queryStudyTime();
      
      //从0点到23点,统计每个时间段学习的次数
      //从0点到23点,统计每个时间段学习的次数
      int[] hours = new int[24];
      
      int h=0;
@@ -138,7 +138,7 @@
         count = count + num;
      }
      
      //计算出前三
      //计算出前三
      int[][] most3 = new int[][]{{0,0},{0,0},{0,0}};
      
      for(int i=0;i<24;i++){
@@ -154,7 +154,7 @@
      
      List<Map<String,Object>> data = new ArrayList<Map<String,Object>>();
      
      //返回前三(非零)的数据
      //返回前三(非零)的数据
      for(int j=0;j<3;j++){
         if(most3[j][0]>0){
            data.add(CollectionUtils.newObjectMap(
@@ -190,7 +190,7 @@
   }
   /**
    * 查询练习、讲义、视频学习的时间统计数据
    * 查询练习、讲义、视频学习的时间统计数据
    * @return
    */
   private List<Map<String, Object>> queryStudyTime() {
@@ -208,22 +208,22 @@
   
   private String getTimeAlias(int hour){
      if(hour<3){
         return "深夜";
         return "深夜";
      }
      if(hour<6){
         return "凌晨";
         return "凌晨";
      }
      if(hour<12){
         return "早上";
         return "早上";
      }
      if(hour<14){
         return "中午";
         return "中午";
      }
      if(hour<18){
         return "下午";
         return "下午";
      }
      if(hour<24){
         return "晚上";
         return "晚上";
      }
      return null;
   }
@@ -269,7 +269,7 @@
   }
   /**
    * 设置传播大使数据
    * 设置传播大使数据
    * @param report
    */
   @SuppressWarnings("unchecked")
@@ -385,7 +385,7 @@
   }
   /**
    * 将report转换为返回机构数据结果
    * 将report转换为返回机构数据结果
    * 
    * @param report
    * @return