更新Vo

# 任务逻辑

根据 model 创建、更新 Vo，先检查Vo是否存在，如果不存在则创建Vo，否则根据要求更新Vo
更新结果保存到 D:\idea-workspace\Contract-Manager\docs\create_vo.md
Model和Vo的对应关系记录在 create_vo.md 结果记录中，如果未找到对应的Vo，从结果记录中查看是否有对应关系

## model

- 所在目录： D:\idea-workspace\Contract-Manager\common\src\main\java\com\ecep\contract\model
- 注解为 @Entity 的 .java 文件
- 请根据所在目录找到的Model，更新本文件中的 Entity 类清单
  如果 model 不在 Entity 类清单中，从清单中移除
- Model 需要继承 com.ecep.contract.model.Voable 接口的类，并且实现 toVo 方法
- 以 Local 结尾的 Model 类，并且前面部分名称正好是一个枚举类，则需继承自 BaseEnumEntity 

### 参考

- D:\idea-workspace\Contract-Manager\common\src\main\java\com\ecep\contract\model\Bank.java

## ViewModel VM

- 所在目录： D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\vm
- 继承 IdentityViewModel<VO>
- 包含一个 名为 from 的静态方法
```java
public static BankViewModel from(BankVo v) {
  BankViewModel vm = new BankViewModel();
  vm.update(v);
  return vm;
}
```
- 继承实现 void updateFrom(Vo v) 方法
- 继承实现 void copyTo(Vo v) 方法
- 关联对象 使用 ObjectProperty<Integer>，不使用 IntegerProperty
- IdentityViewModel 不需要调整
- 如果Vo的属性是 boolean，使用 BooleanProperty

### 参考

- D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\vm\BankViewModel.java
- D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\vm\CompanyBankAccountViewModel.java

## vo

- 所在目录： D:\idea-workspace\Contract-Manager\common\src\main\java\com\ecep\contract\vo

### 参考

- D:\idea-workspace\Contract-Manager\common\src\main\java\com\ecep\contract\vo\BankVo.java

## Service (client 模块)

- 所在目录： D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\service
- 继承 QueryService<Vo, VM>
- 指定 @Service 注解
- 如果 指定了 @CacheConfig 注解，则需要实现 findById、findAll、save和delete方法，并且方法上实现 Cache 相关注解，参考 [`BankService.java`](\client\src\main\java\com\ecep\contract\service\BankService.java)
- find** 方法，则通过调用父类的 `findAll（params, pageable)` 方法实现，如下代码
```java
  public List<ContractVo> findAllByCompanyVendor(CompanyVendorVo vendor, LocalDate beginDate, LocalDate endDate) {
    return findAll(ParamUtils.builder()
    .equals("company", vendor.getCompanyId())
    .between("setupDate", beginDate, endDate)
    .build(), Pageable.unpaged()).getContent();
  }
```
- 查询条件中的 .equals("company", vendor.getCompanyId()) 中的company 是对应 model 中对应的字段的名，不对 vo 中对应字段的名
- 如果方法内没有具体的实现，也用如上代码实现

## Service (Server 模块)

- 所在目录： D:\idea-workspace\Contract-Manager\server\src\main\java\com\ecep\contract\ds\**功能块**\service
- 需要继承l IEntityService 接口的 Service 都需要继承 VoableService<M, Vo>
- 指定 @Service 注解

## Controller

- ManagerWindowController
    - 继承 AbstManagerWindowController<VO, VM, ManagerSkin>
    - 实现 createDefaultSkin 方法 返回 ManagerSkin
    - 实现 getViewModelService 方法 返回 对应的 Service
    - 需要给定以下注解 @Lazy、@Scope("prototype")、@Component、@FxmlPath("/ui/bank-manager.fxml")

### 参考

- D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\controller\bank\BankManagerWindowController.java
- D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\controller\bank\BankManagerSkin.java

## TabSkin

EditableEntityTableTabSkin<Vo, VM>

## TableCell

- 所在目录： D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\controller\table\cell
- TableCell<T> extends AsyncUpdateTableCell<T, VO>
- TableVIew 使用 TableCell
    - bankAccountTable_bankColumn.setCellValueFactory(param -> param.getValue().getBankId());
    - bankAccountTable_bankColumn.setCellFactory(param -> new BankTableCell<>(getBankService()));

### 参考

D:\idea-workspace\Contract-Manager\client\src\main\java\com\ecep\contract\controller\table\cell\BankTableCell.java

## Combo

## FXML UI 界面

- 所在目录： D:\idea-workspace\Contract-Manager\client\src\main\resources\ui

## 其他要求

- 检索到的Model，先记录在 create_vo.md
- 主键名称为id，类型都是 Integer
- 布尔类型的属性使用 boolean,不要使用 Boolean，初始值为false
- 注解为@Embeddable、@MappedSuperclass的Model不需要更新Vo
- 更新结果以 Model：Vo (状态) 保存， Model 和 VO 的名称后期后修改，可能会不一一对应

# Entity 类清单

Bank
CloudRk
CloudTyc
CloudYu
Company
CompanyBankAccount
CompanyBlackReason
CompanyContact
CompanyContract
CompanyCustomer
CompanyCustomerEntity
CompanyCustomerEvaluationFormFile
CompanyCustomerFile
CompanyCustomerFileTypeLocal
CompanyExtendInfo
CompanyFile
CompanyFileTypeLocal
CompanyInvoiceInfo
CompanyOldName
CompanyVendor
CompanyVendorApprovedFile
CompanyVendorApprovedItem
CompanyVendorApprovedList
CompanyVendorEntity
CompanyVendorFile
Contract
ContractBidVendor
ContractCatalog
ContractFile
ContractFileTypeLocal
ContractGroup
ContractItem
ContractKind
ContractPayPlan
ContractType
CustomerCatalog
CustomerSatisfactionSurvey
DeliverySignMethod
ExtendVendorInfo
HolidayTable
Inventory
InventoryCatalog
InventoryHistoryPrice
Invoice
ProductType
ProductUsage
Project
ProjectBid
ProjectCost
ProjectCostItem
ProjectFile
ProjectFileTypeLocal
ProjectFundPlan
ProjectIndustry
ProjectQuotation
ProjectSaleType
ProjectSaleTypeRequireFileType
ProjectType
PurchaseBillVoucher
PurchaseBillVoucherItem
PurchaseOrder
PurchaseOrderItem
PurchaseReceipt
PurchaseSettlementVoucher
PurchaseSettlementVoucherItem
SalesBillVoucher
SalesBillVoucherItem
SalesOrder
SalesOrderInvoice
SalesOrderItem
SysConf
Unit
VendorCatalog
VendorFileTypeLocal
VendorGroup
VendorGroupRequireFileType
VendorTypeLocal
VolumeSize

# 结果记录

EmployeeAuthBind: EmployeeAuthBindVo (已创建)
EmployeeLoginHistory: EmployeeLoginHistoryVo (已创建)
ProjectSaleTypeRequireFileType: ProjectSaleTypeRequireFileTypeVo (已创建)
ProjectFundPlan: ProjectFundPlanVo (已创建)
SalesOrderInvoice: SalesOrderInvoiceVo (已创建)
SalesBillVoucherItem: SalesBillVoucherItemVo (已创建)
SalesBillVoucher: SalesBillVoucherVo (已创建)
PurchaseSettlementVoucherItem: PurchaseSettlementVoucherItemVo (已创建)
PurchaseSettlementVoucher: PurchaseSettlementVoucherVo (已创建)
PurchaseBillVoucherItem: PurchaseBillVoucherItemVo (已创建)
PurchaseBillVoucher: PurchaseBillVoucherVo (已创建)
CompanyOldName: CompanyOldNameVo (已创建)
ContractCatalog: ContractCatalogVo (已创建)
CompanyBlackReason: CompanyBlackReasonVo (已更新)
CompanyContract: CompanyContractVo (已更新)
CompanyCustomer: CompanyCustomerVo (已更新)
CompanyCustomerEntity: CompanyCustomerEntityVo (已创建)
CompanyCustomerEvaluationFormFile: CompanyCustomerEvaluationFormFileVo (已更新)
CompanyCustomerFile: CompanyCustomerFileVo (已更新)
CompanyCustomerFileTypeLocal: CompanyCustomerFileTypeLocalVo (已更新)
CompanyExtendInfo: CompanyExtendInfoVo (已更新)
CompanyFileTypeLocal: CompanyFileTypeLocalVo (已更新)
CompanyVendor: CompanyVendorVo (已更新)
CompanyVendorApprovedFile: CompanyVendorApprovedFileVo (已更新)
CompanyVendorApprovedItem: CompanyVendorApprovedItemVo (已更新)
CompanyVendorApprovedList: CompanyVendorApprovedListVo (已更新)
CompanyVendorEntity: CompanyVendorEntityVo (已更新)
CompanyVendorFile: CompanyVendorFileVo (已更新)
CustomerSatisfactionSurvey: CustomerSatisfactionSurveyVo (已更新)
EmployeeRole: EmployeeRoleVo (已更新)
ProductType: ProductTypeVo (已更新)
PurchaseOrder: PurchaseOrderVo (已更新)
CloudRk: CloudRkVo (已更新)
CloudTyc: CloudTycVo (已更新)
CloudYu: CloudYuVo (已更新)
ProjectFile: ProjectFileVo (已更新)

CompanyContact: CompanyContactVo (已更新)
ContractType: ContractTypeVo (已更新)
ContractKind: ContractKindVo (已更新)
ContractPayPlan: ContractPayPlanVo (已更新)
CustomerCatalog: CustomerCatalogVo (已更新)
Department: DepartmentVo (已更新)
Function: FunctionVo (已更新)
ProjectType: ProjectTypeVo (已更新)
ProductType: ProductTypeVo (已更新)
ProductUsage: ProductUsageVo (已更新)
Price: PriceVo (已更新)
ContractGroup: ContractGroupVo (已更新)
DeliverySignMethod: DeliverySignMethodVo (已更新)
Employee: EmployeeVo (已更新)
Inventory: InventoryVo (已更新)
InventoryCatalog: InventoryCatalogVo (已更新)
Project: ProjectVo (已更新)
ProjectIndustry: ProjectIndustryVo (已更新)
ProjectSaleType: ProjectSaleTypeVo (已更新)
CompanyBankAccount: CompanyBankAccountVo (已更新)
CompanyInvoiceInfo: CompanyInvoiceInfoVo (已更新)
CompanyOldName: CompanyOldNameVo (已更新)
Company: CompanyVo (已更新)
Contract: ContractVo (已更新)
PurchaseReceipt: PurchaseReceiptVo (已更新)

ContractItem: ContractItemVo (已检查)
VolumeSize: VolumeSizeVo (已检查)
Bank: BankVo (已检查)
Contract: ContractVo (已检查)
ContractBidVendor: ContractBidVendorVo (已检查)
ContractCatalog: ContractCatalogVo (已检查)
ContractFile: ContractFileVo (已检查)
ContractFileTypeLocal: ContractFileTypeLocalVo (已检查)
Employee: EmployeeVo (已检查)
Department: DepartmentVo (已检查)
Inventory: InventoryVo (已更新)
InventoryCatalog: InventoryCatalogVo (已检查)
Project: ProjectVo (已检查)
ProjectIndustry: ProjectIndustryVo (已检查)
ProjectSaleType: ProjectSaleTypeVo (已检查)
Company: CompanyVo (已检查)
Invoice: InvoiceVo (已更新)
PurchaseOrder: PurchaseOrderVo (已更新)
SalesOrder: SalesOrderVo (已更新)
ProjectBid: ProjectBidVo (已更新)
ProjectQuotation: ProjectQuotationVo (已更新)
CompanyBankAccount: CompanyBankAccountVo (已检查)
ExtendVendorInfo: ExtendVendorInfoVo (已更新)
ProjectCost: ProjectCostVo (已更新)
VendorGroup: VendorGroupVo (已更新)
VendorGroupRequireFileType: VendorGroupRequireFileTypeVo (已更新)
ProjectCostItem: ProjectCostItemVo (已更新)
ProjectFileTypeLocal: ProjectFileTypeLocalVo (已更新)
VendorTypeLocal: VendorTypeLocalVo (已更新)
VendorFileTypeLocal: VendorFileTypeLocalVo (已更新)