LAC 调度模式完成

yun-zuoyi
汪云昊 6 years ago
parent 86a18d730a
commit 50bf9300ba

@ -9,11 +9,12 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;
/**
* @Description :
@ -92,4 +93,8 @@ public class LacCommandStackRecord extends BaseBean {
@ApiParam(value ="执行说明")
private String executionDescription;
@Transient
@ApiParam(value ="步骤列表")
private List<LacCommandStackStep> stepList;
}

@ -102,7 +102,6 @@ public class LacCommandStackStepTask extends BaseBean {
@Column(name="IS_CRUX")
@ApiParam(value ="是否关键")
private Integer isCrux;
@Transient
@ApiParam(value ="适配任务")
private LacSuitTask lacSuitTask;

@ -73,6 +73,10 @@ public class LacSuitTask extends BaseBean {
@ApiParam(value ="超时时间")
private Integer taskTimeout;
public int getTaskTimeoutVal(){
return taskTimeout == null ? -1 : taskTimeout.intValue();
}
@Column(name="TASK_RETRY_NUM")
@ApiParam(value ="重试次数")
private Integer taskRetryNum;
@ -120,6 +124,10 @@ public class LacSuitTask extends BaseBean {
private LacSuitCase lacSuitCase;
@Transient
@ApiParam(value ="任务实例id")
private Long taskInstanceId;
@Transient
@ApiParam(value ="适配参数")
private List<LacSuitTaskParam> lacSuitTaskParamList;

@ -1,8 +1,11 @@
package cn.estsh.i3plus.pojo.model.lac;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackRecord;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackTemplate;
import cn.estsh.i3plus.pojo.lac.bean.LacSuitTask;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@ -22,12 +25,6 @@ public class LacCommandStackModel {
private Long recordId;
/**
*
*/
@Deprecated
private LacCommandStackTemplate commandStackTemplate;
/**
*
*/
private LacCommandStackRecord commandStackRecord;
@ -47,13 +44,50 @@ public class LacCommandStackModel {
* key :
* value
*/
private Map<Long, Object> orginMessage = new ConcurrentHashMap<>();
private Map<Long, Object> orginMessageMap = new ConcurrentHashMap<>();
/**
*
* key :
* value
*/
private Map<Long, String> transMessage = new ConcurrentHashMap<>();
private Map<Long, Object> transMessageMap = new ConcurrentHashMap<>();
/**
*
*/
private Exception exception;
public void setException(Exception exception){
LoggerFactory.getLogger("YYYY").error("异常信息:{}",exception);
this.exception = exception;
}
public void setCommandStackRecord(LacCommandStackRecord commandStackRecord){
this.commandStackRecord = commandStackRecord;
this.recordId = commandStackRecord.getId();
}
public List<TaskParam> getTaskRequestParam(String taskCode){
for (Task task : this.getRequest().getTaskList()) {
if(task.getCode().equals(taskCode)){
return task.getParamList();
}
}
return null;
}
public void putOrginMessage(LacSuitTask lacSuitTask,Object orginMessage){
if(lacSuitTask == null || lacSuitTask.getTaskInstanceId() ==null){
return;
}
this.orginMessageMap.put(lacSuitTask.getTaskInstanceId(), orginMessage == null ? StringUtils.EMPTY : orginMessage);
}
public void putTransMessage(LacSuitTask lacSuitTask,Object transMessage){
if(lacSuitTask == null || lacSuitTask.getTaskInstanceId() ==null){
return;
}
this.transMessageMap.put(lacSuitTask.getTaskInstanceId(), transMessage == null ? StringUtils.EMPTY : transMessage);
}
}

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.model.lac;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;
@ -34,4 +35,10 @@ public class LacSuitResponse {
*/
private Object result;
public LacSuitResponse(){
this.success = true;
this.code = ResourceEnumUtil.MESSAGE.SUCCESS.getCode();
this.message = ResourceEnumUtil.MESSAGE.SUCCESS.getDescription();
}
}

Loading…
Cancel
Save