refactor(vo): 重构VO对象结构,统一字段命名和接口实现
重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
This commit is contained in:
@@ -9,6 +9,7 @@ import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import com.ecep.contract.ContractPayWay;
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
import com.ecep.contract.vo.ContractVo;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -35,7 +36,8 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "CONTRACT", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class Contract implements IdentityEntity, NamedEntity, BasedEntity, CompanyBasedEntity, Serializable {
|
||||
public class Contract
|
||||
implements IdentityEntity, NamedEntity, BasedEntity, CompanyBasedEntity, Serializable, Voable<ContractVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 主键
|
||||
@@ -304,4 +306,66 @@ public class Contract implements IdentityEntity, NamedEntity, BasedEntity, Compa
|
||||
public final int hashCode() {
|
||||
return HibernateProxyUtils.hashCode(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractVo toVo() {
|
||||
ContractVo vo = new ContractVo();
|
||||
vo.setId(id);
|
||||
vo.setGuid(getGuid());
|
||||
vo.setCode(getCode());
|
||||
vo.setName(name);
|
||||
if (getCompany() != null) {
|
||||
vo.setCompanyId(getCompany().getId());
|
||||
}
|
||||
if (group != null) {
|
||||
vo.setGroupId(group.getId());
|
||||
}
|
||||
if (type != null) {
|
||||
vo.setTypeId(type.getId());
|
||||
}
|
||||
if (kind != null) {
|
||||
vo.setKindId(kind.getId());
|
||||
}
|
||||
if (project != null) {
|
||||
vo.setProject(project.getId());
|
||||
}
|
||||
vo.setParentCode(getParentCode());
|
||||
vo.setOrderDate(getOrderDate());
|
||||
vo.setStartDate(getStartDate());
|
||||
vo.setEndDate(getEndDate());
|
||||
if (setupPerson != null) {
|
||||
vo.setSetupPersonId(setupPerson.getId());
|
||||
}
|
||||
vo.setSetupDate(getSetupDate());
|
||||
if (inurePerson != null) {
|
||||
vo.setInurePersonId(inurePerson.getId());
|
||||
}
|
||||
vo.setInureDate(getInureDate());
|
||||
if (varyPerson != null) {
|
||||
vo.setVaryPersonId(varyPerson.getId());
|
||||
}
|
||||
vo.setVaryDate(getVaryDate());
|
||||
if (employee != null) {
|
||||
vo.setEmployeeId(employee.getId());
|
||||
}
|
||||
if (handler != null) {
|
||||
vo.setHandlerId(handler.getId());
|
||||
}
|
||||
vo.setState(getState());
|
||||
vo.setPath(getPath());
|
||||
vo.setDescription(getDescription());
|
||||
vo.setCreated(getCreated());
|
||||
vo.setAmount(getAmount());
|
||||
vo.setStandardPayWay(isStandardPayWay());
|
||||
vo.setStandardPContractText(isStandardPContractText());
|
||||
vo.setTotalQuantity(getTotalQuantity());
|
||||
vo.setTotalAmount(getTotalAmount());
|
||||
vo.setTotalUnTaxAmount(getTotalUnTaxAmount());
|
||||
vo.setExecQuantity(getExecQuantity());
|
||||
vo.setExecAmount(getExecAmount());
|
||||
vo.setExecUnTaxAmount(getExecUnTaxAmount());
|
||||
vo.setPayWay(getPayWay());
|
||||
vo.setVersion(getVersion());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user