Ver código fonte

1、课程大纲得分向下取整,没慢就不给星星

liyanbo 4 meses atrás
pai
commit
4bd64ff195

+ 2 - 1
byzs-web/src/main/java/cn/iocoder/byzs/module/web/service/blockly/WebBlocklyServiceImpl.java

@@ -111,7 +111,8 @@ public class WebBlocklyServiceImpl {
             if (progressMap.containsKey(blocklyType.getId())) {
                 WebBlocklyProgressDO progress = progressMap.get(blocklyType.getId());
                 Double brpProgress = progress.getBrpProgress();
-                long progressL = Math.round(brpProgress / blocklyType.getSectionCount() * 5);
+                //向下取整
+                double progressL = Math.floor(brpProgress / blocklyType.getSectionCount() * 5);
                 blocklyType.setProgress((int) progressL);
             }else{
                 blocklyType.setProgress(0);