Browse Source

Merge remote-tracking branch 'origin/ywx' into wn

tags/正式3.11.0
王宁 1 year ago
parent
commit
b66bfcf3b0

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

@@ -55,6 +55,8 @@ public interface QuestionMapper extends TkMapper<TQuestion> {
55 55
     QuestionVo findById(@Param("questionid") String questionid);
56 56
     //复合题子题
57 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,6 +493,10 @@ public class QuestionService {
493 493
         Integer createid = question.getCreateid();
494 494
         int timestamp = N_Utils.getSecondTimestamp();
495 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 500
         List<TQuestionPoint> questionPoints = q.getQuestionPoints();
497 501
         List<TQuestionDirector> questionDirectors = q.getDirectors();
498 502
         List<Integer> schoolids = q.getSchools().stream().map(s -> (Integer) s.get("schoolid")).collect(Collectors.toList());
@@ -518,6 +522,19 @@ public class QuestionService {
518 522
             tq.setSchoolid(schoolid);
519 523
             tq.setShareqid(shareqid);
520 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 540
             for (TQuestionPoint p : questionPoints) {

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

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

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

@@ -108,4 +108,5 @@ public class ResourceVo {
108 108
     private List<DirectorVo> directors;
109 109
 
110 110
     private Integer sharenum;//分享集团校数量
111
+    private String resourcepid;//所属资源id
111 112
 }

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

@@ -118,6 +118,10 @@
118 118
              ,q.qtypeid,q.qtypename,q.ctype,q.qlevel,q.sorder
119 119
         from t_question q where q.qlevel=3 and q.questionpid=#{questionid} order by q.sorder
120 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 126
     <select id="findAll" resultType="java.util.Map">
123 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,6 +141,7 @@
141 141
         <result property="directornum" column="directornum"/>
142 142
         <result property="areaall" column="areaall"/>
143 143
         <result property="sharenum" column="sharenum"/>
144
+        <result property="resourcepid" column="resourcepid"/>
144 145
         <collection property="directors" ofType="com.xhkjedu.sstudy.vo.subjectbook.DirectorVo" javaType="java.util.List">
145 146
             <result property="lsbid" column="lsbid"/>
146 147
             <result property="directorid" column="directorid"/>
@@ -167,6 +168,7 @@
167 168
     </select>
168 169
     <select id="findById2" resultType="com.xhkjedu.sstudy.vo.resource.ResourceVo">
169 170
         select r.resourceid,r.resourceclass,r.resourceurl,r.pdfurl,r.converted,r.suffix,r.mp4code
171
+        ,r.belong,r.resourcepid
170 172
         from t_resource r where r.resourceid=#{resourceid}
171 173
     </select>
172 174
     <!--更新下载次数-->

Loading…
Cancel
Save