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;
|
||||
}
|
||||
|
||||
@@ -17,8 +17,10 @@ public class CompanyContactVo implements IdentityEntity, NamedEntity, CompanyBas
|
||||
private String u8Code;
|
||||
private String memo;
|
||||
private LocalDate created;
|
||||
private boolean primary = false;
|
||||
private String description;
|
||||
private boolean active = false;
|
||||
|
||||
private int version;
|
||||
|
||||
// 备用扩展
|
||||
private boolean primary = false;
|
||||
private boolean active = false;
|
||||
}
|
||||
@@ -10,8 +10,8 @@ public class ContractGroupVo implements IdentityEntity, NamedEntity {
|
||||
private String name;
|
||||
private String code;
|
||||
private String title;
|
||||
private Integer parentId;
|
||||
private Integer order;
|
||||
|
||||
// 以下field在ContractGroup实体中不存在,待后期扩展用途
|
||||
private String description;
|
||||
private boolean active = false;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public class ProjectSaleTypeVo implements IdentityEntity, NamedEntity {
|
||||
private Double criticalProjectLimit;
|
||||
private boolean active = false;
|
||||
private String description;
|
||||
|
||||
private LocalDate created;
|
||||
private int version;
|
||||
}
|
||||
@@ -1,21 +1,33 @@
|
||||
package com.ecep.contract.vo;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.ecep.contract.model.IdentityEntity;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PurchaseOrderVo implements IdentityEntity, ContractBasedVo {
|
||||
private Integer id;
|
||||
private Integer contractId;
|
||||
private Integer refId;
|
||||
private String code;
|
||||
private String name;
|
||||
private Integer vendorId;
|
||||
private LocalDate orderDate;
|
||||
private String vendorCode;
|
||||
|
||||
private Integer employeeId;
|
||||
private Integer makerId;
|
||||
private LocalDateTime makerDate;
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
private Integer verifierId;
|
||||
private LocalDateTime verifierDate;
|
||||
|
||||
private Integer closerId;
|
||||
private LocalDateTime closerDate;
|
||||
|
||||
private Double totalAmount;
|
||||
private Double taxAmount;
|
||||
private Double taxRate;
|
||||
private Integer statusId;
|
||||
private String remark;
|
||||
private Boolean active = false;
|
||||
|
||||
private String description;
|
||||
}
|
||||
@@ -8,15 +8,11 @@ import java.time.LocalDate;
|
||||
@Data
|
||||
public class SalesOrderItemVo implements IdentityEntity {
|
||||
private Integer id;
|
||||
private Integer salesOrderId;
|
||||
private Integer orderId;
|
||||
private String code;
|
||||
private String name;
|
||||
|
||||
private Integer contractItemId;
|
||||
private Integer inventoryId;
|
||||
private String itemName;
|
||||
private Integer unitId;
|
||||
|
||||
//
|
||||
private double quantity;
|
||||
private double price;
|
||||
private double taxRate;
|
||||
@@ -26,4 +22,9 @@ public class SalesOrderItemVo implements IdentityEntity {
|
||||
private LocalDate endDate;
|
||||
|
||||
private String description;
|
||||
|
||||
// 备用扩展
|
||||
private Integer contractItemId;
|
||||
private Integer inventoryId;
|
||||
private Integer unitId;
|
||||
}
|
||||
Reference in New Issue
Block a user