Commit 2e82ed53 by huangfusuper

解决空指针异常

parent d9524b48
...@@ -789,17 +789,17 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -789,17 +789,17 @@ public class ApiFlowServiceImpl implements ApiFlowService {
Map<String, Long> statusMap = betweenRunRecording.stream().collect(Collectors.groupingBy(RunRecording::getFlowStatus, Collectors.counting())); Map<String, Long> statusMap = betweenRunRecording.stream().collect(Collectors.groupingBy(RunRecording::getFlowStatus, Collectors.counting()));
//成功的 //成功的
long successCount = resultMap.get("1"); long successCount = resultMap.get("1") == null?0:resultMap.get("1");
long reSuccessCount = resultMap.get("3"); long reSuccessCount = resultMap.get("3") == null?0:resultMap.get("3");
long successTotal = successCount+reSuccessCount; long successTotal = successCount+reSuccessCount;
//失败的 //失败的
long errorCount = resultMap.get("2"); long errorCount = resultMap.get("2") == null?0:resultMap.get("2");
long reErrorCount = resultMap.get("4"); long reErrorCount = resultMap.get("4") == null?0:resultMap.get("4");
long killCount = resultMap.get("5"); long killCount = resultMap.get("5") == null?0:resultMap.get("5");
long errorTotal = errorCount+reErrorCount +killCount; long errorTotal = errorCount+reErrorCount +killCount;
//运行中的 //运行中的
long runingFlow = statusMap.get("2"); long runingFlow = statusMap.get("2") == null?0:statusMap.get("2");
long stopFlow = statusMap.get("3"); long stopFlow = statusMap.get("3") == null?0:statusMap.get("3");
long runTotal = runingFlow+stopFlow; long runTotal = runingFlow+stopFlow;
...@@ -807,7 +807,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -807,7 +807,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//统计固定时间内所有flow表的数据 查询所有待运行的工作流 //统计固定时间内所有flow表的数据 查询所有待运行的工作流
List<Flow> allFlow = flowMapper.findAllByThisDayFlow(statisticsConditionDto); List<Flow> allFlow = flowMapper.findAllByThisDayFlow(statisticsConditionDto);
//统计视力表啊的数据 //统计视力表啊的数据
long notStartFlowCount = statusMap.get("1"); long notStartFlowCount = statusMap.get("1") == null?0:statusMap.get("1");
//统计等待表哦数据 //统计等待表哦数据
List<WaitingRecord> allByCondition = waitingRecordMapper.findAllByCondition(statisticsConditionDto); List<WaitingRecord> allByCondition = waitingRecordMapper.findAllByCondition(statisticsConditionDto);
int waitFlowCount = 0; int waitFlowCount = 0;
...@@ -844,16 +844,16 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -844,16 +844,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StatisticData figFlowStatisticData = new StatisticData(); StatisticData figFlowStatisticData = new StatisticData();
Map<Integer, Long> integerLongMap = flowStatusSnapshoots.stream().collect(Collectors.groupingBy(FlowStatusSnapshoot::getFlowStatus, Collectors.counting())); Map<Integer, Long> integerLongMap = flowStatusSnapshoots.stream().collect(Collectors.groupingBy(FlowStatusSnapshoot::getFlowStatus, Collectors.counting()));
//未运行的 //未运行的
long waitFigFlowCount = integerLongMap.get("1"); long waitFigFlowCount = integerLongMap.get("1") == null?0:integerLongMap.get("1");
//运行中的 暂停的 //运行中的 暂停的
long runFigFlowCount = integerLongMap.get("2"); long runFigFlowCount = integerLongMap.get("2") == null?0:integerLongMap.get("2");
long stopFigFlowCount = integerLongMap.get("3"); long stopFigFlowCount = integerLongMap.get("3") == null?0:integerLongMap.get("3");
long figRunTotal = runFigFlowCount + stopFigFlowCount; long figRunTotal = runFigFlowCount + stopFigFlowCount;
//成功的 //成功的
long successFigFlowCount = integerLongMap.get("4"); long successFigFlowCount = integerLongMap.get("4") == null?0:integerLongMap.get("4");
//失败的 //失败的
long errorFigFlowCount = integerLongMap.get("5"); long errorFigFlowCount = integerLongMap.get("5") == null?0:integerLongMap.get("5");
long killFigFlowCount = integerLongMap.get("6"); long killFigFlowCount = integerLongMap.get("6") == null?0:integerLongMap.get("6");
long figErrorTotal = errorFigFlowCount + killFigFlowCount; long figErrorTotal = errorFigFlowCount + killFigFlowCount;
figFlowStatisticData.setUnstart((int)waitFigFlowCount); figFlowStatisticData.setUnstart((int)waitFigFlowCount);
figFlowStatisticData.setFail((int)figErrorTotal); figFlowStatisticData.setFail((int)figErrorTotal);
...@@ -909,16 +909,16 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -909,16 +909,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StatisticData statisticData = new StatisticData(); StatisticData statisticData = new StatisticData();
Map<String, Long> stringLongMap = logWithBLOBs.stream().collect(Collectors.groupingBy(JobTaskRunLogWithBLOBs::getRunCode, Collectors.counting())); Map<String, Long> stringLongMap = logWithBLOBs.stream().collect(Collectors.groupingBy(JobTaskRunLogWithBLOBs::getRunCode, Collectors.counting()));
//成功的 //成功的
long successCount = stringLongMap.get("1"); long successCount = stringLongMap.get("1") == null?0:stringLongMap.get("1");
long reSuccessCount = stringLongMap.get("3"); long reSuccessCount = stringLongMap.get("3") == null?0:stringLongMap.get("3");
long successTotal = successCount + reSuccessCount; long successTotal = successCount + reSuccessCount;
//执行中的 //执行中的
long runIngCount = stringLongMap.get("0"); long runIngCount = stringLongMap.get("0") == null?0:stringLongMap.get("0");
//失败的 //失败的
long errorCount = stringLongMap.get("2"); long errorCount = stringLongMap.get("2") == null?0:stringLongMap.get("2");
long reErorCount = stringLongMap.get("4"); long reErorCount = stringLongMap.get("4") == null?0:stringLongMap.get("4");
long killCount = stringLongMap.get("5"); long killCount = stringLongMap.get("5") == null?0:stringLongMap.get("5");
long upErrorCount = stringLongMap.get("6"); long upErrorCount = stringLongMap.get("6") == null?0:stringLongMap.get("6");
long errorTotal = errorCount + reErorCount + upErrorCount + killCount; long errorTotal = errorCount + reErorCount + upErrorCount + killCount;
//待运行的 //待运行的
long waitTotal = total - (successTotal + runIngCount + errorTotal); long waitTotal = total - (successTotal + runIngCount + errorTotal);
......
...@@ -269,21 +269,21 @@ public class JobSnapshotThreadRunHelper extends BaseThreadRunHelper { ...@@ -269,21 +269,21 @@ public class JobSnapshotThreadRunHelper extends BaseThreadRunHelper {
List<JobTaskRunLogWithBLOBs> jobTaskRunLogWithBLOBs = logService.findJobTaskRunLogWithBLOBsByFlowIdAndRunId(runRecording.getFlowId(), runRecording.getRunId()); List<JobTaskRunLogWithBLOBs> jobTaskRunLogWithBLOBs = logService.findJobTaskRunLogWithBLOBsByFlowIdAndRunId(runRecording.getFlowId(), runRecording.getRunId());
Map<String, Long> longMap = jobTaskRunLogWithBLOBs.stream().collect(Collectors.groupingBy(JobTaskRunLogWithBLOBs::getRunCode, Collectors.counting())); Map<String, Long> longMap = jobTaskRunLogWithBLOBs.stream().collect(Collectors.groupingBy(JobTaskRunLogWithBLOBs::getRunCode, Collectors.counting()));
//成功的统计 //成功的统计
long successCount = longMap.get(NodeRunStatusPropertyEnum.RUN_SUCCESS.getCode()); long successCount = longMap.get(NodeRunStatusPropertyEnum.RUN_SUCCESS.getCode()) == null ? 0:longMap.get(NodeRunStatusPropertyEnum.RUN_SUCCESS.getCode());
long reSuccessCount = longMap.get(NodeRunStatusPropertyEnum.RE_RUN_SUCCESS.getCode()); long reSuccessCount = longMap.get(NodeRunStatusPropertyEnum.RE_RUN_SUCCESS.getCode()) == null ?0 : longMap.get(NodeRunStatusPropertyEnum.RE_RUN_SUCCESS.getCode());
long successTotilCount = successCount + reSuccessCount; long successTotilCount = successCount + reSuccessCount;
flowStatusSnapshoot.setSuccessNode((int)successTotilCount); flowStatusSnapshoot.setSuccessNode((int)successTotilCount);
//失败的统计 //失败的统计
long erroeCount = longMap.get(NodeRunStatusPropertyEnum.RUN_FAILURE.getCode()); long erroeCount = longMap.get(NodeRunStatusPropertyEnum.RUN_FAILURE.getCode()) == null ? 0 : longMap.get(NodeRunStatusPropertyEnum.RUN_FAILURE.getCode());
long reErroeCount = longMap.get(NodeRunStatusPropertyEnum.RE_RUN_FAILURE.getCode()); long reErroeCount = longMap.get(NodeRunStatusPropertyEnum.RE_RUN_FAILURE.getCode()) == null ?0 : longMap.get(NodeRunStatusPropertyEnum.RE_RUN_FAILURE.getCode());
long upNodeErroeCount = longMap.get(NodeRunStatusPropertyEnum.PARENT_NODE_FAILED.getCode()); long upNodeErroeCount = longMap.get(NodeRunStatusPropertyEnum.PARENT_NODE_FAILED.getCode()) == null ? 0 : longMap.get(NodeRunStatusPropertyEnum.PARENT_NODE_FAILED.getCode());
long errorTotilCount = erroeCount + reErroeCount + upNodeErroeCount; long errorTotilCount = erroeCount + reErroeCount + upNodeErroeCount;
flowStatusSnapshoot.setFailNode((int)errorTotilCount); flowStatusSnapshoot.setFailNode((int)errorTotilCount);
//kill的统计 //kill的统计
long killCount = longMap.get(NodeRunStatusPropertyEnum.KILL.getCode()); long killCount = longMap.get(NodeRunStatusPropertyEnum.KILL.getCode()) == null ? 0 : longMap.get(NodeRunStatusPropertyEnum.KILL.getCode());
flowStatusSnapshoot.setKillNode((int)killCount); flowStatusSnapshoot.setKillNode((int)killCount);
//运行中的统计 //运行中的统计
long runIng = longMap.get(NodeRunStatusPropertyEnum.RUN_ING.getCode()); long runIng = longMap.get(NodeRunStatusPropertyEnum.RUN_ING.getCode()) == null ? 0 : longMap.get(NodeRunStatusPropertyEnum.RUN_ING.getCode());
flowStatusSnapshoot.setRuningNode((int)runIng); flowStatusSnapshoot.setRuningNode((int)runIng);
//未运行的统计 //未运行的统计
Integer totalNodeCount = runRecording.getFlowNodeCount(); Integer totalNodeCount = runRecording.getFlowNodeCount();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment