浏览代码

【BUG】组图表数据错误

zhaomn 1 年之前
父节点
当前提交
0732efd88f

+ 6 - 6
railway-business/src/main/java/com/railway/business/bi/service/impl/ChartServiceImpl.java

@@ -124,16 +124,16 @@ public class ChartServiceImpl implements IChartService {
         continue;
       }
       if (bdDto.getGq().equals("变配电修试队")){
-        bdDto.setDj1(bdyc.getDj1());
-        bdDto.setDj2(bdyc.getDj2());
-        bdDto.setDj3(bdyc.getDj3());
+        bdDto.setDj1(null == bdyc || null == bdyc.getDj1() ? 0 : bdyc.getDj1());
+        bdDto.setDj2(null == bdyc || null == bdyc.getDj2() ? 0 : bdyc.getDj2());
+        bdDto.setDj3(null == bdyc || null == bdyc.getDj3() ? 0 : bdyc.getDj3());
       }
       gqFlag.add(bdDto.getGq());
       DlycDTO dlDto = dlycMap.get(bdDto.getGq());
       if (dlDto.getGq().equals("电力维修队")){
-        dlDto.setDj1(dlyc.getDj1());
-        dlDto.setDj2(dlyc.getDj2());
-        dlDto.setDj3(dlyc.getDj3());
+        dlDto.setDj1(null == dlyc || null == dlyc.getDj1() ? 0 : dlyc.getDj1());
+        dlDto.setDj2(null == dlyc || null == dlyc.getDj2() ? 0 : dlyc.getDj2());
+        dlDto.setDj3(null == dlyc || null == dlyc.getDj3() ? 0 : dlyc.getDj3());
       }
       List<SeriesDTO> series = listSeries(xAxis, bdDto, dlDto);
       chartList.add(createChartVO(xAxis, series, bdDto.getGq()));