Browse Source

fix(server): 统计信息

Go 5 years ago
parent
commit
ae8c9e0903

+ 1 - 1
front/project/admin/components/Association/index.js

@@ -5,7 +5,7 @@ import Select from '@src/components/Select';
 import { getMap, generateSearch } from '@src/services/Tools';
 import QuestionNoList from '../QuestionNoList';
 import { Question } from '../../stores/question';
-import { Sentence } from '../../stores/sentence';
+// import { Sentence } from '../../stores/sentence';
 
 class Association extends Component {
   constructor(props) {

+ 2 - 2
front/project/www/routes/my/main/page.js

@@ -202,8 +202,8 @@ export default class extends Page {
 
   initData() {
     // 获取学习数据
-    My.getStudyTotal().then((total, index) => {
-      total.categorys = total.categorys.map(row => {
+    My.getStudyTotal().then((total) => {
+      total.categorys = total.categorys.map((row, index) => {
         row.ratio = (row.time * 100) / total.time;
         row.time = formatSeconds(row.time);
         row.color = this.colors[index];

+ 1 - 1
server/data/src/main/java/com/qxgmat/data/relation/mapping/UserAskCourseRelationMapper.xml

@@ -41,7 +41,7 @@
   </update>
 
   <!--用户提问列表-->
-  <select id="listWithCourse" resultMap="IdMap">
+  <select id="listAdmin" resultMap="IdMap">
     select
     <include refid="Id_Column_List" />
     from `user_ask_course` uac

+ 1 - 1
server/gateway-api/src/main/java/com/qxgmat/controller/api/MyController.java

@@ -675,7 +675,7 @@ public class MyController {
         UserRecordStatRelation sentenceStatRelation = userSentenceRecordService.stat(user.getId(), null, null);
         if (sentenceStatRelation != null){
             Integer sentenceTime = categoryMap.getOrDefault(PaperModule.SENTENCE.key, 0);
-            totalTime += sentenceTime;
+            totalTime += sentenceTime + sentenceStatRelation.getUserTime();
             categoryMap.put(PaperModule.SENTENCE.key, sentenceTime + sentenceStatRelation.getUserTime());
         }
 

+ 0 - 100
server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/PreviewDetailDto.java

@@ -1,100 +0,0 @@
-package com.qxgmat.dto.admin.response;
-
-import com.nuliji.tools.annotation.Dto;
-import com.qxgmat.data.dao.entity.PreviewPaper;
-
-import java.util.Date;
-
-@Dto(entity = PreviewPaper.class)
-public class PreviewDetailDto {
-
-    private Integer id;
-
-    private String title;
-
-    private Integer category;
-
-    private Date startTime;
-
-    private Date endTime;
-
-    private Integer[] questionNoIds;
-
-    private Integer[] userIds;
-
-    private Integer finish;
-
-//    private Collection<QuestionNoExtendDto> questionNos;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
-
-    public Integer getFinish() {
-        return finish;
-    }
-
-    public void setFinish(Integer finish) {
-        this.finish = finish;
-    }
-
-    public Integer[] getUserIds() {
-        return userIds;
-    }
-
-    public void setUserIds(Integer[] userIds) {
-        this.userIds = userIds;
-    }
-
-    public Integer getCategory() {
-        return category;
-    }
-
-    public void setCategory(Integer category) {
-        this.category = category;
-    }
-
-    public Integer[] getQuestionNoIds() {
-        return questionNoIds;
-    }
-
-    public void setQuestionNoIds(Integer[] questionNoIds) {
-        this.questionNoIds = questionNoIds;
-    }
-
-//    public Collection<QuestionNoExtendDto> getQuestionNos() {
-//        return questionNos;
-//    }
-//
-//    public void setQuestionNos(Collection<QuestionNoExtendDto> questionNos) {
-//        this.questionNos = questionNos;
-//    }
-}

+ 10 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/PreviewPaperListDto.java

@@ -26,6 +26,8 @@ public class PreviewPaperListDto {
 
     private String paperModule;
 
+    private String questionType;
+
     private Date createTime;
 
     private Date updateTime;
@@ -109,4 +111,12 @@ public class PreviewPaperListDto {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+    public String getQuestionType() {
+        return questionType;
+    }
+
+    public void setQuestionType(String questionType) {
+        this.questionType = questionType;
+    }
 }

+ 1 - 0
server/gateway-api/src/main/java/com/qxgmat/service/inline/UserCourseRecordService.java

@@ -84,6 +84,7 @@ public class UserCourseRecordService extends AbstractService {
 
     public Map<Integer, List<UserCourseRecord>> groupByCourse(Integer recordId, Collection courseNoIds){
         Map<Integer, List<UserCourseRecord>> relationMap = new HashMap<>();
+        if(courseNoIds == null || courseNoIds.size() == 0) return relationMap;
         Example example = new Example(UserCourseRecord.class);
         example.and(
                 example.createCriteria()