xiatian 8 kuukautta sitten
vanhempi
commit
dd4f5786a5

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

@@ -224,10 +224,10 @@ public class SubjectServiceImpl extends MppServiceImpl<SubjectDao, SubjectEntity
                 vo.setScannedCount(vo.getStudentCount() - vo.getUnexistCount());
                 totalScanned = totalScanned + vo.getScannedCount();
                 vo.setProgress(Calculator.percentage(vo.getScannedCount(), vo.getStudentCount(), 2));
-                double speed = Calculator.divide(endTime - startTime, inTimeScannedCount, 6);
                 if (inTimeScannedCount == null || inTimeScannedCount == 0) {
                     vo.setEstimation("-");
                 } else {
+                    double speed = Calculator.divide(endTime - startTime, inTimeScannedCount, 6);
                     double es = Calculator.divide(Calculator.multiply(speed, vo.getUnexistCount()), 3600000, 2);
                     totalEstimation = Calculator.add(totalEstimation, es);
                     vo.setEstimation(es + "h");