Merge branch 'ext-dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into ext-dev
commit
3efb1123c8
@ -0,0 +1,99 @@
|
||||
package cn.estsh.i3plus.pojo.mes.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||
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 org.hibernate.type.TimeType;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description :工位程序数据缓存
|
||||
* @Reference :
|
||||
* @Author : wangjie
|
||||
* @CreateDate : 2019-08-30
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Inheritance(strategy = InheritanceType.JOINED)
|
||||
@Table(name = "MES_WORK_CELL_DATA_CACHE", indexes = {
|
||||
@Index(columnList = "KEY_"),
|
||||
@Index(columnList = "KEY_, ITEM_")
|
||||
})
|
||||
@Api("mes工位程序数据缓存表")
|
||||
public class MesWorkCellDataCache extends BaseBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3883501945696764210L;
|
||||
|
||||
@Column(name = "KEY_")
|
||||
@ApiParam("KEY")
|
||||
private String key;
|
||||
|
||||
@Column(name = "ITEM_")
|
||||
@ApiParam("元素")
|
||||
private String item;
|
||||
|
||||
@Lob
|
||||
@Column(name = "VALUE_")
|
||||
@ApiParam("值")
|
||||
private String value;
|
||||
|
||||
@Column(name = "CLAZZ_")
|
||||
@ApiParam("对象CLASS")
|
||||
private String clazz;
|
||||
|
||||
@Column(name = "TIME_")
|
||||
@ApiParam("过期时间")
|
||||
private String time;
|
||||
|
||||
public MesWorkCellDataCache() {}
|
||||
|
||||
public MesWorkCellDataCache(String key, String item, String value, String clazz, String time, String organizeCode, String modifyDatetime) {
|
||||
this.key = key;
|
||||
this.item = item;
|
||||
this.value = value;
|
||||
this.clazz = clazz;
|
||||
this.time = time;
|
||||
super.organizeCode = organizeCode;
|
||||
super.createDatetime = modifyDatetime;
|
||||
super.modifyDatetime = modifyDatetime;
|
||||
}
|
||||
|
||||
public void override(String value, String clazz, String time, String organizeCode, String modifyDatetime) {
|
||||
this.value = value;
|
||||
this.clazz = clazz;
|
||||
this.time = time;
|
||||
super.organizeCode = organizeCode;
|
||||
super.modifyDatetime = modifyDatetime;
|
||||
if (super.isDeleted == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) super.isDeleted = CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue();
|
||||
if (super.isValid == CommonEnumUtil.IS_VAILD.INVAILD.getValue()) super.isValid = CommonEnumUtil.IS_VAILD.VAILD.getValue();
|
||||
}
|
||||
|
||||
public String getValue_(String curTime) {
|
||||
|
||||
if (!StringUtils.isEmpty(this.time) && !this.time.equals(String.valueOf(MesPcnEnumUtil.EXPIRE_TIME.NEVER.getValue())) && this.time.compareTo(curTime) < 0) return null;
|
||||
|
||||
if (super.isDeleted == CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) return null;
|
||||
|
||||
if (super.isValid == CommonEnumUtil.IS_VAILD.INVAILD.getValue()) return null;
|
||||
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public MesWorkCellDataCache logicalDelete(){
|
||||
super.isDeleted = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
|
||||
return this;
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.estsh.i3plus.pojo.mes.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellDataCache;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author :
|
||||
* @CreateDate : 2020-05-18 16:49
|
||||
* @Modify:
|
||||
**/
|
||||
@Repository
|
||||
public interface MesWorkCellDataCacheRepository extends BaseRepository<MesWorkCellDataCache, Long> {
|
||||
|
||||
}
|
Loading…
Reference in New Issue