refactor(service): 实现VoableService接口以统一VO与实体映射逻辑
refactor(model): 重构实体类与VO类的字段映射关系 style: 调整代码格式与注释 fix: 修复部分字段映射错误
This commit is contained in:
@@ -57,6 +57,7 @@ public class ContractFileTypeLocal extends BaseEnumEntity<ContractFileType> impl
|
||||
vo.setId(getId());
|
||||
vo.setLang(getLang());
|
||||
vo.setType(getType());
|
||||
vo.setValue(getValue());
|
||||
vo.setDescription(getDescription());
|
||||
vo.setSuggestFileName(suggestFileName);
|
||||
return vo;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.ProjectFileType;
|
||||
|
||||
@@ -7,7 +7,6 @@ import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
import com.ecep.contract.vo.ProjectQuotationVo;
|
||||
import com.ecep.contract.model.Voable;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -32,7 +31,8 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "PROJECT_QUOTATION")
|
||||
@ToString
|
||||
public class ProjectQuotation implements IdentityEntity, ProjectBasedEntity, java.io.Serializable, Voable<ProjectQuotationVo> {
|
||||
public class ProjectQuotation
|
||||
implements IdentityEntity, ProjectBasedEntity, java.io.Serializable, Voable<ProjectQuotationVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -47,7 +47,6 @@ public class ProjectQuotation implements IdentityEntity, ProjectBasedEntity, jav
|
||||
@ToString.Exclude
|
||||
private Project project;
|
||||
|
||||
|
||||
/**
|
||||
* 客户资信等级
|
||||
*/
|
||||
@@ -116,7 +115,7 @@ public class ProjectQuotation implements IdentityEntity, ProjectBasedEntity, jav
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (this == object) {
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
if (object == null) {
|
||||
@@ -154,10 +153,10 @@ public class ProjectQuotation implements IdentityEntity, ProjectBasedEntity, jav
|
||||
}
|
||||
vo.setAuthorizationTime(authorizationTime);
|
||||
vo.setAuthorizationFile(authorizationFile);
|
||||
vo.setDescription(description);
|
||||
if (evaluationFile != null) {
|
||||
vo.setEvaluationFileId(evaluationFile.getId());
|
||||
}
|
||||
vo.setDescription(description);
|
||||
// active字段默认为false,在ProjectQuotationVo类中已经设置
|
||||
return vo;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ProjectSaleType implements IdentityEntity, NamedEntity, BasedEntity
|
||||
* 符合重大项目的合同金额条件
|
||||
*/
|
||||
@Column(name = "CRITICAL_PROJECT_LIMIT")
|
||||
private double criticalProjectLimit;
|
||||
private Double criticalProjectLimit;
|
||||
|
||||
@Column(name = "IS_ACTIVE")
|
||||
private boolean active;
|
||||
|
||||
@@ -28,7 +28,8 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "PURCHASE_ORDER", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class PurchaseOrder implements IdentityEntity, BasedEntity, ContractBasedEntity, java.io.Serializable, Voable<PurchaseOrderVo> {
|
||||
public class PurchaseOrder
|
||||
implements IdentityEntity, BasedEntity, ContractBasedEntity, java.io.Serializable, Voable<PurchaseOrderVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -126,17 +127,26 @@ public class PurchaseOrder implements IdentityEntity, BasedEntity, ContractBased
|
||||
vo.setContractId(contract.getId());
|
||||
}
|
||||
vo.setCode(code);
|
||||
// PurchaseOrder中没有name字段,这里可以设置为code
|
||||
vo.setName(code);
|
||||
// PurchaseOrder中没有vendorId字段,只有vendorCode
|
||||
// vo.setVendorId();
|
||||
// PurchaseOrder中没有orderDate字段,这里可以设置为makerDate
|
||||
if (makerDate != null) {
|
||||
vo.setOrderDate(makerDate.toLocalDate());
|
||||
vo.setRefId(refId);
|
||||
vo.setVendorCode(vendorCode);
|
||||
vo.setDescription(description);
|
||||
vo.setMakerDate(makerDate);
|
||||
vo.setModifyDate(modifyDate);
|
||||
vo.setVerifierDate(verifierDate);
|
||||
vo.setCloserDate(closerDate);
|
||||
|
||||
if (employee != null) {
|
||||
vo.setEmployeeId(employee.getId());
|
||||
}
|
||||
if (maker != null) {
|
||||
vo.setMakerId(maker.getId());
|
||||
}
|
||||
if (verifier != null) {
|
||||
vo.setVerifierId(verifier.getId());
|
||||
}
|
||||
if (closer != null) {
|
||||
vo.setCloserId(closer.getId());
|
||||
}
|
||||
// PurchaseOrder中没有totalAmount、taxAmount、taxRate和statusId字段,暂时不设置
|
||||
vo.setRemark(description);
|
||||
// active字段默认为false,在PurchaseOrderVo类中已经设置
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,15 +107,16 @@ public class SalesOrderItem implements IdentityEntity, BasedEntity, Serializable
|
||||
vo.setCode(code);
|
||||
vo.setName(name);
|
||||
if (order != null) {
|
||||
vo.setSalesOrderId(order.getId());
|
||||
vo.setOrderId(order.getId());
|
||||
}
|
||||
vo.setItemName(name);
|
||||
vo.setQuantity(quantity);
|
||||
vo.setPrice(price);
|
||||
vo.setTaxRate(taxRate);
|
||||
vo.setExclusiveTaxPrice(exclusiveTaxPrice);
|
||||
|
||||
vo.setStartDate(startDate);
|
||||
vo.setEndDate(endDate);
|
||||
|
||||
vo.setDescription(description);
|
||||
return vo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user