|
@@ -41,6 +41,7 @@ import java.util.Collections;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -84,6 +85,16 @@ public class SysImplementPlanManager {
|
|
plan.setCreateTime(now);
|
|
plan.setCreateTime(now);
|
|
plan.setUpdateTime(now);
|
|
plan.setUpdateTime(now);
|
|
|
|
|
|
|
|
+ Long availScore;
|
|
|
|
+ if (resource.getParentId() != 0){
|
|
|
|
+
|
|
|
|
+ availScore = implementPlanService.calcAvailScore(resource.getParentId(), resource.getPlanScore());
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ availScore = resource.getPlanScore();
|
|
|
|
+ }
|
|
|
|
+ plan.setAvailScore(availScore);
|
|
|
|
+
|
|
return implementPlanService.createPlan(plan);
|
|
return implementPlanService.createPlan(plan);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -265,6 +276,16 @@ public class SysImplementPlanManager {
|
|
plan.setUpdateBy(username);
|
|
plan.setUpdateBy(username);
|
|
plan.setUpdateTime(now);
|
|
plan.setUpdateTime(now);
|
|
|
|
|
|
|
|
+ // 归还父计划的分值
|
|
|
|
+ if (!result){
|
|
|
|
+ SysImplementPlan p = implementPlanService.getById(resource.getPlanId());
|
|
|
|
+ if (p.getParentId() != 0){
|
|
|
|
+ SysImplementPlan parentPlan = implementPlanService.getById(p.getParentId());
|
|
|
|
+ parentPlan.setAvailScore(parentPlan.getAvailScore() + p.getPlanScore());
|
|
|
|
+ implementPlanService.updatePlan(parentPlan);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
return implementPlanService.updatePlan(plan);
|
|
return implementPlanService.updatePlan(plan);
|
|
}
|
|
}
|