|
@@ -3,7 +3,9 @@ package com.xhkjedu.sexam.service.paperstudent;
|
3
|
3
|
import com.xhkjedu.sexam.mapper.exam.EBaseMapper;
|
4
|
4
|
import com.xhkjedu.sexam.mapper.exam.EClassStudentMapper;
|
5
|
5
|
import com.xhkjedu.sexam.mapper.paper.EPaperQtypeQuestionMapper;
|
|
6
|
+import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
|
6
|
7
|
import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
|
|
8
|
+import com.xhkjedu.sexam.mapper.paperstudent.EPsqbatchDetailMapper;
|
7
|
9
|
import com.xhkjedu.sexam.mapper.paperstudent.EPsqbatchMapper;
|
8
|
10
|
import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
|
9
|
11
|
import com.xhkjedu.sexam.model.paperstudent.EPsqbatch;
|
|
@@ -41,7 +43,11 @@ public class EPsqbatchService {
|
41
|
43
|
@Resource
|
42
|
44
|
private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
|
43
|
45
|
@Resource
|
|
46
|
+ private EPaperStudentMapper ePaperStudentMapper;
|
|
47
|
+ @Resource
|
44
|
48
|
private EBaseMapper eBaseMapper;
|
|
49
|
+ @Resource
|
|
50
|
+ private EPsqbatchDetailMapper ePsqbatchDetailMapper;
|
45
|
51
|
|
46
|
52
|
/**
|
47
|
53
|
* @Description 获取考试科目
|
|
@@ -88,29 +94,32 @@ public class EPsqbatchService {
|
88
|
94
|
if (code != 0) return new ResultVo(1, map.get("msg").toString());
|
89
|
95
|
LinkedHashMap<Integer, List<String>> errMsg = (LinkedHashMap<Integer, List<String>>) map.get("errMsg");
|
90
|
96
|
if (errMsg.size() != 0) return new ResultVo(1, null, errMsg);
|
91
|
|
- ePsqbatchMapper.insertUseGeneratedKeys(batch);
|
92
|
97
|
List<EPsqbatchStuVo> stus = (List<EPsqbatchStuVo>) map.get("stus");
|
|
98
|
+ batch.setStunum(stus.size());
|
|
99
|
+ batch.setCreatetime(N_Utils.getSecondTimestamp());
|
|
100
|
+ ePsqbatchMapper.insertUseGeneratedKeys(batch);
|
93
|
101
|
for (EPsqbatchStuVo stu : stus) {
|
94
|
102
|
new Thread(()->{
|
95
|
103
|
try {
|
96
|
104
|
saveEPsqbatchDetail(stu,batch);
|
97
|
105
|
}catch (Exception e){
|
98
|
|
- log.error("保存学生试题重试:" + e.getMessage());
|
|
106
|
+ log.error("补录学生成绩重试:" + e.getMessage());
|
99
|
107
|
try {
|
100
|
108
|
saveEPsqbatchDetail(stu,batch);
|
101
|
109
|
}catch (Exception se){
|
102
|
|
- log.error("保存学生试题重试出错:" + se.getMessage());
|
|
110
|
+ log.error("补录学生成绩重试出错:" + se.getMessage());
|
103
|
111
|
}
|
104
|
112
|
}
|
105
|
113
|
}).start();
|
106
|
114
|
}
|
107
|
115
|
} catch (Exception e) {
|
108
|
|
- e.printStackTrace();
|
|
116
|
+ log.error("导入补录学生成绩失败",e);
|
|
117
|
+ return new ResultVo(1,e.getMessage());
|
109
|
118
|
}
|
110
|
119
|
return new ResultVo(0,"导入成功");
|
111
|
120
|
}
|
112
|
121
|
|
113
|
|
- //保存学生试题
|
|
122
|
+ //补录学生成绩
|
114
|
123
|
@Transactional(rollbackFor = Exception.class)
|
115
|
124
|
public void saveEPsqbatchDetail(EPsqbatchStuVo stu, EPsqbatch batch) {
|
116
|
125
|
try {
|
|
@@ -127,16 +136,23 @@ public class EPsqbatchService {
|
127
|
136
|
EPsqbatchDetail detail = details.get(i);
|
128
|
137
|
EPaperStudentQuestion question = questions.get(i);
|
129
|
138
|
question.setStuscore(detail.getNewscore());
|
130
|
|
- detail.setStuscore(question.getStuscore());
|
131
|
|
- detail.setEpid(epid);
|
132
|
139
|
detail.setBatchid(batchId);
|
|
140
|
+ detail.setStudentid(studentid);
|
|
141
|
+ detail.setEpid(epid);
|
|
142
|
+ detail.setEpsqid(question.getEpsqid());
|
|
143
|
+ detail.setQn(question.getQn());
|
|
144
|
+ detail.setStuscore(question.getStuscore());
|
133
|
145
|
detail.setTeacherid(teacherid);
|
134
|
146
|
detail.setCreatetime(timestamp);
|
135
|
147
|
}
|
|
148
|
+ ePsqbatchDetailMapper.insertList(details);//保存考试补录成绩详情
|
|
149
|
+ ePaperStudentQuestionMapper.updateBatchStuQuestionSore(questions);//更改单个学生试题分值
|
|
150
|
+ Integer epsid = questions.get(0).getEpsid();
|
|
151
|
+ ePaperStudentMapper.updateStuPaperscoreEpsid(epsid);//更改单个学生试卷分值
|
136
|
152
|
} catch (Exception e) {
|
137
|
|
- log.error("保存学生试题失败:" + e.getMessage());
|
|
153
|
+ log.error("补录学生成绩失败:" + e.getMessage());
|
138
|
154
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
139
|
|
- throw new RuntimeException("保存学生试题失败");
|
|
155
|
+ throw new RuntimeException("补录学生成绩失败");
|
140
|
156
|
}
|
141
|
157
|
}
|
142
|
158
|
|