Browse Source

试卷模板完善

ywx
王宁 2 weeks ago
parent
commit
c0a9c746b6

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java View File

@@ -37,6 +37,8 @@ public interface MsSubjectMapper extends TkMapper<MsSubject> {
37 37
     int updatePtstateByMpid(@Param("mpid")Integer mpid,@Param("ptstate")Integer ptstate);
38 38
     //更改科目试卷题块设置状
39 39
     int updatePbstateByMpid(@Param("mpid")Integer mpid,@Param("pbstate")Integer pbstate);
40
+    //重置试卷模板和题块状态
41
+    int updateTempAndBlockStateByMpid(@Param("mpid")Integer mpid);
40 42
 
41 43
     //获取考试下所有科目名称
42 44
     List<Map<String,String>> listSubjectNameByExamId(@Param("examid") Integer examid);

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsTemplateMapper.java View File

@@ -26,6 +26,8 @@ public interface MsTemplateMapper extends TkMapper<MsTemplate> {
26 26
 
27 27
     //修改模板题块框选状态
28 28
     int updateTemplateTbstate(@Param("mtid")Integer mtid, @Param("tbstate")Integer tbstate);
29
+    //恢复模板状态
30
+    int updateTemplateAllState(@Param("mtid")Integer mtid);
29 31
 
30 32
     //获取试卷未框选主观题模板数量
31 33
     int getUnSelTemplateCount(@Param("mpid")Integer mpid);

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsTemplate.java View File

@@ -49,6 +49,8 @@ public class MsTemplate extends BaseBean {
49 49
     private String misscoor;
50 50
     //违规标记坐标
51 51
     private String violatecoor;
52
+    //考号类型1涂卡 2条形码 3手写1 4手写2
53
+    private Integer enumtype;
52 54
     //考号定位坐标
53 55
     private String examnocoor;
54 56
     //涂卡数字坐标列表

+ 10
- 4
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsTemplateService.java View File

@@ -123,8 +123,14 @@ public class MsTemplateService {
123 123
 
124 124
         //根据模板ID获取模板信息
125 125
         MsTemplate oldTemplate = msTemplateMapper.selectByPrimaryKey(msTemplate.getMtid());
126
-        if(!msTemplate.getCurrstep().equals(oldTemplate.getCurrstep())) throw new ServiceException("请按顺序操作");
127 126
 
127
+        if(msTemplate.getCurrstep() < 6 && oldTemplate.getTstate() == 1){
128
+            msTemplateMapper.updateTemplateAllState(msTemplate.getMtid());
129
+            //当模板当前步骤不是6选择答题区7选择违纪区时,需要清空所有题块和模板框选
130
+            msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),null);
131
+            msPaperBlockMapper.deleteObjByMpidAndBlocktype(oldTemplate.getMpid(),null);
132
+            msSubjectMapper.updateTempAndBlockStateByMpid(oldTemplate.getMpid());
133
+        }
128 134
         //定位区选择
129 135
         if(msTemplate.getCurrstep() == 3){
130 136
             SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
@@ -168,9 +174,9 @@ public class MsTemplateService {
168 174
         Integer timestamp = N_Utils.getSecondTimestamp();
169 175
         Integer createid = msTemplate.getCreateid();
170 176
 
171
-        //保存之前先清除已保存的信息试卷客观题题块、模板题块
172
-        msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),1);
173
-        msPaperBlockMapper.deleteObjByMpidAndBlocktype(mpid,1);
177
+        // //保存之前先清除已保存的信息试卷客观题题块、模板题块
178
+        // msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),1);
179
+        // msPaperBlockMapper.deleteObjByMpidAndBlocktype(mpid,1);
174 180
         //获取试卷中所有试题信息
175 181
         List<MsPaperQtypeQuestion> questions = msPaperQtypeQuestionMapper.listQuestionsByMpid(mpid);
176 182
         List<MsPaperQtypeQuestion> objQuestions = questions.stream().filter(q -> q.getQtype() == 1).collect(Collectors.toList());//客观题试题信息

+ 3
- 4
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java View File

@@ -29,7 +29,6 @@ import com.xhkjedu.smarking.vo.stupaper.PaperStudentWebVo;
29 29
 import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
30 30
 import com.xhkjedu.utils.N_Utils;
31 31
 import com.xhkjedu.vo.ResultVo;
32
-import org.opencv.core.Core;
33 32
 import org.springframework.stereotype.Service;
34 33
 import org.springframework.transaction.annotation.Transactional;
35 34
 
@@ -72,9 +71,9 @@ public class MsScanbatchPaperService {
72 71
     @Resource
73 72
     private MsExamMapper msExamMapper;
74 73
 
75
-    static {
76
-        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
77
-    }
74
+    // static {
75
+    //     System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
76
+    // }
78 77
 
79 78
     /*
80 79
      * @Description 扫描记录-查看原卷

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentScoreService.java View File

@@ -174,7 +174,7 @@ public class MsPaperStudentScoreService {
174 174
         }
175 175
         //获取考试的所有科目
176 176
         List<ESubjectVo> subjects = msPaperStudentScoreMapper.listSubjectsByExamid(mpstuScore.getExamid());
177
-        Map<String,ESubjectVo> subjectMap = subjects.stream().collect(HashMap::new, (m,v)->m.put(v.getSubjectid(),v), HashMap::putAll);
177
+        Map<String,ESubjectVo> subjectMap = subjects.stream().collect(HashMap::new, (m,v)->m.put(v.getSubjectname(),v), HashMap::putAll);
178 178
         //考试班级
179 179
         List<MsClass> classes = msPaperStudentScoreMapper.listClassesByExamid(mpstuScore.getExamid());
180 180
         List<String> classNames = classes.stream().map(MsClass::getClassname).collect(ArrayList::new, ArrayList::add, ArrayList::addAll);

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/utils/ImportUtil.java View File

@@ -152,7 +152,7 @@ public class ImportUtil {
152 152
             }
153 153
 
154 154
         } catch (Exception e) {
155
-            log.error("读取Excel文件失败", e.getMessage());
155
+            log.error("读取Excel文件失败 :" + e.getMessage());
156 156
             throw new Exception("读取Excel文件失败");
157 157
         }
158 158
         return rtnList;

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/scan/TemplateBlockQuestionVo.java View File

@@ -13,6 +13,10 @@ public class TemplateBlockQuestionVo {
13 13
     private Integer mtbqid;
14 14
     //题号
15 15
     private String qn;
16
+
17
+    //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11复合题
18
+    // 12听力题13填空题14作文(语文)15作文(英语)16完形填空、阅读理解 17任务型阅读(符合)
19
+    private Integer ctype;
16 20
     //试卷试题ID
17 21
     private Integer mptqid;
18 22
     //定位坐标

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/scan/TemplateVo.java View File

@@ -43,6 +43,8 @@ public class TemplateVo {
43 43
     private String misscoor;
44 44
     //违规标记坐标
45 45
     private String violatecoor;
46
+    //考号类型1涂卡 2条形码 3手写1 4手写2
47
+    private Integer enumtype;
46 48
     //考号定位坐标
47 49
     private String examnocoor;
48 50
     //涂卡数字坐标列表

+ 5
- 0
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -85,6 +85,11 @@
85 85
     <update id="updatePbstateByMpid">
86 86
         update ms_subject s,ms_paper p set s.pbstate=#{pbstate} where s.msid=p.msid and p.mpid=#{mpid}
87 87
     </update>
88
+    <!--重置试卷模板和题块状态-->
89
+    <update id="updateTempAndBlockStateByMpid">
90
+        update ms_subject s,ms_paper p set s.ptstate=0 s.pbstate=0 where s.msid=p.msid and p.mpid=#{mpid}
91
+    </update>
92
+
88 93
     <!--更改考试科目监考设置状态-->
89 94
     <update id="updateInvigilateStateByMsId">
90 95
         update ms_subject set invigilatestate=#{invigilatestate} where msid=#{msid}

+ 10
- 3
smarking/src/main/resources/mapper/paper/MsTemplateMapper.xml View File

@@ -44,6 +44,10 @@
44 44
     <update id="updateTemplateTbstate">
45 45
         update ms_template set tbstate=#{tbstate} where mtid=#{mtid}
46 46
     </update>
47
+    <!--恢复模板状态-->
48
+    <update id="updateTemplateAllState">
49
+        update ms_template set tstate=0, tbstate=0 where mtid=#{mtid}
50
+    </update>
47 51
 
48 52
     <!--获取试卷未框选主观题模板数量-->
49 53
     <select id="getUnSelTemplateCount" resultType="java.lang.Integer">
@@ -68,6 +72,7 @@
68 72
         <result property="dwtback" column="dwtback"/>
69 73
         <result property="misscoor" column="misscoor"/>
70 74
         <result property="violatecoor" column="violatecoor"/>
75
+        <result property="enumtype" column="enumtype"/>
71 76
         <result property="examnocoor" column="examnocoor"/>
72 77
         <result property="cardcoor" column="cardcoor"/>
73 78
         <collection property="tblocks" ofType="com.xhkjedu.smarking.vo.scan.TemplateBlockVo" javaType="java.util.ArrayList">
@@ -82,6 +87,7 @@
82 87
                 <result property="mtbqid" column="mtbqid"/>
83 88
                 <result property="qn" column="qn"/>
84 89
                 <result property="mptqid" column="mptqid"/>
90
+                <result property="ctype" column="ctype"></result>
85 91
                 <result property="qlocalcoor" column="qlocalcoor"/>
86 92
                 <result property="mtbqorder" column="mtbqorder"/>
87 93
             </collection>
@@ -89,12 +95,13 @@
89 95
     </resultMap>
90 96
     <select id="listTemplateBlockQueByMpid" resultMap="paperTemplate">
91 97
         select t.mtid,t.mpid,t.tsize,t.twidth,t.theight,t.tfront,t.tback,t.blankindex,t.anglefront,t.angleback,t.coorfront,t.coorback,
92
-        t.dwtfront,t.dwtback,t.misscoor,t.violatecoor,t.examnocoor,t.cardcoor
98
+        t.dwtfront,t.dwtback,t.misscoor,t.violatecoor,t.enumtype,t.examnocoor,t.cardcoor
93 99
         ,tb.mtbid,tb.mblockid,tb.mttype,tb.mtborder,tb.localcoor,tb.extendcoor,tb.scorecoor
94
-        ,q.mtbqid,q.qn,q.mptqid,q.qlocalcoor,q.mtbqorder
100
+        ,q.mtbqid,q.qn,q.mptqid,q.qlocalcoor,q.mtbqorder,tq.ctype
95 101
         from ms_template t left join ms_template_block tb on t.mtid=tb.mtid
96 102
         left join ms_template_block_question q on tb.mtbid=q.mtbid
97
-        where t.mpid=#{mpid} order by t.mtid,tb.mtborder,q.mtbqorder
103
+        left join ms_paper_qtype_question tq on q.mptqid=tq.mptqid
104
+        where t.mpid=#{mpid} order by t.mtid,tb.mttype,tb.mtborder,q.mtbqorder
98 105
     </select>
99 106
 
100 107
     <!--获取模版详情和考试id-->

+ 2
- 2
smarking/src/main/resources/mapper/stupaper/MsPaperStudentMapper.xml View File

@@ -270,12 +270,12 @@
270 270
 
271 271
     <!--补录成绩-补录单科-->
272 272
     <update id="updateStuScoreForFillScore">
273
-        update ms_paper_student set stuscore=#{psc.fillscore},stuscoretype=2 where mpsid=#{psc.mpsid} and stuscoretype=0
273
+        update ms_paper_student set stuscore=#{psc.fillscore},stuscoretype=2 where mpsid=#{psc.mpsid} and stuscoretype!=1
274 274
     </update>
275 275
     <!--补录成绩-补录多科-->
276 276
     <update id="updateBatchStuScoreForFillScore">
277 277
         <foreach collection="list" item="p" separator=";">
278
-            update ms_paper_student set stuscore=#{p.fillscore},stuscoretype=2 where mpsid=#{p.mpsid} and stuscoretype=0
278
+            update ms_paper_student set stuscore=#{p.fillscore},stuscoretype=2 where mpsid=#{p.mpsid} and stuscoretype!=1
279 279
         </foreach>
280 280
     </update>
281 281
     <!--补录成绩-清空学生补录分数-->

Loading…
Cancel
Save