Browse Source

Merge branch 'master' of http://git.qmth.com.cn/themis/backend-service
1

wangliang 4 years ago
parent
commit
d609c8c6f4

+ 14 - 1
themis-business/src/main/java/com/qmth/themis/business/dto/response/TEExamQueryDto.java

@@ -46,7 +46,10 @@ public class TEExamQueryDto implements Serializable {
 
 
     @ApiModelProperty(name = "算分进度")
     @ApiModelProperty(name = "算分进度")
     private Double progress;//算分进度
     private Double progress;//算分进度
-
+    
+    @ApiModelProperty(name = "算分状态")
+    private String scoreStatus;//算分状态
+    
     @ApiModelProperty(name = "更新时间")
     @ApiModelProperty(name = "更新时间")
     private Long updateTime;//更新时间
     private Long updateTime;//更新时间
 
 
@@ -195,4 +198,14 @@ public class TEExamQueryDto implements Serializable {
     public void setUpdateName(String updateName) {
     public void setUpdateName(String updateName) {
         this.updateName = updateName;
         this.updateName = updateName;
     }
     }
+
+	public String getScoreStatus() {
+		return scoreStatus;
+	}
+
+	public void setScoreStatus(String scoreStatus) {
+		this.scoreStatus = scoreStatus;
+	}
+    
+    
 }
 }

+ 5 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -1225,6 +1225,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
 
 
             TEExamService examService = SpringContextHolder.getBean(TEExamService.class);
             TEExamService examService = SpringContextHolder.getBean(TEExamService.class);
             teExamMapper.updateScoreStatus(ScoreStatusEnum.CALCULATING, examId);
             teExamMapper.updateScoreStatus(ScoreStatusEnum.CALCULATING, examId);
+            teExamMapper.updateScoreProgress(0.0, examId);
             examService.updateExamCacheBean(examId);
             examService.updateExamCacheBean(examId);
             task = tbTaskHistoryService.getById(taskId);
             task = tbTaskHistoryService.getById(taskId);
             task.setStatus(TaskStatusEnum.RUNNING);
             task.setStatus(TaskStatusEnum.RUNNING);
@@ -1246,7 +1247,9 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                             toeExamRecordService.calculateScore(rc.getId());
                             toeExamRecordService.calculateScore(rc.getId());
                         }
                         }
                     }
                     }
-                    task.setProgress(getPercentage(index, total));
+                    Double progress=getPercentage(index, total);
+                    task.setProgress(progress);
+                    teExamMapper.updateScoreProgress(progress, examId);
                     tbTaskHistoryService.saveOrUpdate(task);
                     tbTaskHistoryService.saveOrUpdate(task);
                 }
                 }
             }
             }
@@ -1285,7 +1288,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         if (b == 0) {
         if (b == 0) {
             return null;
             return null;
         }
         }
-        Double da = Double.valueOf(a);
+        Double da = Double.valueOf(a*100);
         Double db = Double.valueOf(b);
         Double db = Double.valueOf(b);
         BigDecimal bd = new BigDecimal(da / db);
         BigDecimal bd = new BigDecimal(da / db);
         Double tem = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
         Double tem = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();

+ 1 - 0
themis-business/src/main/resources/mapper/TEExamMapper.xml

@@ -40,6 +40,7 @@
         t.startTime,
         t.startTime,
         t.endTime,
         t.endTime,
         t.progress,
         t.progress,
+        t.score_status scoreStatus,
         if(t.updateName is not null, t.updateName, t.createName) as updateName,
         if(t.updateName is not null, t.updateName, t.createName) as updateName,
         if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime,
         if(t.updateTime is not null, t.updateTime, t.createTime) as updateTime,
         t.enableIpLimit,
         t.enableIpLimit,