Browse Source

第一次点开始分析计算不显示状态的bugfix

wangliang 3 years ago
parent
commit
f10901f8cf

+ 2 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/NotifyApiController.java

@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
 import java.util.*;
@@ -107,7 +108,7 @@ public class NotifyApiController {
                     gradeBatch.setStatus(GradeAnalyzePaperStatusEnum.FINISH_CALCULATE);
                 }
                 if (Objects.nonNull(calculateNotifyResult.getProgress())) {
-                    gradeBatch.setProgress(calculateNotifyResult.getProgress());
+                    gradeBatch.setProgress(calculateNotifyResult.getProgress().multiply(SystemConstant.PERCENT).setScale(2, BigDecimal.ROUND_HALF_UP));
                 }
                 gradeBatch.setNotifyTime(System.currentTimeMillis());
                 if (Objects.nonNull(calculateNotifyResult.getResult())) {

+ 2 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -15,6 +15,7 @@ import org.springframework.cglib.beans.BeanMap;
 
 import java.io.*;
 import java.lang.reflect.Field;
+import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.nio.charset.Charset;
 import java.util.*;
@@ -90,6 +91,7 @@ public class SystemConstant {
     public static final int FINAL_SCALE = 1;
     public static final int CALCULATE_SCALE = 4;
     public static final int OPER_SCALE = 8;
+    public static final BigDecimal PERCENT = new BigDecimal(100);
     public static final String HYPHEN = "-";
     public static final String DEFAULT_SIGN = "#";
     public static final String PARENT_ORG = "武汉大学教务处";