Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
7b6a61a933

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java View File

119
     Integer getSubjectStateByEpsid(@Param("epsid") Integer epsid);
119
     Integer getSubjectStateByEpsid(@Param("epsid") Integer epsid);
120
     //根据试卷学生id获取考试科目状态和学生试卷状态
120
     //根据试卷学生id获取考试科目状态和学生试卷状态
121
     Map getSubjectStateAndSstageByEpsid(@Param("epsid") Integer epsid);
121
     Map getSubjectStateAndSstageByEpsid(@Param("epsid") Integer epsid);
122
+
123
+    //更改单个学生试卷分值和状态
124
+    void updateStuScoreAndStateEpsid(@Param("epsid") Integer epsid);
122
 }
125
 }

+ 1
- 1
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPsqbatchService.java View File

152
             ePsqbatchDetailMapper.insertList(details);//保存考试补录成绩详情
152
             ePsqbatchDetailMapper.insertList(details);//保存考试补录成绩详情
153
             ePaperStudentQuestionMapper.updateBatchStuQuestionSore(questions);//更改单个学生试题分值
153
             ePaperStudentQuestionMapper.updateBatchStuQuestionSore(questions);//更改单个学生试题分值
154
             Integer epsid = questions.get(0).getEpsid();
154
             Integer epsid = questions.get(0).getEpsid();
155
-            ePaperStudentMapper.updateStuPaperscoreEpsid(epsid);//更改单个学生试卷分值
155
+            ePaperStudentMapper.updateStuScoreAndStateEpsid(epsid);//更改单个学生试卷分值和状态
156
         } catch (Exception e) {
156
         } catch (Exception e) {
157
             log.error("补录学生成绩失败:" + e.getMessage());
157
             log.error("补录学生成绩失败:" + e.getMessage());
158
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
158
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

+ 2
- 3
sexam/src/main/java/com/xhkjedu/sexam/utils/PoiUtils.java View File

228
     public static String getCellValue(Cell cell) {
228
     public static String getCellValue(Cell cell) {
229
         String value = null;
229
         String value = null;
230
         if (cell == null) return value;
230
         if (cell == null) return value;
231
-        DecimalFormat df = new DecimalFormat("0");  //格式化number String字符
231
+        DecimalFormat df = new DecimalFormat("0.##");  //格式化number String字符
232
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  //日期格式化
232
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  //日期格式化
233
-        DecimalFormat df2 = new DecimalFormat("0");  //格式化数字
234
         switch (cell.getCellTypeEnum()) {
233
         switch (cell.getCellTypeEnum()) {
235
             case STRING:
234
             case STRING:
236
                 value = cell.getRichStringCellValue().getString();
235
                 value = cell.getRichStringCellValue().getString();
248
                 } else if ("m/d/yy".equals(cellStyle)) {
247
                 } else if ("m/d/yy".equals(cellStyle)) {
249
                     value = sdf.format(cell.getDateCellValue());
248
                     value = sdf.format(cell.getDateCellValue());
250
                 } else {
249
                 } else {
251
-                    value = df2.format(cell.getNumericCellValue());
250
+                    value = df.format(cell.getNumericCellValue());
252
                 }
251
                 }
253
                 break;
252
                 break;
254
             case BOOLEAN:
253
             case BOOLEAN:

+ 6
- 0
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

372
         select concat(es.sdate,' ',es.endtime,':00')device,(right(#{studentid},2)+0)/100 score
372
         select concat(es.sdate,' ',es.endtime,':00')device,(right(#{studentid},2)+0)/100 score
373
         from e_subject es where es.esid=#{esid}
373
         from e_subject es where es.esid=#{esid}
374
     </select>
374
     </select>
375
+    <!--更改单个学生试卷分值和状态-->
376
+    <update id="updateStuScoreAndStateEpsid">
377
+        update e_paper_student ps set ps.sstate=2
378
+        ,ps.stuscore=(select sum(ifnull(q.stuscore,0)) from e_paper_student_question q where q.epsid=#{epsid} )
379
+        where ps.epsid=#{epsid}
380
+    </update>
375
 </mapper>
381
 </mapper>

Loading…
Cancel
Save