feat(softswitch):重试功能

yun-zuoyi
汪云昊 5 years ago
parent a9520cecf7
commit f1ab018d85

@ -228,7 +228,7 @@ public class BlockSoftSwitchEnumUtil {
SCHEDULE(2,"定时调度"),
RABBITMQ(3,"MQ 调用"),
HTTP(4,"接口调用"),
CLOUD(5,"Cloud调用"),
CLOUD(5,"微服务调用"),
REST(6,"REST调用"),
WEB_SERVICE(7,"WebService"),
SOCKET(8,"socket"),
@ -1161,4 +1161,49 @@ public class BlockSoftSwitchEnumUtil {
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BS_SUIT_RETRY_STATUS {
NOT_RETRY(10, "未重试"),
RETRY(20, "已重试");
private int value;
private String description;
private BS_SUIT_RETRY_STATUS (int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
public static BS_SUIT_RETRY_STATUS valueOf(int val) {
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
return values()[i];
}
}
return null;
}
}
}

@ -3,12 +3,13 @@ package cn.estsh.i3plus.pojo.softswitch.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
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.Table;
@ -26,7 +27,7 @@ import javax.persistence.Table;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SUIT_FILE")
@Api(value = "适配文件信息", description = "适配文件信息")
@ApiModel(value = "适配文件信息", description = "适配文件信息")
public class BsSuitFile extends BaseBean {
private static final long serialVersionUID = -5476684791619434327L;

@ -5,10 +5,11 @@ import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.BlockSoftSwitchEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
@ -34,7 +35,7 @@ import java.util.Map;
@Index(name="bs_suit_record_create_date_time_idx",columnList = "CREATE_DATE_TIME"),
@Index(name="bs_suit_record_process_time_idx",columnList = "PROCESS_TIME"),
})
@Api(value = "适配记录", description = "适配记录")
@ApiModel(value = "适配记录", description = "适配记录")
public class BsSuitRecord extends BaseBean {
private static final long serialVersionUID = 174969165955420968L;
@ -157,6 +158,26 @@ public class BsSuitRecord extends BaseBean {
@ApiParam(value = "处理结果")
private String processResult;
@ColumnDefault(value = "10")
@Column(name = "RETRY_STATUS")
@ApiParam(value = "重试状态")
@AnnoOutputColumn(refClass = BlockSoftSwitchEnumUtil.BS_SUIT_RETRY_STATUS.class)
private Integer retryStatus;
public String getRetryStatusTxt() {
return retryStatus == null ? BlockSoftSwitchEnumUtil.BS_SUIT_RETRY_STATUS.NOT_RETRY.getDescription() :
BlockSoftSwitchEnumUtil.BS_SUIT_RETRY_STATUS.valueOfDescription(retryStatus);
}
@ColumnDefault(value = "0")
@Column(name = "RETRY_NUM")
@ApiParam(value = "重试状态")
private Integer retryNum;
public int getRetryNumVal() {
return retryNum == null ? 0 : retryNum;
}
/************************************** 临时属性 ***************************************/
@Transient

@ -320,7 +320,7 @@ public class SoftSwitchHqlPack {
DdlPreparedPack.getInPackList(bsSuitRecord.getSearchIdList(),"id",ddlPackBean);
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getSuitCaseId(),"suitCaseId",ddlPackBean);
DdlPreparedPack.getStringLikePack(bsSuitRecord.getSuitSid(),"suitSid",ddlPackBean);
DdlPreparedPack.getStringLikerPack(bsSuitRecord.getSuitSid(),"suitSid",ddlPackBean);
DdlPreparedPack.getStringLikerPack(bsSuitRecord.getSuitCaseNameRdd(),"suitCaseNameRdd",ddlPackBean);
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getSuitTypeId(),"suitTypeId",ddlPackBean);
DdlPreparedPack.getStringLikerPack(bsSuitRecord.getSuitCaseCode(),"suitCaseCode",ddlPackBean);
@ -330,9 +330,10 @@ public class SoftSwitchHqlPack {
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getCaseTypeId(),"caseTypeId",ddlPackBean);
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getSuitResult(),"suitResult",ddlPackBean);
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getProcessState(), "processState", ddlPackBean);
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getRequestSource(), "requestSource", ddlPackBean);
DdlPreparedPack.getNumEqualPack(bsSuitRecord.getRetryRecordId(), "retryRecordId", ddlPackBean);
DdlPreparedPack.timeBuilder(bsSuitRecord.getSuitStartTime(), "suitStartTime", ddlPackBean, false, true);
DdlPreparedPack.timeBuilder(bsSuitRecord.getCreateDatetime(), "createDatetime", ddlPackBean, false, true);
ddlPackBean.setOrderByStr(bsSuitRecord.orderBy());
return ddlPackBean;

Loading…
Cancel
Save