|
@@ -47,67 +47,78 @@ public class EPaperVerifyService {
|
47
|
47
|
public void correctSave(PaperStudentParams psParams){
|
48
|
48
|
Integer epid = psParams.getEpid();
|
49
|
49
|
Integer studentid = psParams.getStudentid();
|
50
|
|
-
|
51
|
|
- //是否验证0待验证1验证通过2验证不通过
|
52
|
|
- if(psParams.getVerified() == 2){
|
53
|
|
- EPaperStudent paperStudent = new EPaperStudent();
|
54
|
|
- paperStudent.setEpid(epid);
|
55
|
|
- paperStudent.setStudentid(studentid);
|
56
|
|
- paperStudent.setVerified(2);
|
57
|
|
- ePaperVerifyMapper.updateStuPaperVerified(paperStudent);
|
58
|
|
-
|
59
|
|
- //验证不通过,更改状态
|
60
|
|
- EPaperStudent0608 ps0608 = new EPaperStudent0608();
|
61
|
|
- ps0608.setEpid(epid);
|
62
|
|
- ps0608.setStudentid(studentid);
|
63
|
|
- ps0608.setVerified(2);
|
64
|
|
- ps0608.setSamed(0);
|
65
|
|
- ePaperVerifyMapper.updateStuPaper0608(ps0608);
|
66
|
|
- }else{
|
67
|
|
- //获取原试卷答案,
|
68
|
|
- List<EPaperQtypeQuestion> questions = ePaperVerifyMapper.listPaperAnswer(psParams.getEpid());
|
69
|
|
- List<EPaperStudentQuestion> stuQues = psParams.getQuestions();
|
70
|
|
-
|
71
|
|
- Double paperscore = 0D;//学生试卷得分
|
72
|
|
-
|
73
|
|
- for(EPaperStudentQuestion psq : stuQues){
|
74
|
|
- EPaperQtypeQuestion pqtypeQues = questions.stream().filter(a -> a.getEptqid().equals(psq.getEptqid())).findFirst().orElse(null);
|
75
|
|
- setCommitQuestion(psq,pqtypeQues);
|
76
|
|
-
|
77
|
|
- paperscore = N_Utils.add(paperscore, psq.getStuscore());
|
78
|
|
- psq.setStudentid(studentid);
|
79
|
|
- psq.setEpid(epid);
|
80
|
|
- }
|
81
|
|
- ePaperVerifyMapper.updateBatchStuQuestion(stuQues);
|
82
|
|
-
|
83
|
|
- EPaperStudent paperStudent = new EPaperStudent();
|
84
|
|
- paperStudent.setEpid(epid);
|
85
|
|
- paperStudent.setStudentid(studentid);
|
86
|
|
- paperStudent.setStuscore(paperscore);
|
87
|
|
- paperStudent.setStupic(psParams.getStupic());
|
88
|
|
- paperStudent.setPagenum(psParams.getPagenum());
|
89
|
|
- paperStudent.setSstate(2);
|
90
|
|
- paperStudent.setChecked(2);
|
91
|
|
- paperStudent.setVerified(1);
|
92
|
|
- ePaperVerifyMapper.updateStuPaper(paperStudent);
|
93
|
|
-
|
94
|
|
- EPaperStudent0608 ps0608 = new EPaperStudent0608();
|
95
|
|
- ps0608.setEpid(epid);
|
96
|
|
- ps0608.setStudentid(studentid);
|
97
|
|
- ps0608.setVerified(1);
|
98
|
|
- ps0608.setSamed(psParams.getSamed());
|
99
|
|
- ePaperVerifyMapper.updateStuPaper0608(ps0608);
|
|
50
|
+ Integer newstudentid = psParams.getNewstudentid();
|
|
51
|
+ Integer samed = 2; //是否和以前一致1一致2不一致
|
|
52
|
+ if(N_Utils.isTrueInteger(newstudentid) && studentid.equals(newstudentid)){
|
|
53
|
+ samed = 1;
|
|
54
|
+ newstudentid = studentid;
|
100
|
55
|
}
|
|
56
|
+ //获取原试卷答案,
|
|
57
|
+ List<EPaperQtypeQuestion> questions = ePaperVerifyMapper.listPaperAnswer(psParams.getEpid());
|
|
58
|
+
|
|
59
|
+ List<EPaperStudentQuestion> stuQues = psParams.getQuestions();//仅包含客观题
|
|
60
|
+
|
|
61
|
+ List<EPaperStudentQuestion> saveQues = new ArrayList<>();
|
101
|
62
|
|
|
63
|
+ Double paperscore = 0D;//学生试卷得分
|
|
64
|
+
|
|
65
|
+ for(EPaperStudentQuestion psq : stuQues){
|
|
66
|
+ EPaperQtypeQuestion pqtypeQues = questions.stream().filter(a -> a.getEptqid().equals(psq.getEptqid())).findFirst().orElse(null);
|
|
67
|
+ setCommitQuestion(psq,pqtypeQues);
|
|
68
|
+
|
|
69
|
+ paperscore = N_Utils.add(paperscore, psq.getStuscore());
|
|
70
|
+ psq.setStudentid(newstudentid);
|
|
71
|
+ psq.setEpid(epid);
|
|
72
|
+ saveQues.add(psq);
|
|
73
|
+ }
|
102
|
74
|
|
|
75
|
+ //获取试卷中主观题
|
|
76
|
+ List<EPaperStudentQuestion> stuQuesZgt = ePaperVerifyMapper.listQuestionZGT(epid,studentid);
|
|
77
|
+ for(EPaperStudentQuestion psqZgt : stuQuesZgt){
|
|
78
|
+ psqZgt.setStudentid(newstudentid);
|
|
79
|
+ paperscore = N_Utils.add(paperscore, psqZgt.getStuscore());
|
|
80
|
+ saveQues.add(psqZgt);
|
|
81
|
+ }
|
103
|
82
|
|
|
83
|
+ ePaperVerifyMapper.updateBatchStuQuestion(saveQues);
|
|
84
|
+
|
|
85
|
+ //获取原试卷信息
|
|
86
|
+ EPaperStudent ps = ePaperVerifyMapper.getStuPaperInfo(epid,studentid);
|
|
87
|
+
|
|
88
|
+ //更改新学生信息
|
|
89
|
+ EPaperStudent paperStudent = new EPaperStudent();
|
|
90
|
+ paperStudent.setEpid(epid);
|
|
91
|
+ paperStudent.setStudentid(newstudentid);
|
|
92
|
+ paperStudent.setStuscore(paperscore);
|
|
93
|
+ paperStudent.setStupic(ps.getStupic());
|
|
94
|
+ paperStudent.setPagenum(ps.getPagenum());
|
|
95
|
+ paperStudent.setBatchid(ps.getBatchid());
|
|
96
|
+ paperStudent.setSstate(2);
|
|
97
|
+ paperStudent.setChecked(2);
|
|
98
|
+ paperStudent.setVerified(1);
|
|
99
|
+ ePaperVerifyMapper.updateStuPaper(paperStudent);
|
|
100
|
+
|
|
101
|
+ EPaperStudent0608 ps0608 = new EPaperStudent0608();
|
|
102
|
+ ps0608.setEpid(epid);
|
|
103
|
+ ps0608.setStudentid(newstudentid);
|
|
104
|
+ ps0608.setVerified(1);
|
|
105
|
+ ps0608.setSamed(samed);
|
|
106
|
+ ePaperVerifyMapper.updateStuPaper0608(ps0608);
|
|
107
|
+
|
|
108
|
+ if(samed == 2){
|
|
109
|
+ //说明学生信息布一致,清空表中原学生试卷及试题信息
|
|
110
|
+ ePaperVerifyMapper.clearPaperStuQues(epid,studentid);
|
|
111
|
+ ePaperVerifyMapper.clearPaperStu(epid,studentid);
|
|
112
|
+ }
|
104
|
113
|
}
|
105
|
114
|
|
106
|
115
|
//判断单道题情况
|
107
|
116
|
private void setCommitQuestion(EPaperStudentQuestion psq, EPaperQtypeQuestion answerVo) {
|
108
|
117
|
int timestamp = N_Utils.getSecondTimestamp();
|
109
|
|
- psq.setAnswertime(timestamp);
|
110
|
|
- int coverted = 1;//是否转换0未转换1已转换2转换失败
|
|
118
|
+ if(!N_Utils.isTrueInteger(psq.getAnswertime())){
|
|
119
|
+ psq.setAnswertime(timestamp);
|
|
120
|
+ }
|
|
121
|
+
|
111
|
122
|
String stuanswer = psq.getStuanswer();
|
112
|
123
|
String stuanswertxt = psq.getStuanswertxt();
|
113
|
124
|
Double stuscore = 0D;
|
|
@@ -164,13 +175,9 @@ public class EPaperVerifyService {
|
164
|
175
|
}
|
165
|
176
|
}
|
166
|
177
|
}
|
167
|
|
-
|
168
|
178
|
psq.setChecked(2);
|
169
|
179
|
psq.setChecktime(timestamp);
|
170
|
180
|
} else {
|
171
|
|
- if (stuanswers.size() > 1) {
|
172
|
|
- coverted = 0;//上传的多张图片设为0未转换
|
173
|
|
- }
|
174
|
181
|
psq.setChecked(0);
|
175
|
182
|
}
|
176
|
183
|
} else {
|
|
@@ -198,8 +205,6 @@ public class EPaperVerifyService {
|
198
|
205
|
}
|
199
|
206
|
psq.setStuscore(stuscore);
|
200
|
207
|
}
|
201
|
|
-
|
202
|
|
- psq.setConverted(coverted);
|
203
|
208
|
}
|
204
|
209
|
|
205
|
210
|
|