Browse Source

Merge branch 'master' of https://git.proginn.com/zaixianjiaoyu/sourcecode

KaysonCui 5 years ago
parent
commit
f5cd3626ec
100 changed files with 3533 additions and 955 deletions
  1. 1 1
      front/project/Constant.js
  2. 44 23
      front/project/admin/routes/setting/time/page.js
  3. 25 6
      front/project/admin/routes/subject/sentenceArticle/page.js
  4. 9 10
      front/project/admin/routes/subject/sentenceQuestion/page.js
  5. 12 0
      front/project/admin/stores/class.js
  6. 12 0
      front/project/admin/stores/question.js
  7. 8 0
      front/project/admin/stores/system.js
  8. 5 1
      server/data/src/main/java/com/qxgmat/data/constants/enums/QuestionType.java
  9. 1 1
      server/data/src/main/java/com/qxgmat/data/constants/enums/SettingKey.java
  10. 20 3
      server/data/src/main/java/com/qxgmat/data/constants/enums/module/PaperModule.java
  11. 22 0
      server/data/src/main/java/com/qxgmat/data/constants/enums/module/PaperOrigin.java
  12. 19 5
      server/data/src/main/java/com/qxgmat/data/constants/enums/module/QuestionModule.java
  13. 34 0
      server/data/src/main/java/com/qxgmat/data/constants/enums/module/QuestionOrigin.java
  14. 6 1
      server/data/src/main/java/com/qxgmat/data/constants/enums/user/AskTarget.java
  15. 0 7
      server/data/src/main/java/com/qxgmat/data/dao/ClassCommentMapper.java
  16. 7 0
      server/data/src/main/java/com/qxgmat/data/dao/UserAskCourseMapper.java
  17. 7 0
      server/data/src/main/java/com/qxgmat/data/dao/UserCourseCommentMapper.java
  18. 7 0
      server/data/src/main/java/com/qxgmat/data/dao/UserNoteCourseMapper.java
  19. 0 63
      server/data/src/main/java/com/qxgmat/data/dao/entity/ClassComment.java
  20. 16 16
      server/data/src/main/java/com/qxgmat/data/dao/entity/ClassCourse.java
  21. 7 7
      server/data/src/main/java/com/qxgmat/data/dao/entity/ExercisePaper.java
  22. 16 16
      server/data/src/main/java/com/qxgmat/data/dao/entity/PreviewPaper.java
  23. 70 0
      server/data/src/main/java/com/qxgmat/data/dao/entity/SentenceArticle.java
  24. 12 12
      server/data/src/main/java/com/qxgmat/data/dao/entity/SentenceQuestion.java
  25. 501 0
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserAskCourse.java
  26. 16 16
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserAskQuestion.java
  27. 16 16
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserCollectQuestion.java
  28. 186 0
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserCourseComment.java
  29. 7 7
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserFeedbackError.java
  30. 247 0
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserNoteCourse.java
  31. 255 21
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserNoteQuestion.java
  32. 39 39
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserPaper.java
  33. 51 16
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserPaperQuestion.java
  34. 0 26
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserPay.java
  35. 70 0
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserQuestion.java
  36. 54 19
      server/data/src/main/java/com/qxgmat/data/dao/entity/UserReport.java
  37. 0 10
      server/data/src/main/java/com/qxgmat/data/dao/mapping/ClassCommentMapper.xml
  38. 2 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/ClassCourseMapper.xml
  39. 2 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/PreviewPaperMapper.xml
  40. 3 1
      server/data/src/main/java/com/qxgmat/data/dao/mapping/SentenceArticleMapper.xml
  41. 2 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/SentenceQuestionMapper.xml
  42. 41 0
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserAskCourseMapper.xml
  43. 2 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserAskQuestionMapper.xml
  44. 2 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserCollectQuestionMapper.xml
  45. 31 0
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserCourseCommentMapper.xml
  46. 33 0
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserNoteCourseMapper.xml
  47. 13 3
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserNoteQuestionMapper.xml
  48. 3 3
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserPaperMapper.xml
  49. 3 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserPaperQuestionMapper.xml
  50. 2 3
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserPayMapper.xml
  51. 5 2
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserQuestionMapper.xml
  52. 5 4
      server/data/src/main/java/com/qxgmat/data/dao/mapping/UserReportMapper.xml
  53. 26 0
      server/data/src/main/java/com/qxgmat/data/relation/UserAskCourseRelationMapper.java
  54. 0 7
      server/data/src/main/java/com/qxgmat/data/relation/UserAskQuestionRelationMapper.java
  55. 20 0
      server/data/src/main/java/com/qxgmat/data/relation/UserPaperQuestionRelationMapper.java
  56. 14 7
      server/data/src/main/java/com/qxgmat/data/relation/UserReportRelationMapper.java
  57. 61 0
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserAskCourseRelationMapper.xml
  58. 2 2
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserAskQuestionRelationMapper.xml
  59. 2 2
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserCourseRecordRelationMapper.xml
  60. 29 7
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserReportRelationMapper.xml
  61. 1 1
      server/data/src/main/java/com/qxgmat/data/relation/mapping/UserSentenceRecordRelationMapper.xml
  62. 5 4
      server/gateway-api/src/main/java/com/qxgmat/Application.java
  63. 110 6
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/ClassController.java
  64. 31 2
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/PreviewController.java
  65. 121 7
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/QuestionController.java
  66. 1 1
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/SentenceController.java
  67. 17 0
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/SettingController.java
  68. 1 1
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/TextbookController.java
  69. 0 153
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserAskController.java
  70. 52 14
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserController.java
  71. 2 3
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserFeedbackErrorController.java
  72. 0 65
      server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserPreviewController.java
  73. 6 5
      server/gateway-api/src/main/java/com/qxgmat/controller/api/CourseController.java
  74. 154 29
      server/gateway-api/src/main/java/com/qxgmat/controller/api/MyController.java
  75. 33 7
      server/gateway-api/src/main/java/com/qxgmat/controller/api/QuestionController.java
  76. 133 127
      server/gateway-api/src/main/java/com/qxgmat/controller/api/SentenceController.java
  77. 54 0
      server/gateway-api/src/main/java/com/qxgmat/controller/api/TextbookController.java
  78. 43 0
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/extend/UserAskCourseExtendDto.java
  79. 0 56
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/extend/UserAskExtendDto.java
  80. 43 0
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/extend/UserAskQuestionExtendDto.java
  81. 52 0
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/request/UserAskCourseDto.java
  82. 1 1
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/request/UserAskDto.java
  83. 81 0
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/UserAskCourseDetailDto.java
  84. 50 0
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/UserAskCourseListDto.java
  85. 4 4
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/UserAskDetailDto.java
  86. 1 1
      server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/UserAskListDto.java
  87. 9 9
      server/gateway-api/src/main/java/com/qxgmat/dto/extend/QuestionExtendDto.java
  88. 9 41
      server/gateway-api/src/main/java/com/qxgmat/dto/extend/QuestionNoExtendDto.java
  89. 3 2
      server/gateway-api/src/main/java/com/qxgmat/dto/extend/SentenceQuestionBaseExtendDto.java
  90. 132 0
      server/gateway-api/src/main/java/com/qxgmat/dto/extend/UserNoteExtendDto.java
  91. 13 0
      server/gateway-api/src/main/java/com/qxgmat/dto/request/ErrorReportDto.java
  92. 23 0
      server/gateway-api/src/main/java/com/qxgmat/dto/request/TextbookStartDto.java
  93. 10 0
      server/gateway-api/src/main/java/com/qxgmat/dto/request/UserAskDto.java
  94. 10 0
      server/gateway-api/src/main/java/com/qxgmat/dto/request/UserCollectDto.java
  95. 11 1
      server/gateway-api/src/main/java/com/qxgmat/dto/request/UserErrorBindDto.java
  96. 10 11
      server/gateway-api/src/main/java/com/qxgmat/dto/request/UserFeedbackErrorDto.java
  97. 50 0
      server/gateway-api/src/main/java/com/qxgmat/dto/request/UserNoteDto.java
  98. 9 9
      server/gateway-api/src/main/java/com/qxgmat/dto/response/UserClassDetailDto.java
  99. 143 0
      server/gateway-api/src/main/java/com/qxgmat/dto/response/UserNoteDetailDto.java
  100. 0 0
      server/gateway-api/src/main/java/com/qxgmat/dto/response/UserQuestionDataDto.java

+ 1 - 1
front/project/Constant.js

@@ -8,7 +8,7 @@ export const TextbookType = [{ label: 'PS/数学', value: 'ps' }, { label: 'DS/
 
 export const MoneyRange = [{ label: '0', value: 0 }, { label: '1-1000', value: 1 }, { label: '1000-5000', value: 2 }, { label: '5000-10000', value: 3 }, { label: '10000以上', value: 4 }];
 
-export const AskTarget = [{ label: '题目', value: 'question' }, { label: '官方', value: 'official' }, { label: '千行解析', value: 'qx' }, { label: '题源联想', value: 'association' }];
+export const AskTarget = [{ label: '题目', value: 'question' }, { label: '官方', value: 'official' }, { label: '千行解析', value: 'qx' }, { label: '题源联想', value: 'association' }, { label: '相关问答', value: 'qa' }];
 
 export const PreviewStatus = [{ label: '全部', value: 0 }, { label: '未开始', value: 1 }, { label: '进行中', value: 2 }, { label: '已结束', value: 3 }];
 

+ 44 - 23
front/project/admin/routes/setting/time/page.js

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Tabs, Form, Row, Col, InputNumber, Button } from 'antd';
+import { Tabs, Form, Row, Col, InputNumber, Button, Switch } from 'antd';
 import './index.less';
 import Page from '@src/containers/Page';
 import Block from '@src/components/Block';
@@ -65,7 +65,7 @@ export default class extends Page {
 
   refresh(tab) {
     if (tab === 'exercise') {
-      return Promise.all([this.refreshExercise(), this.refreshTextbook()]);
+      return Promise.all([this.refreshScoreSwitch(), this.refreshExercise(), this.refreshSentence(), this.refreshTextbook()]);
     }
     if (tab === 'examination') {
       return this.refreshExamination();
@@ -76,6 +76,12 @@ export default class extends Page {
     return Promise.reject();
   }
 
+  refreshScoreSwitch() {
+    return System.getScoreSwitch().then(result => {
+      this.setState({ score: result || {} });
+    });
+  }
+
   refreshExercise() {
     return System.getExerciseTime().then((result) => {
       this.setState({ exercise: result || {} });
@@ -92,7 +98,7 @@ export default class extends Page {
   }
 
   refreshTextbook() {
-    return System.getSentenceTime().then((result) => {
+    return System.getTextbookTime().then((result) => {
       this.setState({ textbook: result || {} });
 
       const { form } = this.props;
@@ -154,11 +160,12 @@ export default class extends Page {
   submit(tab) {
     let handler;
     if (tab === 'exercise') {
-      handler = this.submitExercise();
-      handler = handler.then(() => {
-        // return this.submitSentence();
-        return this.submitTextbook();
-      });
+      handler = this.submitExercise()
+        .then(() => {
+          return this.submitTextbook();
+        }).then(() => {
+          return this.submitSentence();
+        });
     }
     if (tab === 'examination') {
       handler = this.submitExamination();
@@ -171,6 +178,11 @@ export default class extends Page {
     });
   }
 
+  submitScore() {
+    const { score } = this.state;
+    return System.setScoreSwitch(score);
+  }
+
   submitExercise() {
     const { exercise } = this.state;
     return System.setExerciseTime(exercise);
@@ -208,6 +220,23 @@ export default class extends Page {
     });
   }
 
+  renderAll() {
+    return <Form>
+      <Row>
+        <Col span={8} offset={16}>
+          <Form.Item labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} label='是否启动全站数据'>
+            <Switch checked={this.state.score.all} checkedChildren='启用' unCheckedChildren='未启用' onChange={(value) => {
+              const { score } = this.state;
+              score.all = value;
+              this.setState({ score });
+              this.submitScore();
+            }} />
+          </Form.Item>
+        </Col>
+      </Row>
+    </Form>;
+  }
+
   renderExercise() {
     return <TableLayout
       columns={this.exerciseColumns}
@@ -217,12 +246,12 @@ export default class extends Page {
     />;
   }
 
-  renderSentence() {
+  renderOther() {
     const { getFieldDecorator } = this.props.form;
     return <Form>
       <Row>
         <Col span={12}>
-          <Form.Item labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} label='每题预估时间'>
+          <Form.Item labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} label='长难句'>
             {getFieldDecorator('sentence.time', {
               rules: [
                 { required: true, message: '输入每题预估时间' },
@@ -234,23 +263,16 @@ export default class extends Page {
             )}
           </Form.Item>
         </Col>
-      </Row>
-    </Form>;
-  }
 
-  renderTextbook() {
-    const { getFieldDecorator } = this.props.form;
-    return <Form>
-      <Row>
         <Col span={12}>
-          <Form.Item labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} label='每题预估时间'>
-            {getFieldDecorator('sentence.time', {
+          <Form.Item labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} label='数据机经'>
+            {getFieldDecorator('textbook.time', {
               rules: [
                 { required: true, message: '输入每题预估时间' },
               ],
             })(
               <InputNumber placeholder='请输入每题预估时间' addonAfter="s" onChange={(value) => {
-                this.changeValue('sentence', 'time', value);
+                this.changeValue('textbook', 'time', value);
               }} style={{ width: '200px' }} />,
             )}
           </Form.Item>
@@ -309,10 +331,9 @@ export default class extends Page {
       this.refresh(value);
     }}>
       <Tabs.TabPane tab="预估做题时间" key="exercise">
-        <h1>练习设置</h1>
+        {this.renderAll()}
         {this.renderExercise()}
-        <h1>机经设置</h1>
-        {this.renderTextbook()}
+        {this.renderOther()}
       </Tabs.TabPane>
       <Tabs.TabPane tab="数据剔除时间" key="filter">
         {this.renderFilterTime()}

+ 25 - 6
front/project/admin/routes/subject/sentenceArticle/page.js

@@ -94,7 +94,7 @@ export default class extends Page {
   }
 
   renderBase() {
-    const { getFieldDecorator } = this.props.form;
+    const { getFieldDecorator, getFieldValue } = this.props.form;
     return <Block>
       <Form>
         {getFieldDecorator('id')(<input hidden />)}
@@ -134,11 +134,30 @@ export default class extends Page {
           )}
         </Form.Item>
         <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='开放试用'>
-          {getFieldDecorator('isTrail', {
-            valuePropName: 'checked',
-          })(
-            <Switch checkedChildren='on' unCheckedChildren='off' />,
-          )}
+          <Row>
+            <Col span={4}>
+              {getFieldDecorator('isTrail', {
+                valuePropName: 'checked',
+              })(
+                <Switch checkedChildren='on' unCheckedChildren='off' />,
+              )}
+            </Col>
+            <Col span={3}>
+              <Form.Item>
+                {getFieldDecorator('trailStart')(
+                  <InputNumber disabled={!getFieldValue('isTrail')} min={1} precision={0} formatter={(v) => parseInt(v, 10) || 1} />,
+                )}
+              </Form.Item>
+            </Col>
+            <Col span={1}>至</Col>
+            <Col span={3}>
+              <Form.Item>
+                {getFieldDecorator('trailEnd')(
+                  <InputNumber disabled={!getFieldValue('isTrail')} min={1} precision={0} formatter={(v) => parseInt(v, 10) || 1} />,
+                )}
+              </Form.Item>
+            </Col>
+          </Row>
         </Form.Item>
       </Form>
     </Block>;

+ 9 - 10
front/project/admin/routes/subject/sentenceQuestion/page.js

@@ -56,7 +56,7 @@ export default class extends Page {
       if (!err) {
         const data = form.getFieldsValue();
         data.isTrail = data.isTrail ? 1 : 0;
-        data.isCustomer = data.isCustomer ? 1 : 0;
+        data.isPaper = data.isPaper ? 1 : 0;
         data.question.description = data.question.stem.replace(/<[^>]+>/g, '');
         let handler;
         if (data.id) {
@@ -97,15 +97,6 @@ export default class extends Page {
             <InputNumber min={1} precision={0} formatter={(v) => parseInt(v, 10) || 1} />,
           )}
         </Form.Item>
-        {/* 不允许修改组卷逻辑 */}
-        <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='自定义库' help='打开后,不自动组卷,用于预习作业,设定后,不允许修改'>
-          {id && (data.isSystem ? '是' : '否')}
-          {!id && getFieldDecorator('isCustomer', {
-            valuePropName: 'checked',
-          })(
-            <Switch checkedChildren='on' unCheckedChildren='off' />,
-          )}
-        </Form.Item>
         <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='名称'>
           {getFieldDecorator('title', {
             rules: [
@@ -122,6 +113,14 @@ export default class extends Page {
             <Switch checkedChildren='on' unCheckedChildren='off' />,
           )}
         </Form.Item>
+        {/* 不允许修改组卷逻辑 */}
+        <Form.Item labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label='组卷题目' >
+          {!id && getFieldDecorator('isPaper', {
+            valuePropName: 'checked',
+          })(
+            <Switch checkedChildren='on' unCheckedChildren='off' />,
+          )}
+        </Form.Item>
       </Form>
     </Block>;
   }

+ 12 - 0
front/project/admin/stores/class.js

@@ -4,6 +4,18 @@ export default class ClassStore extends BaseStore {
   listCourse(params) {
     return this.apiGet('/class/course/list', params);
   }
+
+  listAsk(params) {
+    return this.apiGet('/class/ask/list', params);
+  }
+
+  editAsk(params) {
+    return this.apiPut('/class/ask/edit', params);
+  }
+
+  getAsk(params) {
+    return this.apiGet('/class/ask/detail', params);
+  }
 }
 
 export const Class = new ClassStore({ key: 'class' });

+ 12 - 0
front/project/admin/stores/question.js

@@ -32,6 +32,18 @@ export default class QuestionStore extends BaseStore {
   get(params) {
     return this.apiGet('/question/detail', params);
   }
+
+  listAsk(params) {
+    return this.apiGet('/question/ask/list', params);
+  }
+
+  editAsk(params) {
+    return this.apiPut('/question/ask/edit', params);
+  }
+
+  getAsk(params) {
+    return this.apiGet('/question/ask/detail', params);
+  }
 }
 
 export const Question = new QuestionStore({ key: 'question' });

+ 8 - 0
front/project/admin/stores/system.js

@@ -85,6 +85,14 @@ export default class SystemStore extends BaseStore {
     return this.apiPut('/setting/examination_time', params);
   }
 
+  getScoreSwitch() {
+    return this.apiGet('/setting/score_switch');
+  }
+
+  setScoreSwitch(params) {
+    return this.apiPut('/setting/score_switch', params);
+  }
+
   getTips() {
     return this.apiGet('/setting/tips');
   }

+ 5 - 1
server/data/src/main/java/com/qxgmat/data/constants/enums/QuestionType.java

@@ -10,7 +10,11 @@ public enum QuestionType {
     PS("ps", "数学PS"),
     DS("ds", "数学DS"),
     IR("ir", "综合推理"),
-    AWA("awa", "作文");
+    AWA("awa", "作文"),
+
+    SENTENCE("sentence", "长难句"), // 特殊类型
+    ;
+
     final static public String message = "题目类型";
 
     public String key;

+ 1 - 1
server/data/src/main/java/com/qxgmat/data/constants/enums/SettingKey.java

@@ -19,7 +19,7 @@ public enum SettingKey {
     PREPARE_INFO("prepare_info"), // 备考统计信息
     SENTENCE_TIME("sentence_time"), // 长难句题目时间
     TEXTBOOK_TIME("textbook_time"), // 机经题目时间
-    EXAMINATION_SCORE("examination_score"), // 模考分数计算
+    SCORE_SWITCH("score_switch"), // 分数开关
 
     TIPS("tips"); // 页面提示信息
 

+ 20 - 3
server/data/src/main/java/com/qxgmat/data/constants/enums/module/PaperModule.java

@@ -1,11 +1,9 @@
 package com.qxgmat.data.constants.enums.module;
 
+// 组卷模块
 public enum PaperModule {
     EXERCISE("exercise"),
     EXAMINATION("examination"),
-    COLLECT("collect"),
-    ERROR("error"),
-    PREVIEW("preview"),
     TEXTBOOK("textbook"),
     SENTENCE("sentence"),
     ;
@@ -18,4 +16,23 @@ public enum PaperModule {
         if (name == null) return null;
         return PaperModule.valueOf(name.toUpperCase());
     }
+
+    /**
+     * 根据question模块判断paper模块
+     * @param module
+     * @return
+     */
+    public static PaperModule WithQuestion(QuestionModule module){
+        switch(module){
+            case BASE:
+                // 基础题型都当成练习
+                return EXERCISE;
+            case TEXTBOOK:
+                return TEXTBOOK;
+            case SENTENCE:
+                return SENTENCE;
+            default:
+                return null;
+        }
+    }
 }

+ 22 - 0
server/data/src/main/java/com/qxgmat/data/constants/enums/module/PaperOrigin.java

@@ -0,0 +1,22 @@
+package com.qxgmat.data.constants.enums.module;
+
+// 组卷来源
+public enum PaperOrigin {
+    EXERCISE("exercise"),
+    EXAMINATION("examination"),
+    COLLECT("collect"),
+    ERROR("error"),
+    PREVIEW("preview"),
+    TEXTBOOK("textbook"),
+    SENTENCE("sentence"),
+    ;
+    public String key;
+    private PaperOrigin(String key){
+        this.key = key;
+    }
+
+    public static PaperOrigin ValueOf(String name){
+        if (name == null) return null;
+        return PaperOrigin.valueOf(name.toUpperCase());
+    }
+}

+ 19 - 5
server/data/src/main/java/com/qxgmat/data/constants/enums/module/QuestionModule.java

@@ -1,9 +1,11 @@
 package com.qxgmat.data.constants.enums.module;
 
+import com.qxgmat.data.constants.enums.QuestionType;
+
 public enum QuestionModule {
-    BASE("base"), // 练习、模考、错题、收藏、预习作业
-    TEXTBOOK("textbook"), // 机经
+    BASE("base"), // 练习、模考
     SENTENCE("sentence"), // 长难句
+    TEXTBOOK("textbook"), // 机经
     ;
     public String key;
     private QuestionModule(String key){
@@ -26,14 +28,26 @@ public enum QuestionModule {
                 return SENTENCE;
             case TEXTBOOK:
                 return TEXTBOOK;
-            case ERROR:
-            case COLLECT:
             case EXERCISE:
             case EXAMINATION:
-            case PREVIEW:
                 return BASE;
             default:
                 return null;
         }
     }
+
+    /**
+     * 根据question题型判断组卷题目类型
+     * @param type
+     * @return
+     */
+    public static QuestionModule WithQuestionType(QuestionType type){
+        switch(type){
+            case SENTENCE:
+                return SENTENCE;
+            default:
+                // 机经的题型不会在这边判断
+                return BASE;
+        }
+    }
 }

+ 34 - 0
server/data/src/main/java/com/qxgmat/data/constants/enums/module/QuestionOrigin.java

@@ -0,0 +1,34 @@
+package com.qxgmat.data.constants.enums.module;
+
+// 题目来源
+public enum QuestionOrigin {
+    COLLECT("collect"), // 收藏组卷题
+    ERROR("error"), // 错误组卷题
+    REMOVE_ERROR("remove_error"), // 从错误题目列表中移除,
+    ;
+    public String key;
+    private QuestionOrigin(String key){
+        this.key = key;
+    }
+
+    public static QuestionOrigin ValueOf(String name){
+        if (name == null) return null;
+        return QuestionOrigin.valueOf(name.toUpperCase());
+    }
+
+    /**
+     * 根据paper来源判断question来源
+     * @param origin
+     * @return
+     */
+    public static QuestionOrigin WithPaper(PaperOrigin origin){
+        switch(origin){
+            case COLLECT:
+                return COLLECT;
+            case ERROR:
+                return ERROR;
+            default:
+                return null;
+        }
+    }
+}

+ 6 - 1
server/data/src/main/java/com/qxgmat/data/constants/enums/user/AskTarget.java

@@ -2,7 +2,12 @@ package com.qxgmat.data.constants.enums.user;
 
 
 public enum AskTarget {
-    QUESTION("question"), OFFICIAL("official"), QX("qx"), ASSOCIATION("association");
+    QUESTION("question"),
+    OFFICIAL("official"),
+    QX("qx"),
+    ASSOCIATION("association"),
+    QA("qa"),
+    ;
     public String key;
     private AskTarget(String key){
         this.key = key;

+ 0 - 7
server/data/src/main/java/com/qxgmat/data/dao/ClassCommentMapper.java

@@ -1,7 +0,0 @@
-package com.qxgmat.data.dao;
-
-import com.nuliji.tools.mybatis.Mapper;
-import com.qxgmat.data.dao.entity.ClassComment;
-
-public interface ClassCommentMapper extends Mapper<ClassComment> {
-}

+ 7 - 0
server/data/src/main/java/com/qxgmat/data/dao/UserAskCourseMapper.java

@@ -0,0 +1,7 @@
+package com.qxgmat.data.dao;
+
+import com.nuliji.tools.mybatis.Mapper;
+import com.qxgmat.data.dao.entity.UserAskCourse;
+
+public interface UserAskCourseMapper extends Mapper<UserAskCourse> {
+}

+ 7 - 0
server/data/src/main/java/com/qxgmat/data/dao/UserCourseCommentMapper.java

@@ -0,0 +1,7 @@
+package com.qxgmat.data.dao;
+
+import com.nuliji.tools.mybatis.Mapper;
+import com.qxgmat.data.dao.entity.UserCourseComment;
+
+public interface UserCourseCommentMapper extends Mapper<UserCourseComment> {
+}

+ 7 - 0
server/data/src/main/java/com/qxgmat/data/dao/UserNoteCourseMapper.java

@@ -0,0 +1,7 @@
+package com.qxgmat.data.dao;
+
+import com.nuliji.tools.mybatis.Mapper;
+import com.qxgmat.data.dao.entity.UserNoteCourse;
+
+public interface UserNoteCourseMapper extends Mapper<UserNoteCourse> {
+}

+ 0 - 63
server/data/src/main/java/com/qxgmat/data/dao/entity/ClassComment.java

@@ -1,63 +0,0 @@
-package com.qxgmat.data.dao.entity;
-
-import java.io.Serializable;
-import javax.persistence.*;
-
-@Table(name = "class_comment")
-public class ClassComment implements Serializable {
-    @Id
-    @Column(name = "`id`")
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    private Integer id;
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * @return id
-     */
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * @param id
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", id=").append(id);
-        sb.append("]");
-        return sb.toString();
-    }
-
-    public static ClassComment.Builder builder() {
-        return new ClassComment.Builder();
-    }
-
-    public static class Builder {
-        private ClassComment obj;
-
-        public Builder() {
-            this.obj = new ClassComment();
-        }
-
-        /**
-         * @param id
-         */
-        public Builder id(Integer id) {
-            obj.setId(id);
-            return this;
-        }
-
-        public ClassComment build() {
-            return this.obj;
-        }
-    }
-}

+ 16 - 16
server/data/src/main/java/com/qxgmat/data/dao/entity/ClassCourse.java

@@ -24,10 +24,10 @@ public class ClassCourse implements Serializable {
     private Integer parentStructId;
 
     /**
-     * 题目模块:base,sentence,textbook
+     * 题型:从struct上获取extend
      */
-    @Column(name = "`question_module`")
-    private String questionModule;
+    @Column(name = "`question_type`")
+    private String questionType;
 
     /**
      * 课程名称
@@ -91,21 +91,21 @@ public class ClassCourse implements Serializable {
     }
 
     /**
-     * 获取题目模块:base,sentence,textbook
+     * 获取题型:从struct上获取extend
      *
-     * @return question_module - 题目模块:base,sentence,textbook
+     * @return question_type - 题型:从struct上获取extend
      */
-    public String getQuestionModule() {
-        return questionModule;
+    public String getQuestionType() {
+        return questionType;
     }
 
     /**
-     * 设置题目模块:base,sentence,textbook
+     * 设置题型:从struct上获取extend
      *
-     * @param questionModule 题目模块:base,sentence,textbook
+     * @param questionType 题型:从struct上获取extend
      */
-    public void setQuestionModule(String questionModule) {
-        this.questionModule = questionModule;
+    public void setQuestionType(String questionType) {
+        this.questionType = questionType;
     }
 
     /**
@@ -149,7 +149,7 @@ public class ClassCourse implements Serializable {
         sb.append(", id=").append(id);
         sb.append(", structId=").append(structId);
         sb.append(", parentStructId=").append(parentStructId);
-        sb.append(", questionModule=").append(questionModule);
+        sb.append(", questionType=").append(questionType);
         sb.append(", title=").append(title);
         sb.append(", createTime=").append(createTime);
         sb.append("]");
@@ -196,12 +196,12 @@ public class ClassCourse implements Serializable {
         }
 
         /**
-         * 设置题目模块:base,sentence,textbook
+         * 设置题型:从struct上获取extend
          *
-         * @param questionModule 题目模块:base,sentence,textbook
+         * @param questionType 题型:从struct上获取extend
          */
-        public Builder questionModule(String questionModule) {
-            obj.setQuestionModule(questionModule);
+        public Builder questionType(String questionType) {
+            obj.setQuestionType(questionType);
             return this;
         }
 

+ 7 - 7
server/data/src/main/java/com/qxgmat/data/dao/entity/ExercisePaper.java

@@ -11,7 +11,7 @@ public class ExercisePaper implements Serializable {
     private Integer id;
 
     /**
-     * 题型
+     * 题型:从struct上获取extend
      */
     @Column(name = "`question_type`")
     private String questionType;
@@ -87,18 +87,18 @@ public class ExercisePaper implements Serializable {
     }
 
     /**
-     * 获取题型
+     * 获取题型:从struct上获取extend
      *
-     * @return question_type - 题型
+     * @return question_type - 题型:从struct上获取extend
      */
     public String getQuestionType() {
         return questionType;
     }
 
     /**
-     * 设置题型
+     * 设置题型:从struct上获取extend
      *
-     * @param questionType 题型
+     * @param questionType 题型:从struct上获取extend
      */
     public void setQuestionType(String questionType) {
         this.questionType = questionType;
@@ -307,9 +307,9 @@ public class ExercisePaper implements Serializable {
         }
 
         /**
-         * 设置题型
+         * 设置题型:从struct上获取extend
          *
-         * @param questionType 题型
+         * @param questionType 题型:从struct上获取extend
          */
         public Builder questionType(String questionType) {
             obj.setQuestionType(questionType);

+ 16 - 16
server/data/src/main/java/com/qxgmat/data/dao/entity/PreviewPaper.java

@@ -42,10 +42,10 @@ public class PreviewPaper implements Serializable {
     private Integer mode;
 
     /**
-     * 题目模块:base,preview,textbook
+     * 题目类型
      */
-    @Column(name = "`question_module`")
-    private String questionModule;
+    @Column(name = "`question_type`")
+    private String questionType;
 
     /**
      * 制定作业用户id:json
@@ -184,21 +184,21 @@ public class PreviewPaper implements Serializable {
     }
 
     /**
-     * 获取题目模块:base,preview,textbook
+     * 获取题目类型
      *
-     * @return question_module - 题目模块:base,preview,textbook
+     * @return question_type - 题目类型
      */
-    public String getQuestionModule() {
-        return questionModule;
+    public String getQuestionType() {
+        return questionType;
     }
 
     /**
-     * 设置题目模块:base,preview,textbook
+     * 设置题目类型
      *
-     * @param questionModule 题目模块:base,preview,textbook
+     * @param questionType 题目类型
      */
-    public void setQuestionModule(String questionModule) {
-        this.questionModule = questionModule;
+    public void setQuestionType(String questionType) {
+        this.questionType = questionType;
     }
 
     /**
@@ -313,7 +313,7 @@ public class PreviewPaper implements Serializable {
         sb.append(", courseNo=").append(courseNo);
         sb.append(", questionNoIds=").append(questionNoIds);
         sb.append(", mode=").append(mode);
-        sb.append(", questionModule=").append(questionModule);
+        sb.append(", questionType=").append(questionType);
         sb.append(", userIds=").append(userIds);
         sb.append(", startTime=").append(startTime);
         sb.append(", endTime=").append(endTime);
@@ -394,12 +394,12 @@ public class PreviewPaper implements Serializable {
         }
 
         /**
-         * 设置题目模块:base,preview,textbook
+         * 设置题目类型
          *
-         * @param questionModule 题目模块:base,preview,textbook
+         * @param questionType 题目类型
          */
-        public Builder questionModule(String questionModule) {
-            obj.setQuestionModule(questionModule);
+        public Builder questionType(String questionType) {
+            obj.setQuestionType(questionType);
             return this;
         }
 

+ 70 - 0
server/data/src/main/java/com/qxgmat/data/dao/entity/SentenceArticle.java

@@ -35,6 +35,18 @@ public class SentenceArticle implements Serializable {
     private Integer isTrail;
 
     /**
+     * 试看起始页
+     */
+    @Column(name = "`trail_start`")
+    private Integer trailStart;
+
+    /**
+     * 试看结束页
+     */
+    @Column(name = "`trail_end`")
+    private Integer trailEnd;
+
+    /**
      * 内容
      */
     @Column(name = "`content`")
@@ -129,6 +141,42 @@ public class SentenceArticle implements Serializable {
     }
 
     /**
+     * 获取试看起始页
+     *
+     * @return trail_start - 试看起始页
+     */
+    public Integer getTrailStart() {
+        return trailStart;
+    }
+
+    /**
+     * 设置试看起始页
+     *
+     * @param trailStart 试看起始页
+     */
+    public void setTrailStart(Integer trailStart) {
+        this.trailStart = trailStart;
+    }
+
+    /**
+     * 获取试看结束页
+     *
+     * @return trail_end - 试看结束页
+     */
+    public Integer getTrailEnd() {
+        return trailEnd;
+    }
+
+    /**
+     * 设置试看结束页
+     *
+     * @param trailEnd 试看结束页
+     */
+    public void setTrailEnd(Integer trailEnd) {
+        this.trailEnd = trailEnd;
+    }
+
+    /**
      * 获取内容
      *
      * @return content - 内容
@@ -157,6 +205,8 @@ public class SentenceArticle implements Serializable {
         sb.append(", chapter=").append(chapter);
         sb.append(", part=").append(part);
         sb.append(", isTrail=").append(isTrail);
+        sb.append(", trailStart=").append(trailStart);
+        sb.append(", trailEnd=").append(trailEnd);
         sb.append(", content=").append(content);
         sb.append("]");
         return sb.toString();
@@ -222,6 +272,26 @@ public class SentenceArticle implements Serializable {
         }
 
         /**
+         * 设置试看起始页
+         *
+         * @param trailStart 试看起始页
+         */
+        public Builder trailStart(Integer trailStart) {
+            obj.setTrailStart(trailStart);
+            return this;
+        }
+
+        /**
+         * 设置试看结束页
+         *
+         * @param trailEnd 试看结束页
+         */
+        public Builder trailEnd(Integer trailEnd) {
+            obj.setTrailEnd(trailEnd);
+            return this;
+        }
+
+        /**
          * 设置内容
          *
          * @param content 内容

+ 12 - 12
server/data/src/main/java/com/qxgmat/data/dao/entity/SentenceQuestion.java

@@ -25,8 +25,8 @@ public class SentenceQuestion implements Serializable {
     /**
      * 是否教材:1教材题,1用于作业
      */
-    @Column(name = "`is_custom`")
-    private Integer isCustom;
+    @Column(name = "`is_paper`")
+    private Integer isPaper;
 
     /**
      * 组卷序号
@@ -122,19 +122,19 @@ public class SentenceQuestion implements Serializable {
     /**
      * 获取是否教材:1教材题,1用于作业
      *
-     * @return is_custom - 是否教材:1教材题,1用于作业
+     * @return is_paper - 是否教材:1教材题,1用于作业
      */
-    public Integer getIsCustom() {
-        return isCustom;
+    public Integer getIsPaper() {
+        return isPaper;
     }
 
     /**
      * 设置是否教材:1教材题,1用于作业
      *
-     * @param isCustom 是否教材:1教材题,1用于作业
+     * @param isPaper 是否教材:1教材题,1用于作业
      */
-    public void setIsCustom(Integer isCustom) {
-        this.isCustom = isCustom;
+    public void setIsPaper(Integer isPaper) {
+        this.isPaper = isPaper;
     }
 
     /**
@@ -268,7 +268,7 @@ public class SentenceQuestion implements Serializable {
         sb.append(", id=").append(id);
         sb.append(", title=").append(title);
         sb.append(", isTrail=").append(isTrail);
-        sb.append(", isCustom=").append(isCustom);
+        sb.append(", isPaper=").append(isPaper);
         sb.append(", no=").append(no);
         sb.append(", questionId=").append(questionId);
         sb.append(", questionNoId=").append(questionNoId);
@@ -322,10 +322,10 @@ public class SentenceQuestion implements Serializable {
         /**
          * 设置是否教材:1教材题,1用于作业
          *
-         * @param isCustom 是否教材:1教材题,1用于作业
+         * @param isPaper 是否教材:1教材题,1用于作业
          */
-        public Builder isCustom(Integer isCustom) {
-            obj.setIsCustom(isCustom);
+        public Builder isPaper(Integer isPaper) {
+            obj.setIsPaper(isPaper);
             return this;
         }
 

+ 501 - 0
server/data/src/main/java/com/qxgmat/data/dao/entity/UserAskCourse.java

@@ -0,0 +1,501 @@
+package com.qxgmat.data.dao.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.*;
+
+@Table(name = "user_ask_course")
+public class UserAskCourse implements Serializable {
+    @Id
+    @Column(name = "`id`")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @Column(name = "`user_id`")
+    private Integer userId;
+
+    /**
+     * 课程id
+     */
+    @Column(name = "`course_id`")
+    private Integer courseId;
+
+    /**
+     * 课时id
+     */
+    @Column(name = "`course_no_id`")
+    private Integer courseNoId;
+
+    /**
+     * 位置
+     */
+    @Column(name = "`position`")
+    private String position;
+
+    /**
+     * 回答状态: 0未回答,1回答,2忽略
+     */
+    @Column(name = "`answer_status`")
+    private Integer answerStatus;
+
+    /**
+     * 回答人id
+     */
+    @Column(name = "`manager_id`")
+    private Integer managerId;
+
+    /**
+     * 展示状态:0关闭,1打开
+     */
+    @Column(name = "`show_status`")
+    private Integer showStatus;
+
+    /**
+     * 回答时间
+     */
+    @Column(name = "`answer_time`")
+    private Date answerTime;
+
+    /**
+     * 排序:从大到小
+     */
+    @Column(name = "`order`")
+    private Integer order;
+
+    @Column(name = "`create_time`")
+    private Date createTime;
+
+    @Column(name = "`update_time`")
+    private Date updateTime;
+
+    /**
+     * 提问
+     */
+    @Column(name = "`content`")
+    private String content;
+
+    /**
+     * 回答
+     */
+    @Column(name = "`answer`")
+    private String answer;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * @return id
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * @param id
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取用户id
+     *
+     * @return user_id - 用户id
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+
+    /**
+     * 设置用户id
+     *
+     * @param userId 用户id
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取课程id
+     *
+     * @return course_id - 课程id
+     */
+    public Integer getCourseId() {
+        return courseId;
+    }
+
+    /**
+     * 设置课程id
+     *
+     * @param courseId 课程id
+     */
+    public void setCourseId(Integer courseId) {
+        this.courseId = courseId;
+    }
+
+    /**
+     * 获取课时id
+     *
+     * @return course_no_id - 课时id
+     */
+    public Integer getCourseNoId() {
+        return courseNoId;
+    }
+
+    /**
+     * 设置课时id
+     *
+     * @param courseNoId 课时id
+     */
+    public void setCourseNoId(Integer courseNoId) {
+        this.courseNoId = courseNoId;
+    }
+
+    /**
+     * 获取位置
+     *
+     * @return position - 位置
+     */
+    public String getPosition() {
+        return position;
+    }
+
+    /**
+     * 设置位置
+     *
+     * @param position 位置
+     */
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    /**
+     * 获取回答状态: 0未回答,1回答,2忽略
+     *
+     * @return answer_status - 回答状态: 0未回答,1回答,2忽略
+     */
+    public Integer getAnswerStatus() {
+        return answerStatus;
+    }
+
+    /**
+     * 设置回答状态: 0未回答,1回答,2忽略
+     *
+     * @param answerStatus 回答状态: 0未回答,1回答,2忽略
+     */
+    public void setAnswerStatus(Integer answerStatus) {
+        this.answerStatus = answerStatus;
+    }
+
+    /**
+     * 获取回答人id
+     *
+     * @return manager_id - 回答人id
+     */
+    public Integer getManagerId() {
+        return managerId;
+    }
+
+    /**
+     * 设置回答人id
+     *
+     * @param managerId 回答人id
+     */
+    public void setManagerId(Integer managerId) {
+        this.managerId = managerId;
+    }
+
+    /**
+     * 获取展示状态:0关闭,1打开
+     *
+     * @return show_status - 展示状态:0关闭,1打开
+     */
+    public Integer getShowStatus() {
+        return showStatus;
+    }
+
+    /**
+     * 设置展示状态:0关闭,1打开
+     *
+     * @param showStatus 展示状态:0关闭,1打开
+     */
+    public void setShowStatus(Integer showStatus) {
+        this.showStatus = showStatus;
+    }
+
+    /**
+     * 获取回答时间
+     *
+     * @return answer_time - 回答时间
+     */
+    public Date getAnswerTime() {
+        return answerTime;
+    }
+
+    /**
+     * 设置回答时间
+     *
+     * @param answerTime 回答时间
+     */
+    public void setAnswerTime(Date answerTime) {
+        this.answerTime = answerTime;
+    }
+
+    /**
+     * 获取排序:从大到小
+     *
+     * @return order - 排序:从大到小
+     */
+    public Integer getOrder() {
+        return order;
+    }
+
+    /**
+     * 设置排序:从大到小
+     *
+     * @param order 排序:从大到小
+     */
+    public void setOrder(Integer order) {
+        this.order = order;
+    }
+
+    /**
+     * @return create_time
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * @param createTime
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * @return update_time
+     */
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    /**
+     * @param updateTime
+     */
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * 获取提问
+     *
+     * @return content - 提问
+     */
+    public String getContent() {
+        return content;
+    }
+
+    /**
+     * 设置提问
+     *
+     * @param content 提问
+     */
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    /**
+     * 获取回答
+     *
+     * @return answer - 回答
+     */
+    public String getAnswer() {
+        return answer;
+    }
+
+    /**
+     * 设置回答
+     *
+     * @param answer 回答
+     */
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userId=").append(userId);
+        sb.append(", courseId=").append(courseId);
+        sb.append(", courseNoId=").append(courseNoId);
+        sb.append(", position=").append(position);
+        sb.append(", answerStatus=").append(answerStatus);
+        sb.append(", managerId=").append(managerId);
+        sb.append(", showStatus=").append(showStatus);
+        sb.append(", answerTime=").append(answerTime);
+        sb.append(", order=").append(order);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", content=").append(content);
+        sb.append(", answer=").append(answer);
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public static UserAskCourse.Builder builder() {
+        return new UserAskCourse.Builder();
+    }
+
+    public static class Builder {
+        private UserAskCourse obj;
+
+        public Builder() {
+            this.obj = new UserAskCourse();
+        }
+
+        /**
+         * @param id
+         */
+        public Builder id(Integer id) {
+            obj.setId(id);
+            return this;
+        }
+
+        /**
+         * 设置用户id
+         *
+         * @param userId 用户id
+         */
+        public Builder userId(Integer userId) {
+            obj.setUserId(userId);
+            return this;
+        }
+
+        /**
+         * 设置课程id
+         *
+         * @param courseId 课程id
+         */
+        public Builder courseId(Integer courseId) {
+            obj.setCourseId(courseId);
+            return this;
+        }
+
+        /**
+         * 设置课时id
+         *
+         * @param courseNoId 课时id
+         */
+        public Builder courseNoId(Integer courseNoId) {
+            obj.setCourseNoId(courseNoId);
+            return this;
+        }
+
+        /**
+         * 设置位置
+         *
+         * @param position 位置
+         */
+        public Builder position(String position) {
+            obj.setPosition(position);
+            return this;
+        }
+
+        /**
+         * 设置回答
+         *
+         * @param answer 回答
+         */
+        public Builder answer(String answer) {
+            obj.setAnswer(answer);
+            return this;
+        }
+
+        /**
+         * 设置回答状态: 0未回答,1回答,2忽略
+         *
+         * @param answerStatus 回答状态: 0未回答,1回答,2忽略
+         */
+        public Builder answerStatus(Integer answerStatus) {
+            obj.setAnswerStatus(answerStatus);
+            return this;
+        }
+
+        /**
+         * 设置回答人id
+         *
+         * @param managerId 回答人id
+         */
+        public Builder managerId(Integer managerId) {
+            obj.setManagerId(managerId);
+            return this;
+        }
+
+        /**
+         * 设置展示状态:0关闭,1打开
+         *
+         * @param showStatus 展示状态:0关闭,1打开
+         */
+        public Builder showStatus(Integer showStatus) {
+            obj.setShowStatus(showStatus);
+            return this;
+        }
+
+        /**
+         * 设置回答时间
+         *
+         * @param answerTime 回答时间
+         */
+        public Builder answerTime(Date answerTime) {
+            obj.setAnswerTime(answerTime);
+            return this;
+        }
+
+        /**
+         * 设置排序:从大到小
+         *
+         * @param order 排序:从大到小
+         */
+        public Builder order(Integer order) {
+            obj.setOrder(order);
+            return this;
+        }
+
+        /**
+         * @param createTime
+         */
+        public Builder createTime(Date createTime) {
+            obj.setCreateTime(createTime);
+            return this;
+        }
+
+        /**
+         * @param updateTime
+         */
+        public Builder updateTime(Date updateTime) {
+            obj.setUpdateTime(updateTime);
+            return this;
+        }
+
+        /**
+         * 设置提问
+         *
+         * @param content 提问
+         */
+        public Builder content(String content) {
+            obj.setContent(content);
+            return this;
+        }
+
+        public UserAskCourse build() {
+            return this.obj;
+        }
+    }
+}

+ 16 - 16
server/data/src/main/java/com/qxgmat/data/dao/entity/UserAskQuestion.java

@@ -18,10 +18,10 @@ public class UserAskQuestion implements Serializable {
     private Integer userId;
 
     /**
-     * 模块:题目模块
+     * 题目模块
      */
-    @Column(name = "`module`")
-    private String module;
+    @Column(name = "`question_module`")
+    private String questionModule;
 
     /**
      * 题目id
@@ -124,21 +124,21 @@ public class UserAskQuestion implements Serializable {
     }
 
     /**
-     * 获取模块:题目模块
+     * 获取题目模块
      *
-     * @return module - 模块:题目模块
+     * @return question_module - 题目模块
      */
-    public String getModule() {
-        return module;
+    public String getQuestionModule() {
+        return questionModule;
     }
 
     /**
-     * 设置模块:题目模块
+     * 设置题目模块
      *
-     * @param module 模块:题目模块
+     * @param questionModule 题目模块
      */
-    public void setModule(String module) {
-        this.module = module;
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
     }
 
     /**
@@ -357,7 +357,7 @@ public class UserAskQuestion implements Serializable {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", userId=").append(userId);
-        sb.append(", module=").append(module);
+        sb.append(", questionModule=").append(questionModule);
         sb.append(", questionId=").append(questionId);
         sb.append(", questionNoId=").append(questionNoId);
         sb.append(", target=").append(target);
@@ -404,12 +404,12 @@ public class UserAskQuestion implements Serializable {
         }
 
         /**
-         * 设置模块:题目模块
+         * 设置题目模块
          *
-         * @param module 模块:题目模块
+         * @param questionModule 题目模块
          */
-        public Builder module(String module) {
-            obj.setModule(module);
+        public Builder questionModule(String questionModule) {
+            obj.setQuestionModule(questionModule);
             return this;
         }
 

+ 16 - 16
server/data/src/main/java/com/qxgmat/data/dao/entity/UserCollectQuestion.java

@@ -18,10 +18,10 @@ public class UserCollectQuestion implements Serializable {
     private Integer userId;
 
     /**
-     * 模块:exercise, examination, sentence
+     * 模块:base, sentence, textbook
      */
-    @Column(name = "`module`")
-    private String module;
+    @Column(name = "`question_module`")
+    private String questionModule;
 
     /**
      * 题目id
@@ -73,21 +73,21 @@ public class UserCollectQuestion implements Serializable {
     }
 
     /**
-     * 获取模块:exercise, examination, sentence
+     * 获取模块:base, sentence, textbook
      *
-     * @return module - 模块:exercise, examination, sentence
+     * @return question_module - 模块:base, sentence, textbook
      */
-    public String getModule() {
-        return module;
+    public String getQuestionModule() {
+        return questionModule;
     }
 
     /**
-     * 设置模块:exercise, examination, sentence
+     * 设置模块:base, sentence, textbook
      *
-     * @param module 模块:exercise, examination, sentence
+     * @param questionModule 模块:base, sentence, textbook
      */
-    public void setModule(String module) {
-        this.module = module;
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
     }
 
     /**
@@ -148,7 +148,7 @@ public class UserCollectQuestion implements Serializable {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", userId=").append(userId);
-        sb.append(", module=").append(module);
+        sb.append(", questionModule=").append(questionModule);
         sb.append(", questionId=").append(questionId);
         sb.append(", questionNoId=").append(questionNoId);
         sb.append(", createTime=").append(createTime);
@@ -186,12 +186,12 @@ public class UserCollectQuestion implements Serializable {
         }
 
         /**
-         * 设置模块:exercise, examination, sentence
+         * 设置模块:base, sentence, textbook
          *
-         * @param module 模块:exercise, examination, sentence
+         * @param questionModule 模块:base, sentence, textbook
          */
-        public Builder module(String module) {
-            obj.setModule(module);
+        public Builder questionModule(String questionModule) {
+            obj.setQuestionModule(questionModule);
             return this;
         }
 

+ 186 - 0
server/data/src/main/java/com/qxgmat/data/dao/entity/UserCourseComment.java

@@ -0,0 +1,186 @@
+package com.qxgmat.data.dao.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.*;
+
+@Table(name = "user_course_comment")
+public class UserCourseComment implements Serializable {
+    @Id
+    @Column(name = "`id`")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @Column(name = "`user_id`")
+    private Integer userId;
+
+    /**
+     * 课程id
+     */
+    @Column(name = "`course_id`")
+    private Integer courseId;
+
+    @Column(name = "`create_time`")
+    private Date createTime;
+
+    @Column(name = "`content`")
+    private String content;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * @return id
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * @param id
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取用户id
+     *
+     * @return user_id - 用户id
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+
+    /**
+     * 设置用户id
+     *
+     * @param userId 用户id
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取课程id
+     *
+     * @return course_id - 课程id
+     */
+    public Integer getCourseId() {
+        return courseId;
+    }
+
+    /**
+     * 设置课程id
+     *
+     * @param courseId 课程id
+     */
+    public void setCourseId(Integer courseId) {
+        this.courseId = courseId;
+    }
+
+    /**
+     * @return create_time
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * @param createTime
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * @return content
+     */
+    public String getContent() {
+        return content;
+    }
+
+    /**
+     * @param content
+     */
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userId=").append(userId);
+        sb.append(", courseId=").append(courseId);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", content=").append(content);
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public static UserCourseComment.Builder builder() {
+        return new UserCourseComment.Builder();
+    }
+
+    public static class Builder {
+        private UserCourseComment obj;
+
+        public Builder() {
+            this.obj = new UserCourseComment();
+        }
+
+        /**
+         * @param id
+         */
+        public Builder id(Integer id) {
+            obj.setId(id);
+            return this;
+        }
+
+        /**
+         * 设置用户id
+         *
+         * @param userId 用户id
+         */
+        public Builder userId(Integer userId) {
+            obj.setUserId(userId);
+            return this;
+        }
+
+        /**
+         * 设置课程id
+         *
+         * @param courseId 课程id
+         */
+        public Builder courseId(Integer courseId) {
+            obj.setCourseId(courseId);
+            return this;
+        }
+
+        /**
+         * @param createTime
+         */
+        public Builder createTime(Date createTime) {
+            obj.setCreateTime(createTime);
+            return this;
+        }
+
+        /**
+         * @param content
+         */
+        public Builder content(String content) {
+            obj.setContent(content);
+            return this;
+        }
+
+        public UserCourseComment build() {
+            return this.obj;
+        }
+    }
+}

+ 7 - 7
server/data/src/main/java/com/qxgmat/data/dao/entity/UserFeedbackError.java

@@ -18,7 +18,7 @@ public class UserFeedbackError implements Serializable {
     private Integer userId;
 
     /**
-     * 模块:题目模块
+     * 模块:question,data
      */
     @Column(name = "`module`")
     private String module;
@@ -109,18 +109,18 @@ public class UserFeedbackError implements Serializable {
     }
 
     /**
-     * 获取模块:题目模块
+     * 获取模块:question,data
      *
-     * @return module - 模块:题目模块
+     * @return module - 模块:question,data
      */
     public String getModule() {
         return module;
     }
 
     /**
-     * 设置模块:题目模块
+     * 设置模块:question,data
      *
-     * @param module 模块:题目模块
+     * @param module 模块:question,data
      */
     public void setModule(String module) {
         this.module = module;
@@ -336,9 +336,9 @@ public class UserFeedbackError implements Serializable {
         }
 
         /**
-         * 设置模块:题目模块
+         * 设置模块:question,data
          *
-         * @param module 模块:题目模块
+         * @param module 模块:question,data
          */
         public Builder module(String module) {
             obj.setModule(module);

+ 247 - 0
server/data/src/main/java/com/qxgmat/data/dao/entity/UserNoteCourse.java

@@ -0,0 +1,247 @@
+package com.qxgmat.data.dao.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.*;
+
+@Table(name = "user_note_course")
+public class UserNoteCourse implements Serializable {
+    @Id
+    @Column(name = "`id`")
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @Column(name = "`user_id`")
+    private Integer userId;
+
+    /**
+     * 课程ID
+     */
+    @Column(name = "`course_id`")
+    private Integer courseId;
+
+    /**
+     * 课时id
+     */
+    @Column(name = "`course_no_id`")
+    private Integer courseNoId;
+
+    @Column(name = "`create_time`")
+    private Date createTime;
+
+    @Column(name = "`update_time`")
+    private Date updateTime;
+
+    @Column(name = "`conntent`")
+    private String conntent;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * @return id
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * @param id
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取用户id
+     *
+     * @return user_id - 用户id
+     */
+    public Integer getUserId() {
+        return userId;
+    }
+
+    /**
+     * 设置用户id
+     *
+     * @param userId 用户id
+     */
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    /**
+     * 获取课程ID
+     *
+     * @return course_id - 课程ID
+     */
+    public Integer getCourseId() {
+        return courseId;
+    }
+
+    /**
+     * 设置课程ID
+     *
+     * @param courseId 课程ID
+     */
+    public void setCourseId(Integer courseId) {
+        this.courseId = courseId;
+    }
+
+    /**
+     * 获取课时id
+     *
+     * @return course_no_id - 课时id
+     */
+    public Integer getCourseNoId() {
+        return courseNoId;
+    }
+
+    /**
+     * 设置课时id
+     *
+     * @param courseNoId 课时id
+     */
+    public void setCourseNoId(Integer courseNoId) {
+        this.courseNoId = courseNoId;
+    }
+
+    /**
+     * @return create_time
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * @param createTime
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * @return update_time
+     */
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    /**
+     * @param updateTime
+     */
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    /**
+     * @return conntent
+     */
+    public String getConntent() {
+        return conntent;
+    }
+
+    /**
+     * @param conntent
+     */
+    public void setConntent(String conntent) {
+        this.conntent = conntent;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", userId=").append(userId);
+        sb.append(", courseId=").append(courseId);
+        sb.append(", courseNoId=").append(courseNoId);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append(", conntent=").append(conntent);
+        sb.append("]");
+        return sb.toString();
+    }
+
+    public static UserNoteCourse.Builder builder() {
+        return new UserNoteCourse.Builder();
+    }
+
+    public static class Builder {
+        private UserNoteCourse obj;
+
+        public Builder() {
+            this.obj = new UserNoteCourse();
+        }
+
+        /**
+         * @param id
+         */
+        public Builder id(Integer id) {
+            obj.setId(id);
+            return this;
+        }
+
+        /**
+         * 设置用户id
+         *
+         * @param userId 用户id
+         */
+        public Builder userId(Integer userId) {
+            obj.setUserId(userId);
+            return this;
+        }
+
+        /**
+         * 设置课程ID
+         *
+         * @param courseId 课程ID
+         */
+        public Builder courseId(Integer courseId) {
+            obj.setCourseId(courseId);
+            return this;
+        }
+
+        /**
+         * 设置课时id
+         *
+         * @param courseNoId 课时id
+         */
+        public Builder courseNoId(Integer courseNoId) {
+            obj.setCourseNoId(courseNoId);
+            return this;
+        }
+
+        /**
+         * @param createTime
+         */
+        public Builder createTime(Date createTime) {
+            obj.setCreateTime(createTime);
+            return this;
+        }
+
+        /**
+         * @param updateTime
+         */
+        public Builder updateTime(Date updateTime) {
+            obj.setUpdateTime(updateTime);
+            return this;
+        }
+
+        /**
+         * @param conntent
+         */
+        public Builder conntent(String conntent) {
+            obj.setConntent(conntent);
+            return this;
+        }
+
+        public UserNoteCourse build() {
+            return this.obj;
+        }
+    }
+}

+ 255 - 21
server/data/src/main/java/com/qxgmat/data/dao/entity/UserNoteQuestion.java

@@ -18,10 +18,10 @@ public class UserNoteQuestion implements Serializable {
     private Integer userId;
 
     /**
-     * 模块:exercise, exaination, sentence
+     * 模块:exercise, exaination, sentence, textbook
      */
-    @Column(name = "`module`")
-    private String module;
+    @Column(name = "`question_module`")
+    private String questionModule;
 
     /**
      * 题目id
@@ -35,6 +35,21 @@ public class UserNoteQuestion implements Serializable {
     @Column(name = "`question_no_id`")
     private Integer questionNoId;
 
+    @Column(name = "`content_time`")
+    private Date contentTime;
+
+    @Column(name = "`official_time`")
+    private Date officialTime;
+
+    @Column(name = "`qx_time`")
+    private Date qxTime;
+
+    @Column(name = "`association_time`")
+    private Date associationTime;
+
+    @Column(name = "`qa_time`")
+    private Date qaTime;
+
     @Column(name = "`create_time`")
     private Date createTime;
 
@@ -47,6 +62,18 @@ public class UserNoteQuestion implements Serializable {
     @Column(name = "`content`")
     private String content;
 
+    @Column(name = "`official_content`")
+    private String officialContent;
+
+    @Column(name = "`qx_content`")
+    private String qxContent;
+
+    @Column(name = "`association_content`")
+    private String associationContent;
+
+    @Column(name = "`qa_content`")
+    private String qaContent;
+
     private static final long serialVersionUID = 1L;
 
     /**
@@ -82,21 +109,21 @@ public class UserNoteQuestion implements Serializable {
     }
 
     /**
-     * 获取模块:exercise, exaination, sentence
+     * 获取模块:exercise, exaination, sentence, textbook
      *
-     * @return module - 模块:exercise, exaination, sentence
+     * @return question_module - 模块:exercise, exaination, sentence, textbook
      */
-    public String getModule() {
-        return module;
+    public String getQuestionModule() {
+        return questionModule;
     }
 
     /**
-     * 设置模块:exercise, exaination, sentence
+     * 设置模块:exercise, exaination, sentence, textbook
      *
-     * @param module 模块:exercise, exaination, sentence
+     * @param questionModule 模块:exercise, exaination, sentence, textbook
      */
-    public void setModule(String module) {
-        this.module = module;
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
     }
 
     /**
@@ -136,6 +163,76 @@ public class UserNoteQuestion implements Serializable {
     }
 
     /**
+     * @return content_time
+     */
+    public Date getContentTime() {
+        return contentTime;
+    }
+
+    /**
+     * @param contentTime
+     */
+    public void setContentTime(Date contentTime) {
+        this.contentTime = contentTime;
+    }
+
+    /**
+     * @return official_time
+     */
+    public Date getOfficialTime() {
+        return officialTime;
+    }
+
+    /**
+     * @param officialTime
+     */
+    public void setOfficialTime(Date officialTime) {
+        this.officialTime = officialTime;
+    }
+
+    /**
+     * @return qx_time
+     */
+    public Date getQxTime() {
+        return qxTime;
+    }
+
+    /**
+     * @param qxTime
+     */
+    public void setQxTime(Date qxTime) {
+        this.qxTime = qxTime;
+    }
+
+    /**
+     * @return association_time
+     */
+    public Date getAssociationTime() {
+        return associationTime;
+    }
+
+    /**
+     * @param associationTime
+     */
+    public void setAssociationTime(Date associationTime) {
+        this.associationTime = associationTime;
+    }
+
+    /**
+     * @return qa_time
+     */
+    public Date getQaTime() {
+        return qaTime;
+    }
+
+    /**
+     * @param qaTime
+     */
+    public void setQaTime(Date qaTime) {
+        this.qaTime = qaTime;
+    }
+
+    /**
      * @return create_time
      */
     public Date getCreateTime() {
@@ -181,6 +278,62 @@ public class UserNoteQuestion implements Serializable {
         this.content = content;
     }
 
+    /**
+     * @return official_content
+     */
+    public String getOfficialContent() {
+        return officialContent;
+    }
+
+    /**
+     * @param officialContent
+     */
+    public void setOfficialContent(String officialContent) {
+        this.officialContent = officialContent;
+    }
+
+    /**
+     * @return qx_content
+     */
+    public String getQxContent() {
+        return qxContent;
+    }
+
+    /**
+     * @param qxContent
+     */
+    public void setQxContent(String qxContent) {
+        this.qxContent = qxContent;
+    }
+
+    /**
+     * @return association_content
+     */
+    public String getAssociationContent() {
+        return associationContent;
+    }
+
+    /**
+     * @param associationContent
+     */
+    public void setAssociationContent(String associationContent) {
+        this.associationContent = associationContent;
+    }
+
+    /**
+     * @return qa_content
+     */
+    public String getQaContent() {
+        return qaContent;
+    }
+
+    /**
+     * @param qaContent
+     */
+    public void setQaContent(String qaContent) {
+        this.qaContent = qaContent;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -189,12 +342,21 @@ public class UserNoteQuestion implements Serializable {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", userId=").append(userId);
-        sb.append(", module=").append(module);
+        sb.append(", questionModule=").append(questionModule);
         sb.append(", questionId=").append(questionId);
         sb.append(", questionNoId=").append(questionNoId);
+        sb.append(", contentTime=").append(contentTime);
+        sb.append(", officialTime=").append(officialTime);
+        sb.append(", qxTime=").append(qxTime);
+        sb.append(", associationTime=").append(associationTime);
+        sb.append(", qaTime=").append(qaTime);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", content=").append(content);
+        sb.append(", officialContent=").append(officialContent);
+        sb.append(", qxContent=").append(qxContent);
+        sb.append(", associationContent=").append(associationContent);
+        sb.append(", qaContent=").append(qaContent);
         sb.append("]");
         return sb.toString();
     }
@@ -229,12 +391,12 @@ public class UserNoteQuestion implements Serializable {
         }
 
         /**
-         * 设置模块:exercise, exaination, sentence
+         * 设置模块:exercise, exaination, sentence, textbook
          *
-         * @param module 模块:exercise, exaination, sentence
+         * @param questionModule 模块:exercise, exaination, sentence, textbook
          */
-        public Builder module(String module) {
-            obj.setModule(module);
+        public Builder questionModule(String questionModule) {
+            obj.setQuestionModule(questionModule);
             return this;
         }
 
@@ -259,6 +421,56 @@ public class UserNoteQuestion implements Serializable {
         }
 
         /**
+         * 设置笔记内容
+         *
+         * @param content 笔记内容
+         */
+        public Builder content(String content) {
+            obj.setContent(content);
+            return this;
+        }
+
+        /**
+         * @param contentTime
+         */
+        public Builder contentTime(Date contentTime) {
+            obj.setContentTime(contentTime);
+            return this;
+        }
+
+        /**
+         * @param officialTime
+         */
+        public Builder officialTime(Date officialTime) {
+            obj.setOfficialTime(officialTime);
+            return this;
+        }
+
+        /**
+         * @param qxTime
+         */
+        public Builder qxTime(Date qxTime) {
+            obj.setQxTime(qxTime);
+            return this;
+        }
+
+        /**
+         * @param associationTime
+         */
+        public Builder associationTime(Date associationTime) {
+            obj.setAssociationTime(associationTime);
+            return this;
+        }
+
+        /**
+         * @param qaTime
+         */
+        public Builder qaTime(Date qaTime) {
+            obj.setQaTime(qaTime);
+            return this;
+        }
+
+        /**
          * @param createTime
          */
         public Builder createTime(Date createTime) {
@@ -275,12 +487,34 @@ public class UserNoteQuestion implements Serializable {
         }
 
         /**
-         * 设置笔记内容
-         *
-         * @param content 笔记内容
+         * @param officialContent
          */
-        public Builder content(String content) {
-            obj.setContent(content);
+        public Builder officialContent(String officialContent) {
+            obj.setOfficialContent(officialContent);
+            return this;
+        }
+
+        /**
+         * @param qxContent
+         */
+        public Builder qxContent(String qxContent) {
+            obj.setQxContent(qxContent);
+            return this;
+        }
+
+        /**
+         * @param associationContent
+         */
+        public Builder associationContent(String associationContent) {
+            obj.setAssociationContent(associationContent);
+            return this;
+        }
+
+        /**
+         * @param qaContent
+         */
+        public Builder qaContent(String qaContent) {
+            obj.setQaContent(qaContent);
             return this;
         }
 

+ 39 - 39
server/data/src/main/java/com/qxgmat/data/dao/entity/UserPaper.java

@@ -24,22 +24,22 @@ public class UserPaper implements Serializable {
     private String title;
 
     /**
-     * 组卷模块:examination,exercise,collect,error,preview
+     * 组卷模块:examination,exercise, sentence
      */
     @Column(name = "`paper_module`")
     private String paperModule;
 
     /**
-     * 组卷扩展:examination, exercise
+     * 组卷来源:examination, exercise, collect, error, preview
      */
-    @Column(name = "`module_extend`")
-    private String moduleExtend;
+    @Column(name = "`paper_origin`")
+    private String paperOrigin;
 
     /**
-     * 对应模块id
+     * 对应来源id
      */
-    @Column(name = "`module_id`")
-    private Integer moduleId;
+    @Column(name = "`origin_id`")
+    private Integer originId;
 
     /**
      * 题目编号id列表:json
@@ -148,57 +148,57 @@ public class UserPaper implements Serializable {
     }
 
     /**
-     * 获取组卷模块:examination,exercise,collect,error,preview
+     * 获取组卷模块:examination,exercise, sentence
      *
-     * @return paper_module - 组卷模块:examination,exercise,collect,error,preview
+     * @return paper_module - 组卷模块:examination,exercise, sentence
      */
     public String getPaperModule() {
         return paperModule;
     }
 
     /**
-     * 设置组卷模块:examination,exercise,collect,error,preview
+     * 设置组卷模块:examination,exercise, sentence
      *
-     * @param paperModule 组卷模块:examination,exercise,collect,error,preview
+     * @param paperModule 组卷模块:examination,exercise, sentence
      */
     public void setPaperModule(String paperModule) {
         this.paperModule = paperModule;
     }
 
     /**
-     * 获取组卷扩展:examination, exercise
+     * 获取组卷来源:examination, exercise, collect, error, preview
      *
-     * @return module_extend - 组卷扩展:examination, exercise
+     * @return paper_origin - 组卷来源:examination, exercise, collect, error, preview
      */
-    public String getModuleExtend() {
-        return moduleExtend;
+    public String getPaperOrigin() {
+        return paperOrigin;
     }
 
     /**
-     * 设置组卷扩展:examination, exercise
+     * 设置组卷来源:examination, exercise, collect, error, preview
      *
-     * @param moduleExtend 组卷扩展:examination, exercise
+     * @param paperOrigin 组卷来源:examination, exercise, collect, error, preview
      */
-    public void setModuleExtend(String moduleExtend) {
-        this.moduleExtend = moduleExtend;
+    public void setPaperOrigin(String paperOrigin) {
+        this.paperOrigin = paperOrigin;
     }
 
     /**
-     * 获取对应模块id
+     * 获取对应来源id
      *
-     * @return module_id - 对应模块id
+     * @return origin_id - 对应来源id
      */
-    public Integer getModuleId() {
-        return moduleId;
+    public Integer getOriginId() {
+        return originId;
     }
 
     /**
-     * 设置对应模块id
+     * 设置对应来源id
      *
-     * @param moduleId 对应模块id
+     * @param originId 对应来源id
      */
-    public void setModuleId(Integer moduleId) {
-        this.moduleId = moduleId;
+    public void setOriginId(Integer originId) {
+        this.originId = originId;
     }
 
     /**
@@ -373,8 +373,8 @@ public class UserPaper implements Serializable {
         sb.append(", userId=").append(userId);
         sb.append(", title=").append(title);
         sb.append(", paperModule=").append(paperModule);
-        sb.append(", moduleExtend=").append(moduleExtend);
-        sb.append(", moduleId=").append(moduleId);
+        sb.append(", paperOrigin=").append(paperOrigin);
+        sb.append(", originId=").append(originId);
         sb.append(", questionNoIds=").append(questionNoIds);
         sb.append(", questionNumber=").append(questionNumber);
         sb.append(", times=").append(times);
@@ -428,9 +428,9 @@ public class UserPaper implements Serializable {
         }
 
         /**
-         * 设置组卷模块:examination,exercise,collect,error,preview
+         * 设置组卷模块:examination,exercise, sentence
          *
-         * @param paperModule 组卷模块:examination,exercise,collect,error,preview
+         * @param paperModule 组卷模块:examination,exercise, sentence
          */
         public Builder paperModule(String paperModule) {
             obj.setPaperModule(paperModule);
@@ -438,22 +438,22 @@ public class UserPaper implements Serializable {
         }
 
         /**
-         * 设置组卷扩展:examination, exercise
+         * 设置组卷来源:examination, exercise, collect, error, preview
          *
-         * @param moduleExtend 组卷扩展:examination, exercise
+         * @param paperOrigin 组卷来源:examination, exercise, collect, error, preview
          */
-        public Builder moduleExtend(String moduleExtend) {
-            obj.setModuleExtend(moduleExtend);
+        public Builder paperOrigin(String paperOrigin) {
+            obj.setPaperOrigin(paperOrigin);
             return this;
         }
 
         /**
-         * 设置对应模块id
+         * 设置对应来源id
          *
-         * @param moduleId 对应模块id
+         * @param originId 对应来源id
          */
-        public Builder moduleId(Integer moduleId) {
-            obj.setModuleId(moduleId);
+        public Builder originId(Integer originId) {
+            obj.setOriginId(originId);
             return this;
         }
 

+ 51 - 16
server/data/src/main/java/com/qxgmat/data/dao/entity/UserPaperQuestion.java

@@ -23,16 +23,22 @@ public class UserPaperQuestion implements Serializable {
     private Integer paperId;
 
     /**
+     * 题目模块:base, sentence, textbook
+     */
+    @Column(name = "`question_module`")
+    private String questionModule;
+
+    /**
      * 题目编号id
      */
     @Column(name = "`question_no_id`")
     private Integer questionNoId;
 
     /**
-     * 模块标记:collect,error,remove_error
+     * 题目来源:collect,error,remove_error
      */
-    @Column(name = "`paper_module`")
-    private String paperModule;
+    @Column(name = "`question_origin`")
+    private String questionOrigin;
 
     private static final long serialVersionUID = 1L;
 
@@ -87,6 +93,24 @@ public class UserPaperQuestion implements Serializable {
     }
 
     /**
+     * 获取题目模块:base, sentence, textbook
+     *
+     * @return question_module - 题目模块:base, sentence, textbook
+     */
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    /**
+     * 设置题目模块:base, sentence, textbook
+     *
+     * @param questionModule 题目模块:base, sentence, textbook
+     */
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
+
+    /**
      * 获取题目编号id
      *
      * @return question_no_id - 题目编号id
@@ -105,21 +129,21 @@ public class UserPaperQuestion implements Serializable {
     }
 
     /**
-     * 获取模块标记:collect,error,remove_error
+     * 获取题目来源:collect,error,remove_error
      *
-     * @return paper_module - 模块标记:collect,error,remove_error
+     * @return question_origin - 题目来源:collect,error,remove_error
      */
-    public String getPaperModule() {
-        return paperModule;
+    public String getQuestionOrigin() {
+        return questionOrigin;
     }
 
     /**
-     * 设置模块标记:collect,error,remove_error
+     * 设置题目来源:collect,error,remove_error
      *
-     * @param paperModule 模块标记:collect,error,remove_error
+     * @param questionOrigin 题目来源:collect,error,remove_error
      */
-    public void setPaperModule(String paperModule) {
-        this.paperModule = paperModule;
+    public void setQuestionOrigin(String questionOrigin) {
+        this.questionOrigin = questionOrigin;
     }
 
     @Override
@@ -131,8 +155,9 @@ public class UserPaperQuestion implements Serializable {
         sb.append(", id=").append(id);
         sb.append(", userId=").append(userId);
         sb.append(", paperId=").append(paperId);
+        sb.append(", questionModule=").append(questionModule);
         sb.append(", questionNoId=").append(questionNoId);
-        sb.append(", paperModule=").append(paperModule);
+        sb.append(", questionOrigin=").append(questionOrigin);
         sb.append("]");
         return sb.toString();
     }
@@ -177,6 +202,16 @@ public class UserPaperQuestion implements Serializable {
         }
 
         /**
+         * 设置题目模块:base, sentence, textbook
+         *
+         * @param questionModule 题目模块:base, sentence, textbook
+         */
+        public Builder questionModule(String questionModule) {
+            obj.setQuestionModule(questionModule);
+            return this;
+        }
+
+        /**
          * 设置题目编号id
          *
          * @param questionNoId 题目编号id
@@ -187,12 +222,12 @@ public class UserPaperQuestion implements Serializable {
         }
 
         /**
-         * 设置模块标记:collect,error,remove_error
+         * 设置题目来源:collect,error,remove_error
          *
-         * @param paperModule 模块标记:collect,error,remove_error
+         * @param questionOrigin 题目来源:collect,error,remove_error
          */
-        public Builder paperModule(String paperModule) {
-            obj.setPaperModule(paperModule);
+        public Builder questionOrigin(String questionOrigin) {
+            obj.setQuestionOrigin(questionOrigin);
             return this;
         }
 

+ 0 - 26
server/data/src/main/java/com/qxgmat/data/dao/entity/UserPay.java

@@ -29,9 +29,6 @@ public class UserPay implements Serializable {
     @Column(name = "`module_extend`")
     private String moduleExtend;
 
-    @Column(name = "`module_id`")
-    private Integer moduleId;
-
     /**
      * 使用状态:0未使用,1已使用
      */
@@ -124,20 +121,6 @@ public class UserPay implements Serializable {
     }
 
     /**
-     * @return module_id
-     */
-    public Integer getModuleId() {
-        return moduleId;
-    }
-
-    /**
-     * @param moduleId
-     */
-    public void setModuleId(Integer moduleId) {
-        this.moduleId = moduleId;
-    }
-
-    /**
      * 获取使用状态:0未使用,1已使用
      *
      * @return is_use - 使用状态:0未使用,1已使用
@@ -225,7 +208,6 @@ public class UserPay implements Serializable {
         sb.append(", userId=").append(userId);
         sb.append(", module=").append(module);
         sb.append(", moduleExtend=").append(moduleExtend);
-        sb.append(", moduleId=").append(moduleId);
         sb.append(", isUse=").append(isUse);
         sb.append(", useTime=").append(useTime);
         sb.append(", startTime=").append(startTime);
@@ -275,14 +257,6 @@ public class UserPay implements Serializable {
         }
 
         /**
-         * @param moduleId
-         */
-        public Builder moduleId(Integer moduleId) {
-            obj.setModuleId(moduleId);
-            return this;
-        }
-
-        /**
          * 设置模块扩展信息
          *
          * @param moduleExtend 模块扩展信息

+ 70 - 0
server/data/src/main/java/com/qxgmat/data/dao/entity/UserQuestion.java

@@ -25,6 +25,18 @@ public class UserQuestion implements Serializable {
     private Integer reportId;
 
     /**
+     * 题目模块:exercise, examination, sentence, textbook
+     */
+    @Column(name = "`question_module`")
+    private String questionModule;
+
+    /**
+     * 题型
+     */
+    @Column(name = "`question_type`")
+    private String questionType;
+
+    /**
      * 题目id
      */
     @Column(name = "`question_id`")
@@ -134,6 +146,42 @@ public class UserQuestion implements Serializable {
     }
 
     /**
+     * 获取题目模块:exercise, examination, sentence, textbook
+     *
+     * @return question_module - 题目模块:exercise, examination, sentence, textbook
+     */
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    /**
+     * 设置题目模块:exercise, examination, sentence, textbook
+     *
+     * @param questionModule 题目模块:exercise, examination, sentence, textbook
+     */
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
+
+    /**
+     * 获取题型
+     *
+     * @return question_type - 题型
+     */
+    public String getQuestionType() {
+        return questionType;
+    }
+
+    /**
+     * 设置题型
+     *
+     * @param questionType 题型
+     */
+    public void setQuestionType(String questionType) {
+        this.questionType = questionType;
+    }
+
+    /**
      * 获取题目id
      *
      * @return question_id - 题目id
@@ -318,6 +366,8 @@ public class UserQuestion implements Serializable {
         sb.append(", id=").append(id);
         sb.append(", userId=").append(userId);
         sb.append(", reportId=").append(reportId);
+        sb.append(", questionModule=").append(questionModule);
+        sb.append(", questionType=").append(questionType);
         sb.append(", questionId=").append(questionId);
         sb.append(", questionNoId=").append(questionNoId);
         sb.append(", no=").append(no);
@@ -372,6 +422,26 @@ public class UserQuestion implements Serializable {
         }
 
         /**
+         * 设置题目模块:exercise, examination, sentence, textbook
+         *
+         * @param questionModule 题目模块:exercise, examination, sentence, textbook
+         */
+        public Builder questionModule(String questionModule) {
+            obj.setQuestionModule(questionModule);
+            return this;
+        }
+
+        /**
+         * 设置题型
+         *
+         * @param questionType 题型
+         */
+        public Builder questionType(String questionType) {
+            obj.setQuestionType(questionType);
+            return this;
+        }
+
+        /**
          * 设置题目id
          *
          * @param questionId 题目id

+ 54 - 19
server/data/src/main/java/com/qxgmat/data/dao/entity/UserReport.java

@@ -25,13 +25,19 @@ public class UserReport implements Serializable {
     private Integer paperId;
 
     /**
-     * 对应模块:exercise,examination,sentence, homework_preview
+     * 组卷模块:exercise,examination,sentence
      */
     @Column(name = "`paper_module`")
     private String paperModule;
 
-    @Column(name = "`module_id`")
-    private Integer moduleId;
+    /**
+     * 组卷来源
+     */
+    @Column(name = "`paper_origin`")
+    private String paperOrigin;
+
+    @Column(name = "`origin_id`")
+    private Integer originId;
 
     /**
      * 题目编号id列表:json
@@ -158,35 +164,53 @@ public class UserReport implements Serializable {
     }
 
     /**
-     * 获取对应模块:exercise,examination,sentence, homework_preview
+     * 获取组卷模块:exercise,examination,sentence
      *
-     * @return paper_module - 对应模块:exercise,examination,sentence, homework_preview
+     * @return paper_module - 组卷模块:exercise,examination,sentence
      */
     public String getPaperModule() {
         return paperModule;
     }
 
     /**
-     * 设置对应模块:exercise,examination,sentence, homework_preview
+     * 设置组卷模块:exercise,examination,sentence
      *
-     * @param paperModule 对应模块:exercise,examination,sentence, homework_preview
+     * @param paperModule 组卷模块:exercise,examination,sentence
      */
     public void setPaperModule(String paperModule) {
         this.paperModule = paperModule;
     }
 
     /**
-     * @return module_id
+     * 获取组卷来源
+     *
+     * @return paper_origin - 组卷来源
+     */
+    public String getPaperOrigin() {
+        return paperOrigin;
+    }
+
+    /**
+     * 设置组卷来源
+     *
+     * @param paperOrigin 组卷来源
      */
-    public Integer getModuleId() {
-        return moduleId;
+    public void setPaperOrigin(String paperOrigin) {
+        this.paperOrigin = paperOrigin;
     }
 
     /**
-     * @param moduleId
+     * @return origin_id
      */
-    public void setModuleId(Integer moduleId) {
-        this.moduleId = moduleId;
+    public Integer getOriginId() {
+        return originId;
+    }
+
+    /**
+     * @param originId
+     */
+    public void setOriginId(Integer originId) {
+        this.originId = originId;
     }
 
     /**
@@ -425,7 +449,8 @@ public class UserReport implements Serializable {
         sb.append(", userId=").append(userId);
         sb.append(", paperId=").append(paperId);
         sb.append(", paperModule=").append(paperModule);
-        sb.append(", moduleId=").append(moduleId);
+        sb.append(", paperOrigin=").append(paperOrigin);
+        sb.append(", originId=").append(originId);
         sb.append(", questionNoIds=").append(questionNoIds);
         sb.append(", questionNumber=").append(questionNumber);
         sb.append(", time=").append(time);
@@ -483,9 +508,9 @@ public class UserReport implements Serializable {
         }
 
         /**
-         * 设置对应模块:exercise,examination,sentence, homework_preview
+         * 设置组卷模块:exercise,examination,sentence
          *
-         * @param paperModule 对应模块:exercise,examination,sentence, homework_preview
+         * @param paperModule 组卷模块:exercise,examination,sentence
          */
         public Builder paperModule(String paperModule) {
             obj.setPaperModule(paperModule);
@@ -493,10 +518,20 @@ public class UserReport implements Serializable {
         }
 
         /**
-         * @param moduleId
+         * 设置组卷来源
+         *
+         * @param paperOrigin 组卷来源
+         */
+        public Builder paperOrigin(String paperOrigin) {
+            obj.setPaperOrigin(paperOrigin);
+            return this;
+        }
+
+        /**
+         * @param originId
          */
-        public Builder moduleId(Integer moduleId) {
-            obj.setModuleId(moduleId);
+        public Builder originId(Integer originId) {
+            obj.setOriginId(originId);
             return this;
         }
 

+ 0 - 10
server/data/src/main/java/com/qxgmat/data/dao/mapping/ClassCommentMapper.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qxgmat.data.dao.ClassCommentMapper">
-  <resultMap id="BaseResultMap" type="com.qxgmat.data.dao.entity.ClassComment">
-    <!--
-      WARNING - @mbg.generated
-    -->
-    <id column="id" jdbcType="INTEGER" property="id" />
-  </resultMap>
-</mapper>

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/ClassCourseMapper.xml

@@ -8,7 +8,7 @@
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="struct_id" jdbcType="INTEGER" property="structId" />
     <result column="parent_struct_id" jdbcType="INTEGER" property="parentStructId" />
-    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
+    <result column="question_type" jdbcType="VARCHAR" property="questionType" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
@@ -16,6 +16,6 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `struct_id`, `parent_struct_id`, `question_module`, `title`, `create_time`
+    `id`, `struct_id`, `parent_struct_id`, `question_type`, `title`, `create_time`
   </sql>
 </mapper>

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/PreviewPaperMapper.xml

@@ -11,7 +11,7 @@
     <result column="course_no" jdbcType="INTEGER" property="courseNo" />
     <result column="question_no_ids" jdbcType="VARCHAR" property="questionNoIds" typeHandler="com.nuliji.tools.mybatis.handler.IntegerArrayWithJsonHandler" />
     <result column="mode" jdbcType="INTEGER" property="mode" />
-    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
+    <result column="question_type" jdbcType="VARCHAR" property="questionType" />
     <result column="user_ids" jdbcType="VARCHAR" property="userIds" typeHandler="com.nuliji.tools.mybatis.handler.IntegerArrayWithJsonHandler" />
     <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
     <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
@@ -23,7 +23,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `title`, `course_id`, `course_no`, `question_no_ids`, `mode`, `question_module`, 
+    `id`, `title`, `course_id`, `course_no`, `question_no_ids`, `mode`, `question_type`, 
     `user_ids`, `start_time`, `end_time`, `finish`, `create_time`, `update_time`
   </sql>
 </mapper>

+ 3 - 1
server/data/src/main/java/com/qxgmat/data/dao/mapping/SentenceArticleMapper.xml

@@ -10,6 +10,8 @@
     <result column="chapter" jdbcType="INTEGER" property="chapter" />
     <result column="part" jdbcType="INTEGER" property="part" />
     <result column="is_trail" jdbcType="INTEGER" property="isTrail" />
+    <result column="trail_start" jdbcType="INTEGER" property="trailStart" />
+    <result column="trail_end" jdbcType="INTEGER" property="trailEnd" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.qxgmat.data.dao.entity.SentenceArticle">
     <!--
@@ -21,7 +23,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `title`, `chapter`, `part`, `is_trail`
+    `id`, `title`, `chapter`, `part`, `is_trail`, `trail_start`, `trail_end`
   </sql>
   <sql id="Blob_Column_List">
     <!--

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/SentenceQuestionMapper.xml

@@ -8,7 +8,7 @@
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="is_trail" jdbcType="INTEGER" property="isTrail" />
-    <result column="is_custom" jdbcType="INTEGER" property="isCustom" />
+    <result column="is_paper" jdbcType="INTEGER" property="isPaper" />
     <result column="no" jdbcType="INTEGER" property="no" />
     <result column="question_id" jdbcType="INTEGER" property="questionId" />
     <result column="question_no_id" jdbcType="INTEGER" property="questionNoId" />
@@ -26,7 +26,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `title`, `is_trail`, `is_custom`, `no`, `question_id`, `question_no_id`, `total_time`, 
+    `id`, `title`, `is_trail`, `is_paper`, `no`, `question_id`, `question_no_id`, `total_time`, 
     `total_number`, `total_correct`
   </sql>
   <sql id="Blob_Column_List">

+ 41 - 0
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserAskCourseMapper.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qxgmat.data.dao.UserAskCourseMapper">
+  <resultMap id="BaseResultMap" type="com.qxgmat.data.dao.entity.UserAskCourse">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_id" jdbcType="INTEGER" property="userId" />
+    <result column="course_id" jdbcType="INTEGER" property="courseId" />
+    <result column="course_no_id" jdbcType="INTEGER" property="courseNoId" />
+    <result column="position" jdbcType="VARCHAR" property="position" />
+    <result column="answer_status" jdbcType="INTEGER" property="answerStatus" />
+    <result column="manager_id" jdbcType="INTEGER" property="managerId" />
+    <result column="show_status" jdbcType="INTEGER" property="showStatus" />
+    <result column="answer_time" jdbcType="TIMESTAMP" property="answerTime" />
+    <result column="order" jdbcType="INTEGER" property="order" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.qxgmat.data.dao.entity.UserAskCourse">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <result column="content" jdbcType="LONGVARCHAR" property="content" />
+    <result column="answer" jdbcType="LONGVARCHAR" property="answer" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    `id`, `user_id`, `course_id`, `course_no_id`, `position`, `answer_status`, `manager_id`, 
+    `show_status`, `answer_time`, `order`, `create_time`, `update_time`
+  </sql>
+  <sql id="Blob_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    `content`, `answer`
+  </sql>
+</mapper>

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserAskQuestionMapper.xml

@@ -7,7 +7,7 @@
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="user_id" jdbcType="INTEGER" property="userId" />
-    <result column="module" jdbcType="VARCHAR" property="module" />
+    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
     <result column="question_id" jdbcType="INTEGER" property="questionId" />
     <result column="question_no_id" jdbcType="INTEGER" property="questionNoId" />
     <result column="target" jdbcType="VARCHAR" property="target" />
@@ -30,7 +30,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `module`, `question_id`, `question_no_id`, `target`, `answer_status`, 
+    `id`, `user_id`, `question_module`, `question_id`, `question_no_id`, `target`, `answer_status`, 
     `manager_id`, `show_status`, `answer_time`, `order`, `create_time`, `update_time`
   </sql>
   <sql id="Blob_Column_List">

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserCollectQuestionMapper.xml

@@ -7,7 +7,7 @@
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="user_id" jdbcType="INTEGER" property="userId" />
-    <result column="module" jdbcType="VARCHAR" property="module" />
+    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
     <result column="question_id" jdbcType="INTEGER" property="questionId" />
     <result column="question_no_id" jdbcType="INTEGER" property="questionNoId" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -16,6 +16,6 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `module`, `question_id`, `question_no_id`, `create_time`
+    `id`, `user_id`, `question_module`, `question_id`, `question_no_id`, `create_time`
   </sql>
 </mapper>

+ 31 - 0
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserCourseCommentMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qxgmat.data.dao.UserCourseCommentMapper">
+  <resultMap id="BaseResultMap" type="com.qxgmat.data.dao.entity.UserCourseComment">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_id" jdbcType="INTEGER" property="userId" />
+    <result column="course_id" jdbcType="INTEGER" property="courseId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.qxgmat.data.dao.entity.UserCourseComment">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <result column="content" jdbcType="LONGVARCHAR" property="content" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    `id`, `user_id`, `course_id`, `create_time`
+  </sql>
+  <sql id="Blob_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    `content`
+  </sql>
+</mapper>

+ 33 - 0
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserNoteCourseMapper.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qxgmat.data.dao.UserNoteCourseMapper">
+  <resultMap id="BaseResultMap" type="com.qxgmat.data.dao.entity.UserNoteCourse">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="user_id" jdbcType="INTEGER" property="userId" />
+    <result column="course_id" jdbcType="INTEGER" property="courseId" />
+    <result column="course_no_id" jdbcType="INTEGER" property="courseNoId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.qxgmat.data.dao.entity.UserNoteCourse">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <result column="conntent" jdbcType="LONGVARCHAR" property="conntent" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    `id`, `user_id`, `course_id`, `course_no_id`, `create_time`, `update_time`
+  </sql>
+  <sql id="Blob_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    `conntent`
+  </sql>
+</mapper>

+ 13 - 3
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserNoteQuestionMapper.xml

@@ -7,9 +7,14 @@
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="user_id" jdbcType="INTEGER" property="userId" />
-    <result column="module" jdbcType="VARCHAR" property="module" />
+    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
     <result column="question_id" jdbcType="INTEGER" property="questionId" />
     <result column="question_no_id" jdbcType="INTEGER" property="questionNoId" />
+    <result column="content_time" jdbcType="TIMESTAMP" property="contentTime" />
+    <result column="official_time" jdbcType="TIMESTAMP" property="officialTime" />
+    <result column="qx_time" jdbcType="TIMESTAMP" property="qxTime" />
+    <result column="association_time" jdbcType="TIMESTAMP" property="associationTime" />
+    <result column="qa_time" jdbcType="TIMESTAMP" property="qaTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
@@ -18,17 +23,22 @@
       WARNING - @mbg.generated
     -->
     <result column="content" jdbcType="LONGVARCHAR" property="content" />
+    <result column="official_content" jdbcType="LONGVARCHAR" property="officialContent" />
+    <result column="qx_content" jdbcType="LONGVARCHAR" property="qxContent" />
+    <result column="association_content" jdbcType="LONGVARCHAR" property="associationContent" />
+    <result column="qa_content" jdbcType="LONGVARCHAR" property="qaContent" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `module`, `question_id`, `question_no_id`, `create_time`, `update_time`
+    `id`, `user_id`, `question_module`, `question_id`, `question_no_id`, `content_time`, 
+    `official_time`, `qx_time`, `association_time`, `qa_time`, `create_time`, `update_time`
   </sql>
   <sql id="Blob_Column_List">
     <!--
       WARNING - @mbg.generated
     -->
-    `content`
+    `content`, `official_content`, `qx_content`, `association_content`, `qa_content`
   </sql>
 </mapper>

+ 3 - 3
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserPaperMapper.xml

@@ -9,8 +9,8 @@
     <result column="user_id" jdbcType="INTEGER" property="userId" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="paper_module" jdbcType="VARCHAR" property="paperModule" />
-    <result column="module_extend" jdbcType="VARCHAR" property="moduleExtend" />
-    <result column="module_id" jdbcType="INTEGER" property="moduleId" />
+    <result column="paper_origin" jdbcType="VARCHAR" property="paperOrigin" />
+    <result column="origin_id" jdbcType="INTEGER" property="originId" />
     <result column="question_no_ids" jdbcType="VARCHAR" property="questionNoIds" typeHandler="com.nuliji.tools.mybatis.handler.IntegerArrayWithJsonHandler" />
     <result column="question_number" jdbcType="INTEGER" property="questionNumber" />
     <result column="times" jdbcType="INTEGER" property="times" />
@@ -25,7 +25,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `title`, `paper_module`, `module_extend`, `module_id`, `question_no_ids`, 
+    `id`, `user_id`, `title`, `paper_module`, `paper_origin`, `origin_id`, `question_no_ids`, 
     `question_number`, `times`, `time`, `total_time`, `total_number`, `total_correct`, 
     `delete_time`, `is_reset`
   </sql>

+ 3 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserPaperQuestionMapper.xml

@@ -8,13 +8,14 @@
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="user_id" jdbcType="INTEGER" property="userId" />
     <result column="paper_id" jdbcType="INTEGER" property="paperId" />
+    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
     <result column="question_no_id" jdbcType="INTEGER" property="questionNoId" />
-    <result column="paper_module" jdbcType="VARCHAR" property="paperModule" />
+    <result column="question_origin" jdbcType="VARCHAR" property="questionOrigin" />
   </resultMap>
   <sql id="Base_Column_List">
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `paper_id`, `question_no_id`, `paper_module`
+    `id`, `user_id`, `paper_id`, `question_module`, `question_no_id`, `question_origin`
   </sql>
 </mapper>

+ 2 - 3
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserPayMapper.xml

@@ -9,7 +9,6 @@
     <result column="user_id" jdbcType="INTEGER" property="userId" />
     <result column="module" jdbcType="VARCHAR" property="module" />
     <result column="module_extend" jdbcType="VARCHAR" property="moduleExtend" />
-    <result column="module_id" jdbcType="INTEGER" property="moduleId" />
     <result column="is_use" jdbcType="INTEGER" property="isUse" />
     <result column="use_time" jdbcType="TIMESTAMP" property="useTime" />
     <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
@@ -20,7 +19,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `module`, `module_extend`, `module_id`, `is_use`, `use_time`, `start_time`, 
-    `expire_time`, `create_time`
+    `id`, `user_id`, `module`, `module_extend`, `is_use`, `use_time`, `start_time`, `expire_time`, 
+    `create_time`
   </sql>
 </mapper>

+ 5 - 2
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserQuestionMapper.xml

@@ -8,6 +8,8 @@
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="user_id" jdbcType="INTEGER" property="userId" />
     <result column="report_id" jdbcType="INTEGER" property="reportId" />
+    <result column="question_module" jdbcType="VARCHAR" property="questionModule" />
+    <result column="question_type" jdbcType="VARCHAR" property="questionType" />
     <result column="question_id" jdbcType="INTEGER" property="questionId" />
     <result column="question_no_id" jdbcType="INTEGER" property="questionNoId" />
     <result column="no" jdbcType="INTEGER" property="no" />
@@ -23,7 +25,8 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `report_id`, `question_id`, `question_no_id`, `no`, `time`, `user_time`, 
-    `user_answer`, `is_correct`, `setting`, `detail`, `create_time`
+    `id`, `user_id`, `report_id`, `question_module`, `question_type`, `question_id`, 
+    `question_no_id`, `no`, `time`, `user_time`, `user_answer`, `is_correct`, `setting`, 
+    `detail`, `create_time`
   </sql>
 </mapper>

+ 5 - 4
server/data/src/main/java/com/qxgmat/data/dao/mapping/UserReportMapper.xml

@@ -9,7 +9,8 @@
     <result column="user_id" jdbcType="INTEGER" property="userId" />
     <result column="paper_id" jdbcType="INTEGER" property="paperId" />
     <result column="paper_module" jdbcType="VARCHAR" property="paperModule" />
-    <result column="module_id" jdbcType="INTEGER" property="moduleId" />
+    <result column="paper_origin" jdbcType="VARCHAR" property="paperOrigin" />
+    <result column="origin_id" jdbcType="INTEGER" property="originId" />
     <result column="question_no_ids" jdbcType="VARCHAR" property="questionNoIds" typeHandler="com.nuliji.tools.mybatis.handler.IntegerArrayWithJsonHandler" />
     <result column="question_number" jdbcType="INTEGER" property="questionNumber" />
     <result column="time" jdbcType="INTEGER" property="time" />
@@ -28,8 +29,8 @@
     <!--
       WARNING - @mbg.generated
     -->
-    `id`, `user_id`, `paper_id`, `paper_module`, `module_id`, `question_no_ids`, `question_number`, 
-    `time`, `user_number`, `user_time`, `user_correct`, `finish_time`, `setting`, `score`, 
-    `detail`, `is_finish`, `create_time`, `update_time`
+    `id`, `user_id`, `paper_id`, `paper_module`, `paper_origin`, `origin_id`, `question_no_ids`, 
+    `question_number`, `time`, `user_number`, `user_time`, `user_correct`, `finish_time`, 
+    `setting`, `score`, `detail`, `is_finish`, `create_time`, `update_time`
   </sql>
 </mapper>

+ 26 - 0
server/data/src/main/java/com/qxgmat/data/relation/UserAskCourseRelationMapper.java

@@ -0,0 +1,26 @@
+package com.qxgmat.data.relation;
+
+import com.qxgmat.data.dao.entity.UserAskCourse;
+import com.qxgmat.data.dao.entity.UserAskQuestion;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Created by gaojie on 2017/11/9.
+ */
+public interface UserAskCourseRelationMapper {
+    List<UserAskCourse> listWithUser(
+            @Param("type") String type,
+            @Param("category") Number category,
+            @Param("userId") Number userId,
+            @Param("questionNoId") Number questionNoId,
+            @Param("target") String target,
+            @Param("status") Integer status,
+            @Param("showStatus") Integer showStatus,
+            @Param("min") Integer min,
+            @Param("max") Integer max,
+            String order,
+            String direction
+    );
+}

+ 0 - 7
server/data/src/main/java/com/qxgmat/data/relation/UserAskQuestionRelationMapper.java

@@ -9,13 +9,6 @@ import java.util.List;
  * Created by gaojie on 2017/11/9.
  */
 public interface UserAskQuestionRelationMapper {
-    void adjust(
-            @Param("questionNoId") Number questionNoId,
-            @Param("order") Integer order,
-            @Param("direction") String direction,
-            @Param("flag") String flag
-    );
-
     List<UserAskQuestion> listWithUser(
             @Param("type") String type,
             @Param("category") Number category,

+ 20 - 0
server/data/src/main/java/com/qxgmat/data/relation/UserPaperQuestionRelationMapper.java

@@ -0,0 +1,20 @@
+package com.qxgmat.data.relation;
+
+import com.qxgmat.data.dao.entity.UserPaper;
+import com.qxgmat.data.dao.entity.UserPaperQuestion;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Created by gaojie on 2017/11/9.
+ */
+public interface UserPaperQuestionRelationMapper {
+    List<UserPaperQuestion> filterTimes(
+            @Param("userId") Number userId,
+            @Param("questionOrigin") String origin,
+            @Param("questionNoIds") Collection questionNoIds,
+            @Param("filterTimes") Number filterTimes
+    );
+}

+ 14 - 7
server/data/src/main/java/com/qxgmat/data/relation/UserReportRelationMapper.java

@@ -13,6 +13,14 @@ import java.util.List;
  * Created by gaojie on 2017/11/9.
  */
 public interface UserReportRelationMapper {
+
+    void accumulation(
+            @Param("id") Number reportId,
+            @Param("number") Integer number,
+            @Param("time") Integer time,
+            @Param("current") Integer current
+    );
+
     List<UserReport> listFinishLast(
             @Param("paperIds") Collection paperIds,
             @Param("startTime") String startTime,
@@ -23,13 +31,6 @@ public interface UserReportRelationMapper {
             @Param("paperIds") Collection paperIds
     );
 
-    void accumulation(
-            @Param("id") Number reportId,
-            @Param("number") Integer number,
-            @Param("time") Integer time,
-            @Param("current") Integer current
-    );
-
     List<UserReportLimitRelation> statLimit(
             @Param("module") String module,
             @Param("moduleId") Integer moduleId
@@ -45,6 +46,12 @@ public interface UserReportRelationMapper {
             @Param("endTime") String endTime
     );
 
+    List<UserStudyStatRelation> statGroupPreviewType(
+            @Param("userId") Integer userId,
+            @Param("startTime") String startTime,
+            @Param("endTime") String endTime
+    );
+
     List<UserRankStatRelation> rankExerciseByTime(
         @Param("userId") Integer userId,
         @Param("startTime") String startTime,

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

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qxgmat.data.relation.UserAskCourseRelationMapper">
+  <resultMap id="IdMap" type="com.qxgmat.data.dao.entity.UserAskCourse">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+  </resultMap>
+  <sql id="Id_Column_List">
+    <!--
+      WARNING - @mbg.generated
+    -->
+    ua.`id`
+  </sql>
+
+  <!--修改问答排序-->
+  <update id="adjust">
+    UPDATE `user_ask_course`
+    <trim prefix="set" suffixOverrides=",">
+      `order`#{flag}1
+    </trim>
+    WHERE `question_id` = #{questionId,jdbcType=VARCHAR} and `order` #{direction} #{order,jdbcType=INT}
+  </update>
+
+  <!--用户提问列表-->
+  <select id="listWithUser" resultMap="IdMap">
+    select
+    <include refid="Id_Column_List" />
+    from `user_ask_course` ua
+    left join `user` u on u.`id` = ua.`user_id`
+      <if test="userId != null">
+        and ua.`user_id` = #{userId,jdbcType=VARCHAR}
+      </if>
+      <if test="max != null">
+        and u.`total_money` &lt; ${max}
+      </if>
+      <if test="min != null">
+        and u.`total_money` &gt; ${min}
+      </if>
+    left join `question` q on q.`id` = ua.`question_id`
+    where
+    u.`id` != null
+    <if test="questionNoId != null">
+      and ua.`question_no_id` = #{questionNoId,jdbcType=VARCHAR}
+    </if>
+    <if test="target != null">
+      and ua.`target` = #{target,jdbcType=VARCHAR}
+    </if>
+    <if test="status != null">
+      and ua.`status` = #{status,jdbcType=INT}
+    </if>
+    <if test="showStatus != null">
+      and ua.`show_status` = #{showStatus,jdbcType=INT}
+    </if>
+    <if test="type != null">
+      and q.`type` =#{type,jdbcType=VARCHAR}
+    </if>
+    order by ${order} ${direction}
+  </select>
+</mapper>

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/relation/mapping/UserAskQuestionRelationMapper.xml

@@ -16,7 +16,7 @@
 
   <!--修改问答排序-->
   <update id="adjust">
-    UPDATE `user_ask`
+    UPDATE `user_ask_question`
     <trim prefix="set" suffixOverrides=",">
       `order`#{flag}1
     </trim>
@@ -27,7 +27,7 @@
   <select id="listWithUser" resultMap="IdMap">
     select
     <include refid="Id_Column_List" />
-    from `user_ask` ua
+    from `user_ask_question` ua
     left join `user` u on u.`id` = ua.`user_id`
       <if test="userId != null">
         and ua.`user_id` = #{userId,jdbcType=VARCHAR}

+ 2 - 2
server/data/src/main/java/com/qxgmat/data/relation/mapping/UserCourseRecordRelationMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qxgmat.data.relation.UserReportRelationMapper">
+<mapper namespace="com.qxgmat.data.relation.UserCourseRecordRelationMapper">
   <resultMap id="IdMap" type="com.qxgmat.data.dao.entity.UserCourseRecord">
     <!--
       WARNING - @mbg.generated
@@ -11,7 +11,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    <id column="module" jdbcType="VERCHAR" property="module" />
+    <id column="module" jdbcType="VARCHAR" property="module" />
     <id column="user_time" jdbcType="INTEGER" property="user_time" />
   </resultMap>
   <resultMap id="rankMap" type="com.qxgmat.data.relation.entity.UserRankStatRelation">

+ 29 - 7
server/data/src/main/java/com/qxgmat/data/relation/mapping/UserReportRelationMapper.xml

@@ -18,7 +18,7 @@
     <!--
       WARNING - @mbg.generated
     -->
-    <id column="module" jdbcType="VERCHAR" property="module" />
+    <id column="module" jdbcType="VARCHAR" property="module" />
     <id column="user_number" jdbcType="INTEGER" property="user_number" />
     <id column="user_time" jdbcType="INTEGER" property="user_time" />
     <id column="user_correct" jdbcType="INTEGER" property="user_correct" />
@@ -104,20 +104,20 @@
     where
       `user_time` &lt; `time`
     and `user_number` = `question_number`
-    and `module` = #{module,jdbcType=VARCHAR}
+    and `paper_origin` = #{module,jdbcType=VARCHAR}
     and `module_id` = #{module_id,jdbcType=INTEGER}
   </select>
 
   <!--
-    用户不同模块记录统计,分学科
+    用户不同来源记录统计
   -->
   <select id="statGroupModule" resultMap="studyMap">
     select
-    sum(`user_number`) as `user_number`, sum(`user_time`) as `user_time`, sum(`user_correct`) as `user_correct`, `paper_module` as `module`
+    sum(`user_number`) as `user_number`, sum(`user_time`) as `user_time`, sum(`user_correct`) as `user_correct`, `paper_origin` as `module`
     from `user_report`
     where
     `user_id` = #{userId,jdbcType=VARCHAR}
-    group `module`
+    group `paper_origin`
   </select>
 
   <!--
@@ -130,14 +130,36 @@
       left join `exercise_paper` ep on ep.`id` = ur.`module_id`
     where
     ur.`user_id` = #{userId,jdbcType=VARCHAR}
-    and ur.`paper_module` = 'exercise'
+    and ur.`paper_origin` = 'exercise'
+    and ep.`id` != null
     <if test="startTime != null">
       and ur.`update_time` &gt; #{startTime,jdbcType=VARCHAR}
     </if>
     <if test="endTime != null">
       and ur.`update_time` &lt; #{endTime,jdbcType=VARCHAR}
     </if>
-    group eq.`question_type`
+    group ep.`question_type`
+  </select>
+
+  <!--
+    用户预习作业模块记录统计,分题型
+  -->
+  <select id="statGroupPreviewType" resultMap="studyMap">
+    select
+    sum(ur.`user_number`) as `user_number`, sum(ur.`user_time`) as `user_time`, sum(ur.`user_correct`) as `user_correct`, ep.`question_type` as `module`
+    from `user_report` ur
+    left join `preview_paper` pp on pp.`id` = ur.`module_id`
+    where
+    ur.`user_id` = #{userId,jdbcType=VARCHAR}
+    and ur.`paper_origin` = 'preview'
+    and pp.`id` != null
+    <if test="startTime != null">
+      and ur.`update_time` &gt; #{startTime,jdbcType=VARCHAR}
+    </if>
+    <if test="endTime != null">
+      and ur.`update_time` &lt; #{endTime,jdbcType=VARCHAR}
+    </if>
+    group pp.`question_type`
   </select>
 
   <!--

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

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qxgmat.data.relation.UserReportRelationMapper">
+<mapper namespace="com.qxgmat.data.relation.UserSentenceRecordRelationMapper">
   <resultMap id="IdMap" type="com.qxgmat.data.dao.entity.UserSentenceRecord">
     <!--
       WARNING - @mbg.generated

+ 5 - 4
server/gateway-api/src/main/java/com/qxgmat/Application.java

@@ -26,9 +26,10 @@ public class Application {
     }
 }
 
-// 每日数据统计
-// 服务权限验证
+// 服务:开通,服务权限验证,后台支付
 // 预习作业添加模式:用于主动发送用户
 // 课程与预习作业关系,分册进度
-// 作文练习,单题成卷
-// 模考做题次数,reset
+// 模考做题次数,reset
+// 订单结构分析:服务、课程、数据都是商品
+// 购物车,订单
+// 自动组卷:练习,长难句,作文练习,单题成卷

+ 110 - 6
server/gateway-api/src/main/java/com/qxgmat/controller/admin/ClassController.java

@@ -5,26 +5,52 @@ import com.nuliji.tools.PageMessage;
 import com.nuliji.tools.Response;
 import com.nuliji.tools.ResponseHelp;
 import com.nuliji.tools.Transform;
-import com.qxgmat.data.dao.entity.ClassCourse;
-import com.qxgmat.dto.admin.response.ClassCourseListDto;
+import com.qxgmat.data.constants.enums.status.AskStatus;
+import com.qxgmat.data.constants.enums.status.DirectionStatus;
+import com.qxgmat.data.constants.enums.user.AskTarget;
+import com.qxgmat.data.constants.enums.user.MoneyRange;
+import com.qxgmat.data.dao.entity.*;
+import com.qxgmat.dto.admin.extend.*;
+import com.qxgmat.dto.admin.request.UserAskCourseDto;
+import com.qxgmat.dto.admin.response.*;
+import com.qxgmat.help.ShiroHelp;
+import com.qxgmat.service.ManagerService;
+import com.qxgmat.service.UsersService;
 import com.qxgmat.service.inline.ClassCourseService;
+import com.qxgmat.service.inline.ManagerLogService;
+import com.qxgmat.service.inline.UserAskCourseService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import java.util.Collection;
+import java.util.Date;
 import java.util.List;
 
 @RestController("AdminClassController")
 @RequestMapping("/admin/class")
 public class ClassController {
+    @Autowired
+    private ShiroHelp shiroHelp;
 
     @Autowired
     private ClassCourseService classCourseService;
 
+    @Autowired
+    private UserAskCourseService userAskCourseService;
+
+    @Autowired
+    private ManagerLogService managerLogService;
+
+    @Autowired
+    private ManagerService managerService;
+
+    @Autowired
+    private UsersService usersService;
+
     @RequestMapping(value = "/course/list", method = RequestMethod.GET)
     @ApiOperation(value = "课程列表", httpMethod = "GET")
     public Response<PageMessage<ClassCourseListDto>> list(
@@ -36,4 +62,82 @@ public class ClassController {
 
         return ResponseHelp.success(pr, page, size, p.getTotal());
     }
+
+
+    @RequestMapping(value = "/ask/edit", method = RequestMethod.PUT)
+    @ApiOperation(value = "修改提问信息", httpMethod = "PUT")
+    public Response<Boolean> edit(@RequestBody @Validated UserAskCourseDto dto, HttpServletRequest request) {
+        UserAskCourse entity = Transform.dtoToEntity(dto);
+        UserAskCourse in = userAskCourseService.get(entity.getId());
+        // 调整回答
+        if(!entity.getAnswer().isEmpty() || !in.getAnswer().equals(entity.getAnswer())){
+            entity.setAnswerTime(new Date());
+            entity.setAnswerStatus(AskStatus.ANSWER.index);
+            Manager manager = shiroHelp.getLoginManager();
+            entity.setManagerId(manager.getId());
+        }
+
+        entity = userAskCourseService.edit(entity);
+
+        if (dto.getOther() !=null && dto.getOther().length > 0){
+            // 更新回答排序
+            userAskCourseService.updateOrder(dto.getOther());
+        }
+
+        managerLogService.log(request);
+        return ResponseHelp.success(true);
+    }
+
+    @RequestMapping(value = "/ask/detail", method = RequestMethod.GET)
+    @ApiOperation(value = "提问详情", httpMethod = "GET")
+    public Response<UserAskCourseDetailDto> detail(@RequestParam int id, HttpServletRequest request) {
+        UserAskCourse entity = userAskCourseService.get(id);
+        UserAskCourseDetailDto dto = Transform.convert(entity, UserAskCourseDetailDto.class);
+
+        if (entity.getManagerId() != null && entity.getManagerId() > 0){
+            Manager manager = managerService.get(entity.getManagerId());
+            if (manager != null)
+                dto.setManager(Transform.convert(manager, ManagerExtendDto.class));
+        }
+
+        User user = usersService.get(entity.getUserId());
+        dto.setUser(Transform.convert(user, UserExtendDto.class));
+
+        // 所有回答
+        List<UserAskCourse> userAskList = userAskCourseService.listByCourse(entity.getCourseId(), true);
+        dto.setOthers(Transform.convert(userAskList, UserAskCourseExtendDto.class));
+        return ResponseHelp.success(dto);
+    }
+
+    @RequestMapping(value = "/ask/list", method = RequestMethod.GET)
+    @ApiOperation(value = "提问列表", httpMethod = "GET")
+    public Response<PageMessage<UserAskCourseListDto>> list(
+            @RequestParam(required = false, defaultValue = "1") int page,
+            @RequestParam(required = false, defaultValue = "100") int size,
+            @RequestParam(required = false) String type,
+            @RequestParam(required = false) Integer category,
+            @RequestParam(required = false) Number userId,
+            @RequestParam(required = false) Number questionNoId,
+            @RequestParam(required = false) String target,
+            @RequestParam(required = false) Integer status,
+            @RequestParam(required = false) Integer showStatus,
+            @RequestParam(required = false) Integer moneyRang,
+            @RequestParam(required = false, defaultValue = "id") String order,
+            @RequestParam(required = false, defaultValue = "desc") String direction,
+            HttpSession session) {
+        Page<UserAskCourse> p = userAskCourseService.listWithUser(page, size, type, category, userId, questionNoId, AskTarget.ValueOf(target), AskStatus.ValueOf(status), showStatus, MoneyRange.ValueOf(moneyRang), order, DirectionStatus.ValueOf(direction));
+        List<UserAskCourseListDto> pr = Transform.convert(p, UserAskCourseListDto.class);
+
+        // 绑定用户
+        Collection userIds = Transform.getIds(p, UserAskQuestion.class, "userId");
+        List<User> userList = usersService.select(userIds);
+        Transform.combine(pr, userList, UserAskQuestionListDto.class, "userId", "user", User.class, "id", UserExtendDto.class);
+
+        // 绑定管理员
+        Collection managerIds = Transform.getIds(p, UserAskQuestion.class, "managerId");
+        List<Manager> managerList = managerService.select(managerIds);
+        Transform.combine(pr, managerList, UserAskQuestionListDto.class, "managerId", "manager", Manager.class, "id", ManagerExtendDto.class);
+
+        return ResponseHelp.success(pr, page, size, p.getTotal());
+    }
 }

+ 31 - 2
server/gateway-api/src/main/java/com/qxgmat/controller/admin/PreviewController.java

@@ -5,12 +5,16 @@ import com.nuliji.tools.PageMessage;
 import com.nuliji.tools.Response;
 import com.nuliji.tools.ResponseHelp;
 import com.nuliji.tools.Transform;
+import com.qxgmat.data.constants.enums.QuestionType;
+import com.qxgmat.data.constants.enums.module.QuestionModule;
 import com.qxgmat.data.constants.enums.status.PreviewStatus;
 import com.qxgmat.data.dao.entity.PreviewPaper;
+import com.qxgmat.data.dao.entity.UserPaper;
 import com.qxgmat.dto.admin.request.PreviewDto;
 import com.qxgmat.dto.admin.response.PreviewDetailDto;
 import com.qxgmat.dto.admin.response.PreviewListDto;
 import com.qxgmat.service.PreviewService;
+import com.qxgmat.service.extend.QuestionFlowService;
 import com.qxgmat.service.inline.ManagerLogService;
 import com.qxgmat.service.inline.QuestionNoService;
 import io.swagger.annotations.Api;
@@ -37,11 +41,25 @@ public class PreviewController {
     @Autowired
     private QuestionNoService questionNoService;
 
+    @Autowired
+    private QuestionFlowService questionFlowService;
+
     @RequestMapping(value = "/add", method = RequestMethod.POST)
     @ApiOperation(value = "添加预习作业", httpMethod = "POST")
     public Response<PreviewPaper> add(@RequestBody @Validated PreviewDto dto, HttpServletRequest request) {
         PreviewPaper entity = Transform.dtoToEntity(dto);
-        entity = previewService.edit(entity);
+
+        // 获取考题模块
+        QuestionModule module = QuestionModule.WithQuestionType(QuestionType.ValueOf(entity.getQuestionType()));
+
+        UserPaper tmpPaper = UserPaper.builder()
+                .questionNoIds(entity.getQuestionNoIds())
+                .questionNumber(entity.getQuestionNoIds().length)
+                .build();
+        // 初始化paper:主要是计算做题时间
+        questionFlowService.initPaper(tmpPaper, module);
+
+        entity = previewService.edit(entity, tmpPaper.getTime());
         managerLogService.log(request);
         return ResponseHelp.success(entity);
     }
@@ -50,7 +68,18 @@ public class PreviewController {
     @ApiOperation(value = "编辑预习作业", httpMethod = "PUT")
     public Response<Boolean> edit(@RequestBody @Validated PreviewDto dto, HttpServletRequest request) {
         PreviewPaper entity = Transform.dtoToEntity(dto);
-        entity = previewService.edit(entity);
+
+        // 获取考题模块
+        QuestionModule module = QuestionModule.WithQuestionType(QuestionType.ValueOf(entity.getQuestionType()));
+
+        UserPaper tmpPaper = UserPaper.builder()
+                .questionNoIds(entity.getQuestionNoIds())
+                .questionNumber(entity.getQuestionNoIds().length)
+                .build();
+        // 初始化paper:主要是计算做题时间
+        questionFlowService.initPaper(tmpPaper, module);
+
+        entity = previewService.edit(entity, tmpPaper.getTime());
         managerLogService.log(request);
         return ResponseHelp.success(true);
     }

+ 121 - 7
server/gateway-api/src/main/java/com/qxgmat/controller/admin/QuestionController.java

@@ -1,20 +1,28 @@
 package com.qxgmat.controller.admin;
 
 
+import com.github.pagehelper.Page;
 import com.nuliji.tools.*;
 import com.nuliji.tools.exception.ParameterException;
-import com.qxgmat.data.dao.entity.Question;
-import com.qxgmat.data.dao.entity.QuestionNo;
+import com.qxgmat.data.constants.enums.status.AskStatus;
+import com.qxgmat.data.constants.enums.status.DirectionStatus;
+import com.qxgmat.data.constants.enums.user.AskTarget;
+import com.qxgmat.data.constants.enums.user.MoneyRange;
+import com.qxgmat.data.dao.entity.*;
 import com.qxgmat.data.relation.entity.QuestionNoRelation;
-import com.qxgmat.dto.admin.extend.QuestionNoExtendDto;
-import com.qxgmat.dto.admin.request.QuestionDto;
-import com.qxgmat.dto.admin.request.QuestionNoDto;
-import com.qxgmat.dto.admin.request.QuestionNoSearchDto;
+import com.qxgmat.dto.admin.extend.*;
+import com.qxgmat.dto.admin.request.*;
 import com.qxgmat.dto.admin.response.QuestionDetailDto;
+import com.qxgmat.dto.admin.response.UserAskQuestionDetailDto;
+import com.qxgmat.dto.admin.response.UserAskQuestionListDto;
+import com.qxgmat.help.ShiroHelp;
 import com.qxgmat.service.ExercisePaperService;
+import com.qxgmat.service.ManagerService;
+import com.qxgmat.service.UsersService;
 import com.qxgmat.service.inline.ManagerLogService;
 import com.qxgmat.service.inline.QuestionNoService;
 import com.qxgmat.service.inline.QuestionService;
+import com.qxgmat.service.inline.UserAskQuestionService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,12 +31,17 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.util.Collection;
+import java.util.Date;
 import java.util.List;
 
 @RestController("AdminQuestionController")
 @RequestMapping("/admin/question")
 @Api(tags = "题目接口", description = "题目相关", produces = MediaType.APPLICATION_JSON_VALUE)
 public class QuestionController {
+    @Autowired
+    private ShiroHelp shiroHelp;
 
     @Autowired
     private ManagerLogService managerLogService;
@@ -42,6 +55,15 @@ public class QuestionController {
     @Autowired
     private QuestionService questionService;
 
+    @Autowired
+    private UserAskQuestionService userAskQuestionService;
+
+    @Autowired
+    private ManagerService managerService;
+
+    @Autowired
+    private UsersService usersService;
+
     @RequestMapping(value = "/add", method = RequestMethod.POST)
     @ApiOperation(value = "添加题目", httpMethod = "POST")
     public Response<Question> add(@RequestBody @Validated QuestionDto dto, HttpServletRequest request) {
@@ -54,7 +76,6 @@ public class QuestionController {
         return ResponseHelp.success(entity);
     }
 
-
     @RequestMapping(value = "/edit", method = RequestMethod.PUT)
     @ApiOperation(value = "修改题目", httpMethod = "PUT")
     public Response<Boolean> edit(@RequestBody @Validated QuestionDto dto, HttpServletRequest request) {
@@ -137,4 +158,97 @@ public class QuestionController {
 
         return ResponseHelp.success(pr, dto.getPage(), dto.getSize(), p.getTotal());
     }
+
+    @RequestMapping(value = "/ask/edit", method = RequestMethod.PUT)
+    @ApiOperation(value = "修改提问信息", httpMethod = "PUT")
+    public Response<Boolean> editAsk(@RequestBody @Validated UserAskQuestionDto dto, HttpServletRequest request) {
+        UserAskQuestion entity = Transform.dtoToEntity(dto);
+        UserAskQuestion in = userAskQuestionService.get(entity.getId());
+        // 调整回答
+        if(!entity.getAnswer().isEmpty() || !in.getAnswer().equals(entity.getAnswer())){
+            entity.setAnswerTime(new Date());
+            entity.setAnswerStatus(AskStatus.ANSWER.index);
+            Manager manager = shiroHelp.getLoginManager();
+            entity.setManagerId(manager.getId());
+        }
+
+        entity = userAskQuestionService.edit(entity);
+
+        if (dto.getOther() !=null && dto.getOther().length > 0){
+            // 更新回答排序
+            userAskQuestionService.updateOrder(dto.getOther());
+        }
+
+        managerLogService.log(request);
+        return ResponseHelp.success(true);
+    }
+
+    @RequestMapping(value = "/ask/detail", method = RequestMethod.GET)
+    @ApiOperation(value = "提问详情", httpMethod = "GET")
+    public Response<UserAskQuestionDetailDto> detailAsk(@RequestParam int id, HttpServletRequest request) {
+        UserAskQuestion entity = userAskQuestionService.get(id);
+        UserAskQuestionDetailDto dto = Transform.convert(entity, UserAskQuestionDetailDto.class);
+
+        if (entity.getManagerId() != null && entity.getManagerId() > 0){
+            Manager manager = managerService.get(entity.getManagerId());
+            if (manager != null)
+                dto.setManager(Transform.convert(manager, ManagerExtendDto.class));
+        }
+
+        User user = usersService.get(entity.getUserId());
+        dto.setUser(Transform.convert(user, UserExtendDto.class));
+
+        Question question = questionService.get(entity.getQuestionId());
+        dto.setQuestion(Transform.convert(question, QuestionExtendDto.class));
+
+        QuestionNo questionNo = questionNoService.get(entity.getQuestionNoId());
+        dto.setQuestionNo(Transform.convert(questionNo, QuestionNoExtendDto.class));
+
+        // 所有回答
+        List<UserAskQuestion> userAskList = userAskQuestionService.listByQuestion(entity.getQuestionId(), true);
+        dto.setOthers(Transform.convert(userAskList, UserAskQuestionExtendDto.class));
+        return ResponseHelp.success(dto);
+    }
+
+    @RequestMapping(value = "/ask/list", method = RequestMethod.GET)
+    @ApiOperation(value = "提问列表", httpMethod = "GET")
+    public Response<PageMessage<UserAskQuestionListDto>> listAsk(
+            @RequestParam(required = false, defaultValue = "1") int page,
+            @RequestParam(required = false, defaultValue = "100") int size,
+            @RequestParam(required = false) String type,
+            @RequestParam(required = false) Integer category,
+            @RequestParam(required = false) Number userId,
+            @RequestParam(required = false) Number questionNoId,
+            @RequestParam(required = false) String target,
+            @RequestParam(required = false) Integer status,
+            @RequestParam(required = false) Integer showStatus,
+            @RequestParam(required = false) Integer moneyRang,
+            @RequestParam(required = false, defaultValue = "id") String order,
+            @RequestParam(required = false, defaultValue = "desc") String direction,
+            HttpSession session) {
+        Page<UserAskQuestion> p = userAskQuestionService.listWithUser(page, size, type, category, userId, questionNoId, AskTarget.ValueOf(target), AskStatus.ValueOf(status), showStatus, MoneyRange.ValueOf(moneyRang), order, DirectionStatus.ValueOf(direction));
+        List<UserAskQuestionListDto> pr = Transform.convert(p, UserAskQuestionListDto.class);
+
+        // 绑定题目
+        Collection questionIds = Transform.getIds(p, UserAskQuestion.class, "questionId");
+        List<Question> questionList = questionService.select(questionIds);
+        Transform.combine(pr, questionList, UserAskQuestionListDto.class, "questionId", "question", Question.class, "id", QuestionExtendDto.class);
+
+        // 绑定题目编号
+        Collection questionNoIds = Transform.getIds(p, UserAskQuestion.class, "questionNoId");
+        List<QuestionNo> questionNoList = questionNoService.select(questionNoIds);
+        Transform.combine(pr, questionNoList, UserAskQuestionListDto.class, "questionNoId", "questionNo", QuestionNo.class, "id", QuestionNoExtendDto.class);
+
+        // 绑定用户
+        Collection userIds = Transform.getIds(p, UserAskQuestion.class, "userId");
+        List<User> userList = usersService.select(userIds);
+        Transform.combine(pr, userList, UserAskQuestionListDto.class, "userId", "user", User.class, "id", UserExtendDto.class);
+
+        // 绑定管理员
+        Collection managerIds = Transform.getIds(p, UserAskQuestion.class, "managerId");
+        List<Manager> managerList = managerService.select(managerIds);
+        Transform.combine(pr, managerList, UserAskQuestionListDto.class, "managerId", "manager", Manager.class, "id", ManagerExtendDto.class);
+
+        return ResponseHelp.success(pr, page, size, p.getTotal());
+    }
 }

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

@@ -32,9 +32,9 @@ import java.util.List;
 @RestController("AdminSentenceController")
 @RequestMapping("/admin/sentence")
 public class SentenceController {
-
     @Autowired
     private ManagerLogService managerLogService;
+
     @Autowired
     private SentenceQuestionService sentenceQuestionService;
 

+ 17 - 0
server/gateway-api/src/main/java/com/qxgmat/controller/admin/SettingController.java

@@ -182,6 +182,23 @@ public class SettingController {
         return ResponseHelp.success(entity.getValue());
     }
 
+    @RequestMapping(value = "/score_switch", method = RequestMethod.PUT)
+    @ApiOperation(value = "修改分数开关", httpMethod = "PUT")
+    private Response<Boolean> editScoreSwitch(@RequestBody @Validated JSONObject dto){
+        Setting entity = settingService.getByKey(SettingKey.SCORE_SWITCH);
+        entity.setValue(dto);
+        settingService.edit(entity);
+        return ResponseHelp.success(true);
+    }
+
+    @RequestMapping(value = "/score_switch", method = RequestMethod.GET)
+    @ApiOperation(value = "获取分数开关", httpMethod = "GET")
+    private Response<JSONObject> getScoreSwitch(){
+        Setting entity = settingService.getByKey(SettingKey.SCORE_SWITCH);
+
+        return ResponseHelp.success(entity.getValue());
+    }
+
     @RequestMapping(value = "/tips", method = RequestMethod.PUT)
     @ApiOperation(value = "修改结构说明", httpMethod = "PUT")
     private Response<Boolean> editTips(@RequestBody @Validated JSONObject dto){

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

@@ -36,7 +36,7 @@ import java.util.Collection;
 import java.util.List;
 
 @RestController("AdminTextbookController")
-@RequestMapping("/admin/textbookl")
+@RequestMapping("/admin/textbook")
 @Api(tags = "机经接口", description = "机经相关", produces = MediaType.APPLICATION_JSON_VALUE)
 public class TextbookController {
 

+ 0 - 153
server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserAskController.java

@@ -1,153 +0,0 @@
-package com.qxgmat.controller.admin;
-
-import com.github.pagehelper.Page;
-import com.nuliji.tools.PageMessage;
-import com.nuliji.tools.Response;
-import com.nuliji.tools.ResponseHelp;
-import com.nuliji.tools.Transform;
-import com.qxgmat.data.constants.enums.status.AskStatus;
-import com.qxgmat.data.constants.enums.status.DirectionStatus;
-import com.qxgmat.data.constants.enums.user.AskTarget;
-import com.qxgmat.data.constants.enums.user.MoneyRange;
-import com.qxgmat.data.dao.entity.*;
-import com.qxgmat.dto.admin.extend.*;
-import com.qxgmat.dto.admin.request.UserAskDto;
-import com.qxgmat.dto.admin.response.UserAskDetailDto;
-import com.qxgmat.dto.admin.response.UserAskListDto;
-import com.qxgmat.help.ShiroHelp;
-import com.qxgmat.service.ManagerService;
-import com.qxgmat.service.UsersService;
-import com.qxgmat.service.inline.ManagerLogService;
-import com.qxgmat.service.inline.QuestionNoService;
-import com.qxgmat.service.inline.QuestionService;
-import com.qxgmat.service.inline.UserAskQuestionService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-
-@RestController("AdminUserAskController")
-@RequestMapping("/admin/user/ask")
-@Api(tags = "用户提问接口", description = "用户提问相关", produces = MediaType.APPLICATION_JSON_VALUE)
-public class UserAskController {
-    @Autowired
-    private ManagerLogService managerLogService;
-    @Autowired
-    private ShiroHelp shiroHelp;
-
-    @Autowired
-    private UserAskQuestionService userAskQuestionService;
-
-    @Autowired
-    private QuestionService questionService;
-
-    @Autowired
-    private QuestionNoService questionNoService;
-
-    @Autowired
-    private UsersService usersService;
-
-    @Autowired
-    private ManagerService managerService;
-
-    @RequestMapping(value = "/edit", method = RequestMethod.PUT)
-    @ApiOperation(value = "修改提问信息", httpMethod = "PUT")
-    public Response<Boolean> edit(@RequestBody @Validated UserAskDto dto, HttpServletRequest request) {
-        UserAskQuestion entity = Transform.dtoToEntity(dto);
-        UserAskQuestion in = userAskQuestionService.get(entity.getId());
-        // 调整回答
-        if(!entity.getAnswer().isEmpty() || !in.getAnswer().equals(entity.getAnswer())){
-            entity.setAnswerTime(new Date());
-            entity.setAnswerStatus(AskStatus.ANSWER.index);
-            Manager manager = shiroHelp.getLoginManager();
-            entity.setManagerId(manager.getId());
-        }
-
-        entity = userAskQuestionService.edit(entity);
-
-        if (dto.getOther() !=null && dto.getOther().length > 0){
-            // 更新回答排序
-            userAskQuestionService.updateOrder(dto.getOther());
-        }
-
-        managerLogService.log(request);
-        return ResponseHelp.success(true);
-    }
-
-    @RequestMapping(value = "/detail", method = RequestMethod.GET)
-    @ApiOperation(value = "提问详情", httpMethod = "GET")
-    public Response<UserAskDetailDto> detail(@RequestParam int id, HttpServletRequest request) {
-        UserAskQuestion entity = userAskQuestionService.get(id);
-        UserAskDetailDto dto = Transform.convert(entity, UserAskDetailDto.class);
-
-        if (entity.getManagerId() != null && entity.getManagerId() > 0){
-            Manager manager = managerService.get(entity.getManagerId());
-            if (manager != null)
-                dto.setManager(Transform.convert(manager, ManagerExtendDto.class));
-        }
-
-        User user = usersService.get(entity.getUserId());
-        dto.setUser(Transform.convert(user, UserExtendDto.class));
-
-        Question question = questionService.get(entity.getQuestionId());
-        dto.setQuestion(Transform.convert(question, QuestionExtendDto.class));
-
-        QuestionNo questionNo = questionNoService.get(entity.getQuestionNoId());
-        dto.setQuestionNo(Transform.convert(questionNo, QuestionNoExtendDto.class));
-
-        // 所有回答
-        List<UserAskQuestion> userAskList = userAskQuestionService.listByQuestion(entity.getQuestionId(), true);
-        dto.setOthers(Transform.convert(userAskList, UserAskExtendDto.class));
-        return ResponseHelp.success(dto);
-    }
-
-    @RequestMapping(value = "/list", method = RequestMethod.GET)
-    @ApiOperation(value = "提问列表", httpMethod = "GET")
-    public Response<PageMessage<UserAskListDto>> list(
-            @RequestParam(required = false, defaultValue = "1") int page,
-            @RequestParam(required = false, defaultValue = "100") int size,
-            @RequestParam(required = false) String type,
-            @RequestParam(required = false) Integer category,
-            @RequestParam(required = false) Number userId,
-            @RequestParam(required = false) Number questionNoId,
-            @RequestParam(required = false) String target,
-            @RequestParam(required = false) Integer status,
-            @RequestParam(required = false) Integer showStatus,
-            @RequestParam(required = false) Integer moneyRang,
-            @RequestParam(required = false, defaultValue = "id") String order,
-            @RequestParam(required = false, defaultValue = "desc") String direction,
-            HttpSession session) {
-        Page<UserAskQuestion> p = userAskQuestionService.listWithUser(page, size, type, category, userId, questionNoId, AskTarget.ValueOf(target), AskStatus.ValueOf(status), showStatus, MoneyRange.ValueOf(moneyRang), order, DirectionStatus.ValueOf(direction));
-        List<UserAskListDto> pr = Transform.convert(p, UserAskListDto.class);
-
-        // 绑定题目
-        Collection questionIds = Transform.getIds(p, UserAskQuestion.class, "questionId");
-        List<Question> questionList = questionService.select(questionIds);
-        Transform.combine(pr, questionList, UserAskListDto.class, "questionId", "question", Question.class, "id", QuestionExtendDto.class);
-
-        // 绑定题目编号
-        Collection questionNoIds = Transform.getIds(p, UserAskQuestion.class, "questionNoId");
-        List<QuestionNo> questionNoList = questionNoService.select(questionNoIds);
-        Transform.combine(pr, questionNoList, UserAskListDto.class, "questionNoId", "questionNo", QuestionNo.class, "id", QuestionNoExtendDto.class);
-
-        // 绑定用户
-        Collection userIds = Transform.getIds(p, UserAskQuestion.class, "userId");
-        List<User> userList = usersService.select(userIds);
-        Transform.combine(pr, userList, UserAskListDto.class, "userId", "user", User.class, "id", UserExtendDto.class);
-
-        // 绑定管理员
-        Collection managerIds = Transform.getIds(p, UserAskQuestion.class, "managerId");
-        List<Manager> managerList = managerService.select(managerIds);
-        Transform.combine(pr, managerList, UserAskListDto.class, "managerId", "manager", Manager.class, "id", ManagerExtendDto.class);
-
-        return ResponseHelp.success(pr, page, size, p.getTotal());
-    }
-}

+ 52 - 14
server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserController.java

@@ -1,23 +1,18 @@
 package com.qxgmat.controller.admin;
 
 import com.github.pagehelper.Page;
-import com.nuliji.tools.PageMessage;
-import com.nuliji.tools.Response;
-import com.nuliji.tools.ResponseHelp;
-import com.nuliji.tools.Transform;
+import com.nuliji.tools.*;
 import com.qxgmat.data.constants.enums.status.DirectionStatus;
-import com.qxgmat.data.dao.entity.User;
-import com.qxgmat.data.dao.entity.UserClass;
-import com.qxgmat.data.dao.entity.UserPay;
-import com.qxgmat.data.dao.entity.UserService;
-import com.qxgmat.dto.admin.extend.UserClassExtendDto;
-import com.qxgmat.dto.admin.extend.UserServiceExtendDto;
+import com.qxgmat.data.dao.entity.*;
+import com.qxgmat.data.relation.entity.UserPreviewPaperRelation;
+import com.qxgmat.dto.admin.extend.*;
 import com.qxgmat.dto.admin.response.UserListDto;
+import com.qxgmat.dto.admin.response.UserPreviewListDto;
+import com.qxgmat.help.ShiroHelp;
+import com.qxgmat.service.ManagerService;
+import com.qxgmat.service.PreviewService;
 import com.qxgmat.service.UsersService;
-import com.qxgmat.service.inline.ManagerLogService;
-import com.qxgmat.service.inline.UserClassService;
-import com.qxgmat.service.inline.UserPayService;
-import com.qxgmat.service.inline.UserServiceService;
+import com.qxgmat.service.inline.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,9 +29,18 @@ import java.util.Map;
 @Api(tags = "用户接口", description = "用户相关操作", produces = MediaType.APPLICATION_JSON_VALUE)
 public class UserController {
     @Autowired
+    private ShiroHelp shiroHelp;
+
+    @Autowired
     private ManagerLogService managerLogService;
 
     @Autowired
+    private QuestionService questionService;
+
+    @Autowired
+    private QuestionNoService questionNoService;
+
+    @Autowired
     private UsersService usersService;
 
     @Autowired
@@ -48,6 +52,12 @@ public class UserController {
     @Autowired
     private UserPayService userPayService;
 
+    @Autowired
+    private ManagerService managerService;
+
+    @Autowired
+    private PreviewService previewService;
+
 //    @RequestMapping(value = "/add", method = RequestMethod.POST)
 //    @ApiOperation(value = "添加用户信息", httpMethod = "POST")
 //    public Response<User> add(@RequestBody @Validated UserDto dto, HttpServletRequest request) {
@@ -158,4 +168,32 @@ public class UserController {
 
         return ResponseHelp.success(pr, page, size, p.getTotal());
     }
+
+    @RequestMapping(value = "/preview/list", method = RequestMethod.GET)
+    @ApiOperation(value = "预习作业列表", httpMethod = "GET")
+    public Response<PageMessage<UserPreviewListDto>> list(
+            @RequestParam(required = false, defaultValue = "1") int page,
+            @RequestParam(required = false, defaultValue = "100") int size,
+            @RequestParam(required = false, defaultValue = "0") int category,
+            @RequestParam(required = false) Integer userId,
+            @RequestParam(required = false) Integer previewId,
+            @RequestParam(required = false) String startTime,
+            @RequestParam(required = false) String endTime,
+            HttpSession session) {
+        PageResult<UserPreviewPaperRelation> p = previewService.listAdmin(page, size, category, userId, previewId, startTime, endTime);
+
+        // 绑定用户
+        Collection userIds = Transform.getIds(p, UserPreviewPaperRelation.class, "userId");
+        List<User> userList = usersService.select(userIds);
+        Transform.combine(p, userList, UserPreviewPaperRelation.class, "userId", "user", User.class, "id");
+
+        // 绑定预习作业
+        Collection previewIds = Transform.getIds(p, UserPreviewPaperRelation.class, "moduleId");
+        List<PreviewPaper> previewPaperList = previewService.select(previewIds);
+        Transform.combine(p, previewPaperList, UserPreviewPaperRelation.class, "moduleId", "preview", PreviewPaper.class, "id");
+
+        List<UserPreviewListDto> pr = Transform.convert(p, UserPreviewListDto.class);
+
+        return ResponseHelp.success(pr, page, size, p.getTotal());
+    }
 }

+ 2 - 3
server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserFeedbackErrorController.java

@@ -6,14 +6,13 @@ import com.nuliji.tools.Response;
 import com.nuliji.tools.ResponseHelp;
 import com.nuliji.tools.Transform;
 import com.qxgmat.data.constants.enums.module.FeedbackModule;
-import com.qxgmat.data.constants.enums.status.AskStatus;
 import com.qxgmat.data.constants.enums.status.FeedbackStatus;
 import com.qxgmat.data.dao.entity.*;
 import com.qxgmat.dto.admin.extend.UserExtendDto;
 import com.qxgmat.dto.admin.request.UserFeedbackErrorDto;
 import com.qxgmat.dto.admin.response.UserFeedbackErrorDetailDto;
 import com.qxgmat.dto.admin.response.UserFeedbackErrorListDto;
-import com.qxgmat.dto.admin.response.UserAskListDto;
+import com.qxgmat.dto.admin.response.UserAskQuestionListDto;
 import com.qxgmat.help.ShiroHelp;
 import com.qxgmat.service.UsersService;
 import com.qxgmat.service.inline.UserFeedbackErrorService;
@@ -91,7 +90,7 @@ public class UserFeedbackErrorController {
         Collection userIds = Transform.getIds(p, UserAskQuestion.class, "userId");
         List<User> userList = usersService.select(userIds);
         List<UserExtendDto> userExtendDtoList = Transform.convert(userList, UserExtendDto.class);
-        Transform.combine(pr, userExtendDtoList, UserAskListDto.class, "userId", "user", UserExtendDto.class, "id");
+        Transform.combine(pr, userExtendDtoList, UserAskQuestionListDto.class, "userId", "user", UserExtendDto.class, "id");
 
         return ResponseHelp.success(pr, page, size, p.getTotal());
     }

+ 0 - 65
server/gateway-api/src/main/java/com/qxgmat/controller/admin/UserPreviewController.java

@@ -1,65 +0,0 @@
-package com.qxgmat.controller.admin;
-
-import com.nuliji.tools.*;
-import com.qxgmat.data.dao.entity.PreviewPaper;
-import com.qxgmat.data.dao.entity.User;
-import com.qxgmat.data.relation.entity.UserPreviewPaperRelation;
-import com.qxgmat.dto.admin.response.UserPreviewListDto;
-import com.qxgmat.service.UsersService;
-import com.qxgmat.service.PreviewService;
-import com.qxgmat.service.inline.ManagerLogService;
-import com.qxgmat.service.UserPaperService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpSession;
-import java.util.Collection;
-import java.util.List;
-
-@RestController("AdminUserPreviewController")
-@RequestMapping("/admin/user/preview")
-@Api(tags = "用户预习作业接口", description = "用户预习作业", produces = MediaType.APPLICATION_JSON_VALUE)
-public class UserPreviewController {
-    @Autowired
-    private ManagerLogService managerLogService;
-
-    @Autowired
-    private UserPaperService userPaperService;
-
-    @Autowired
-    private UsersService usersService;
-
-    @Autowired
-    private PreviewService previewService;
-
-    @RequestMapping(value = "/list", method = RequestMethod.GET)
-    @ApiOperation(value = "预习作业列表", httpMethod = "GET")
-    public Response<PageMessage<UserPreviewListDto>> list(
-            @RequestParam(required = false, defaultValue = "1") int page,
-            @RequestParam(required = false, defaultValue = "100") int size,
-            @RequestParam(required = false, defaultValue = "0") int category,
-            @RequestParam(required = false) Integer userId,
-            @RequestParam(required = false) Integer previewId,
-            @RequestParam(required = false) String startTime,
-            @RequestParam(required = false) String endTime,
-            HttpSession session) {
-        PageResult<UserPreviewPaperRelation> p = previewService.listAdmin(page, size, category, userId, previewId, startTime, endTime);
-
-        // 绑定用户
-        Collection userIds = Transform.getIds(p, UserPreviewPaperRelation.class, "userId");
-        List<User> userList = usersService.select(userIds);
-        Transform.combine(p, userList, UserPreviewPaperRelation.class, "userId", "user", User.class, "id");
-
-        // 绑定预习作业
-        Collection previewIds = Transform.getIds(p, UserPreviewPaperRelation.class, "moduleId");
-        List<PreviewPaper> previewPaperList = previewService.select(previewIds);
-        Transform.combine(p, previewPaperList, UserPreviewPaperRelation.class, "moduleId", "preview", PreviewPaper.class, "id");
-
-        List<UserPreviewListDto> pr = Transform.convert(p, UserPreviewListDto.class);
-
-        return ResponseHelp.success(pr, page, size, p.getTotal());
-    }
-}

+ 6 - 5
server/gateway-api/src/main/java/com/qxgmat/controller/api/CourseController.java

@@ -53,20 +53,21 @@ public class CourseController {
 
         // 获取每个科目的最后2次作业
         Map<Object, Collection<UserPreviewPaperRelation>> previewMap = previewService.groupByCategory(user.getId(), 3);
-        Transform.combine(dtos, previewMap, UserClassDetailDto.class, "category", "previews", UserPreviewPaperExtendDto.class);
+        Transform.combine(dtos, previewMap, UserClassDetailDto.class, "courseId", "previews", UserPreviewPaperExtendDto.class);
 
         // 获取课程状态:已购买未开通
         List<UserPay> pays = userPayService.listUnUse(user.getId(), PayModule.CLASS);
-        Collection ids = Transform.getIds(userClassList, UserClass.class, "category");
+        Collection ids = Transform.getIds(userClassList, UserClass.class, "courseId");
         for(UserPay pay : pays){
-            Integer category = Integer.valueOf(pay.getModuleExtend());
-            if (!ids.contains(category)){
+            Integer courseId = Integer.valueOf(pay.getModuleExtend());
+            if (!ids.contains(courseId)){
                 UserClassDetailDto dto = new UserClassDetailDto();
-                dto.setCategory(category);
+                dto.setCourseId(courseId);
                 dto.setPayed(true);
                 dtos.add(dto);
             }
         }
+        // todo 区分完成状态
 
         return ResponseHelp.success(dtos);
     }

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

@@ -7,7 +7,9 @@ import com.nuliji.tools.exception.ParameterException;
 import com.nuliji.tools.exception.SystemException;
 import com.qxgmat.data.constants.enums.QuestionType;
 import com.qxgmat.data.constants.enums.SettingKey;
+import com.qxgmat.data.constants.enums.module.FeedbackModule;
 import com.qxgmat.data.constants.enums.module.PaperModule;
+import com.qxgmat.data.constants.enums.module.PaperOrigin;
 import com.qxgmat.data.constants.enums.module.QuestionModule;
 import com.qxgmat.data.constants.enums.status.DirectionStatus;
 import com.qxgmat.data.dao.entity.*;
@@ -18,6 +20,7 @@ import com.qxgmat.dto.request.UserNoteDto;
 import com.qxgmat.dto.response.*;
 import com.qxgmat.help.ShiroHelp;
 import com.qxgmat.service.*;
+import com.qxgmat.service.extend.QuestionFlowService;
 import com.qxgmat.service.inline.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -36,6 +39,7 @@ import java.io.IOException;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * Created by GaoJie on 2017/10/31.
@@ -58,6 +62,9 @@ public class MyController {
     private ShiroHelp shiroHelp;
 
     @Autowired
+    private SettingService settingService;
+
+    @Autowired
     private ExerciseStructService exerciseStructService;
 
     @Autowired
@@ -67,22 +74,25 @@ public class MyController {
     private ClassCourseNoService classCourseNoService;
 
     @Autowired
-    private UsersService usersService;
+    private QuestionNoService questionNoService;
 
     @Autowired
-    private UserMessageService userMessageService;
+    private SentenceQuestionService sentenceQuestionService;
 
     @Autowired
-    private SettingService settingService;
+    private TextbookQuestionService textbookQuestionService;
 
     @Autowired
-    private UserCourseRecordService userCourseRecordService;
+    private UsersService usersService;
 
     @Autowired
-    private UserSentenceRecordService userSentenceRecordService;
+    private UserMessageService userMessageService;
 
     @Autowired
-    private QuestionNoService questionNoService;
+    private UserCourseRecordService userCourseRecordService;
+
+    @Autowired
+    private UserSentenceRecordService userSentenceRecordService;
 
     @Autowired
     private UserServiceService userServiceService;
@@ -108,6 +118,12 @@ public class MyController {
     @Autowired
     private UserPaperService userPaperService;
 
+    @Autowired
+    private UserPaperQuestionService userPaperQuestionService;
+
+    @Autowired
+    private QuestionFlowService questionFlowService;
+
     @RequestMapping(value = "/email", method = RequestMethod.POST)
     @ApiOperation(value = "绑定邮箱", httpMethod = "POST")
     public Response<Boolean> email(@RequestBody @Validated UserEmailDto dto, HttpSession session, HttpServletRequest request) {
@@ -327,7 +343,7 @@ public class MyController {
         dto.setDays((int)((user.getCreateTime().getTime() - new Date().getTime()) / (1000*3600*24)));
         Integer totalTime = 0;
         Map<String, Integer> categoryMap = new HashMap<>();
-        // 按模块类型分组查询: module=> sentence, examination, collect+error, 忽略exercise
+        // 按模块来源分组查询: module=> sentence, examination, collect+error, 忽略exercise,preview
         List<UserStudyStatRelation> moduleList = userReportService.statGroupModule(user.getId());
         for(UserStudyStatRelation module:moduleList){
             // 练习时间过滤
@@ -338,16 +354,24 @@ public class MyController {
             String key = module.getModule();
             totalTime += time;
             // 收藏及错误组卷合并
-            if (module.getModule().equals(PaperModule.COLLECT.key)
-                    || module.getModule().equals(PaperModule.ERROR.key)){
+            if (module.getModule().equals(PaperOrigin.COLLECT.key)
+                    || module.getModule().equals(PaperOrigin.ERROR.key)){
                 key = "freedom";
                 time += categoryMap.getOrDefault(key, 0);
+            }else if (module.getModule().equals(PaperOrigin.PREVIEW.key)){
+                key = PaperOrigin.EXERCISE.key;
             }
             categoryMap.put(key, time);
         }
         // 按题型统计练习
-        List<UserStudyStatRelation> typeList = userReportService.statGroupExerciseType(user.getId(), null, null);
-        for(UserStudyStatRelation type:typeList){
+        List<UserStudyStatRelation> exerciseList = userReportService.statGroupExerciseType(user.getId(), null, null);
+        for(UserStudyStatRelation type:exerciseList){
+            totalTime += type.getUserTime();
+            categoryMap.put(type.getModule(), type.getUserTime());
+        }
+        // 按题型统计预习作业
+        List<UserStudyStatRelation> previewList = userReportService.statGroupExerciseType(user.getId(), null, null);
+        for(UserStudyStatRelation type:previewList){
             totalTime += type.getUserTime();
             categoryMap.put(type.getModule(), type.getUserTime());
         }
@@ -400,38 +424,64 @@ public class MyController {
         User user = (User) shiroHelp.getLoginUser();
         UserStudyDayDto dto = new UserStudyDayDto();
 
+        // todo
+
         return ResponseHelp.success(dto);
     }
 
-    @RequestMapping(value = "/collect", method = RequestMethod.PUT)
+    @RequestMapping(value = "/collect/add", method = RequestMethod.PUT)
     @ApiOperation(value = "添加收藏", notes = "添加收藏", httpMethod = "PUT")
     public Response<Boolean> addCollect(@RequestBody @Validated UserCollectDto dto)  {
         UserCollectQuestion entity = Transform.dtoToEntity(dto);
         User user = (User) shiroHelp.getLoginUser();
-        QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
-        entity.setQuestionId(questionNo.getQuestionId());
-        entity.setModule(questionNo.getModule());
+        switch (QuestionModule.ValueOf(dto.getQuestionModule())){
+            case BASE:
+                entity.setQuestionModule(QuestionModule.BASE.key);
+                QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
+                entity.setQuestionId(questionNo.getQuestionId());
+                entity.setQuestionNoId(questionNo.getId());
+                break;
+            case SENTENCE:
+                entity.setQuestionModule(QuestionModule.SENTENCE.key);
+                SentenceQuestion sentenceQuestion = sentenceQuestionService.get(dto.getQuestionNoId());
+                entity.setQuestionId(sentenceQuestion.getQuestionId());
+                entity.setQuestionNoId(sentenceQuestion.getId());
+                break;
+            case TEXTBOOK:
+                entity.setQuestionModule(QuestionModule.SENTENCE.key);
+                TextbookQuestion textbookQuestion = textbookQuestionService.get(dto.getQuestionNoId());
+                entity.setQuestionId(textbookQuestion.getQuestionId());
+                entity.setQuestionNoId(textbookQuestion.getId());
+                break;
+        }
         entity.setUserId(user.getId());
         userCollectQuestionService.addQuestion(entity);
 
         return ResponseHelp.success(true);
     }
 
-    @RequestMapping(value = "/collect", method = RequestMethod.DELETE)
+    @RequestMapping(value = "/collect/delete", method = RequestMethod.DELETE)
     @ApiOperation(value = "移除收藏", notes = "移除收藏", httpMethod = "DELETE")
-    public Response<Boolean> deleteCollect(Integer questionNoId)  {
+    public Response<Boolean> deleteCollect(String questionModule, Integer questionNoId)  {
         User user = (User) shiroHelp.getLoginUser();
-        Boolean result = userCollectQuestionService.deleteQuestion(user.getId(), questionNoId);
+        Boolean result = userCollectQuestionService.deleteQuestion(user.getId(), QuestionModule.ValueOf(questionModule), questionNoId);
 
         return ResponseHelp.success(result);
     }
 
     @RequestMapping(value = "/collect/bind", method = RequestMethod.POST)
     @ApiOperation(value = "收藏组卷", notes = "收藏组卷", httpMethod = "POST")
-    public Response<Boolean> bindCollect(@RequestBody @Validated UserQuestionIdsDto dto)  {
+    public Response<Boolean> bindCollect(@RequestBody @Validated UserCustomBindDto dto)  {
         User user = (User) shiroHelp.getLoginUser();
 
-        // todo 绑定数据
+        questionFlowService.makePaper(
+                user.getId(),
+                QuestionModule.ValueOf(dto.getQuestionModule()),
+                PaperOrigin.COLLECT,
+                Arrays.stream(dto.getQuestionNoIds()).collect(Collectors.toList()),
+                dto.getFilterTimes()
+        );
+
         return ResponseHelp.success(true);
     }
 
@@ -477,10 +527,17 @@ public class MyController {
 
     @RequestMapping(value = "/error/bind", method = RequestMethod.POST)
     @ApiOperation(value = "错题组卷", notes = "错题组卷", httpMethod = "POST")
-    public Response<Boolean> bindError(@RequestBody @Validated UserErrorBindDto dto)  {
+    public Response<Boolean> bindError(@RequestBody @Validated UserCustomBindDto dto)  {
         User user = (User) shiroHelp.getLoginUser();
 
-        // todo 绑定数据
+        questionFlowService.makePaper(
+                user.getId(),
+                QuestionModule.ValueOf(dto.getQuestionModule()),
+                PaperOrigin.ERROR,
+                Arrays.stream(dto.getQuestionNoIds()).collect(Collectors.toList()),
+                dto.getFilterTimes()
+        );
+
         return ResponseHelp.success(true);
     }
 
@@ -489,6 +546,24 @@ public class MyController {
     public Response<Boolean> clearError(@RequestBody @Validated UserQuestionIdsDto dto)  {
         User user = (User) shiroHelp.getLoginUser();
 
+        List<UserQuestion> questionList = userQuestionService.select(dto.getQuestionNoIds());
+        userPaperQuestionService.addRemoveError(questionList);
+
+        return ResponseHelp.success(true);
+    }
+
+    @RequestMapping(value = "/error/remove", method = RequestMethod.POST)
+    @ApiOperation(value = "移除正确题", notes = "移除正确题", httpMethod = "POST")
+    public Response<Boolean> removeError(@RequestBody @Validated ErrorReportDto dto)  {
+        User user = (User) shiroHelp.getLoginUser();
+
+        UserReport report = userReportService.get(dto.getUserReportId());
+        if (report.getIsFinish() == 0){
+            throw new ParameterException("试卷未完成");
+        }
+        List<UserQuestion> questionList = userQuestionService.listByReport(user.getId(), dto.getUserReportId());
+        userPaperQuestionService.addRemoveError(questionList);
+
         return ResponseHelp.success(true);
     }
 
@@ -498,9 +573,27 @@ public class MyController {
         UserNoteQuestion entity = Transform.dtoToEntity(dto);
         User user = (User) shiroHelp.getLoginUser();
         entity.setUserId(user.getId());
-        QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
-        entity.setQuestionId(questionNo.getQuestionId());
-        entity.setModule(questionNo.getModule());
+        switch (QuestionModule.ValueOf(dto.getQuestionModule())){
+            case BASE:
+                entity.setQuestionModule(QuestionModule.BASE.key);
+                QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
+                entity.setQuestionId(questionNo.getQuestionId());
+                entity.setQuestionNoId(questionNo.getId());
+                break;
+            case SENTENCE:
+                entity.setQuestionModule(QuestionModule.SENTENCE.key);
+                SentenceQuestion sentenceQuestion = sentenceQuestionService.get(dto.getQuestionNoId());
+                entity.setQuestionId(sentenceQuestion.getQuestionId());
+                entity.setQuestionNoId(sentenceQuestion.getId());
+                break;
+            case TEXTBOOK:
+                entity.setQuestionModule(QuestionModule.SENTENCE.key);
+                TextbookQuestion textbookQuestion = textbookQuestionService.get(dto.getQuestionNoId());
+                entity.setQuestionId(textbookQuestion.getQuestionId());
+                entity.setQuestionNoId(textbookQuestion.getId());
+                break;
+        }
+
         userNoteQuestionService.update(entity);
 
         return ResponseHelp.success(true);
@@ -562,20 +655,52 @@ public class MyController {
         UserAskQuestion entity = Transform.dtoToEntity(dto);
         User user = (User) shiroHelp.getLoginUser();
         entity.setUserId(user.getId());
-        QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
-        entity.setQuestionId(questionNo.getQuestionId());
-        entity.setModule(questionNo.getModule());
+        switch (QuestionModule.ValueOf(dto.getQuestionModule())){
+            case BASE:
+                entity.setQuestionModule(QuestionModule.BASE.key);
+                QuestionNo questionNo = questionNoService.get(dto.getQuestionNoId());
+                entity.setQuestionId(questionNo.getQuestionId());
+                entity.setQuestionNoId(questionNo.getId());
+                break;
+            case SENTENCE:
+                entity.setQuestionModule(QuestionModule.SENTENCE.key);
+                SentenceQuestion sentenceQuestion = sentenceQuestionService.get(dto.getQuestionNoId());
+                entity.setQuestionId(sentenceQuestion.getQuestionId());
+                entity.setQuestionNoId(sentenceQuestion.getId());
+                break;
+            case TEXTBOOK:
+                entity.setQuestionModule(QuestionModule.SENTENCE.key);
+                TextbookQuestion textbookQuestion = textbookQuestionService.get(dto.getQuestionNoId());
+                entity.setQuestionId(textbookQuestion.getQuestionId());
+                entity.setQuestionNoId(textbookQuestion.getId());
+                break;
+        }
         userAskQuestionService.add(entity);
 
         return ResponseHelp.success(true);
     }
 
-    @RequestMapping(value = "/feedback/question/error", method = RequestMethod.POST)
+    @RequestMapping(value = "/feedback/error/question", method = RequestMethod.POST)
     @ApiOperation(value = "添加题目勘误", notes = "添加勘误", httpMethod = "POST")
+    public Response<Boolean> addFeedbackErrorQuestion(@RequestBody @Validated UserFeedbackErrorDto dto)  {
+        UserFeedbackError entity = Transform.dtoToEntity(dto);
+        User user = (User) shiroHelp.getLoginUser();
+        entity.setUserId(user.getId());
+        entity.setModule(FeedbackModule.QUESTION.key);
+        entity.setStatus(0);
+        userFeedbackErrorService.add(entity);
+
+        return ResponseHelp.success(true);
+    }
+
+    @RequestMapping(value = "/feedback/error/data", method = RequestMethod.POST)
+    @ApiOperation(value = "添加资料勘误", notes = "添加勘误", httpMethod = "POST")
     public Response<Boolean> addFeedbackError(@RequestBody @Validated UserFeedbackErrorDto dto)  {
         UserFeedbackError entity = Transform.dtoToEntity(dto);
         User user = (User) shiroHelp.getLoginUser();
         entity.setUserId(user.getId());
+        entity.setModule(FeedbackModule.DATA.key);
+        entity.setStatus(0);
         userFeedbackErrorService.add(entity);
 
         return ResponseHelp.success(true);

+ 33 - 7
server/gateway-api/src/main/java/com/qxgmat/controller/api/QuestionController.java

@@ -7,6 +7,7 @@ import com.nuliji.tools.*;
 import com.nuliji.tools.exception.ParameterException;
 import com.qxgmat.data.constants.enums.logic.ExerciseLogic;
 import com.qxgmat.data.constants.enums.module.PaperModule;
+import com.qxgmat.data.constants.enums.module.PaperOrigin;
 import com.qxgmat.data.dao.entity.*;
 import com.qxgmat.data.relation.entity.UserExercisePaperRelation;
 import com.qxgmat.data.relation.entity.UserReportRelation;
@@ -224,7 +225,7 @@ public class QuestionController {
         JSONObject setting = new JSONObject();
         setting.put("disorder", dto.getDisorder());
         setting.put("order", dto.getOrder());
-        UserReport report = questionFlowService.start(user.getId(), PaperModule.EXAMINATION, dto.getPaperId(), setting);
+        UserReport report = questionFlowService.start(user.getId(), PaperOrigin.EXAMINATION, dto.getPaperId(), setting);
 
         return ResponseHelp.success(Transform.convert(report, UserReportBaseDto.class));
     }
@@ -235,7 +236,7 @@ public class QuestionController {
         User user = (User) shiroHelp.getLoginUser();
         JSONObject setting = new JSONObject();
         setting.put("disorder", dto.getDisorder());
-        UserReport report = questionFlowService.start(user.getId(), PaperModule.EXERCISE, dto.getPaperId(), setting);
+        UserReport report = questionFlowService.start(user.getId(), PaperOrigin.EXERCISE, dto.getPaperId(), setting);
 
         return ResponseHelp.success(Transform.convert(report, UserReportBaseDto.class));
     }
@@ -246,7 +247,32 @@ public class QuestionController {
         User user = (User) shiroHelp.getLoginUser();
         JSONObject setting = new JSONObject();
         setting.put("disorder", dto.getDisorder());
-        UserReportRelation report = questionFlowService.start(user.getId(), PaperModule.PREVIEW, dto.getPaperId(), setting);
+        UserReportRelation report = questionFlowService.start(user.getId(), PaperOrigin.PREVIEW, dto.getPaperId(), setting);
+
+        UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
+
+        return ResponseHelp.success(userReportBaseDto);
+    }
+
+    @RequestMapping(value = "/textbook/start", method = RequestMethod.POST)
+    @ApiOperation(value = "开始: 机经", notes = "提交考试设置", httpMethod = "POST")
+    public Response<UserReportBaseDto> startTextbook(@RequestBody @Validated TextbookStartDto dto)  {
+        User user = (User) shiroHelp.getLoginUser();
+        JSONObject setting = new JSONObject();
+        setting.put("disorder", dto.getDisorder());
+        UserReportRelation report = questionFlowService.start(user.getId(), PaperOrigin.TEXTBOOK, dto.getPaperId(), setting);
+
+        UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
+
+        return ResponseHelp.success(userReportBaseDto);
+    }
+
+    @RequestMapping(value = "/sentence/start", method = RequestMethod.POST)
+    @ApiOperation(value = "开始: 长难句", notes = "提交考试设置", httpMethod = "POST")
+    public Response<UserReportBaseDto> startSentence(@RequestBody @Validated SentenceStartDto dto)  {
+        User user = (User) shiroHelp.getLoginUser();
+        JSONObject setting = new JSONObject();
+        UserReportRelation report = questionFlowService.start(user.getId(), PaperOrigin.SENTENCE, dto.getPaperId(), setting);
 
         UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
 
@@ -260,7 +286,7 @@ public class QuestionController {
     )  {
         User user = (User) shiroHelp.getLoginUser();
         UserPaper paper = userPaperService.get(paperId);
-        if (!paper.getPaperModule().equals(PaperModule.ERROR.key)){
+        if (!paper.getPaperOrigin().equals(PaperOrigin.ERROR.key)){
             throw new ParameterException("试卷不存在");
         }
         if (!paper.getUserId().equals(user.getId())){
@@ -277,7 +303,7 @@ public class QuestionController {
         User user = (User) shiroHelp.getLoginUser();
         JSONObject setting = new JSONObject();
         setting.put("disorder", dto.getDisorder());
-        UserReportRelation report = questionFlowService.start(user.getId(), PaperModule.ERROR, dto.getPaperId(), setting);
+        UserReportRelation report = questionFlowService.start(user.getId(), PaperOrigin.ERROR, dto.getPaperId(), setting);
 
         UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
 
@@ -291,7 +317,7 @@ public class QuestionController {
     )  {
         User user = (User) shiroHelp.getLoginUser();
         UserPaper paper = userPaperService.get(paperId);
-        if (!paper.getPaperModule().equals(PaperModule.COLLECT.key)){
+        if (!paper.getPaperOrigin().equals(PaperOrigin.COLLECT.key)){
             throw new ParameterException("试卷不存在");
         }
         if (!paper.getUserId().equals(user.getId())){
@@ -308,7 +334,7 @@ public class QuestionController {
         User user = (User) shiroHelp.getLoginUser();
         JSONObject setting = new JSONObject();
         setting.put("disorder", dto.getDisorder());
-        UserReportRelation report = questionFlowService.start(user.getId(), PaperModule.COLLECT, dto.getPaperId(), setting);
+        UserReportRelation report = questionFlowService.start(user.getId(), PaperOrigin.COLLECT, dto.getPaperId(), setting);
 
         UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
 

+ 133 - 127
server/gateway-api/src/main/java/com/qxgmat/controller/api/SentenceController.java

@@ -7,11 +7,7 @@ import com.nuliji.tools.Transform;
 import com.nuliji.tools.exception.AuthException;
 import com.qxgmat.data.constants.enums.SettingKey;
 import com.qxgmat.data.constants.enums.logic.SentenceLogic;
-import com.qxgmat.data.constants.enums.module.PaperModule;
 import com.qxgmat.data.dao.entity.*;
-import com.qxgmat.data.relation.entity.UserReportRelation;
-import com.qxgmat.dto.extend.QuestionExtendDto;
-import com.qxgmat.dto.extend.SentenceQuestionBaseExtendDto;
 import com.qxgmat.dto.request.*;
 import com.qxgmat.dto.response.*;
 import com.qxgmat.help.ShiroHelp;
@@ -63,6 +59,9 @@ public class SentenceController
     private UserSentenceProcessService userSentenceProcessService;
 
     @Autowired
+    private UserSentenceRecordService userSentenceRecordService;
+
+    @Autowired
     private UserCollectQuestionService userCollectQuestionService;
 
     @Autowired
@@ -70,7 +69,7 @@ public class SentenceController
 
     @RequestMapping(value = "/info", method = RequestMethod.GET)
     @ApiOperation(value = "所有长难句信息", httpMethod = "GET")
-    public Response<JSONObject> sentenceInfo(HttpSession session) {
+    public Response<JSONObject> info(HttpSession session) {
         Setting entity = settingService.getByKey(SettingKey.SENTENCE);
         JSONObject value = entity.getValue();
 
@@ -134,6 +133,25 @@ public class SentenceController
         }
     }
 
+    @RequestMapping(value = "/article/detail", method = RequestMethod.PUT)
+    @ApiOperation(value = "长难句文章详情", httpMethod = "PUT")
+    public Response<UserSentenceArticleDetailDto> detailArticle(
+            @RequestParam(required = true, name="id") Integer articleId
+    ) {
+        User user = (User) shiroHelp.getLoginUser();
+        if (user == null) throw new AuthException("需要登录");
+
+        SentenceArticle article = sentenceArticleService.get(articleId);
+        // 查询文章进度
+        UserSentenceProcess process = userSentenceProcessService.get(user.getId(), article.getChapter(), article.getPart());
+
+        UserSentenceArticleDetailDto dto = Transform.convert(article, UserSentenceArticleDetailDto.class);
+
+        dto.setProcess(process.getProcess());
+
+        return ResponseHelp.success(dto);
+    }
+
     @RequestMapping(value = "/article/process", method = RequestMethod.PUT)
     @ApiOperation(value = "更新长难句文章进度", httpMethod = "PUT")
     public Response<Boolean> articleProcess(@RequestBody @Validated UserSentenceProcessDto dto) {
@@ -143,8 +161,16 @@ public class SentenceController
 
         // 获取本章节的最大part数
         Integer max = sentenceArticleService.maxPart(dto.getChapter());
-        // todo 添加阅读记录
 
+        // 添加阅读记录
+        userSentenceRecordService.add(UserSentenceRecord.builder()
+                .userId(user.getId())
+                .chapter(dto.getChapter())
+                .part(dto.getPart())
+                .userTime(dto.getTime())
+                .build());
+
+        // 更新阅读进度
         userSentenceProcessService.updateProcess(user.getId(), dto.getChapter(), dto.getPart(), dto.getProcess(), max);
         return ResponseHelp.success(true);
     }
@@ -168,26 +194,6 @@ public class SentenceController
         }
     }
 
-    @RequestMapping(value = "/question/detail", method = RequestMethod.GET)
-    @ApiOperation(value = "获取题目详情", notes = "获取题目详情", httpMethod = "GET")
-    public Response<UserSentenceQuestionDetailDto> detailQuestion(
-            @RequestParam(required = true) Integer userQuestionId,
-            @RequestParam(required = true) Integer userReportId,
-            @RequestParam(required = true) Integer no
-    )  {
-        User user = (User) shiroHelp.getLoginUser();
-        if (userQuestionId != null && userQuestionId > 0){
-
-        }else if(userReportId != null && userReportId > 0){
-            if (no == null || no == 0){
-                no = 1;
-            }
-            // 根据题目序号获取
-        }
-
-        return ResponseHelp.success(null);
-    }
-
     @RequestMapping(value = "/paper", method = RequestMethod.GET)
     @ApiOperation(value = "获取练习卷", notes = "获取练习卷", httpMethod = "GET")
     public Response<PaperBaseDto> detailPaper(
@@ -200,105 +206,105 @@ public class SentenceController
 
         return ResponseHelp.success(paperDto);
     }
-
-    @RequestMapping(value = "/report/detail", method = RequestMethod.GET)
-    @ApiOperation(value = "获取详细记录", notes = "获取报告", httpMethod = "GET")
-    public Response<UserReportDetailDto> detailReport(
-            @RequestParam(required = true, name="id") Integer userReportId
-    )  {
-        User user = (User) shiroHelp.getLoginUser();
-        UserReportRelation report = questionFlowService.baseReport(user.getId(), userReportId);
-
-        UserReportDetailDto userReportDto = Transform.convert(report, UserReportDetailDto.class);
-
-        // todo 绑定数据
-
-        return ResponseHelp.success(userReportDto);
-    }
-
-    @RequestMapping(value = "/report/question", method = RequestMethod.GET)
-    @ApiOperation(value = "获取练习做题记录", notes = "获取报告题目", httpMethod = "GET")
-    public Response<List<UserSentenceQuestionDetailDto>> detailReportQuestion(
-            @RequestParam(required = true, name="id") Integer userReportId
-    )  {
-        User user = (User) shiroHelp.getLoginUser();
-        List<UserQuestion> userQuestionList = questionFlowService.listByReport(user.getId(), userReportId);
-
-        List<UserSentenceQuestionDetailDto> userQuestionDetailDtos = Transform.convert(userQuestionList, UserSentenceQuestionDetailDto.class);
-
-        // todo 绑定数据
-
-        return ResponseHelp.success(userQuestionDetailDtos);
-    }
-
-    @RequestMapping(value = "/start", method = RequestMethod.POST)
-    @ApiOperation(value = "开始做题", notes = "提交考试设置", httpMethod = "POST")
-    public Response<UserReportBaseDto> start(@RequestBody @Validated SentenceStartDto dto)  {
-        User user = (User) shiroHelp.getLoginUser();
-        JSONObject setting = new JSONObject();
-        UserReportRelation report = questionFlowService.start(user.getId(), PaperModule.SENTENCE, dto.getPaperId(), setting);
-
-        UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
-
-        return ResponseHelp.success(userReportBaseDto);
-    }
-
-    @RequestMapping(value = "/continue", method = RequestMethod.POST)
-    @ApiOperation(value = "继续做题", notes = "获取报告信息", httpMethod = "POST")
-    public Response<UserReportBaseDto> continueReport(@RequestBody @Validated ReportContinueDto dto)  {
-        User user = (User) shiroHelp.getLoginUser();
-        UserReportRelation report = questionFlowService.continueReport(user.getId(), dto.getUserReportId());
-
-        UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
-
-        return ResponseHelp.success(userReportBaseDto);
-    }
-
-    @RequestMapping(value = "/next", method = RequestMethod.POST)
-    @ApiOperation(value = "获取下一题", notes = "获取下一题", httpMethod = "POST")
-    public Response<UserSentenceQuestionBaseDto> next(@RequestBody @Validated ReportNextDto dto)  {
-        User user = (User) shiroHelp.getLoginUser();
-
-        UserQuestion userQuestion = questionFlowService.next(user.getId(), dto.getUserReportId());
-
-        UserSentenceQuestionBaseDto baseDto = Transform.convert(userQuestion, UserSentenceQuestionBaseDto.class);
-
-        // 绑定question
-        baseDto.setQuestion(Transform.convert(questionService.get(userQuestion.getQuestionId()), QuestionExtendDto.class));
-
-        // 绑定sentenceQuestion
-        baseDto.setSentence(Transform.convert(sentenceQuestionService.get(userQuestion.getQuestionNoId()), SentenceQuestionBaseExtendDto.class));
-
-        // 绑定collect
-        baseDto.setCollect(userCollectQuestionService.getByUserAndQuestion(user.getId(), userQuestion.getQuestionId()) != null);
-
-        return ResponseHelp.success(null);
-    }
-
-    @RequestMapping(value = "/submit", method = RequestMethod.POST)
-    @ApiOperation(value = "提交题目答案", notes = "提交题目", httpMethod = "POST")
-    public Response<Boolean> submit(@RequestBody @Validated QuestionSubmitDto dto)  {
-        User user = (User) shiroHelp.getLoginUser();
-        Boolean result = questionFlowService.submit(user.getId(), dto.getUserQuestionId(), dto.getTime(), dto.getAnswer(), dto.getSetting());
-        return ResponseHelp.success(result);
-    }
-
-    @RequestMapping(value = "/finish", method = RequestMethod.POST)
-    @ApiOperation(value = "完成考试", notes = "完成考试", httpMethod = "POST")
-    public Response<Boolean> finish(@RequestBody @Validated ReportFinishDto dto)  {
-        User user = (User) shiroHelp.getLoginUser();
-
-        Boolean result = questionFlowService.finish(user.getId(), dto.getUserReportId());
-        return ResponseHelp.success(result);
-    }
-
-    @RequestMapping(value = "/restart", method = RequestMethod.POST)
-    @ApiOperation(value = "重置考试", notes = "重置考试", httpMethod = "POST")
-    public Response<Boolean> restart(@RequestBody @Validated PaperRestartDto dto)  {
-        User user = (User) shiroHelp.getLoginUser();
-
-        questionFlowService.restart(dto.getUserPaperId(), user.getId());
-
-        return ResponseHelp.success(true);
-    }
+//
+//    @RequestMapping(value = "/report/detail", method = RequestMethod.GET)
+//    @ApiOperation(value = "获取详细记录", notes = "获取报告", httpMethod = "GET")
+//    public Response<UserReportDetailDto> detailReport(
+//            @RequestParam(required = true, name="id") Integer userReportId
+//    )  {
+//        User user = (User) shiroHelp.getLoginUser();
+//        UserReportRelation report = questionFlowService.baseReport(user.getId(), userReportId);
+//
+//        UserReportDetailDto userReportDto = Transform.convert(report, UserReportDetailDto.class);
+//
+//        // todo 绑定数据
+//
+//        return ResponseHelp.success(userReportDto);
+//    }
+//
+//    @RequestMapping(value = "/report/question", method = RequestMethod.GET)
+//    @ApiOperation(value = "获取做题记录", notes = "获取报告题目", httpMethod = "GET")
+//    public Response<List<UserSentenceQuestionDetailDto>> detailReportQuestion(
+//            @RequestParam(required = true, name="id") Integer userReportId
+//    )  {
+//        User user = (User) shiroHelp.getLoginUser();
+//        List<UserQuestion> userQuestionList = questionFlowService.listByReport(user.getId(), userReportId);
+//
+//        List<UserSentenceQuestionDetailDto> userQuestionDetailDtos = Transform.convert(userQuestionList, UserSentenceQuestionDetailDto.class);
+//
+//        // todo 绑定数据
+//
+//        return ResponseHelp.success(userQuestionDetailDtos);
+//    }
+//
+//    @RequestMapping(value = "/start", method = RequestMethod.POST)
+//    @ApiOperation(value = "开始做题", notes = "提交考试设置", httpMethod = "POST")
+//    public Response<UserReportBaseDto> start(@RequestBody @Validated SentenceStartDto dto)  {
+//        User user = (User) shiroHelp.getLoginUser();
+//        JSONObject setting = new JSONObject();
+//        UserReportRelation report = questionFlowService.start(user.getId(), PaperOrigin.SENTENCE, dto.getPaperId(), setting);
+//
+//        UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
+//
+//        return ResponseHelp.success(userReportBaseDto);
+//    }
+//
+//    @RequestMapping(value = "/continue", method = RequestMethod.POST)
+//    @ApiOperation(value = "继续做题", notes = "获取报告信息", httpMethod = "POST")
+//    public Response<UserReportBaseDto> continueReport(@RequestBody @Validated ReportContinueDto dto)  {
+//        User user = (User) shiroHelp.getLoginUser();
+//        UserReportRelation report = questionFlowService.continueReport(user.getId(), dto.getUserReportId());
+//
+//        UserReportBaseDto userReportBaseDto = Transform.convert(report, UserReportBaseDto.class);
+//
+//        return ResponseHelp.success(userReportBaseDto);
+//    }
+//
+//    @RequestMapping(value = "/next", method = RequestMethod.POST)
+//    @ApiOperation(value = "获取下一题", notes = "获取下一题", httpMethod = "POST")
+//    public Response<UserSentenceQuestionBaseDto> next(@RequestBody @Validated ReportNextDto dto)  {
+//        User user = (User) shiroHelp.getLoginUser();
+//
+//        UserQuestion userQuestion = questionFlowService.next(user.getId(), dto.getUserReportId());
+//
+//        UserSentenceQuestionBaseDto baseDto = Transform.convert(userQuestion, UserSentenceQuestionBaseDto.class);
+//
+//        // 绑定question
+//        baseDto.setQuestion(Transform.convert(questionService.get(userQuestion.getQuestionId()), QuestionExtendDto.class));
+//
+//        // 绑定sentenceQuestion
+//        baseDto.setSentence(Transform.convert(sentenceQuestionService.get(userQuestion.getQuestionNoId()), SentenceQuestionBaseExtendDto.class));
+//
+//        // 绑定collect
+//        baseDto.setCollect(userCollectQuestionService.getByUserAndQuestion(user.getId(), userQuestion.getQuestionId()) != null);
+//
+//        return ResponseHelp.success(null);
+//    }
+//
+//    @RequestMapping(value = "/submit", method = RequestMethod.POST)
+//    @ApiOperation(value = "提交题目答案", notes = "提交题目", httpMethod = "POST")
+//    public Response<Boolean> submit(@RequestBody @Validated QuestionSubmitDto dto)  {
+//        User user = (User) shiroHelp.getLoginUser();
+//        Boolean result = questionFlowService.submit(user.getId(), dto.getUserQuestionId(), dto.getTime(), dto.getAnswer(), dto.getSetting());
+//        return ResponseHelp.success(result);
+//    }
+//
+//    @RequestMapping(value = "/finish", method = RequestMethod.POST)
+//    @ApiOperation(value = "完成考试", notes = "完成考试", httpMethod = "POST")
+//    public Response<Boolean> finish(@RequestBody @Validated ReportFinishDto dto)  {
+//        User user = (User) shiroHelp.getLoginUser();
+//
+//        Boolean result = questionFlowService.finish(user.getId(), dto.getUserReportId());
+//        return ResponseHelp.success(result);
+//    }
+//
+//    @RequestMapping(value = "/restart", method = RequestMethod.POST)
+//    @ApiOperation(value = "重置考试", notes = "重置考试", httpMethod = "POST")
+//    public Response<Boolean> restart(@RequestBody @Validated PaperRestartDto dto)  {
+//        User user = (User) shiroHelp.getLoginUser();
+//
+//        questionFlowService.restart(dto.getUserPaperId(), user.getId());
+//
+//        return ResponseHelp.success(true);
+//    }
 }

+ 54 - 0
server/gateway-api/src/main/java/com/qxgmat/controller/api/TextbookController.java

@@ -0,0 +1,54 @@
+package com.qxgmat.controller.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.nuliji.tools.Response;
+import com.nuliji.tools.ResponseHelp;
+import com.nuliji.tools.Transform;
+import com.qxgmat.data.constants.enums.SettingKey;
+import com.qxgmat.data.dao.entity.Setting;
+import com.qxgmat.data.dao.entity.User;
+import com.qxgmat.help.ShiroHelp;
+import com.qxgmat.service.UsersService;
+import com.qxgmat.service.extend.QuestionFlowService;
+import com.qxgmat.service.inline.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpSession;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/api/textbook")
+@Api(tags = "机经", description = "机经接口")
+public class TextbookController
+{
+    @Autowired
+    private ShiroHelp shiroHelp;
+
+    @Autowired
+    private QuestionService questionService;
+
+    @Autowired
+    private SettingService settingService;
+
+    @Autowired
+    private UsersService usersService;
+
+    @Autowired
+    private QuestionFlowService questionFlowService;
+
+
+    @RequestMapping(value = "/info", method = RequestMethod.GET)
+    @ApiOperation(value = "机经信息", httpMethod = "GET")
+    public Response<JSONObject> info(HttpSession session) {
+        Setting entity = settingService.getByKey(SettingKey.SENTENCE);
+        JSONObject value = entity.getValue();
+
+        User user = (User) shiroHelp.getLoginUser();
+
+        return ResponseHelp.success(value);
+    }
+}

+ 43 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/admin/extend/UserAskCourseExtendDto.java

@@ -0,0 +1,43 @@
+package com.qxgmat.dto.admin.extend;
+
+import com.nuliji.tools.annotation.Dto;
+import com.qxgmat.data.dao.entity.UserAskCourse;
+
+@Dto(entity = UserAskCourse.class)
+public class UserAskCourseExtendDto {
+    private Integer id;
+
+    /**
+     * 提问
+     */
+    private String content;
+
+    /**
+     * 回答
+     */
+    private String answer;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+}

+ 0 - 56
server/gateway-api/src/main/java/com/qxgmat/dto/admin/extend/UserAskExtendDto.java

@@ -1,56 +0,0 @@
-package com.qxgmat.dto.admin.extend;
-
-import com.nuliji.tools.annotation.Dto;
-import com.qxgmat.data.dao.entity.UserAskQuestion;
-
-@Dto(entity = UserAskQuestion.class)
-public class UserAskExtendDto {
-
-    private Integer id;
-
-    private String stem;
-
-    private String type;
-    private String difficult;
-    private String place;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getStem() {
-        return stem;
-    }
-
-    public void setStem(String stem) {
-        this.stem = stem;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getDifficult() {
-        return difficult;
-    }
-
-    public void setDifficult(String difficult) {
-        this.difficult = difficult;
-    }
-
-    public String getPlace() {
-        return place;
-    }
-
-    public void setPlace(String place) {
-        this.place = place;
-    }
-}

+ 43 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/admin/extend/UserAskQuestionExtendDto.java

@@ -0,0 +1,43 @@
+package com.qxgmat.dto.admin.extend;
+
+import com.nuliji.tools.annotation.Dto;
+import com.qxgmat.data.dao.entity.UserAskQuestion;
+
+@Dto(entity = UserAskQuestion.class)
+public class UserAskQuestionExtendDto {
+    private Integer id;
+
+    /**
+     * 提问
+     */
+    private String content;
+
+    /**
+     * 回答
+     */
+    private String answer;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+}

+ 52 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/admin/request/UserAskCourseDto.java

@@ -0,0 +1,52 @@
+package com.qxgmat.dto.admin.request;
+
+import com.nuliji.tools.annotation.Dto;
+import com.qxgmat.data.dao.entity.UserAskCourse;
+
+import javax.validation.constraints.NotEmpty;
+
+@Dto(entity = UserAskCourse.class)
+public class UserAskCourseDto {
+
+    @NotEmpty(message = "提问id不允许为空!")
+    private Integer id;
+
+    @NotEmpty(message = "回答不允许为空")
+    private String answer;
+
+    private Integer[] other;
+
+    private Integer showStatus;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public Integer[] getOther() {
+        return other;
+    }
+
+    public void setOther(Integer[] other) {
+        this.other = other;
+    }
+
+    public Integer getShowStatus() {
+        return showStatus;
+    }
+
+    public void setShowStatus(Integer showStatus) {
+        this.showStatus = showStatus;
+    }
+}

+ 1 - 1
server/gateway-api/src/main/java/com/qxgmat/dto/admin/request/UserAskDto.java

@@ -6,7 +6,7 @@ import com.qxgmat.data.dao.entity.UserAskQuestion;
 import javax.validation.constraints.NotEmpty;
 
 @Dto(entity = UserAskQuestion.class)
-public class UserAskDto {
+public class UserAskQuestionDto {
 
     @NotEmpty(message = "提问id不允许为空!")
     private Integer id;

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

@@ -0,0 +1,81 @@
+package com.qxgmat.dto.admin.response;
+
+import com.nuliji.tools.annotation.Dto;
+import com.qxgmat.data.dao.entity.UserAskCourse;
+import com.qxgmat.dto.admin.extend.*;
+
+import java.util.Collection;
+
+@Dto(entity = UserAskCourse.class)
+public class UserAskCourseDetailDto {
+
+    private Integer id;
+
+    private Collection<UserAskCourseExtendDto> others;
+
+    private UserExtendDto user;
+
+    private ManagerExtendDto manager;
+
+    private String target;
+
+    private String content;
+
+    private String answer;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public UserExtendDto getUser() {
+        return user;
+    }
+
+    public void setUser(UserExtendDto user) {
+        this.user = user;
+    }
+
+    public ManagerExtendDto getManager() {
+        return manager;
+    }
+
+    public void setManager(ManagerExtendDto manager) {
+        this.manager = manager;
+    }
+
+    public Collection<UserAskCourseExtendDto> getOthers() {
+        return others;
+    }
+
+    public void setOthers(Collection<UserAskCourseExtendDto> others) {
+        this.others = others;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getAnswer() {
+        return answer;
+    }
+
+    public void setAnswer(String answer) {
+        this.answer = answer;
+    }
+
+    public String getTarget() {
+        return target;
+    }
+
+    public void setTarget(String target) {
+        this.target = target;
+    }
+}

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

@@ -0,0 +1,50 @@
+package com.qxgmat.dto.admin.response;
+
+import com.nuliji.tools.annotation.Dto;
+import com.qxgmat.data.dao.entity.UserAskCourse;
+import com.qxgmat.dto.admin.extend.ManagerExtendDto;
+import com.qxgmat.dto.admin.extend.UserExtendDto;
+
+@Dto(entity = UserAskCourse.class)
+public class UserAskCourseListDto {
+
+    private Integer id;
+
+    private String title;
+
+    private UserExtendDto user;
+
+    private ManagerExtendDto manager;
+
+    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 UserExtendDto getUser() {
+        return user;
+    }
+
+    public void setUser(UserExtendDto user) {
+        this.user = user;
+    }
+
+    public ManagerExtendDto getManager() {
+        return manager;
+    }
+
+    public void setManager(ManagerExtendDto manager) {
+        this.manager = manager;
+    }
+}

+ 4 - 4
server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/UserAskDetailDto.java

@@ -7,7 +7,7 @@ import com.qxgmat.dto.admin.extend.*;
 import java.util.Collection;
 
 @Dto(entity = UserAskQuestion.class)
-public class UserAskDetailDto {
+public class UserAskQuestionDetailDto {
 
     private Integer id;
 
@@ -17,7 +17,7 @@ public class UserAskDetailDto {
 
     private Collection<QuestionNoExtendDto> questionNos;
 
-    private Collection<UserAskExtendDto> others;
+    private Collection<UserAskQuestionExtendDto> others;
 
     private UserExtendDto user;
 
@@ -77,11 +77,11 @@ public class UserAskDetailDto {
         this.questionNos = questionNos;
     }
 
-    public Collection<UserAskExtendDto> getOthers() {
+    public Collection<UserAskQuestionExtendDto> getOthers() {
         return others;
     }
 
-    public void setOthers(Collection<UserAskExtendDto> others) {
+    public void setOthers(Collection<UserAskQuestionExtendDto> others) {
         this.others = others;
     }
 

+ 1 - 1
server/gateway-api/src/main/java/com/qxgmat/dto/admin/response/UserAskListDto.java

@@ -8,7 +8,7 @@ import com.qxgmat.dto.admin.extend.QuestionNoExtendDto;
 import com.qxgmat.dto.admin.extend.UserExtendDto;
 
 @Dto(entity = UserAskQuestion.class)
-public class UserAskListDto {
+public class UserAskQuestionListDto {
 
     private Integer id;
 

+ 9 - 9
server/gateway-api/src/main/java/com/qxgmat/dto/extend/QuestionExtendDto.java

@@ -8,7 +8,7 @@ public class QuestionExtendDto {
 
     private Integer id;
 
-    private String stem;
+    private String description;
 
     private String type;
     private String difficult;
@@ -22,14 +22,6 @@ public class QuestionExtendDto {
         this.id = id;
     }
 
-    public String getStem() {
-        return stem;
-    }
-
-    public void setStem(String stem) {
-        this.stem = stem;
-    }
-
     public String getType() {
         return type;
     }
@@ -53,4 +45,12 @@ public class QuestionExtendDto {
     public void setPlace(String place) {
         this.place = place;
     }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
 }

+ 9 - 41
server/gateway-api/src/main/java/com/qxgmat/dto/extend/QuestionNoExtendDto.java

@@ -9,50 +9,10 @@ import javax.validation.constraints.NotEmpty;
 public class QuestionNoExtendDto {
     private Integer id;
 
-    /**
-     * 模块:examination, exercise, sentence
-     */
-    @NotEmpty(message = "题目所属模块!")
-    private String module;
-
-    /**
-     * 人工id
-     */
-    @NotEmpty(message = "题目ID!")
-    private String no;
-
-    /**
-     * 对应模块结构信息,逗号分隔
-     */
-    @NotEmpty(message = "对应模块层级!")
-    private Integer[] moduleStruct;
+    private String title;
 
     private QuestionExtendDto question;
 
-    public String getModule() {
-        return module;
-    }
-
-    public void setModule(String module) {
-        this.module = module;
-    }
-
-    public String getNo() {
-        return no;
-    }
-
-    public void setNo(String no) {
-        this.no = no;
-    }
-
-    public Integer[] getModuleStruct() {
-        return moduleStruct;
-    }
-
-    public void setModuleStruct(Integer[] moduleStruct) {
-        this.moduleStruct = moduleStruct;
-    }
-
     public QuestionExtendDto getQuestion() {
         return question;
     }
@@ -68,4 +28,12 @@ public class QuestionNoExtendDto {
     public void setId(Integer id) {
         this.id = id;
     }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
 }

+ 3 - 2
server/gateway-api/src/main/java/com/qxgmat/dto/extend/SentenceQuestionBaseExtendDto.java

@@ -2,9 +2,10 @@ package com.qxgmat.dto.extend;
 
 import com.nuliji.tools.annotation.Dto;
 import com.qxgmat.data.dao.entity.SentenceQuestion;
+import com.qxgmat.data.dao.entity.TextbookQuestion;
 
-@Dto(entity = SentenceQuestion.class)
-public class SentenceQuestionBaseExtendDto {
+@Dto(entity = TextbookQuestion.class)
+public class TextbookQuestionDetailExtendDto {
     private String title;
 
     private Integer no;

+ 132 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/extend/UserNoteExtendDto.java

@@ -3,10 +3,70 @@ package com.qxgmat.dto.extend;
 import com.nuliji.tools.annotation.Dto;
 import com.qxgmat.data.dao.entity.UserNoteQuestion;
 
+import java.util.Date;
+
 @Dto(entity = UserNoteQuestion.class)
 public class UserNoteExtendDto {
+    private Integer id;
+
+    private String questionModule;
+
+    private Integer questionId;
+
+    private Integer questionNoId;
+
     private String content;
 
+    private String officialContent;
+
+    private String qxContent;
+
+    private String associationContent;
+
+    private String qaContent;
+
+    private Date contentTime;
+
+    private Date officialTime;
+
+    private Date qxTime;
+
+    private Date associationTime;
+
+    private Date qaTime;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
+
+    public Integer getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(Integer questionId) {
+        this.questionId = questionId;
+    }
+
+    public Integer getQuestionNoId() {
+        return questionNoId;
+    }
+
+    public void setQuestionNoId(Integer questionNoId) {
+        this.questionNoId = questionNoId;
+    }
+
     public String getContent() {
         return content;
     }
@@ -14,4 +74,76 @@ public class UserNoteExtendDto {
     public void setContent(String content) {
         this.content = content;
     }
+
+    public String getOfficialContent() {
+        return officialContent;
+    }
+
+    public void setOfficialContent(String officialContent) {
+        this.officialContent = officialContent;
+    }
+
+    public String getQxContent() {
+        return qxContent;
+    }
+
+    public void setQxContent(String qxContent) {
+        this.qxContent = qxContent;
+    }
+
+    public String getAssociationContent() {
+        return associationContent;
+    }
+
+    public void setAssociationContent(String associationContent) {
+        this.associationContent = associationContent;
+    }
+
+    public Date getContentTime() {
+        return contentTime;
+    }
+
+    public void setContentTime(Date contentTime) {
+        this.contentTime = contentTime;
+    }
+
+    public Date getOfficialTime() {
+        return officialTime;
+    }
+
+    public void setOfficialTime(Date officialTime) {
+        this.officialTime = officialTime;
+    }
+
+    public Date getQxTime() {
+        return qxTime;
+    }
+
+    public void setQxTime(Date qxTime) {
+        this.qxTime = qxTime;
+    }
+
+    public Date getAssociationTime() {
+        return associationTime;
+    }
+
+    public void setAssociationTime(Date associationTime) {
+        this.associationTime = associationTime;
+    }
+
+    public String getQaContent() {
+        return qaContent;
+    }
+
+    public void setQaContent(String qaContent) {
+        this.qaContent = qaContent;
+    }
+
+    public Date getQaTime() {
+        return qaTime;
+    }
+
+    public void setQaTime(Date qaTime) {
+        this.qaTime = qaTime;
+    }
 }

+ 13 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/request/ErrorReportDto.java

@@ -0,0 +1,13 @@
+package com.qxgmat.dto.request;
+
+public class ErrorReportDto {
+    private Integer userReportId;
+
+    public Integer getUserReportId() {
+        return userReportId;
+    }
+
+    public void setUserReportId(Integer userReportId) {
+        this.userReportId = userReportId;
+    }
+}

+ 23 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/request/TextbookStartDto.java

@@ -0,0 +1,23 @@
+package com.qxgmat.dto.request;
+
+public class TextbookStartDto {
+    private Boolean disorder;
+
+    private Integer paperId;
+
+    public Boolean getDisorder() {
+        return disorder;
+    }
+
+    public void setDisorder(Boolean disorder) {
+        this.disorder = disorder;
+    }
+
+    public Integer getPaperId() {
+        return paperId;
+    }
+
+    public void setPaperId(Integer paperId) {
+        this.paperId = paperId;
+    }
+}

+ 10 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/request/UserAskDto.java

@@ -8,6 +8,8 @@ import com.qxgmat.data.dao.entity.UserNoteQuestion;
 public class UserAskDto {
     private String target;
 
+    private String questionModule;
+
     private Integer questionNoId;
 
     private String content;
@@ -35,4 +37,12 @@ public class UserAskDto {
     public void setTarget(String target) {
         this.target = target;
     }
+
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
 }

+ 10 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/request/UserCollectDto.java

@@ -6,6 +6,8 @@ import com.qxgmat.data.dao.entity.UserCollectQuestion;
 @Dto(entity = UserCollectQuestion.class)
 public class UserCollectDto {
 
+    private String questionModule;
+
     private Integer questionNoId;
 
     public Integer getQuestionNoId() {
@@ -15,4 +17,12 @@ public class UserCollectDto {
     public void setQuestionNoId(Integer questionNoId) {
         this.questionNoId = questionNoId;
     }
+
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
 }

+ 11 - 1
server/gateway-api/src/main/java/com/qxgmat/dto/request/UserErrorBindDto.java

@@ -1,6 +1,8 @@
 package com.qxgmat.dto.request;
 
-public class UserErrorBindDto {
+public class UserCustomBindDto {
+    private String questionModule;
+
     private Integer[] questionNoIds;
 
     // 过滤已组卷n次的题目
@@ -21,4 +23,12 @@ public class UserErrorBindDto {
     public void setFilterTimes(Integer filterTimes) {
         this.filterTimes = filterTimes;
     }
+
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
 }

+ 10 - 11
server/gateway-api/src/main/java/com/qxgmat/dto/request/UserFeedbackErrorDto.java

@@ -5,25 +5,16 @@ import com.qxgmat.data.dao.entity.UserFeedbackError;
 
 @Dto(entity = UserFeedbackError.class)
 public class UserFeedbackErrorDto {
-
-    private String module;
-
     private Integer moduleId;
 
+    private String title;
+
     private String position;
 
     private String originContent;
 
     private String content;
 
-    public String getModule() {
-        return module;
-    }
-
-    public void setModule(String module) {
-        this.module = module;
-    }
-
     public Integer getModuleId() {
         return moduleId;
     }
@@ -55,4 +46,12 @@ public class UserFeedbackErrorDto {
     public void setContent(String content) {
         this.content = content;
     }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
 }

+ 50 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/request/UserNoteDto.java

@@ -6,10 +6,20 @@ import com.qxgmat.data.dao.entity.UserNoteQuestion;
 @Dto(entity = UserNoteQuestion.class)
 public class UserNoteDto {
 
+    private String questionModule;
+
     private Integer questionNoId;
 
     private String content;
 
+    private String qxContent;
+
+    private String officialContent;
+
+    private String associationContent;
+
+    private String qaContent;
+
     public Integer getQuestionNoId() {
         return questionNoId;
     }
@@ -25,4 +35,44 @@ public class UserNoteDto {
     public void setContent(String content) {
         this.content = content;
     }
+
+    public String getQxContent() {
+        return qxContent;
+    }
+
+    public void setQxContent(String qxContent) {
+        this.qxContent = qxContent;
+    }
+
+    public String getOfficialContent() {
+        return officialContent;
+    }
+
+    public void setOfficialContent(String officialContent) {
+        this.officialContent = officialContent;
+    }
+
+    public String getAssociationContent() {
+        return associationContent;
+    }
+
+    public void setAssociationContent(String associationContent) {
+        this.associationContent = associationContent;
+    }
+
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
+
+    public String getQaContent() {
+        return qaContent;
+    }
+
+    public void setQaContent(String qaContent) {
+        this.qaContent = qaContent;
+    }
 }

+ 9 - 9
server/gateway-api/src/main/java/com/qxgmat/dto/response/UserClassDetailDto.java

@@ -9,7 +9,7 @@ import java.util.List;
 
 @Dto(entity = UserClass.class)
 public class UserClassDetailDto {
-    private Integer category;
+    private Integer courseId;
     private Date startTime;
     private Date expireTime;
     private Boolean payed;
@@ -40,14 +40,6 @@ public class UserClassDetailDto {
         this.payed = payed;
     }
 
-    public Integer getCategory() {
-        return category;
-    }
-
-    public void setCategory(Integer category) {
-        this.category = category;
-    }
-
     public List<UserPreviewPaperExtendDto> getPapers() {
         return papers;
     }
@@ -55,4 +47,12 @@ public class UserClassDetailDto {
     public void setPapers(List<UserPreviewPaperExtendDto> papers) {
         this.papers = papers;
     }
+
+    public Integer getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Integer courseId) {
+        this.courseId = courseId;
+    }
 }

+ 143 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/response/UserNoteDetailDto.java

@@ -2,11 +2,42 @@ package com.qxgmat.dto.response;
 
 import com.nuliji.tools.annotation.Dto;
 import com.qxgmat.data.dao.entity.UserNoteQuestion;
+import com.qxgmat.dto.extend.QuestionNoExtendDto;
+
+import java.util.Date;
 
 @Dto(entity = UserNoteQuestion.class)
 public class UserNoteDetailDto {
     private Integer id;
 
+    private String questionModule;
+
+    private Integer questionId;
+
+    private Integer questionNoId;
+
+    private QuestionNoExtendDto questionNo;
+
+    private String content;
+
+    private String officialContent;
+
+    private String qxContent;
+
+    private String associationContent;
+
+    private String qaContent;
+
+    private Date contentTime;
+
+    private Date officialTime;
+
+    private Date qxTime;
+
+    private Date associationTime;
+
+    private Date qaTime;
+
     public Integer getId() {
         return id;
     }
@@ -14,4 +45,116 @@ public class UserNoteDetailDto {
     public void setId(Integer id) {
         this.id = id;
     }
+
+    public String getQuestionModule() {
+        return questionModule;
+    }
+
+    public void setQuestionModule(String questionModule) {
+        this.questionModule = questionModule;
+    }
+
+    public Integer getQuestionId() {
+        return questionId;
+    }
+
+    public void setQuestionId(Integer questionId) {
+        this.questionId = questionId;
+    }
+
+    public Integer getQuestionNoId() {
+        return questionNoId;
+    }
+
+    public void setQuestionNoId(Integer questionNoId) {
+        this.questionNoId = questionNoId;
+    }
+
+    public QuestionNoExtendDto getQuestionNo() {
+        return questionNo;
+    }
+
+    public void setQuestionNo(QuestionNoExtendDto questionNo) {
+        this.questionNo = questionNo;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getOfficialContent() {
+        return officialContent;
+    }
+
+    public void setOfficialContent(String officialContent) {
+        this.officialContent = officialContent;
+    }
+
+    public String getQxContent() {
+        return qxContent;
+    }
+
+    public void setQxContent(String qxContent) {
+        this.qxContent = qxContent;
+    }
+
+    public String getAssociationContent() {
+        return associationContent;
+    }
+
+    public void setAssociationContent(String associationContent) {
+        this.associationContent = associationContent;
+    }
+
+    public Date getContentTime() {
+        return contentTime;
+    }
+
+    public void setContentTime(Date contentTime) {
+        this.contentTime = contentTime;
+    }
+
+    public Date getOfficialTime() {
+        return officialTime;
+    }
+
+    public void setOfficialTime(Date officialTime) {
+        this.officialTime = officialTime;
+    }
+
+    public Date getQxTime() {
+        return qxTime;
+    }
+
+    public void setQxTime(Date qxTime) {
+        this.qxTime = qxTime;
+    }
+
+    public Date getAssociationTime() {
+        return associationTime;
+    }
+
+    public void setAssociationTime(Date associationTime) {
+        this.associationTime = associationTime;
+    }
+
+    public String getQaContent() {
+        return qaContent;
+    }
+
+    public void setQaContent(String qaContent) {
+        this.qaContent = qaContent;
+    }
+
+    public Date getQaTime() {
+        return qaTime;
+    }
+
+    public void setQaTime(Date qaTime) {
+        this.qaTime = qaTime;
+    }
 }

+ 0 - 0
server/gateway-api/src/main/java/com/qxgmat/dto/response/UserQuestionDataDto.java


Some files were not shown because too many files changed in this diff