Commit c82e7947 by guo_minglei@163.com

修改统计方法

parent 400b9793
...@@ -6,6 +6,7 @@ import com.byit.mapper.*; ...@@ -6,6 +6,7 @@ import com.byit.mapper.*;
import com.byit.model.*; import com.byit.model.*;
import com.byit.thread.BaseThreadRunHelper; import com.byit.thread.BaseThreadRunHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -94,7 +95,10 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper { ...@@ -94,7 +95,10 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
FlowStatusSnapshoot hourFlowStatusSnapshoot = new FlowStatusSnapshoot(); FlowStatusSnapshoot hourFlowStatusSnapshoot = new FlowStatusSnapshoot();
BeanUtils.copyProperties(flowStatusSnapshoot, hourFlowStatusSnapshoot); BeanUtils.copyProperties(flowStatusSnapshoot, hourFlowStatusSnapshoot);
//判断运行状态 //判断运行状态
if (runRecording.getFlowStatus().equals("1") || runRecording.getFlowStatus().equals("2") || runRecording.getFlowStatus().equals("3")){ if(StringUtils.isEmpty(runRecording.getFlowStatus())){
//如果为空设置为未运行
hourFlowStatusSnapshoot.setFlowStatus(1);
}else if (runRecording.getFlowStatus().equals("1") || runRecording.getFlowStatus().equals("2") || runRecording.getFlowStatus().equals("3")){
hourFlowStatusSnapshoot.setFlowStatus(Integer.valueOf(runRecording.getFlowStatus())); hourFlowStatusSnapshoot.setFlowStatus(Integer.valueOf(runRecording.getFlowStatus()));
}else if (runRecording.getFlowStatus().equals("4")){ }else if (runRecording.getFlowStatus().equals("4")){
switch (runRecording.getFlowRunResult()){ switch (runRecording.getFlowRunResult()){
...@@ -140,6 +144,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper { ...@@ -140,6 +144,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
flowStatusSnapshootList.addAll(preHourFlowStatusSnapshootList); flowStatusSnapshootList.addAll(preHourFlowStatusSnapshootList);
}else { }else {
//如果上个小时也没有,就设置为未运行 //如果上个小时也没有,就设置为未运行
flowStatusSnapshoot.setFlowStatus(1);
flowStatusSnapshoot.setUnstartNode(flow.getFlowNodeCount()); flowStatusSnapshoot.setUnstartNode(flow.getFlowNodeCount());
flowStatusSnapshootList.add(flowStatusSnapshoot); flowStatusSnapshootList.add(flowStatusSnapshoot);
} }
...@@ -147,6 +152,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper { ...@@ -147,6 +152,7 @@ public class StatusSnapshootThreadRunHelper extends BaseThreadRunHelper {
} }
}else { }else {
//如果不存在运行实例 //如果不存在运行实例
flowStatusSnapshoot.setFlowStatus(1);
flowStatusSnapshoot.setUnstartNode(flow.getFlowNodeCount()); flowStatusSnapshoot.setUnstartNode(flow.getFlowNodeCount());
flowStatusSnapshootList.add(flowStatusSnapshoot); flowStatusSnapshootList.add(flowStatusSnapshoot);
} }
......
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