Browse Source

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

ywx
王宁 1 week ago
parent
commit
e2f4e57850

+ 1
- 2
smarking/src/main/java/com/xhkjedu/smarking/controller/stupaper/MsPaperStudentController.java View File

@@ -183,8 +183,7 @@ public class MsPaperStudentController {
183 183
     @PostMapping("/stu_paper")
184 184
     public ResultVo listStuPaperQtypeQueAnswerForWeb(@RequestBody MsPaperStudent paperStudent) {
185 185
         N_Utils.validation(new Object[]{paperStudent.getMpsid(), "学生试卷id", 1});
186
-        List<Map<String,Object>> rtnlst = msPaperStudentService.listStuPaperQtypeQueAnswerForWeb(paperStudent.getMpsid());
187
-        return new ResultVo(0, "查询成功", rtnlst);
186
+        return new ResultVo(0, "查询成功", msPaperStudentService.listStuPaperQtypeQueAnswerForWeb(paperStudent.getMpsid()));
188 187
     }
189 188
 
190 189
 }

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

@@ -288,7 +288,7 @@ public class MsPaperQtypeService {
288 288
         // 更新试卷设置答案状态
289 289
         msPaperMapper.updatePaperAnswer(1, mpid);
290 290
         // 保存试卷答案
291
-        msPaperQtypeQuestionMapper.updateBatchQuestionAnswer(changelist);
291
+        if (N_Utils.isListNotEmpty(changelist)) msPaperQtypeQuestionMapper.updateBatchQuestionAnswer(changelist);
292 292
 
293 293
         // 判断考试状态是开始,已提交学生重新批阅,需要重新批阅
294 294
         PExamSubjectVo examSubjectVo = msPaperMapper.getSubjectStateByMpid(mpid);

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckService.java View File

@@ -42,7 +42,7 @@ public class MsPaperCheckService {
42 42
      **/
43 43
     public void add(MsPaperCheck msPaperCheck) {
44 44
         Integer checkstate = msSubjectMapper.getCheckStateByMsId(msPaperCheck.getMsid());//根据考试科目id获取阅卷状态
45
-        if (checkstate.equals(0)) throw new ServiceException("开始阅卷后不支持修改");
45
+        if (!checkstate.equals(0)) throw new ServiceException("开始阅卷后不支持修改");
46 46
         saveOrUpdate(msPaperCheck);
47 47
     }
48 48
 

+ 1
- 11
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java View File

@@ -377,17 +377,7 @@ public class MsPaperCheckTeacherArbitrateService {
377 377
     public List<Map> getScore(MsCheckParam param) {
378 378
         List<Map> score = msPaperCheckTeacherArbitrateMapper.getScore(param);
379 379
         for (Map map : score) {
380
-            double diffscore1 = 0;
381
-            double diffscore2 = 0;
382
-            if (map.get("scoreway").equals(2)) {
383
-                Object qscore = map.get("qscore");
384
-                Object diffscore = map.get("diffscore");
385
-                double scoreDiff1 = MarkingUtil.scoreDiff(map.get("firstccore"), qscore);
386
-                double scoreDiff2 = MarkingUtil.scoreDiff(map.get("secondcscore"), qscore);
387
-                diffscore1 = MarkingUtil.sub(diffscore, scoreDiff1);
388
-                diffscore2 = MarkingUtil.sub(diffscore, scoreDiff2);
389
-            }
390
-            map.put("diffscore1", diffscore1);
380
+            double diffscore2 = MarkingUtil.scoreDiff(map.get("firstccore"), map.get("secondcscore"));
391 381
             map.put("diffscore2", diffscore2);
392 382
         }
393 383
         return score;

+ 3
- 3
smarking/src/main/java/com/xhkjedu/smarking/service/report/report/MsrClassService.java View File

@@ -404,10 +404,10 @@ public class MsrClassService {
404 404
     //格式化科目数据列表
405 405
     private List<Map<String, Object>> formatSubjectList(StudentParams params, List<Map<String, Object>> list
406 406
             , List<String> infoFields, String[] gradeFields, String groupname) {
407
-        Map<Integer, List<Map>> collect = list.stream().collect(Collectors.groupingBy(
408
-                m -> N_Utils.obj2Int(m.get("subjectid")), LinkedHashMap::new, Collectors.toList()));
407
+        Map<String, List<Map>> collect = list.stream().collect(Collectors.groupingBy(
408
+                m -> m.get("subjectid").toString(), LinkedHashMap::new, Collectors.toList()));
409 409
         List<Map<String, Object>> result = new ArrayList<>();
410
-        for (Map.Entry<Integer, List<Map>> entry : collect.entrySet()) {
410
+        for (Map.Entry<String, List<Map>> entry : collect.entrySet()) {
411 411
             List<Map> values = entry.getValue();
412 412
             Map<String, Object> map = new LinkedHashMap<>();
413 413
             Map info = values.get(0);

+ 5
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentService.java View File

@@ -314,7 +314,7 @@ public class MsPaperStudentService {
314 314
      * @Param [mpsid]
315 315
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
316 316
      **/
317
-    public List<Map<String,Object>> listStuPaperQtypeQueAnswerForWeb(Integer mpsid){
317
+    public Map<String,Object> listStuPaperQtypeQueAnswerForWeb(Integer mpsid){
318 318
         Integer papertype = msPaperMapper.getPaperTypeByMpsid(mpsid);
319 319
         List<Map<String,Object>> rtnList;
320 320
         if(papertype == 1) {
@@ -323,6 +323,9 @@ public class MsPaperStudentService {
323 323
         }else{
324 324
             rtnList = msPaperStudentQuestionMapper.listStuPaperQtypeQueAnswerForWebFj(mpsid);
325 325
         }
326
-        return rtnList;
326
+        Map<String, Object> map = new HashMap<>();
327
+        map.put("papertype", papertype);
328
+        map.put("qtypes", rtnList);
329
+        return map;
327 330
     }
328 331
 }

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

@@ -966,6 +966,7 @@ public class MarkingUtil {
966 966
     // 根据指定科目字段排序
967 967
     public static List<Map<String, Object>> sortBySubjectField(List<Map<String, Object>> students
968 968
             , String fieldValue, String fieldName,String groupname, Integer od,String listName) {
969
+        if (od == null) od = 2;
969 970
         if (N_Utils.isEmpty(fieldValue)) {
970 971
             if (od.equals(2)) {//降序
971 972
                 return students.stream().sorted(Comparator.comparing(student -> student.get(fieldName).toString(), Comparator.nullsLast(Comparator.reverseOrder()))).collect(Collectors.toList());

+ 2
- 1
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -69,7 +69,8 @@
69 69
     </select>
70 70
     <!--获取考试下所有科目名称-->
71 71
     <select id="listSubjectNameByExamId" resultType="java.util.Map">
72
-        select distinct s.subjectid,s.subjectname,p.mpid from ms_subject s
72
+        select distinct s.subjectid,s.subjectname,p.mpid,s.msid
73
+        from ms_subject s
73 74
         left join ms_paper p on s.msid=p.msid where s.examid=#{examid} order by s.msid
74 75
     </select>
75 76
     <!--根据考试科目id获取阅卷状态-->

Loading…
Cancel
Save