Browse Source

完成度计算

seyason 4 tháng trước cách đây
mục cha
commit
1a8c3f94ad

+ 3 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -1600,7 +1600,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                             int percentRes = 0;
                             if(tmpVO.getPlanHoursSum().compareTo(new BigDecimal(0)) > 0){
                                 percentRes = tmpVO.getRealHoursSum().multiply(new BigDecimal(100))
-                                        .divide(tmpVO.getPlanHoursSum(),RoundingMode.HALF_UP).intValue();
+                                        .divide(tmpVO.getPlanHoursSum(),0, RoundingMode.HALF_UP).intValue();
                             }
                             projectVO.setProgress(percentRes);
                         }
@@ -3297,7 +3297,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
                 int percentRes = 0;
                 if(planHourSum.compareTo(new BigDecimal(0)) > 0){
-                    percentRes = realHourSum.multiply(new BigDecimal(100)).divide(planHourSum,RoundingMode.HALF_UP).intValue();
+                    BigDecimal bg = realHourSum.multiply(new BigDecimal(100)).divide(planHourSum, 0, BigDecimal.ROUND_HALF_UP);
+                    percentRes = bg.intValue();
                 }
                 project.setProgress(percentRes);
             }