lac线程超时监控优化

Session超时时间参数化
lac添加TaskCheck
日志添加索引
yun-zuoyi
汪云昊 5 years ago
parent bc5beeba7d
commit 47fb080742

@ -8,6 +8,8 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.mongodb.core.index.IndexDirection;
import org.springframework.data.mongodb.core.index.Indexed;
import javax.persistence.*;
import java.io.Serializable;
@ -78,6 +80,7 @@ public abstract class BaseBean implements Serializable {
@AnnoOutputColumn(hidden = true)
public String createUser;
@Indexed(direction = IndexDirection.DESCENDING)
@Column(name="CREATE_DATE_TIME",updatable = false)
@ApiParam(value = "创建日期")
public String createDatetime;

@ -221,8 +221,9 @@ public class LacEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PARAM_VALUE_TYPE{
NUMBER(1,"数字"),
STRING(2,"字符串");
INTEGER(1,"整数"),
STRING(2,"字符串"),
FLOAT(3,"浮点");
private int value;
private String description;
@ -341,4 +342,116 @@ public class LacEnumUtil {
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum LOGICAL_OPERATOR{
OR(10,"或"),
AND(20,"与");
private int value;
private String description;
LOGICAL_OPERATOR(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;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum RELATIONAL_OPERATOR{
GT(10,">"),
LT(20,"<"),
EQ(20,"=="),
NE(20,"!="),
GE(20,">="),
LE(20,"<=");
private int value;
private String description;
RELATIONAL_OPERATOR(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;
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum TASK_CHECK_TYPE{
MASTER(10,"主"),
SLAVE(20,"从");
private int value;
private String description;
TASK_CHECK_TYPE(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;
}
}
}

@ -0,0 +1,100 @@
package cn.estsh.i3plus.pojo.lac.bean;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.LacEnumUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
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;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @CreateDate : 2019-12-09 14:47
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="LAC_TASK_CHECK")
@Api(value="任务检查",description = "任务检查")
public class LacTaskCheck extends BaseBean {
@Column(name="COMMAND_STACK_TEMPLATE_ID")
@ApiParam(value ="指令集模板ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long commandStackTemplateId;
@Column(name="STEP_ID")
@ApiParam(value ="步骤ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long stepId;
@Column(name="STEP_TASK_ID")
@ApiParam(value ="步骤ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long stepTaskId;
@Column(name="TASK_ID")
@ApiParam(value ="任务ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long taskId;
@Column(name="TASK_NAME_RDD")
@ApiParam(value ="任务名称")
private String taskNameRdd;
@Column(name="TASK_CHECK_TYPE")
@ApiParam(value ="任务检查类型")
@AnnoOutputColumn(refClass = LacEnumUtil.TASK_CHECK_TYPE.class)
private Integer taskCheckType;
@Column(name="TASK_CHECK_GROUP")
@ApiParam(value ="任务检查组")
private String taskCheckGroup;
@Column(name="PARAM_ID")
@ApiParam(value ="参数id")
@JsonSerialize(using = ToStringSerializer.class)
private Long paramId;
@Column(name="PARAM_NAME_RDD")
@ApiParam(value ="任务名称")
private String paramNameRdd;
@Column(name="PARAM_VALUE_TYPE")
@ApiParam(value ="参数值类型")
@AnnoOutputColumn(refClass = LacEnumUtil.PARAM_VALUE_TYPE.class)
private Integer paramValueType;
@Column(name="RELATIONAL_OPERATOR")
@ApiParam(value ="关系运算符")
@AnnoOutputColumn(refClass = LacEnumUtil.RELATIONAL_OPERATOR.class)
private Integer relationalOperator;
@Column(name="LOGICAL_OPERATOR")
@ApiParam(value ="逻辑运算符")
@AnnoOutputColumn(refClass = LacEnumUtil.LOGICAL_OPERATOR.class)
private Integer logicalOperator;
@Column(name="CHECK_VALUE")
@ApiParam(value ="检查值")
private String checkValue;
@Column(name="TARGET_STEP_ID")
@ApiParam(value ="目标步骤ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long targetStepId;
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.lac.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.lac.bean.LacTaskCheck;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @CreateDate : 2019-12-10 15:10
* @Modify:
**/
public interface LacTaskCheckRepository extends BaseRepository<LacTaskCheck, Long> {
}

@ -4,17 +4,8 @@ import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.LacEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackRecord;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackStep;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackStepTask;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackTemplate;
import cn.estsh.i3plus.pojo.lac.bean.LacCommandStackType;
import cn.estsh.i3plus.pojo.lac.bean.LacLogTask;
import cn.estsh.i3plus.pojo.lac.bean.LacLogTaskDetail;
import cn.estsh.i3plus.pojo.lac.bean.LacSuitTask;
import cn.estsh.i3plus.pojo.lac.bean.LacSuitTaskParam;
import cn.estsh.i3plus.pojo.lac.bean.LacSuitTaskParamAdapter;
import cn.estsh.i3plus.pojo.lac.bean.LacTaskType;
import cn.estsh.i3plus.pojo.lac.bean.*;
import java.util.List;
/**
@ -187,4 +178,10 @@ public class LacHqlPack {
DdlPreparedPack.getNumberSmallerPack(LacEnumUtil.STACK_STATUS.FINISH.getValue(), "stackStatus", ddlPackBean);
return ddlPackBean;
}
public static DdlPackBean packHqlCheckLacTaskCheckMasterOnly(LacTaskCheck lacTaskCheck){
DdlPackBean ddlPackBean = DdlPackBean.getDdlPackBean(lacTaskCheck);
DdlPreparedPack.getStringEqualPack(lacTaskCheck.getTaskCheckGroup(),"taskCheckGroup",ddlPackBean);
return ddlPackBean;
}
}

@ -9,10 +9,10 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.mongodb.core.index.Indexed;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
/**
@ -27,16 +27,12 @@ import javax.persistence.Table;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_LOG_EXCEPTION",
indexes = {
@Index(columnList = "CREATE_DATE_TIME DESC", name = "LOG_INDEX_CREATE_DATE_TIME"),
@Index(columnList = "EXC_MODULE_ID DESC", name = "LOG_INDEX_EXC_MODULE_ID")
}
)
@Table(name="SYS_LOG_EXCEPTION")
@Api(value="系统异常表",description = "记录系统出现的异常")
public class SysLogException extends BaseBean {
//CommonEnumUtil.SOFT_TYPE
@Indexed
@Column(name="EXC_MODULE_ID")
@ApiParam(value ="系统模块(枚举)", example = "1")
@AnnoOutputColumn(refClass = CommonEnumUtil.SOFT_TYPE.class,refForeignKey = "value",value = "description")

@ -12,10 +12,10 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.mongodb.core.index.Indexed;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
/**
@ -30,16 +30,11 @@ import javax.persistence.Table;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_LOG_OPERATE",
indexes = {
@Index(columnList = "CREATE_DATE_TIME DESC", name = "LOG_INDEX_CREATE_DATE_TIME"),
@Index(columnList = "OPERATE_MODULE DESC", name = "LOG_INDEX_OPERATE_MODULE"),
@Index(columnList = "OPERATE_TYPE DESC", name = "LOG_INDEX_OPERATE_TYPE")
})
@Table(name="SYS_LOG_OPERATE")
@Api(value="操作日志表",description = "操作日志表")
public class SysLogOperate extends BaseBean {
//CommonEnumUtil.SOFT_TYPE
@Indexed
@Column(name="OPERATE_MODULE")
@ApiParam(value ="系统模块(枚举)", example = "1")
@AnnoOutputColumn(refClass = CommonEnumUtil.SOFT_TYPE.class,refForeignKey = "value",value = "description")
@ -53,7 +48,7 @@ public class SysLogOperate extends BaseBean {
return operateModuleName;
}
//ImppEnumUtil.OPERATE_TYPE枚举
@Indexed
@Column(name="OPERATE_TYPE")
@ApiParam(value ="操作类型" , example = "-1")
@AnnoOutputColumn(refClass = ImppEnumUtil.OPERATE_TYPE.class,refForeignKey = "value",value = "description")

@ -12,10 +12,10 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.mongodb.core.index.Indexed;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
/**
@ -30,24 +30,19 @@ import javax.persistence.Table;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_LOG_SYSTEM",
indexes = {
@Index(columnList = "CREATE_DATE_TIME", name = "LOG_INDEX_CREATE_DATE_TIME"),
@Index(columnList = "LOG_LEVEL", name = "LOG_INDEX_LOG_LEVEL"),
@Index(columnList = "LOG_MODULE_ID", name = "LOG_INDEX_LOG_MODULE_ID")
})
@Table(name="SYS_LOG_SYSTEM")
@Api(value="系统日志表",description = "系统日志表")
public class SysLogSystem extends BaseBean {
@Indexed
@Column(name="LOG_LEVEL")
@ApiParam(value ="日志级别" , example ="1")
//ImppEnumUtil.LOG_LEVEL
@AnnoOutputColumn(refClass = ImppEnumUtil.LOG_LEVEL.class,refForeignKey = "value",value = "name")
private Integer logLevel;
@Indexed
@Column(name="LOG_MODULE_ID")
@ApiParam(value ="系统模块(枚举)", example = "1")
//CommonEnumUtil.SOFT_TYPE
@AnnoOutputColumn(refClass = CommonEnumUtil.SOFT_TYPE.class,refForeignKey = "value",value = "description")
private Integer logModuleId;

@ -11,9 +11,10 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.mongodb.core.index.Indexed;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
/**
@ -28,12 +29,7 @@ import javax.persistence.Table;
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_LOG_TASK_TIME",
indexes = {
@Index(columnList = "CREATE_DATE_TIME", name = "LOG_INDEX_CREATE_DATE_TIME"),
@Index(columnList = "NAME DESC", name = "LOG_INDEX_LOG_NAME"),
@Index(columnList = "GROUP_NAME DESC", name = "LOG_INDEX_LOG_GROUP_NAME")
})
@Table(name="SYS_LOG_TASK_TIME")
@Api(value="定时任务执行日志",description = "定时任务执行记录")
public class SysLogTaskTime extends BaseBean {
@ -79,6 +75,7 @@ public class SysLogTaskTime extends BaseBean {
@ApiParam(value ="任务周期表达式")
private String taskCycleExpsRdd;
@Indexed
@Column(name="EXECUTE_TIME")
@ApiParam(value ="执行耗时")
@JsonSerialize(using = ToStringSerializer.class)

@ -26,10 +26,10 @@ import java.util.List;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SUIT_DATA_DETAIL",indexes = {
@Index(name="index_suit_record_id",columnList = "SUIT_RECORD_ID"),
@Index(name="index_suit_case_name_rdd",columnList = "SUIT_CASE_NAME_RDD"),
@Index(name="index_suit_case_code",columnList = "SUIT_CASE_CODE"),
@Index(name="index_create_date_time",columnList = "CREATE_DATE_TIME")
@Index(name="bs_suit_data_detail_suit_record_id_idx",columnList = "SUIT_RECORD_ID"),
@Index(name="bs_suit_data_detail_suit_case_name_rdd_idx",columnList = "SUIT_CASE_NAME_RDD"),
@Index(name="bs_suit_data_detail_suit_case_code_idx",columnList = "SUIT_CASE_CODE_RDD"),
@Index(name="bs_suit_data_detail_create_date_time_idx",columnList = "CREATE_DATE_TIME")
})
@Api(value = "适配报文详情", description = "适配报文详情")
public class BsSuitDataDetail extends BaseBean {

@ -26,10 +26,10 @@ import java.util.List;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SUIT_RECORD",indexes = {
@Index(name="index_suit_case_name_rdd",columnList = "SUIT_CASE_NAME_RDD"),
@Index(name="index_suit_case_code",columnList = "SUIT_CASE_CODE"),
@Index(name="index_create_date_time",columnList = "CREATE_DATE_TIME"),
@Index(name="index_process_time",columnList = "PROCESS_TIME"),
@Index(name="bs_suit_record_suit_case_name_rdd_idx",columnList = "SUIT_CASE_NAME_RDD"),
@Index(name="bs_suit_record_suit_case_code_idx",columnList = "SUIT_CASE_CODE"),
@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 = "适配记录")
public class BsSuitRecord extends BaseBean {

@ -25,7 +25,7 @@ import javax.persistence.Table;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "SUIT_RECORD_PARAM",indexes = {
@Index(name="index_suit_record_id",columnList = "SUIT_RECORD_ID"),
@Index(name="suit_record_param_suit_record_id_idx",columnList = "SUIT_RECORD_ID"),
})
@Api(value = "适配记录参数", description = "适配记录参数")
public class BsSuitRecordParam extends BaseBean {

@ -25,7 +25,7 @@ import javax.persistence.*;
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SUIT_REQUEST_RECORD",indexes = {
@Index(name="index_suit_record_id",columnList = "SUIT_RECORD_ID"),
@Index(name="bs_suit_request_record_suit_record_id_idx",columnList = "SUIT_RECORD_ID"),
})
@Api(value = "请求适配记录", description = "请求适配记录")
public class BsSuitRequestRecord extends BaseBean {

Loading…
Cancel
Save