对象历史记录 Pojo 创建

yun-zuoyi
wei.peng 5 years ago
parent c8197f3290
commit 3aa1afb0ce

@ -1964,6 +1964,50 @@ public class CommonEnumUtil {
}
}
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DAO_OPERATE_TYPE {
INSERT(1, "新增"),
DELETE(2, "删除"),
UPDATE(3, "修改"),
SELECT(4, "查询");
private int value;
private String description;
private DAO_OPERATE_TYPE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOf(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 int descOf(String desc) {
int tmp = 1;
for (int i = 0; i < values().length; i++) {
if (values()[i].description.equals(desc)) {
tmp = values()[i].value;
}
}
return tmp;
}
}
/**
* actuator env
*/

@ -18,6 +18,7 @@ import java.io.Serializable;
@Data
public class ClassFieldModel implements Serializable {
private static final long serialVersionUID = -8873901724079105728L;
@ApiParam(value ="包名")
private String packageName;

@ -21,6 +21,7 @@ import java.util.List;
@Data
public class ClassModel implements Serializable {
private static final long serialVersionUID = -8024274383480419754L;
@ApiParam(value ="服务ID")
private int serverId;

@ -3,8 +3,11 @@ package cn.estsh.i3plus.pojo.model.license;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import java.io.Serializable;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Objects;
@ -19,6 +22,8 @@ import java.util.Objects;
public class ImppLicense implements Serializable {
private static final long serialVersionUID = 2365830603839063328L;
private static final String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
/**
*
*
@ -47,9 +52,9 @@ public class ImppLicense implements Serializable {
/* 授权信息 */
@ApiParam(value ="授权开始时间")
private Date licenseStartDateTime; // 授权开始时间
private String licenseStartDateTime; // 授权开始时间
@ApiParam(value ="授权结束时间")
private Date licenseEndDateTime; // 授权结束时间
private String licenseEndDateTime; // 授权结束时间
@ApiParam(value ="授权组织数量")
private Integer licenseMaxOrganize; // 授权组织数量
@ApiParam(value ="授权仓库数量")
@ -81,23 +86,31 @@ public class ImppLicense implements Serializable {
/* 授权锁信息(软锁,usb锁) */
@ApiParam(value ="授权使用开始时间")
private Date lockStartTime;
private String lockStartTime;
@ApiParam(value ="授权使用结束时间")
private Date lockEndTime;
private String lockEndTime;
@ApiParam(value ="锁类型")
private String lockType;
/* 基础业务逻辑 */
@ApiParam(value ="到期时间")
private Date maturityDateTime;
private String maturityDateTime;
public String getMaturityDateTime() {
if(StringUtils.isBlank(maturityDateTime)){
return StringUtils.isNotBlank(lockEndTime) ? lockEndTime : licenseEndDateTime;
}
return maturityDateTime;
}
public void setSenseshield(ImppLicenseSenseshield senseshield) {
if(Objects.nonNull(senseshield)){
try {
this.lockStartTime = new Date(senseshield.getLast_update_timestamp() * 1000L);
this.lockEndTime = new Date((senseshield.getLast_update_timestamp() + senseshield.getSpan_time()) * 1000L);
Date lockEndTime = new Date((senseshield.getLast_update_timestamp() + senseshield.getSpan_time()) * 1000L);
Date licenseEndDateTime = new Date(this.licenseEndDateTime);
this.lockType = senseshield.getType();
this.maturityDateTime = lockEndTime.getTime() > licenseEndDateTime.getTime() ? licenseEndDateTime: lockEndTime;
this.maturityDateTime = DateFormatUtils.format(lockEndTime.getTime() > licenseEndDateTime.getTime() ? licenseEndDateTime: lockEndTime,TIME_FORMAT);
}catch (Exception e){
}
}

@ -0,0 +1,82 @@
package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
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.*;
/**
* @Description :
* @Reference :
* @Author : wei.peng
* @CreateDate : 20-4-20 9:46
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_POJO_VERSION")
@Api(value="对象历史")
public class SysPojoVersion extends BaseBean {
private static final long serialVersionUID = -2456588444446248239L;
@Column(name="SOFT_TYPE")
@ApiParam(value ="产品类型")
private Integer softType;
public String getSoftTypeTxt() {
return softType == null ? null : CommonEnumUtil.SOFT_TYPE.valueOfDescription(softType);
}
@Column(name="REF_ID")
@ApiParam(value ="对象id" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long refId;
@Column(name="REF_CLASS")
@ApiParam(value ="记录对象")
private String refClass;
@Column(name="VERSION_NO")
@ApiParam(value ="记录对象版本号")
private Integer versionNo = 0;
@Column(name="operateType")
@ApiParam(value ="操作类型")
private Integer operateType;
public String getOperateTypeTxt() {
return operateType == null ? null : CommonEnumUtil.DAO_OPERATE_TYPE.valueOf(operateType);
}
@Column(name="VERSION_METHOD_NAME")
@ApiParam(value ="操作方法名称")
private String versionMethodName;
@Column(name="POJO_DETAIL_ID")
@ApiParam(value ="对象明细id" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long pojoDetailId;
@Lob
@Column(name="POJO_COMPARE")
@ApiParam(value ="记录对象对比差异")
private String pojoCompare;
@Transient
@ApiParam(value ="用户部门信息")
private SysPojoVersionDetail versionDetail;
}

@ -0,0 +1,56 @@
package cn.estsh.i3plus.pojo.platform.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.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.Lob;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : wei.peng
* @CreateDate : 20-4-20 9:46
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_POJO_VERSION_DETAIL")
@Api(value="对象历史")
public class SysPojoVersionDetail extends BaseBean {
private static final long serialVersionUID = -2456588444446248239L;
@Column(name="POJO_VERSION_ID")
@ApiParam(value ="对象id" ,example = "-1")
@JsonSerialize(using = ToStringSerializer.class)
private Long pojoVersionId;
@Lob
@Column(name="POJO_BEFORE",length = 5000)
@ApiParam(value ="原始对象信息")
private String pojoBefore;
@Lob
@Column(name="POJO_AFTER",length = 5000)
@ApiParam(value ="修改之后对象信息")
private String pojoAfter;
@Lob
@Column(name="POJO_COMPARE",length = 5000)
@ApiParam(value ="记录对象对比差异")
private String pojoCompare;
}

@ -0,0 +1,56 @@
package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
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 : wei.peng
* @CreateDate : 20-4-20 9:46
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="SYS_POJO_VERSION_PLAN")
@Api(value="对象历史")
public class SysPojoVersionPlan extends BaseBean {
private static final long serialVersionUID = -1120504360281638917L;
@Column(name="SOFT_TYPE")
@ApiParam(value ="产品类型")
private Integer softType;
public String getSoftTypeTxt() {
return softType == null ? null : CommonEnumUtil.SOFT_TYPE.valueOfDescription(softType);
}
@Column(name="REF_CLASS")
@ApiParam(value ="记录对象")
private String refClass;
@Column(name="REF_CLASS_TITLE")
@ApiParam(value ="记录对象名称")
private String refClassTitle;
@Column(name="PLAN_STATUS")
@ApiParam(value ="记录对象状态")
private Integer planStatus;
@Column(name="PLAN_DESCRIPTION")
@ApiParam(value ="记录对象描述")
private String planDescription;
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.platform.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.platform.bean.SysPojoVersionDetail;
/**
* @Description :
* @Reference :
* @Author : wei.peng
* @Date : 2020-04-21 14:19:34
* @Modify :
**/
public interface SysPojoVersionDetailRepository extends BaseRepository<SysPojoVersionDetail, Long> {
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.platform.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.platform.bean.SysPojoVersionPlan;
/**
* @Description :
* @Reference :
* @Author : wei.peng
* @Date : 2020-04-21 14:19:34
* @Modify :
**/
public interface SysPojoVersionPlanRepository extends BaseRepository<SysPojoVersionPlan, Long> {
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.platform.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.platform.bean.SysPojoVersion;
/**
* @Description :
* @Reference :
* @Author : wei.peng
* @Date : 2020-04-21 14:19:34
* @Modify :
**/
public interface SysPojoVersionRepository extends BaseRepository<SysPojoVersion, Long> {
}
Loading…
Cancel
Save