Commit c82e7947 by guo_minglei@163.com

修改统计方法

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