xiatian hai 8 meses
pai
achega
ed8c0e96c8

+ 6 - 6
src/main/java/cn/com/qmth/scancentral/service/impl/SubjectServiceImpl.java

@@ -213,7 +213,7 @@ public class SubjectServiceImpl extends MppServiceImpl<SubjectDao, SubjectEntity
         if (CollectionUtils.isNotEmpty(subjects)) {
             Calendar now = Calendar.getInstance();
             long endTime = now.getTimeInMillis();
-            now.add(Calendar.MINUTE, -1);
+            now.add(Calendar.HOUR_OF_DAY, -1);
             long startTime = now.getTimeInMillis();
             for (SubjectScanProgressVo vo : subjects) {
                 vo.setScannedCount(vo.getStudentCount() - vo.getUnexistCount());
@@ -223,14 +223,14 @@ public class SubjectServiceImpl extends MppServiceImpl<SubjectDao, SubjectEntity
                     vo.setEstimation("-");
                 } else {
                     vo.setEstimation(Calculator.divide(
-                            Calculator.multiply(Calculator.divide(count, endTime - startTime), vo.getUnexistCount()),
-                            3600000) + "h");
+                            Calculator.multiply(Calculator.divide(count, endTime - startTime, 6), vo.getUnexistCount()),
+                            3600000, 2) + "h");
                 }
             }
             int totalUnScanned = studentService.getUnscannedCountByExam(examId);
             int totalCount = studentService.getCountByExam(examId);
             ret.getTotal().setStudentCount(totalCount);
-            ret.getTotal().setScannedCount(totalCount-totalUnScanned);
+            ret.getTotal().setScannedCount(totalCount - totalUnScanned);
             ret.getTotal().setUnexistCount(totalUnScanned);
             ret.getTotal().setProgress(
                     Calculator.percentage(ret.getTotal().getScannedCount(), ret.getTotal().getStudentCount(), 2));
@@ -239,8 +239,8 @@ public class SubjectServiceImpl extends MppServiceImpl<SubjectDao, SubjectEntity
                 ret.getTotal().setEstimation("-");
             } else {
                 ret.getTotal().setEstimation(
-                        Calculator.divide(Calculator.multiply(Calculator.divide(count, endTime - startTime),
-                                ret.getTotal().getUnexistCount()), 3600000) + "h");
+                        Calculator.divide(Calculator.multiply(Calculator.divide(count, endTime - startTime, 6),
+                                ret.getTotal().getUnexistCount()), 3600000, 2) + "h");
             }
         }
         return ret;

+ 0 - 12
src/main/java/cn/com/qmth/scancentral/util/Calculator.java

@@ -155,18 +155,6 @@ public class Calculator {
 
     }
 
-    /**
-     * 除法
-     * 
-     * @param v1
-     * @param v2
-     * @param len
-     * @return
-     */
-    public static double divide(double v1, double v2) {
-        return divide(v1, v2, null);
-    }
-
     /**
      * 除法 保留指定位小数
      *