UP
This commit is contained in:
@@ -4,7 +4,7 @@ import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.vo.CompanyCustomerVo;
|
||||
import com.ecep.contract.vo.CustomerVo;
|
||||
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CompanyCustomerViewModel extends IdentityViewModel<CompanyCustomerVo> {
|
||||
public class CompanyCustomerViewModel extends IdentityViewModel<CustomerVo> {
|
||||
private SimpleStringProperty state = new SimpleStringProperty();
|
||||
/**
|
||||
* 关联的企业,Company
|
||||
@@ -39,13 +39,13 @@ public class CompanyCustomerViewModel extends IdentityViewModel<CompanyCustomerV
|
||||
private SimpleObjectProperty<LocalDateTime> created = new SimpleObjectProperty<>();
|
||||
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
||||
|
||||
public static CompanyCustomerViewModel from(CompanyCustomerVo cc) {
|
||||
public static CompanyCustomerViewModel from(CustomerVo cc) {
|
||||
CompanyCustomerViewModel model = new CompanyCustomerViewModel();
|
||||
model.update(cc);
|
||||
return model;
|
||||
}
|
||||
|
||||
public void updateFrom(CompanyCustomerVo c) {
|
||||
public void updateFrom(CustomerVo c) {
|
||||
super.updateFrom(c);
|
||||
getCompany().set(c.getCompanyId());
|
||||
getCatalog().set(c.getCatalogId());
|
||||
@@ -57,7 +57,7 @@ public class CompanyCustomerViewModel extends IdentityViewModel<CompanyCustomerV
|
||||
version.set(c.getVersion());
|
||||
}
|
||||
|
||||
public boolean copyTo(CompanyCustomerVo v) {
|
||||
public boolean copyTo(CustomerVo v) {
|
||||
boolean modified = super.copyTo(v);
|
||||
if (!Objects.equals(company.get(), v.getCompanyId())) {
|
||||
v.setCompanyId(company.get());
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
||||
import com.ecep.contract.vo.CustomerFileVo;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
@@ -16,10 +16,10 @@ import lombok.ToString;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ToString
|
||||
public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCustomerFileVo> {
|
||||
public class CustomerFileViewModel extends IdentityViewModel<CustomerFileVo> {
|
||||
|
||||
public static CompanyCustomerFileViewModel from(CompanyCustomerFileVo companyCustomerFile) {
|
||||
CompanyCustomerFileViewModel model = new CompanyCustomerFileViewModel();
|
||||
public static CustomerFileViewModel from(CustomerFileVo companyCustomerFile) {
|
||||
CustomerFileViewModel model = new CustomerFileViewModel();
|
||||
model.update(companyCustomerFile);
|
||||
return model;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCusto
|
||||
private SimpleBooleanProperty valid = new SimpleBooleanProperty(this, "valid", false);
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CompanyCustomerFileVo v) {
|
||||
protected void updateFrom(CustomerFileVo v) {
|
||||
super.updateFrom(v);
|
||||
getCustomer().set(v.getCustomer());
|
||||
getType().set(v.getType());
|
||||
@@ -56,7 +56,7 @@ public class CompanyCustomerFileViewModel extends IdentityViewModel<CompanyCusto
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CompanyCustomerFileVo v) {
|
||||
public boolean copyTo(CustomerFileVo v) {
|
||||
boolean modified = super.copyTo(v);
|
||||
if (!Objects.equals(customer.get(), v.getCustomer())) {
|
||||
v.setCustomer(customer.get());
|
||||
Reference in New Issue
Block a user