拆分模块
This commit is contained in:
103
common/src/main/java/com/ecep/contract/model/SalesOrder.java
Normal file
103
common/src/main/java/com/ecep/contract/model/SalesOrder.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.hibernate.proxy.HibernateProxy;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 销售订单
|
||||
* 对应 U8 的 SO_SOMain 表
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "CONTRACT_SALES_ORDER", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class SalesOrder implements IdentityEntity, BasedEntity, ContractBasedEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "CONTRACT_ID")
|
||||
@ToString.Exclude
|
||||
private Contract contract;
|
||||
|
||||
/**
|
||||
* 业务员
|
||||
*/
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "EMPLOYEE_ID")
|
||||
@ToString.Exclude
|
||||
private Employee employee;
|
||||
|
||||
@Column(name = "CODE")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 制单人
|
||||
*/
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "MAKER_ID")
|
||||
@ToString.Exclude
|
||||
private Employee maker;
|
||||
|
||||
/**
|
||||
* 制单日期
|
||||
*/
|
||||
@Column(name = "MAKER_DATE")
|
||||
private LocalDate makerDate;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "VERIFIER_ID")
|
||||
@ToString.Exclude
|
||||
private Employee verifier;
|
||||
/**
|
||||
* 审核日期
|
||||
*/
|
||||
@Column(name = "VERIFIER_DATE")
|
||||
private LocalDate verifierDate;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Column(name = "DESCRIPTION", columnDefinition = "TEXT")
|
||||
private String description;
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
|
||||
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
|
||||
if (thisEffectiveClass != oEffectiveClass) return false;
|
||||
SalesOrder that = (SalesOrder) o;
|
||||
return getId() != null && Objects.equals(getId(), that.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toPrettyString() {
|
||||
return "#" + getId();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user