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,4 +119,7 @@ public interface EPaperStudentMapper extends TkMapper<EPaperStudent> {
119 119
     Integer getSubjectStateByEpsid(@Param("epsid") Integer epsid);
120 120
     //根据试卷学生id获取考试科目状态和学生试卷状态
121 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,7 +152,7 @@ public class EPsqbatchService {
152 152
             ePsqbatchDetailMapper.insertList(details);//保存考试补录成绩详情
153 153
             ePaperStudentQuestionMapper.updateBatchStuQuestionSore(questions);//更改单个学生试题分值
154 154
             Integer epsid = questions.get(0).getEpsid();
155
-            ePaperStudentMapper.updateStuPaperscoreEpsid(epsid);//更改单个学生试卷分值
155
+            ePaperStudentMapper.updateStuScoreAndStateEpsid(epsid);//更改单个学生试卷分值和状态
156 156
         } catch (Exception e) {
157 157
             log.error("补录学生成绩失败:" + e.getMessage());
158 158
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

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

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

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

@@ -372,4 +372,10 @@
372 372
         select concat(es.sdate,' ',es.endtime,':00')device,(right(#{studentid},2)+0)/100 score
373 373
         from e_subject es where es.esid=#{esid}
374 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 381
 </mapper>

Loading…
Cancel
Save