refactor(vo): 重构VO对象结构,统一字段命名和接口实现
重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Objects;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
import com.ecep.contract.vo.InvoiceVo;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -29,7 +30,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "INVOICE", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class Invoice implements IdentityEntity, BasedEntity, Serializable {
|
||||
public class Invoice implements IdentityEntity, BasedEntity, Serializable, Voable<InvoiceVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@@ -88,4 +89,17 @@ public class Invoice implements IdentityEntity, BasedEntity, Serializable {
|
||||
public final int hashCode() {
|
||||
return HibernateProxyUtils.hashCode(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvoiceVo toVo() {
|
||||
InvoiceVo vo = new InvoiceVo();
|
||||
vo.setId(id);
|
||||
if (company != null) {
|
||||
vo.setCompanyId(company.getId());
|
||||
}
|
||||
vo.setCode(code);
|
||||
vo.setInvoiceDate(invoiceDate);
|
||||
vo.setDescription(description);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user