Commit 2e82ed53 by huangfusuper

解决空指针异常

parent d9524b48
......@@ -789,17 +789,17 @@ public class ApiFlowServiceImpl implements ApiFlowService {
Map<String, Long> statusMap = betweenRunRecording.stream().collect(Collectors.groupingBy(RunRecording::getFlowStatus, Collectors.counting()));
//成功的
long successCount = resultMap.get("1");
long reSuccessCount = resultMap.get("3");
long successCount = resultMap.get("1") == null?0:resultMap.get("1");
long reSuccessCount = resultMap.get("3") == null?0:resultMap.get("3");
long successTotal = successCount+reSuccessCount;
//失败的
long errorCount = resultMap.get("2");
long reErrorCount = resultMap.get("4");
long killCount = resultMap.get("5");
long errorCount = resultMap.get("2") == null?0:resultMap.get("2");
long reErrorCount = resultMap.get("4") == null?0:resultMap.get("4");
long killCount = resultMap.get("5") == null?0:resultMap.get("5");
long errorTotal = errorCount+reErrorCount +killCount;
//运行中的
long runingFlow = statusMap.get("2");
long stopFlow = statusMap.get("3");
long runingFlow = statusMap.get("2") == null?0:statusMap.get("2");
long stopFlow = statusMap.get("3") == null?0:statusMap.get("3");
long runTotal = runingFlow+stopFlow;
......@@ -807,7 +807,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//统计固定时间内所有flow表的数据 查询所有待运行的工作流
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);
int waitFlowCount = 0;
......@@ -844,16 +844,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StatisticData figFlowStatisticData = new StatisticData();
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 stopFigFlowCount = integerLongMap.get("3");
long runFigFlowCount = integerLongMap.get("2") == null?0:integerLongMap.get("2");
long stopFigFlowCount = integerLongMap.get("3") == null?0:integerLongMap.get("3");
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 killFigFlowCount = integerLongMap.get("6");
long errorFigFlowCount = integerLongMap.get("5") == null?0:integerLongMap.get("5");
long killFigFlowCount = integerLongMap.get("6") == null?0:integerLongMap.get("6");
long figErrorTotal = errorFigFlowCount + killFigFlowCount;
figFlowStatisticData.setUnstart((int)waitFigFlowCount);
figFlowStatisticData.setFail((int)figErrorTotal);
......@@ -909,16 +909,16 @@ public class ApiFlowServiceImpl implements ApiFlowService {
StatisticData statisticData = new StatisticData();
Map<String, Long> stringLongMap = logWithBLOBs.stream().collect(Collectors.groupingBy(JobTaskRunLogWithBLOBs::getRunCode, Collectors.counting()));
//成功的
long successCount = stringLongMap.get("1");
long reSuccessCount = stringLongMap.get("3");
long successCount = stringLongMap.get("1") == null?0:stringLongMap.get("1");
long reSuccessCount = stringLongMap.get("3") == null?0:stringLongMap.get("3");
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 reErorCount = stringLongMap.get("4");
long killCount = stringLongMap.get("5");
long upErrorCount = stringLongMap.get("6");
long errorCount = stringLongMap.get("2") == null?0:stringLongMap.get("2");
long reErorCount = stringLongMap.get("4") == null?0:stringLongMap.get("4");
long killCount = stringLongMap.get("5") == null?0:stringLongMap.get("5");
long upErrorCount = stringLongMap.get("6") == null?0:stringLongMap.get("6");
long errorTotal = errorCount + reErorCount + upErrorCount + killCount;
//待运行的
long waitTotal = total - (successTotal + runIngCount + errorTotal);
......
......@@ -269,21 +269,21 @@ public class JobSnapshotThreadRunHelper extends BaseThreadRunHelper {
List<JobTaskRunLogWithBLOBs> jobTaskRunLogWithBLOBs = logService.findJobTaskRunLogWithBLOBsByFlowIdAndRunId(runRecording.getFlowId(), runRecording.getRunId());
Map<String, Long> longMap = jobTaskRunLogWithBLOBs.stream().collect(Collectors.groupingBy(JobTaskRunLogWithBLOBs::getRunCode, Collectors.counting()));
//成功的统计
long successCount = longMap.get(NodeRunStatusPropertyEnum.RUN_SUCCESS.getCode());
long reSuccessCount = longMap.get(NodeRunStatusPropertyEnum.RE_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()) == null ?0 : longMap.get(NodeRunStatusPropertyEnum.RE_RUN_SUCCESS.getCode());
long successTotilCount = successCount + reSuccessCount;
flowStatusSnapshoot.setSuccessNode((int)successTotilCount);
//失败的统计
long erroeCount = longMap.get(NodeRunStatusPropertyEnum.RUN_FAILURE.getCode());
long reErroeCount = longMap.get(NodeRunStatusPropertyEnum.RE_RUN_FAILURE.getCode());
long upNodeErroeCount = longMap.get(NodeRunStatusPropertyEnum.PARENT_NODE_FAILED.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()) == null ?0 : longMap.get(NodeRunStatusPropertyEnum.RE_RUN_FAILURE.getCode());
long upNodeErroeCount = longMap.get(NodeRunStatusPropertyEnum.PARENT_NODE_FAILED.getCode()) == null ? 0 : longMap.get(NodeRunStatusPropertyEnum.PARENT_NODE_FAILED.getCode());
long errorTotilCount = erroeCount + reErroeCount + upNodeErroeCount;
flowStatusSnapshoot.setFailNode((int)errorTotilCount);
//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);
//运行中的统计
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);
//未运行的统计
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