refactor(vo): 重构VO对象结构,统一字段命名和接口实现
重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
This commit is contained in:
@@ -4,10 +4,7 @@ import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.CustomerSatisfactionSurvey;
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.model.Project;
|
||||
|
||||
import com.ecep.contract.vo.CustomerSatisfactionSurveyVo;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
@@ -16,11 +13,11 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CustomerSatisfactionSurveyViewModel extends IdentityViewModel<CustomerSatisfactionSurvey> implements ProjectBasedViewModel {
|
||||
public class CustomerSatisfactionSurveyViewModel extends IdentityViewModel<CustomerSatisfactionSurveyVo> implements ProjectBasedViewModel {
|
||||
/**
|
||||
* 关联的项目
|
||||
* 关联的项目,Project
|
||||
*/
|
||||
private SimpleObjectProperty<Project> project = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Integer> project = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleStringProperty code = new SimpleStringProperty();
|
||||
|
||||
@@ -28,7 +25,10 @@ public class CustomerSatisfactionSurveyViewModel extends IdentityViewModel<Custo
|
||||
|
||||
private SimpleIntegerProperty totalScore = new SimpleIntegerProperty();
|
||||
private SimpleStringProperty data = new SimpleStringProperty();
|
||||
private SimpleObjectProperty<Employee> applicant = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 创建人,Employee
|
||||
*/
|
||||
private SimpleObjectProperty<Integer> applicant = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<LocalDateTime> applyTime = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 说明、注释
|
||||
@@ -36,20 +36,20 @@ public class CustomerSatisfactionSurveyViewModel extends IdentityViewModel<Custo
|
||||
private SimpleStringProperty description = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CustomerSatisfactionSurvey v) {
|
||||
protected void updateFrom(CustomerSatisfactionSurveyVo v) {
|
||||
super.updateFrom(v);
|
||||
getProject().set(v.getProject());
|
||||
getCode().set(v.getCode());
|
||||
getDate().set(v.getDate());
|
||||
getTotalScore().set(v.getTotalScore());
|
||||
getData().set(v.getData());
|
||||
getApplicant().set(v.getApplicant());
|
||||
getApplicant().set(v.getApplicantId());
|
||||
getApplyTime().set(v.getApplyTime());
|
||||
getDescription().set(v.getDescription());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CustomerSatisfactionSurvey v) {
|
||||
public boolean copyTo(CustomerSatisfactionSurveyVo v) {
|
||||
boolean modified = super.copyTo(v);
|
||||
if (!Objects.equals(getProject().get(), v.getProject())) {
|
||||
v.setProject(getProject().get());
|
||||
@@ -71,8 +71,8 @@ public class CustomerSatisfactionSurveyViewModel extends IdentityViewModel<Custo
|
||||
v.setData(getData().get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(getApplicant().get(), v.getApplicant())) {
|
||||
v.setApplicant(getApplicant().get());
|
||||
if (!Objects.equals(getApplicant().get(), v.getApplicantId())) {
|
||||
v.setApplicantId(getApplicant().get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(getApplyTime().get(), v.getApplyTime())) {
|
||||
|
||||
Reference in New Issue
Block a user