Bläddra i källkod

大屏-整改功能调整

zhuang 6 månader sedan
förälder
incheckning
c4f62f2556

+ 10 - 5
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java

@@ -536,8 +536,9 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
                 indicator.setType("rectify_complete");
                 indicator.setSort(8);
                 List<RectifyMachineDto> rectifyMachineDtoList = createRectifyMachineDtoList(list2, null);
-
-                indicator.setCompleted(rectifyMachineDtoList.get(0).getClosedCount() + rectifyMachineDtoList.get(0).getTbcCount());
+                int tbcCount = Optional.ofNullable(rectifyMachineDtoList.get(0).getTbcCount()).orElse(0);
+                int closedCount = Optional.ofNullable(rectifyMachineDtoList.get(0).getClosedCount()).orElse(0);
+                indicator.setCompleted(tbcCount + closedCount);
                 indicator.setTotal(rectifyMachineDtoList.get(0).getTotalCount());
 
                 final BigDecimal denominator = BigDecimal.valueOf(indicator.getCompleted());
@@ -559,10 +560,14 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
                     List<RectifyMachineDto> deptDataVos = createRectifyMachineDtoList(list3, null);
                     if (deptDataVos.size() > 0) {
                         sb.append(list3.get(0).getFirstdeptname() + ",");
-                        Integer i = deptDataVos.get(0).getTbcCount() + deptDataVos.get(0).getClosedCount();
+                        int tbcCount2 = Optional.ofNullable(deptDataVos.get(0).getTbcCount()).orElse(0);
+                        int closedCount2 = Optional.ofNullable(deptDataVos.get(0).getClosedCount()).orElse(0);
+                        int unfinishedCount = Optional.ofNullable(deptDataVos.get(0).getUnfinishedCount()).orElse(0);
+                        Integer totalCount = deptDataVos.get(0).getTotalCount();
+                        Integer i = tbcCount2 + closedCount2;
                         //sb.append(i+"/"+deptDataVos.get(0).getTotalCount() + ",");
-                        sb.append(deptDataVos.get(0).getUnfinishedCount()+ ",");
-                        Float f = i.floatValue() / deptDataVos.get(0).getTotalCount().floatValue() * 100;
+                        sb.append(unfinishedCount+ ",");
+                        Float f = i.floatValue() / totalCount.floatValue() * 100;
                         sb.append(new BigDecimal(String.format("%.2f", f)));
                         if (count.incrementAndGet() < totalSize) {
                             sb.append("-;-");