root 2 gadi atpakaļ
vecāks
revīzija
93d03555ef

+ 3 - 2
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/TaskManager.java

@@ -171,7 +171,7 @@ public class TaskManager {
      * @param userId 项目创建用户的 id
      */
     @SneakyThrows
-    public void score(String projectRunningKey,String userId, String projectId, String projectType) {
+    public void score(String projectRunningKey, String userId, String projectId, String projectType) {
         stringRedisTemplate.delete(projectRunningKey);
         // -------------------------------- 打分 --------------------------------
         ProjectEntity projectEntity = null;
@@ -407,7 +407,8 @@ public class TaskManager {
             parentIndexTemplateList.forEach(indexTemplate -> {
                 String weight = indexTemplate.getWeight();
                 List<LeafIndexEntity> sonTaskIndexList = sonTaskIndexMap.get(indexTemplate.getIndexId());
-                double parentScore = sonTaskIndexList.stream().mapToDouble(taskIndex -> taskIndex.getScore() * Double.parseDouble(taskIndex.getWeight()) / 100).sum();
+                double parentScore = NumberUtil.cut(sonTaskIndexList.stream().mapToDouble(taskIndex -> taskIndex
+                        .getScore() * Double.parseDouble(taskIndex.getWeight()) / 100).sum(), 2);
                 LeafIndexEntity parentTaskIndex = LeafIndexEntity.builder()
                         .id(StringUtil.getRandomUUID())
                         .pId(projectId)