Merge remote-tracking branch 'remotes/origin/dev' into test
commit
1243607e0e
@ -0,0 +1,90 @@
|
||||
package cn.estsh.i3plus.pojo.base.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.persistence.PreUpdate;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description : 实体对象监听
|
||||
* @Reference :
|
||||
* @Author : alwaysfrin
|
||||
* @CreateDate : 2020-08-24 22:28
|
||||
* @Modify:
|
||||
**/
|
||||
public class BaseBeanListener {
|
||||
|
||||
//实体保存前
|
||||
@PrePersist
|
||||
public void prePersist(BaseBean baseBean) {
|
||||
// 创建用户
|
||||
if (StringUtils.isBlank(baseBean.getCreateUser())) {
|
||||
if(StringUtils.isNotBlank(BaseThreadLocal.getThreadEmpName())) {
|
||||
baseBean.setCreateUser(BaseThreadLocal.getThreadEmpName());
|
||||
baseBean.setModifyUser(BaseThreadLocal.getThreadEmpName());
|
||||
}
|
||||
}
|
||||
//组织代码
|
||||
if (StringUtils.isBlank(baseBean.getOrganizeCode())) {
|
||||
if(StringUtils.isNotBlank(BaseThreadLocal.getThreadOrganizeCode())) {
|
||||
baseBean.setOrganizeCode(BaseThreadLocal.getThreadOrganizeCode());
|
||||
}
|
||||
}
|
||||
// 创建时间
|
||||
if (StringUtils.isBlank(baseBean.getCreateDatetime())){
|
||||
baseBean.setCreateDatetime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date()));
|
||||
baseBean.setModifyDatetime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date()));
|
||||
}
|
||||
//有效性
|
||||
if(baseBean.getIsValid() == null ||
|
||||
(baseBean.getIsValid() != CommonEnumUtil.IS_VAILD.VAILD.getValue() && baseBean.getIsValid() != CommonEnumUtil.IS_VAILD.INVAILD.getValue())){
|
||||
baseBean.setIsValid(CommonEnumUtil.IS_VAILD.VAILD.getValue()); //有效
|
||||
}
|
||||
//是否删除
|
||||
if(baseBean.getIsDeleted() == null ||
|
||||
(baseBean.getIsDeleted() != CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() && baseBean.getIsDeleted() != CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue())){
|
||||
baseBean.setIsDeleted(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); //未删除
|
||||
}
|
||||
}
|
||||
|
||||
//实体对象保存之后
|
||||
/*@PostPersist
|
||||
public void afterPersist(){
|
||||
}*/
|
||||
|
||||
//实体对象修改之前
|
||||
@PreUpdate
|
||||
public void preUpdate(BaseBean baseBean) {
|
||||
// 修改用户
|
||||
if (StringUtils.isBlank(baseBean.getModifyUser())) {
|
||||
if(StringUtils.isNotBlank(BaseThreadLocal.getThreadEmpName())) {
|
||||
baseBean.setModifyUser(BaseThreadLocal.getThreadEmpName());
|
||||
}
|
||||
}
|
||||
|
||||
// 修改时间
|
||||
if (StringUtils.isEmpty(baseBean.getModifyDatetime())){
|
||||
baseBean.setModifyDatetime((new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date()));
|
||||
}
|
||||
|
||||
//组织代码
|
||||
if (StringUtils.isBlank(baseBean.getOrganizeCode())) {
|
||||
if(StringUtils.isNotBlank(BaseThreadLocal.getThreadOrganizeCode())) {
|
||||
baseBean.setOrganizeCode(BaseThreadLocal.getThreadOrganizeCode());
|
||||
}
|
||||
}
|
||||
//有效性
|
||||
if(baseBean.getIsValid() == null ||
|
||||
(baseBean.getIsValid() != CommonEnumUtil.IS_VAILD.VAILD.getValue() && baseBean.getIsValid() != CommonEnumUtil.IS_VAILD.INVAILD.getValue())){
|
||||
baseBean.setIsValid(CommonEnumUtil.IS_VAILD.VAILD.getValue()); //有效
|
||||
}
|
||||
//是否删除
|
||||
if(baseBean.getIsDeleted() == null ||
|
||||
(baseBean.getIsDeleted() != CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() && baseBean.getIsDeleted() != CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue())){
|
||||
baseBean.setIsDeleted(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); //未删除
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package cn.estsh.i3plus.pojo.platform.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
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 : 2018-11-21 15:12
|
||||
* @Modify: Dev 2018-12-12 09:41:07
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name = "SYS_ORDER_NO_RECORD")
|
||||
@ApiModel(value = "单号记录", description = "单号记录")
|
||||
public class SysOrderNoRecord extends BaseBean {
|
||||
|
||||
private static final long serialVersionUID = 2749057829943250024L;
|
||||
|
||||
@Column(name = "RULE_CODE")
|
||||
@ApiModelProperty(value = "规则代码")
|
||||
private String ruleCode;
|
||||
|
||||
@Column(name = "ORDER_NO")
|
||||
@ApiModelProperty(value = "单号")
|
||||
private String orderNo;
|
||||
|
||||
|
||||
public SysOrderNoRecord() {
|
||||
}
|
||||
|
||||
public SysOrderNoRecord(String ruleCode,String orderNo) {
|
||||
this.ruleCode = ruleCode;
|
||||
this.orderNo = orderNo;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.estsh.i3plus.pojo.platform.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
|
||||
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 : 2020-09-03 13:32
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="SYS_REF_USER_EXTERNAL")
|
||||
@Api(value="用户外部关系",description = "用户外部关系")
|
||||
public class SysRefUserExternal extends BaseBean {
|
||||
|
||||
@Column(name="USER_ID")
|
||||
@ApiParam(value ="用户id" ,example = "-1")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long userId;
|
||||
|
||||
@Column(name="EXTERNAL_REF")
|
||||
@ApiParam(value ="对象id" ,example = "-1")
|
||||
@AnnoOutputColumn(refClass = ImppEnumUtil.USER_EXTERNAL_REF.class)
|
||||
private Integer externalRef;
|
||||
|
||||
@Column(name="REF_VALUE")
|
||||
@ApiParam(value ="对象id" ,example = "-1")
|
||||
private String refValue;
|
||||
|
||||
}
|
@ -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.SysOrderNoRecord;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2020-09-03 22:01
|
||||
* @Modify:
|
||||
**/
|
||||
public interface SysOrderNoRecordRepository extends BaseRepository<SysOrderNoRecord, 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.SysRefUserExternal;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2020-09-03 13:44
|
||||
* @Modify:
|
||||
**/
|
||||
public interface SysRefUserExternalRepository extends BaseRepository<SysRefUserExternal, Long> {
|
||||
}
|
Loading…
Reference in New Issue