refactor(vo): 重构VO对象结构,统一字段命名和接口实现
重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
This commit is contained in:
@@ -4,8 +4,7 @@ import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
import com.ecep.contract.model.CompanyCustomerFile;
|
||||
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
@@ -17,17 +16,22 @@ import lombok.ToString;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ToString
|
||||
public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCustomerFile> {
|
||||
public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCustomerFileVo> {
|
||||
|
||||
public static CompanyCustomerFileViewModel from(CompanyCustomerFile companyCustomerFile) {
|
||||
public static CompanyCustomerFileViewModel from(CompanyCustomerFileVo companyCustomerFile) {
|
||||
CompanyCustomerFileViewModel model = new CompanyCustomerFileViewModel();
|
||||
model.update(companyCustomerFile);
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* CompanyCustomer
|
||||
*/
|
||||
@ToString.Exclude
|
||||
private SimpleObjectProperty<CompanyCustomer> customer = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleObjectProperty<Integer> customer = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private SimpleObjectProperty<CompanyCustomerFileType> type = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleStringProperty filePath = new SimpleStringProperty();
|
||||
@@ -39,9 +43,8 @@ public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCusto
|
||||
@ToString.Exclude
|
||||
private SimpleBooleanProperty valid = new SimpleBooleanProperty(this, "valid", false);
|
||||
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CompanyCustomerFile v) {
|
||||
protected void updateFrom(CompanyCustomerFileVo v) {
|
||||
super.updateFrom(v);
|
||||
getCustomer().set(v.getCustomer());
|
||||
getType().set(v.getType());
|
||||
@@ -53,7 +56,7 @@ public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCusto
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CompanyCustomerFile v) {
|
||||
public boolean copyTo(CompanyCustomerFileVo v) {
|
||||
boolean modified = super.copyTo(v);
|
||||
if (!Objects.equals(customer.get(), v.getCustomer())) {
|
||||
v.setCustomer(customer.get());
|
||||
|
||||
Reference in New Issue
Block a user