|
@@ -5,12 +5,15 @@ import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
|
5
|
5
|
import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
|
6
|
6
|
import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
|
7
|
7
|
import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
|
|
8
|
+import com.xhkjedu.sexam.mapper.paperstudent.EScanbatchMapper;
|
|
9
|
+import com.xhkjedu.sexam.mapper.paperstudent.EScanerrorMapper;
|
8
|
10
|
import com.xhkjedu.sexam.mapper.system.UserMapper;
|
9
|
11
|
import com.xhkjedu.sexam.model.paper.EPaperFile;
|
10
|
12
|
import com.xhkjedu.sexam.model.paper.EPaperQtype;
|
11
|
13
|
import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
|
12
|
14
|
import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
|
13
|
15
|
import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
|
|
16
|
+import com.xhkjedu.sexam.model.paperstudent.EScanerror;
|
14
|
17
|
import com.xhkjedu.sexam.utils.ConvertUtil;
|
15
|
18
|
import com.xhkjedu.sexam.utils.ExamUtil;
|
16
|
19
|
import com.xhkjedu.sexam.vo.paperstudent.EPaperStudentVo;
|
|
@@ -45,6 +48,10 @@ public class EPaperStudentService {
|
45
|
48
|
private UserMapper userMapper;
|
46
|
49
|
@Resource
|
47
|
50
|
private EPaperFileMapper ePaperFileMapper;
|
|
51
|
+ @Resource
|
|
52
|
+ private EScanbatchMapper eScanbatchMapper;
|
|
53
|
+ @Resource
|
|
54
|
+ private EScanerrorMapper eScanerrorMapper;
|
48
|
55
|
@Autowired
|
49
|
56
|
private ConvertUtil convertUtil;
|
50
|
57
|
|
|
@@ -411,11 +418,13 @@ public class EPaperStudentService {
|
411
|
418
|
* @Author wn
|
412
|
419
|
* @Date 2022/8/3 9:17
|
413
|
420
|
**/
|
|
421
|
+ @Transactional(rollbackFor = Exception.class)
|
414
|
422
|
public void saveCommitPaperForScantron(PaperStudentWebVo pswvo) throws Exception{
|
415
|
423
|
//更加学生姓名和准考证号找到对应学生
|
416
|
424
|
Integer userid = userMapper.getUseridByExamno(pswvo.getExamno());
|
417
|
425
|
if(!N_Utils.isTrueInteger(userid)){
|
418
|
|
- throw new Exception("考号有误");
|
|
426
|
+ updateScanErrorInfo(2,pswvo);
|
|
427
|
+// throw new Exception("考号有误");
|
419
|
428
|
}
|
420
|
429
|
//获取学生试卷
|
421
|
430
|
EPaperStudent ps = ePaperStudentMapper.getPaperStudentByStuidAndEpid(pswvo.getEpid(),userid);
|
|
@@ -423,7 +432,8 @@ public class EPaperStudentService {
|
423
|
432
|
|
424
|
433
|
//试卷不存在
|
425
|
434
|
if(ps == null) {
|
426
|
|
- throw new Exception("学生试卷不存在");
|
|
435
|
+ updateScanErrorInfo(3,pswvo);
|
|
436
|
+// throw new Exception("学生试卷不存在");
|
427
|
437
|
}
|
428
|
438
|
|
429
|
439
|
if(pswvo.getSstate() == 3){
|
|
@@ -432,14 +442,20 @@ public class EPaperStudentService {
|
432
|
442
|
paperStudent.setEpsid(pswvo.getEpsid());
|
433
|
443
|
paperStudent.setStupic(JSON.toJSONString(pswvo.getStupic()));
|
434
|
444
|
paperStudent.setSstate(3);
|
435
|
|
- if(!N_Utils.isEmptyInteger(pswvo.getSstate())){
|
436
|
|
- paperStudent.setHasbad(0);
|
437
|
|
- }else{
|
|
445
|
+ paperStudent.setBatchid(pswvo.getBatchid());
|
|
446
|
+ if(N_Utils.isEmptyInteger(pswvo.getHasbad())){
|
438
|
447
|
paperStudent.setHasbad(1);
|
|
448
|
+ }else{
|
|
449
|
+ paperStudent.setHasbad(0);
|
439
|
450
|
}
|
440
|
451
|
|
441
|
452
|
ePaperStudentMapper.updateStudentPaperState(paperStudent);
|
442
|
453
|
ePaperStudentQuestionMapper.updateStuQuestionChecked(pswvo.getEpsid(),userid);
|
|
454
|
+ eScanbatchMapper.updateQknum(pswvo.getBatchid());//更改缺考数量
|
|
455
|
+ //更改违规数量
|
|
456
|
+ if(paperStudent.getHasbad() == 1){
|
|
457
|
+ eScanbatchMapper.updateWgnum(paperStudent.getBatchid());
|
|
458
|
+ }
|
443
|
459
|
}else{
|
444
|
460
|
List<EPaperStudentQuestion> sqlist = pswvo.getQuestions();//学生提交试卷中试题
|
445
|
461
|
|
|
@@ -465,6 +481,13 @@ public class EPaperStudentService {
|
465
|
481
|
paperStudent.setStupic(JSON.toJSONString(pswvo.getStupic()));
|
466
|
482
|
paperStudent.setSstate(2);
|
467
|
483
|
paperStudent.setStuscore(paperscore);
|
|
484
|
+ paperStudent.setBatchid(pswvo.getBatchid());
|
|
485
|
+ if(N_Utils.isEmptyInteger(pswvo.getHasbad())){
|
|
486
|
+ paperStudent.setHasbad(1);
|
|
487
|
+ }else{
|
|
488
|
+ paperStudent.setHasbad(0);
|
|
489
|
+ }
|
|
490
|
+
|
468
|
491
|
int checked = 0;
|
469
|
492
|
if(checknum == sqlist.size()){
|
470
|
493
|
checked = 2;
|
|
@@ -473,6 +496,12 @@ public class EPaperStudentService {
|
473
|
496
|
|
474
|
497
|
ePaperStudentQuestionMapper.updateBatchStuQuestion(sqlist);
|
475
|
498
|
ePaperStudentMapper.updateStudentPaper(paperStudent);
|
|
499
|
+ //扫描完成更改批次数量
|
|
500
|
+ eScanbatchMapper.updateScannum(paperStudent.getBatchid());
|
|
501
|
+ //更改违规数量
|
|
502
|
+ if(paperStudent.getHasbad() == 1){
|
|
503
|
+ eScanbatchMapper.updateWgnum(paperStudent.getBatchid());
|
|
504
|
+ }
|
476
|
505
|
if(checked == 0){
|
477
|
506
|
//获取试卷中需要合并图片的试题
|
478
|
507
|
chandleStudentQuestionNoconvertedPic(pswvo.getEpsid(),2);
|
|
@@ -480,4 +509,30 @@ public class EPaperStudentService {
|
480
|
509
|
}
|
481
|
510
|
}
|
482
|
511
|
|
|
512
|
+ //更新扫描出错信息
|
|
513
|
+ private void updateScanErrorInfo(Integer errortype,PaperStudentWebVo pswvo){
|
|
514
|
+ //识别出错
|
|
515
|
+ EScanerror er = new EScanerror();
|
|
516
|
+ er.setBatchid(pswvo.getBatchid());
|
|
517
|
+ er.setErrortype(errortype);
|
|
518
|
+ er.setErrorjson(JSON.toJSONString(pswvo));
|
|
519
|
+ er.setCreatetime(N_Utils.getSecondTimestamp());
|
|
520
|
+ eScanerrorMapper.insertSelective(er);
|
|
521
|
+ eScanbatchMapper.updateErrornum(pswvo.getBatchid());
|
|
522
|
+ }
|
|
523
|
+
|
|
524
|
+ /**
|
|
525
|
+ * @description 保存扫描出错信息
|
|
526
|
+ * @param: [eScanerror]
|
|
527
|
+ * @return: void
|
|
528
|
+ * @author: wn
|
|
529
|
+ * @date:
|
|
530
|
+ **/
|
|
531
|
+ public void saveScanPaperError(EScanerror eScanerror){
|
|
532
|
+ eScanerror.setErrortype(1);
|
|
533
|
+ eScanerror.setCreatetime(N_Utils.getSecondTimestamp());
|
|
534
|
+ eScanerrorMapper.insertSelective(eScanerror);
|
|
535
|
+ eScanbatchMapper.updateErrornum(eScanerror.getBatchid());
|
|
536
|
+ }
|
|
537
|
+
|
483
|
538
|
}
|