Browse Source

试题分享集团校复制复合题子题

资源详情兼容压缩包分享集团校
tags/正式3.11.0
雍文秀 1 year ago
parent
commit
1fcf6a0c2a

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/question/QuestionMapper.java View File

55
     QuestionVo findById(@Param("questionid") String questionid);
55
     QuestionVo findById(@Param("questionid") String questionid);
56
     //复合题子题
56
     //复合题子题
57
     List<Map> listSonQuestionsForDetail(@Param("questionid") String questionid);
57
     List<Map> listSonQuestionsForDetail(@Param("questionid") String questionid);
58
+    //复合题子题分享集团校用
59
+    List<TQuestion> listSonQuestionsForShare(@Param("questionid") String questionid);
58
 
60
 
59
     /**
61
     /**
60
      * 章节、知识点选题
62
      * 章节、知识点选题

+ 17
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionService.java View File

493
         Integer createid = question.getCreateid();
493
         Integer createid = question.getCreateid();
494
         int timestamp = N_Utils.getSecondTimestamp();
494
         int timestamp = N_Utils.getSecondTimestamp();
495
         TQuestion q = questionMapper.getQuestionAndDirectorPointById(shareqid);
495
         TQuestion q = questionMapper.getQuestionAndDirectorPointById(shareqid);
496
+        List<TQuestion> list = new ArrayList<>();
497
+        if (q.getQlevel().equals(2)) {
498
+            list = questionMapper.listSonQuestionsForShare(shareqid);
499
+        }
496
         List<TQuestionPoint> questionPoints = q.getQuestionPoints();
500
         List<TQuestionPoint> questionPoints = q.getQuestionPoints();
497
         List<TQuestionDirector> questionDirectors = q.getDirectors();
501
         List<TQuestionDirector> questionDirectors = q.getDirectors();
498
         List<Integer> schoolids = q.getSchools().stream().map(s -> (Integer) s.get("schoolid")).collect(Collectors.toList());
502
         List<Integer> schoolids = q.getSchools().stream().map(s -> (Integer) s.get("schoolid")).collect(Collectors.toList());
518
             tq.setSchoolid(schoolid);
522
             tq.setSchoolid(schoolid);
519
             tq.setShareqid(shareqid);
523
             tq.setShareqid(shareqid);
520
             questions.add(tq);
524
             questions.add(tq);
525
+            for (TQuestion s : list) {
526
+                TQuestion sq = new TQuestion();
527
+                BeanUtils.copyProperties(s, sq);
528
+                sq.setQuestionid(StudyUtil.getId());
529
+                sq.setQuestionpid(questionid);
530
+                sq.setCount(0);
531
+                sq.setCreateid(createid);
532
+                sq.setCreatetime(timestamp);
533
+                sq.setBelong(10);
534
+                sq.setSchoolid(schoolid);
535
+                sq.setShareqid(shareqid);
536
+                questions.add(sq);
537
+            }
521
 
538
 
522
             //试题关联知识点
539
             //试题关联知识点
523
             for (TQuestionPoint p : questionPoints) {
540
             for (TQuestionPoint p : questionPoints) {

+ 1
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/utils/ConvertUtil.java View File

102
             //获取压缩包文件
102
             //获取压缩包文件
103
             pdfurl = messageSender.convertResource(resource);
103
             pdfurl = messageSender.convertResource(resource);
104
         } else {
104
         } else {
105
+            if (resource.getBelong().equals(10)) resourceid = resource.getResourcepid();
105
             List<Map> files = resourceFileMapper.listFile(resourceid);
106
             List<Map> files = resourceFileMapper.listFile(resourceid);
106
             pdfurl = JSON.toJSONString(files);
107
             pdfurl = JSON.toJSONString(files);
107
         }
108
         }

+ 1
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/vo/resource/ResourceVo.java View File

108
     private List<DirectorVo> directors;
108
     private List<DirectorVo> directors;
109
 
109
 
110
     private Integer sharenum;//分享集团校数量
110
     private Integer sharenum;//分享集团校数量
111
+    private String resourcepid;//所属资源id
111
 }
112
 }

+ 4
- 0
sstudy/src/main/resources/mapper/question/QuestionMapper.xml View File

118
              ,q.qtypeid,q.qtypename,q.ctype,q.qlevel,q.sorder
118
              ,q.qtypeid,q.qtypename,q.ctype,q.qlevel,q.sorder
119
         from t_question q where q.qlevel=3 and q.questionpid=#{questionid} order by q.sorder
119
         from t_question q where q.qlevel=3 and q.questionpid=#{questionid} order by q.sorder
120
     </select>
120
     </select>
121
+    <!--复合题子题分享集团校用-->
122
+    <select id="listSonQuestionsForShare" resultType="com.xhkjedu.sstudy.model.question.TQuestion">
123
+        select q.* from t_question q where q.qlevel=3 and q.questionpid=#{questionid} order by q.sorder
124
+    </select>
121
     <!--管理端试题列表-->
125
     <!--管理端试题列表-->
122
     <select id="findAll" resultType="java.util.Map">
126
     <select id="findAll" resultType="java.util.Map">
123
         select q.questionid,q.score,q.complexity,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.belong,q.createid,q.schoolid
127
         select q.questionid,q.score,q.complexity,q.ctype,q.qstem,q.qoption,q.qanswer,q.qanalyze,q.belong,q.createid,q.schoolid

+ 2
- 0
sstudy/src/main/resources/mapper/resource/ResourceMapper.xml View File

141
         <result property="directornum" column="directornum"/>
141
         <result property="directornum" column="directornum"/>
142
         <result property="areaall" column="areaall"/>
142
         <result property="areaall" column="areaall"/>
143
         <result property="sharenum" column="sharenum"/>
143
         <result property="sharenum" column="sharenum"/>
144
+        <result property="resourcepid" column="resourcepid"/>
144
         <collection property="directors" ofType="com.xhkjedu.sstudy.vo.subjectbook.DirectorVo" javaType="java.util.List">
145
         <collection property="directors" ofType="com.xhkjedu.sstudy.vo.subjectbook.DirectorVo" javaType="java.util.List">
145
             <result property="lsbid" column="lsbid"/>
146
             <result property="lsbid" column="lsbid"/>
146
             <result property="directorid" column="directorid"/>
147
             <result property="directorid" column="directorid"/>
167
     </select>
168
     </select>
168
     <select id="findById2" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
169
     <select id="findById2" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
169
         select r.resourceid,r.resourceclass,r.resourceurl,r.pdfurl,r.converted,r.suffix,r.mp4code
170
         select r.resourceid,r.resourceclass,r.resourceurl,r.pdfurl,r.converted,r.suffix,r.mp4code
171
+        ,r.belong,r.resourcepid
170
         from t_resource r where r.resourceid=#{resourceid}
172
         from t_resource r where r.resourceid=#{resourceid}
171
     </select>
173
     </select>
172
     <!--更新下载次数-->
174
     <!--更新下载次数-->

Loading…
Cancel
Save