浏览代码

"计划状态更新"

yangjunfeng 3 周之前
父节点
当前提交
743feabdea

+ 8 - 0
tofly-zhongming-gas/service/zmrq/src/main/java/com/tofly/zmrq/custom/service/impl/CustomPointServiceImpl.java

@@ -367,6 +367,14 @@ public class CustomPointServiceImpl implements CustomPointService {
                             planChild.setIsovertototal(percent * total);
                             planChild.setIsovertototal1(new BigDecimal(pointIsoverTotal));
                             planChild.setIsovertototal0(new BigDecimal(isOver));
+                            PlanChild planChildOne = planChildService.getById(childPlanId);
+                            if (planChildOne != null && org.apache.commons.lang3.StringUtils.isNotBlank(planChildOne.getPlanRate())) {
+                                BigDecimal planRate = new BigDecimal(planChildOne.getPlanRate()).divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
+                                BigDecimal actualPercent = BigDecimal.valueOf(percent1);
+                                if (actualPercent.compareTo(planRate) >= 0) {
+                                    planChild.setChildPlanState("3");
+                                }
+                            }
                             planChildService.updateById(planChild);
 
                             List<PlanPointTemp> pointTemps = new ArrayList<>();