重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
89 lines
3.1 KiB
Java
89 lines
3.1 KiB
Java
package com.ecep.contract.vm;
|
|
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.util.Objects;
|
|
|
|
import com.ecep.contract.vo.CustomerSatisfactionSurveyVo;
|
|
import javafx.beans.property.SimpleIntegerProperty;
|
|
import javafx.beans.property.SimpleObjectProperty;
|
|
import javafx.beans.property.SimpleStringProperty;
|
|
import lombok.Data;
|
|
import lombok.EqualsAndHashCode;
|
|
|
|
@Data
|
|
@EqualsAndHashCode(callSuper = false)
|
|
public class CustomerSatisfactionSurveyViewModel extends IdentityViewModel<CustomerSatisfactionSurveyVo> implements ProjectBasedViewModel {
|
|
/**
|
|
* 关联的项目,Project
|
|
*/
|
|
private SimpleObjectProperty<Integer> project = new SimpleObjectProperty<>();
|
|
|
|
private SimpleStringProperty code = new SimpleStringProperty();
|
|
|
|
private SimpleObjectProperty<LocalDate> date = new SimpleObjectProperty<>();
|
|
|
|
private SimpleIntegerProperty totalScore = new SimpleIntegerProperty();
|
|
private SimpleStringProperty data = new SimpleStringProperty();
|
|
/**
|
|
* 创建人,Employee
|
|
*/
|
|
private SimpleObjectProperty<Integer> applicant = new SimpleObjectProperty<>();
|
|
private SimpleObjectProperty<LocalDateTime> applyTime = new SimpleObjectProperty<>();
|
|
/**
|
|
* 说明、注释
|
|
*/
|
|
private SimpleStringProperty description = new SimpleStringProperty();
|
|
|
|
@Override
|
|
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.getApplicantId());
|
|
getApplyTime().set(v.getApplyTime());
|
|
getDescription().set(v.getDescription());
|
|
}
|
|
|
|
@Override
|
|
public boolean copyTo(CustomerSatisfactionSurveyVo v) {
|
|
boolean modified = super.copyTo(v);
|
|
if (!Objects.equals(getProject().get(), v.getProject())) {
|
|
v.setProject(getProject().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getCode().get(), v.getCode())) {
|
|
v.setCode(getCode().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getDate().get(), v.getDate())) {
|
|
v.setDate(getDate().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getTotalScore().get(), v.getTotalScore())) {
|
|
v.setTotalScore(getTotalScore().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getData().get(), v.getData())) {
|
|
v.setData(getData().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getApplicant().get(), v.getApplicantId())) {
|
|
v.setApplicantId(getApplicant().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getApplyTime().get(), v.getApplyTime())) {
|
|
v.setApplyTime(getApplyTime().get());
|
|
modified = true;
|
|
}
|
|
if (!Objects.equals(getDescription().get(), v.getDescription())) {
|
|
v.setDescription(getDescription().get());
|
|
modified = true;
|
|
}
|
|
return modified;
|
|
}
|
|
}
|