refactor(model): 重构模型类包结构并优化序列化处理
重构模型类包结构,将模型类按功能模块划分到不同的子包中。优化序列化处理,为VO类添加serialVersionUID并实现Serializable接口。移除部分冗余的serialVersionUID字段,简化模型类代码。同时修复UITools中空值处理的问题,并更新pom版本至0.0.100-SNAPSHOT。 - 将模型类按功能模块划分到ds子包中 - 为VO类添加序列化支持 - 移除冗余的serialVersionUID字段 - 修复UITools空值处理问题 - 更新项目版本号
This commit is contained in:
157
.trae/rules/client_controller_rules.md
Normal file
157
.trae/rules/client_controller_rules.md
Normal file
@@ -0,0 +1,157 @@
|
||||
# 客户端 Controller 类规则
|
||||
|
||||
## 1. 目录结构
|
||||
|
||||
客户端控制器位于`client/src/main/java/com/ecep/contract/controller/`目录下,按业务模块组织:
|
||||
|
||||
- **根目录**:包含基础控制器、抽象控制器和主窗口控制器
|
||||
- **业务子包**:按业务领域组织,如`company/`、`project/`、`contract/`、`vendor/`等
|
||||
- **tab/子包**:包含所有Tab皮肤控制器和相关接口、抽象类
|
||||
- **table/子包**:包含表格相关控制器和单元格实现
|
||||
|
||||
## 2. 命名规范
|
||||
|
||||
- **基础控制器**:`BaseController.java`
|
||||
- **抽象控制器**:以`Abst`开头,如`AbstEntityController.java`、`AbstManagerWindowController.java`
|
||||
- **窗口控制器**:以`WindowController`结尾,如`HomeWindowController.java`
|
||||
- **管理窗口控制器**:以`ManagerWindowController`结尾,如`CompanyManagerWindowController.java`
|
||||
- **Tab皮肤控制器**:以`TabSkin`结尾,如`CompanyTabSkinBase.java`
|
||||
- **管理器皮肤**:以`ManagerSkin`结尾,如`CompanyManagerSkin.java`
|
||||
- **组件控制器**:如`OkHttpLoginController.java`
|
||||
|
||||
## 3. 继承关系
|
||||
|
||||
控制器类遵循以下继承层次结构:
|
||||
|
||||
- `BaseController`:所有控制器的基础类,提供窗口显示、异常处理等通用功能
|
||||
- `AbstEntityBasedController`:基于实体的控制器抽象类
|
||||
- `AbstManagerWindowController`:管理窗口控制器的抽象类,包含搜索、分页等功能
|
||||
- `AbstEntityController<T extends IdentityEntity, TV extends IdentityViewModel<T>>`:实体详情窗口控制器的抽象类
|
||||
- 具体业务窗口控制器,如`CompanyWindowController`、`ProjectWindowController`等
|
||||
|
||||
Tab相关控制器继承关系:
|
||||
|
||||
- `Skin`:皮肤接口基础
|
||||
- `TabSkin`:Tab皮肤接口
|
||||
- `AbstGenericTabSkin<C extends BaseController>`:通用Tab皮肤抽象类
|
||||
- `AbstEntityBasedTabSkin<C extends AbstEntityController<T, V>, T extends IdentityEntity, V extends IdentityViewModel<T>>`:基于实体的Tab皮肤抽象类
|
||||
- 具体业务Tab皮肤控制器,如`CompanyTabSkinBase.java`、`ContractTabSkinFiles.java`等
|
||||
|
||||
## 4. 注解使用
|
||||
|
||||
客户端控制器类应使用以下注解:
|
||||
|
||||
- `@Component`:声明为Spring组件,使其可被Spring容器管理
|
||||
- `@Scope("prototype")`:设置为原型作用域,确保每次请求创建新实例
|
||||
- `@Lazy`:延迟加载,提高应用启动性能
|
||||
- `@FxmlPath("/ui/[业务模块]/[文件名].fxml")`:指定对应的FXML文件路径
|
||||
- `@Autowired`:自动注入依赖的服务层组件
|
||||
|
||||
## 5. FXML文件规范
|
||||
|
||||
- **文件位置**:FXML文件通常位于`/client/src/main/resources/ui/`目录下,按业务模块组织子目录
|
||||
- **命名规范**:使用小写字母和下划线,如`home.fxml`、`company/company.fxml`
|
||||
- **关联方式**:通过`@FxmlPath`注解指定控制器对应的FXML文件路径
|
||||
- **组件ID**:FXML文件中组件的id应与控制器中对应的字段名保持一致(驼峰命名法)
|
||||
|
||||
## 6. 控制器方法规范
|
||||
|
||||
### 6.1 初始化方法
|
||||
|
||||
- `initialize()`:控制器初始化方法,用于设置UI组件初始状态、绑定事件监听器等
|
||||
- 此方法会在FXML加载完成后自动调用
|
||||
|
||||
### 6.2 窗口生命周期方法
|
||||
|
||||
- `onShown(WindowEvent windowEvent)`:窗口显示时触发的方法
|
||||
- 用于执行窗口显示后的初始化操作,如数据加载、组件状态更新等
|
||||
- 通常需要调用`super.onShown(windowEvent)`确保父类逻辑执行
|
||||
|
||||
### 6.3 窗口显示方法
|
||||
|
||||
- `public static void show()`:静态方法,用于便捷地显示控制器对应的窗口
|
||||
- 通常有多个重载版本,支持不同参数(如viewModel、owner窗口等)
|
||||
- 内部调用`BaseController.show()`方法实现窗口显示逻辑
|
||||
|
||||
### 6.4 Tab相关方法
|
||||
|
||||
Tab皮肤控制器包含以下核心方法:
|
||||
|
||||
- `install()`:安装Tab皮肤,加载FXML并初始化UI组件
|
||||
- `initializeUIComponents()`:初始化UI组件,设置数据绑定和事件监听
|
||||
- `getTab()`:获取对应的Tab对象
|
||||
- `save()`:保存Tab中的数据变更
|
||||
- `dispose()`:释放资源,清理监听器等
|
||||
|
||||
## 7. 字段规范
|
||||
|
||||
- **UI组件字段**:与FXML文件中的组件id对应,使用`public`访问修饰符
|
||||
- **服务依赖字段**:使用`@Autowired`注解注入,通常使用`private`访问修饰符
|
||||
- **ViewModel字段**:通常作为控制器的核心数据模型,提供`getter/setter`方法
|
||||
- **命名规范**:使用驼峰命名法,如`nameField`、`tabPane`、`saveBtn`等
|
||||
|
||||
## 8. 数据绑定与更新
|
||||
|
||||
- **ViewModel绑定**:控制器通常通过ViewModel与实体数据进行绑定
|
||||
- **异步数据加载**:使用`CompletableFuture`进行异步数据加载,避免阻塞UI线程
|
||||
- **UI更新**:在JavaFX应用线程中更新UI组件,可使用`Platform.runLater()`确保线程安全
|
||||
|
||||
## 9. 事件处理
|
||||
|
||||
- **按钮点击事件**:通过`setOnAction()`方法绑定事件处理器
|
||||
- **表单字段变更**:可通过JavaFX的属性绑定机制监听字段变更
|
||||
- **Tab切换事件**:实现`onTabShown()`方法处理Tab显示事件
|
||||
|
||||
## 10. 异常处理
|
||||
|
||||
- 使用`handleException()`方法统一处理异常
|
||||
- 异常信息通常会显示在状态栏并记录日志
|
||||
- 异步操作中的异常应通过`exceptionally()`或`handle()`方法捕获处理
|
||||
|
||||
## 11. 最佳实践
|
||||
|
||||
- **职责分离**:控制器应专注于UI交互和数据展示,业务逻辑应委托给服务层
|
||||
- **避免重复代码**:利用抽象类和接口提取通用逻辑
|
||||
- **资源管理**:及时释放资源,避免内存泄漏
|
||||
- **线程安全**:确保在JavaFX应用线程中更新UI
|
||||
- **代码可读性**:添加适当的注释,遵循命名规范
|
||||
|
||||
## 12. 示例代码结构
|
||||
|
||||
```java
|
||||
@Lazy
|
||||
@Scope("prototype")
|
||||
@Component
|
||||
@FxmlPath("/ui/[模块名]/[文件名].fxml")
|
||||
public class [业务]WindowController extends AbstEntityController<[Vo类型], [ViewModel类型]> {
|
||||
private static final Logger logger = LoggerFactory.getLogger([业务]WindowController.class);
|
||||
|
||||
@Autowired
|
||||
private [业务]Service [业务]Service;
|
||||
|
||||
// UI组件字段
|
||||
public BorderPane root;
|
||||
public TabPane tabPane;
|
||||
public TextField nameField;
|
||||
// ...其他UI组件
|
||||
|
||||
public static void show([Vo类型] entity, Window window) {
|
||||
show([ViewModel类型].from(entity), window);
|
||||
}
|
||||
|
||||
public static void show([ViewModel类型] viewModel, Window window) {
|
||||
BaseController.show([业务]WindowController.class, viewModel, window);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
// 初始化UI组件和事件监听
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShown(WindowEvent windowEvent) {
|
||||
super.onShown(windowEvent);
|
||||
// 窗口显示后的逻辑
|
||||
}
|
||||
}
|
||||
```
|
||||
239
.trae/rules/client_converter_rules.md
Normal file
239
.trae/rules/client_converter_rules.md
Normal file
@@ -0,0 +1,239 @@
|
||||
# 客户端转换器类规则
|
||||
|
||||
## 1. 目录结构
|
||||
- 所有类型转换器类必须位于 `com.ecep.contract.converter` 包下
|
||||
- 按照实体类型组织,无需进一步分包
|
||||
|
||||
## 2. 命名规范
|
||||
- 类名格式:`[EntityName]StringConverter`
|
||||
- 例如:`ContractStringConverter`、`CompanyStringConverter`、`VendorStringConverter`
|
||||
|
||||
## 3. 继承关系
|
||||
### 3.1 基础转换器类型
|
||||
- 直接继承 `javafx.util.StringConverter<T>` 接口
|
||||
- 适用于简单的转换场景
|
||||
- 例如:
|
||||
```java
|
||||
public class ContractStringConverter extends StringConverter<ContractVo> {
|
||||
// 实现代码
|
||||
}
|
||||
```
|
||||
|
||||
### 3.2 增强转换器类型
|
||||
- 继承自定义的 `EntityStringConverter<T>` 抽象类
|
||||
- 适用于需要更多功能(如延迟初始化、搜索建议等)的场景
|
||||
- 大多数业务实体转换器应使用此类型
|
||||
- 例如:
|
||||
```java
|
||||
public class CompanyStringConverter extends EntityStringConverter<CompanyVo> {
|
||||
// 实现代码
|
||||
}
|
||||
```
|
||||
|
||||
### 3.3 枚举转换器类型
|
||||
- 继承 `EnumEntityStringConverter<E extends Enum<?>, T extends BaseEnumEntity<E>>`
|
||||
- 专门用于处理枚举类型实体
|
||||
- 例如:
|
||||
```java
|
||||
public class EnumEntityStringConverter<E extends Enum<?>, T extends BaseEnumEntity<E>> extends StringConverter<T> {
|
||||
// 实现代码
|
||||
}
|
||||
```
|
||||
|
||||
## 4. 核心接口实现
|
||||
### 4.1 StringConverter<T> 接口
|
||||
- 所有转换器必须实现 `toString(T object)` 方法
|
||||
- 所有转换器必须实现 `fromString(String string)` 方法
|
||||
|
||||
## 5. Spring框架集成
|
||||
### 5.1 组件注解
|
||||
- 增强转换器类型通常使用 `@Component` 注解标记为Spring组件
|
||||
- 结合 `@Lazy` 注解实现延迟加载
|
||||
- 例如:
|
||||
```java
|
||||
@Lazy
|
||||
@Component
|
||||
public class CompanyStringConverter extends EntityStringConverter<CompanyVo> {
|
||||
// 实现代码
|
||||
}
|
||||
```
|
||||
|
||||
### 5.2 依赖注入
|
||||
- 使用 `@Autowired` 注解注入对应的Service实例
|
||||
- 通常也需要为注入的Service添加 `@Lazy` 注解
|
||||
- 例如:
|
||||
```java
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CompanyService service;
|
||||
```
|
||||
|
||||
## 6. 初始化机制
|
||||
### 6.1 构造函数
|
||||
- 基础转换器通常使用构造函数接收Service实例
|
||||
- 例如:
|
||||
```java
|
||||
public ContractStringConverter(ContractService service) {
|
||||
this.service = service;
|
||||
}
|
||||
```
|
||||
|
||||
### 6.2 初始化方法
|
||||
- 增强转换器使用 `@PostConstruct` 注解标记初始化方法
|
||||
- 在初始化方法中配置转换器的各种功能
|
||||
- 例如:
|
||||
```java
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
setInitialized(project -> service.findById(project.getId()));
|
||||
setSuggestion(service::search);
|
||||
setFromString(service::findByName);
|
||||
}
|
||||
```
|
||||
|
||||
## 7. EntityStringConverter 特性配置
|
||||
继承自 EntityStringConverter 的增强转换器可以配置以下特性:
|
||||
|
||||
### 7.1 对象初始化
|
||||
- 使用 `setInitialized(Function<T, T> initialized)` 配置对象延迟初始化逻辑
|
||||
- 通常调用Service的findById方法
|
||||
- 例如:`setInitialized(project -> service.findById(project.getId()))`
|
||||
|
||||
### 7.2 搜索建议
|
||||
- 使用 `setSuggestion(Function<String, List<T>> suggestion)` 配置自动补全数据提供方法
|
||||
- 通常调用Service的search方法
|
||||
- 例如:`setSuggestion(service::search)`
|
||||
|
||||
### 7.3 字符串转换
|
||||
- 使用 `setFromString(Function<String, T> fromString)` 配置从字符串到对象的转换逻辑
|
||||
- 通常调用Service的findByName方法
|
||||
- 例如:`setFromString(service::findByName)`
|
||||
|
||||
### 7.4 格式化器
|
||||
- 使用 `setFormater(Function<T, String> formater)` 配置自定义格式化逻辑
|
||||
- 用于自定义对象的字符串表示
|
||||
- 例如:`setFormater(contract -> contract.getCode() + " " + contract.getName())`
|
||||
|
||||
## 8. 核心方法实现规范
|
||||
### 8.1 toString(T object) 方法
|
||||
- 将对象转换为可读的字符串表示
|
||||
- 必须处理null情况
|
||||
- 通常返回对象的名称、编码或其他关键标识
|
||||
- 对于基础转换器:
|
||||
```java
|
||||
@Override
|
||||
public String toString(ContractVo cc) {
|
||||
return cc.getCode() + " " + cc.getName();
|
||||
}
|
||||
```
|
||||
- 对于枚举转换器:
|
||||
```java
|
||||
@Override
|
||||
public String toString(T object) {
|
||||
return object == null ? "" : object.getValue();
|
||||
}
|
||||
```
|
||||
|
||||
### 8.2 fromString(String string) 方法
|
||||
- 从字符串还原对象实例
|
||||
- 通常调用Service的findByName或findByCode方法
|
||||
- 例如:
|
||||
```java
|
||||
@Override
|
||||
public ContractVo fromString(String string) {
|
||||
return service.findByCode(string);
|
||||
}
|
||||
```
|
||||
- 对于某些场景(如枚举转换器),可能返回null
|
||||
|
||||
## 9. 与Service类的关联
|
||||
### 9.1 Service中的转换器创建
|
||||
- 在Service类中通常会创建并持有对应的StringConverter实例
|
||||
- 实现 `getStringConverter()` 方法返回转换器实例
|
||||
- 例如:
|
||||
```java
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "contract-cache")
|
||||
public class ContractService extends QueryService<ContractVo, ContractViewModel> {
|
||||
|
||||
private final ContractStringConverter stringConverter = new ContractStringConverter(this);
|
||||
|
||||
@Override
|
||||
public StringConverter<ContractVo> getStringConverter() {
|
||||
return stringConverter;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 9.2 Service方法支持
|
||||
- Service需提供 `findByName`、`findById`、`search` 等方法供转换器使用
|
||||
- 这些方法通常需要添加缓存注解以提高性能
|
||||
|
||||
## 10. 使用场景
|
||||
StringConverter主要用于以下场景:
|
||||
- ComboBox、ChoiceBox等选择组件的数据绑定和显示
|
||||
- 表单数据的绑定和转换
|
||||
- 支持用户输入的自动补全功能
|
||||
- 在表格、列表等UI组件中显示对象的可读表示
|
||||
|
||||
## 11. 最佳实践
|
||||
- 对于大多数业务实体,优先使用继承 `EntityStringConverter<T>` 的增强转换器
|
||||
- 使用Spring的依赖注入和组件管理功能
|
||||
- 正确处理null值和空字符串
|
||||
- 为频繁调用的Service方法添加缓存支持
|
||||
- 实现合理的toString逻辑,提供有意义的对象表示
|
||||
|
||||
## 12. 示例代码结构
|
||||
### 12.1 基础转换器示例
|
||||
```java
|
||||
package com.ecep.contract.converter;
|
||||
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.vo.ContractVo;
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
public class ContractStringConverter extends StringConverter<ContractVo> {
|
||||
private final ContractService service;
|
||||
|
||||
public ContractStringConverter(ContractService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(ContractVo cc) {
|
||||
return cc == null ? "" : cc.getCode() + " " + cc.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractVo fromString(String string) {
|
||||
return string == null || string.isEmpty() ? null : service.findByCode(string);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 12.2 增强转换器示例
|
||||
```java
|
||||
package com.ecep.contract.converter;
|
||||
|
||||
import com.ecep.contract.service.CompanyService;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Lazy
|
||||
@Component
|
||||
public class CompanyStringConverter extends EntityStringConverter<CompanyVo> {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CompanyService service;
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
setInitialized(company -> service.findById(company.getId()));
|
||||
setSuggestion(service::search);
|
||||
setFromString(service::findByName);
|
||||
}
|
||||
}
|
||||
```
|
||||
146
.trae/rules/client_service_rules.md
Normal file
146
.trae/rules/client_service_rules.md
Normal file
@@ -0,0 +1,146 @@
|
||||
# 客户端 Service 类规则
|
||||
|
||||
## 1. 目录结构
|
||||
- 所有客户端 Service 类位于 `client/src/main/java/com/ecep/contract/service/` 目录下
|
||||
- 按业务领域组织,直接放置在 service 包下,不进行子包划分
|
||||
- 服务类命名与实体类一一对应
|
||||
|
||||
## 2. 命名规范
|
||||
- 服务类命名格式为:`[实体名称]Service.java`
|
||||
- 例如:`CompanyService.java`、`ContractService.java`、`ProjectService.java`
|
||||
- 基础服务接口命名为:`IEntityService.java`、`ViewModelService.java`
|
||||
- 泛型基础服务类命名为:`QueryService.java`
|
||||
|
||||
## 3. 继承关系
|
||||
- 业务服务类通常继承自泛型基础服务类 `QueryService<T, TV>`
|
||||
- `T` 表示 VO 类型(实现了 IdentityEntity 接口)
|
||||
- `TV` 表示 ViewModel 类型(实现了 IdentityViewModel<T> 接口)
|
||||
- `QueryService` 实现了 `ViewModelService<T, TV>` 接口
|
||||
- `ViewModelService` 继承了 `IEntityService<T>` 接口
|
||||
- 特定场景下可以不继承 `QueryService`,直接实现所需接口或创建独立服务类
|
||||
|
||||
```java
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "company")
|
||||
public class CompanyService extends QueryService<CompanyVo, CompanyViewModel> {
|
||||
// 业务方法实现
|
||||
}
|
||||
```
|
||||
|
||||
## 4. 注解使用
|
||||
- **@Service**:标记为 Spring 服务组件,使其可被自动发现和注入
|
||||
- **@CacheConfig**:配置缓存名称,通常与服务类名对应
|
||||
- **@Cacheable**:标记方法结果可缓存,需指定缓存键(key)
|
||||
- **@CacheEvict**:标记方法执行后清除缓存,可指定缓存键或清除所有
|
||||
- **@Caching**:组合多个缓存操作(如同时清除多个缓存条目)
|
||||
- **@Autowired**:用于自动注入依赖的其他服务
|
||||
|
||||
```java
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "contract")
|
||||
public class ContractService extends QueryService<ContractVo, ContractViewModel> {
|
||||
@Autowired
|
||||
private SysConfService confService;
|
||||
|
||||
@Cacheable(key = "#p0")
|
||||
public ContractVo findById(Integer id) {
|
||||
return super.findById(id);
|
||||
}
|
||||
|
||||
@Caching(evict = {
|
||||
@CacheEvict(key = "#p0.id"),
|
||||
@CacheEvict(key = "'code-'+#p0.code")
|
||||
})
|
||||
public ContractVo save(ContractVo contract) {
|
||||
return super.save(contract);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 5. 缓存机制
|
||||
- 每个服务类应有独立的缓存名称空间
|
||||
- 缓存键(key)应具有唯一性,通常使用 ID、代码或名称等唯一标识
|
||||
- 保存和删除操作时应清除相关缓存,保持数据一致性
|
||||
- 可使用 SpEL 表达式动态生成缓存键
|
||||
- 频繁查询的数据应考虑缓存,提高性能
|
||||
|
||||
## 6. 异步调用机制
|
||||
- 使用 `async()` 方法进行异步远程调用
|
||||
- 方法参数通常包括:方法名、参数值、参数类型列表
|
||||
- 使用 `CompletableFuture` 处理异步结果
|
||||
- 使用 `handle()` 方法处理响应和异常
|
||||
- 远程调用异常应包装为 RuntimeException 并提供详细错误信息
|
||||
|
||||
```java
|
||||
@Cacheable(key = "'code-'+#p0")
|
||||
public ContractVo findByCode(String code) {
|
||||
try {
|
||||
return async("findByCode", code, String.class).handle((response, ex) -> {
|
||||
if (ex != null) {
|
||||
throw new RuntimeException("远程方法+findByCode+调用失败", ex);
|
||||
}
|
||||
if (response != null) {
|
||||
return updateValue(createNewEntity(), response);
|
||||
}
|
||||
return null;
|
||||
}).get();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("查询失败: " + code, e);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 7. 基础方法实现
|
||||
- 应实现 `IEntityService<T>` 接口定义的核心方法:
|
||||
- `findById(Integer id)`:根据 ID 查询实体
|
||||
- `save(T entity)`:保存实体
|
||||
- `delete(T entity)`:删除实体
|
||||
- `findAll()`:查询所有实体
|
||||
- `findAll(Map<String, Object> params, Pageable pageable)`:条件分页查询
|
||||
- `getStringConverter()`:获取类型转换器
|
||||
- 通常通过继承 `QueryService` 来复用这些基础方法的实现
|
||||
- 可根据业务需求重写或扩展基础方法
|
||||
|
||||
## 8. 业务方法规范
|
||||
- 业务方法应与服务端对应,保持方法名和参数一致
|
||||
- 方法命名应清晰表达其功能,如 `findByName`, `findByCode`
|
||||
- 复杂业务逻辑应封装为独立方法
|
||||
- 参数校验应在方法开始处进行
|
||||
- 返回值类型应明确,避免使用过于泛化的类型
|
||||
|
||||
## 9. 类型转换器
|
||||
- 实现 `getStringConverter()` 方法,返回对应的 StringConverter 实例
|
||||
- 通常创建专用的 Converter 类,如 `CustomerCatalogStringConverter`
|
||||
- 转换器实例应作为服务类的成员变量,避免重复创建
|
||||
|
||||
```java
|
||||
public class CustomerCatalogService extends QueryService<CustomerCatalogVo, CustomerCatalogViewModel> {
|
||||
private final CustomerCatalogStringConverter stringConverter = new CustomerCatalogStringConverter(this);
|
||||
|
||||
@Override
|
||||
public StringConverter<CustomerCatalogVo> getStringConverter() {
|
||||
return stringConverter;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 10. 错误处理
|
||||
- 远程调用异常应捕获并包装为更具描述性的 RuntimeException
|
||||
- 提供详细的错误信息,包括调用的方法名和参数
|
||||
- 对于可预期的业务异常,可添加专门的处理逻辑
|
||||
- 不推荐使用 printStackTrace(),应使用日志记录异常
|
||||
|
||||
## 11. 工具方法和辅助功能
|
||||
- 通用功能可封装为工具方法
|
||||
- 配置相关操作可通过 `SysConfService` 实现
|
||||
- 文件路径处理应使用 `File` 类和相关工具方法
|
||||
- 日期时间处理应使用 Java 8+ 的日期时间 API
|
||||
|
||||
## 12. 最佳实践
|
||||
- 遵循单一职责原则,每个服务类专注于一个业务领域
|
||||
- 优先使用继承和接口实现来复用代码
|
||||
- 合理使用缓存提高性能,但注意缓存一致性
|
||||
- 异步调用应正确处理异常和超时情况
|
||||
- 服务类之间的依赖应通过 `@Autowired` 注入,避免硬编码
|
||||
- 方法实现应简洁明了,复杂逻辑应拆分
|
||||
- 为重要方法添加 JavaDoc 注释,说明其功能和参数含义
|
||||
0
.trae/rules/client_task_rules.md
Normal file
0
.trae/rules/client_task_rules.md
Normal file
69
.trae/rules/entity_rules.md
Normal file
69
.trae/rules/entity_rules.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# 实体类规则
|
||||
|
||||
## 1. 目录结构
|
||||
- 实体类统一放置在 `common/src/main/java/com/ecep/contract/model/` 目录下
|
||||
- 按业务领域组织,不使用子目录
|
||||
|
||||
## 2. 命名规范
|
||||
- 类名:使用驼峰命名法,首字母大写,如 `Contract.java`、`Company.java`
|
||||
- 表名:通常与类名对应,使用大写字母和下划线,如 `CONTRACT`、`COMPANY`
|
||||
- 字段名:使用小写字母和驼峰命名法,对应数据库中使用大写字母和下划线的列名
|
||||
|
||||
## 3. 继承与接口实现
|
||||
- 实体类通常实现以下接口:
|
||||
- `IdentityEntity`:提供主键ID的getter/setter及equals方法实现
|
||||
- `BasedEntity`:提供toPrettyString()方法
|
||||
- `NamedEntity`:提供name属性的getter/setter(适用于有名称的实体)
|
||||
- `Voable<T>`:提供toVo()方法,用于将实体转换为对应的VO对象
|
||||
- 特定领域接口:如 `CompanyBasedEntity`、`ContractBasedEntity`、`ProjectBasedEntity` 等
|
||||
|
||||
## 4. 注解规范
|
||||
- **JPA注解**:
|
||||
- `@Entity`:标记为实体类
|
||||
- `@Table(name = "表名", schema = "数据库名")`:指定对应的数据库表和数据库
|
||||
- `@Id`:标记主键字段
|
||||
- `@GeneratedValue(strategy = GenerationType.IDENTITY)`:指定主键生成策略
|
||||
- `@Column(name = "列名", nullable = false, length = 长度)`:指定字段对应的数据库列属性
|
||||
- `@ManyToOne(fetch = FetchType.LAZY)`:指定多对一关系,通常使用LAZY加载
|
||||
- `@JoinColumn(name = "外键列名")`:指定外键列
|
||||
- `@Enumerated(EnumType.ORDINAL)`:指定枚举类型的存储方式
|
||||
- `@Lob`:指定大对象类型
|
||||
- `@Version`:指定乐观锁版本字段
|
||||
- **Lombok注解**:
|
||||
- `@Getter`:生成getter方法
|
||||
- `@Setter`:生成setter方法
|
||||
- `@ToString`:生成toString方法,复杂关联对象可使用`@ToString.Exclude`排除
|
||||
|
||||
## 5. 字段规范
|
||||
- 主键字段:
|
||||
- 类型:`Integer`
|
||||
- 命名:`id`
|
||||
- 注解:`@Id`、`@GeneratedValue(strategy = GenerationType.IDENTITY)`
|
||||
- 其他字段:
|
||||
- 基本类型:使用Java包装类型(如`Integer`、`Boolean`)而不是原始类型
|
||||
- 时间类型:使用`java.time.LocalDate`或`java.time.LocalDateTime`
|
||||
- 布尔类型:使用`boolean`或`Boolean`,对应数据库中的`BIT`或`BOOLEAN`类型
|
||||
- 关联关系:使用`@ManyToOne`、`@OneToMany`等注解定义
|
||||
|
||||
## 6. 方法规范
|
||||
- `equals`方法:通常使用`HibernateProxyUtils`工具类处理代理对象的比较
|
||||
- `hashCode`方法:通常使用`HibernateProxyUtils.hashCode(this)`实现
|
||||
- `toVo`方法:实现`Voable`接口,将实体转换为对应的VO对象
|
||||
- `toString`方法:通常使用Lombok的`@ToString`注解生成
|
||||
|
||||
## 7. 注释规范
|
||||
- 类注释:使用JavaDoc格式,描述实体类的用途
|
||||
- 字段注释:使用JavaDoc格式,描述字段的含义、数据来源、取值范围等
|
||||
- 对于特殊字段,可包含详细的说明表格或示例
|
||||
|
||||
## 8. 序列化规范
|
||||
- **重要**:实体类**不包含**`Serializable`接口和`serialVersionUID`字段
|
||||
- 序列化相关功能由对应的VO类实现
|
||||
|
||||
## 9. 最佳实践
|
||||
- 实体类应保持简洁,只包含数据和基本的数据访问方法
|
||||
- 业务逻辑应在服务层实现
|
||||
- 复杂的查询逻辑应在Repository层或通过Specification实现
|
||||
- 避免在实体类中使用复杂的计算逻辑
|
||||
- 对于多对多关系,建议使用中间表和两个一对多关系实现
|
||||
- 关联关系应使用懒加载(LAZY)以提高性能
|
||||
@@ -1,4 +1,4 @@
|
||||
# Contract-Manager 项目规则
|
||||
# 项目规则
|
||||
|
||||
## 技术栈规范
|
||||
|
||||
@@ -39,10 +39,61 @@
|
||||
- SQL文件:表名使用大写和下划线,如 `CONTRACT_TYPE_LOCAL.sql`
|
||||
|
||||
## 目录结构规范
|
||||
- 源代码位于 `src/main/java` 目录
|
||||
- 资源文件位于 `src/main/resources` 目录
|
||||
- 测试代码位于 `src/test` 目录
|
||||
- 数据库脚本位于 `docs/db` 目录
|
||||
### 项目整体结构
|
||||
- `client/`: 客户端模块,基于JavaFX实现的桌面应用
|
||||
- `server/`: 服务端模块,基于Spring Boot实现的后端服务
|
||||
- `common/`: 公共模块,包含客户端和服务端共享的代码
|
||||
- `docs/`: 项目文档和数据库脚本目录
|
||||
- `.trae/`: Trae IDE相关配置和规则
|
||||
- `.mvn/`: Maven包装器配置
|
||||
- 根目录下包含Maven构建文件和配置文件
|
||||
|
||||
### server 模块目录结构
|
||||
- `src/main/java/com/ecep/contract/`: 主包路径
|
||||
- `api/`: API接口定义
|
||||
- `cloud/`: 云服务集成相关代码
|
||||
- `config/`: Spring Boot配置类
|
||||
- `controller/`: Web控制器
|
||||
- `ds/`: 数据访问层,按业务领域组织
|
||||
- `company/`: 公司相关业务
|
||||
- `contract/`: 合同相关业务
|
||||
- `customer/`: 客户相关业务
|
||||
- `project/`: 项目相关业务
|
||||
- `vendor/`: 供应商相关业务
|
||||
- 每个业务领域包含:`model/`(实体类)、`repository/`(数据访问接口)、`service/`(业务逻辑)、`vo/`(视图对象)
|
||||
- `handler/`: WebSocket处理器
|
||||
- `service/`: 服务层,包含一些通用服务和任务处理器
|
||||
- `ui/`: UI相关组件
|
||||
- `util/`: 工具类
|
||||
- 核心服务接口和基类文件直接位于contract包下
|
||||
- `src/main/resources/`: 资源文件目录
|
||||
- `src/test/`: 测试代码目录
|
||||
|
||||
### client 模块目录结构
|
||||
- `src/main/java/com/ecep/contract/`: 主包路径
|
||||
- `controller/`: JavaFX控制器,按业务领域组织, 详细规范见 .trae\rules\client_controller_rules.md
|
||||
- 包含各种业务窗口控制器和Tab皮肤控制器
|
||||
- `converter/`: 类型转换器,详细规范见 .trae\rules\client_converter_rules.md
|
||||
- `serializer/`: 序列化相关类
|
||||
- `service/`: 客户端服务层,与服务端交互, 详细规范见 .trae\rules\client_service_rules.md
|
||||
- `task/`: 客户端任务类, 详细规范见 .trae\rules\client_task_rules.md
|
||||
- `util/`: 工具类
|
||||
- `vm/`: 视图模型
|
||||
- `src/main/resources/ui/`: FXML界面文件目录
|
||||
- `src/test/`: 测试代码目录
|
||||
|
||||
### common 模块目录结构
|
||||
- `src/main/java/ecep/contract/`: 包含客户端和服务端共享的代码
|
||||
- `constant/`: 常量类,按业务领域组织
|
||||
- `model/`: 实体类,按业务领域组织, 不包含Serializable接口和serialVersionUID字段, 详细规范见 .trae\rules\entity_rules.md
|
||||
- `vo/`: 视图对象,按业务领域组织, 包含Serializable接口和serialVersionUID字段, 详细规范见 .trae\rules\vo_rules.md
|
||||
- `util/`: 工具类
|
||||
|
||||
### 文档和资源目录
|
||||
- `docs/db/`: 数据库脚本文件
|
||||
- `docs/task/`: 任务相关文档和规范
|
||||
- `docs/model/`: 数据模型文档
|
||||
- 其他项目文档和资源
|
||||
|
||||
## 数据库规范
|
||||
- 表名使用大写字母和下划线,如 `COMPANY_VENDOR_FILE_TYPE_LOCAL`
|
||||
|
||||
58
.trae/rules/vo_rules.md
Normal file
58
.trae/rules/vo_rules.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# VO类规则
|
||||
|
||||
## 1. 目录结构
|
||||
- VO类统一放置在 `common/src/main/java/com/ecep/contract/vo/` 目录下
|
||||
- 按业务领域组织,不使用子目录
|
||||
|
||||
## 2. 命名规范
|
||||
- 类名:使用驼峰命名法,首字母大写,以Vo结尾,如 `ContractVo.java`、`CompanyVo.java`
|
||||
|
||||
## 3. 继承与接口实现
|
||||
- **必须实现** `java.io.Serializable` 接口,用于对象序列化
|
||||
- **通常实现** `IdentityEntity` 接口,提供主键ID的getter/setter方法
|
||||
- **可能实现** `NamedEntity` 接口,提供name属性的getter/setter方法(适用于有名称的VO)
|
||||
- **可能实现**特定领域接口,如:
|
||||
- `CompanyBasedVo`:提供companyId属性的getter/setter方法
|
||||
- `ProjectBasedVo`:提供project属性的getter/setter方法
|
||||
- `ContractBasedVo`:提供contractId属性的getter/setter方法
|
||||
- 其他类似的基于特定实体的接口
|
||||
|
||||
## 4. 注解规范
|
||||
- 通常使用Lombok的 `@Data` 注解,自动生成getter、setter、equals、hashCode和toString方法
|
||||
|
||||
## 5. 序列化规范
|
||||
- **必须包含** `private static final long serialVersionUID = 1L;` 字段,用于版本控制
|
||||
- 所有字段类型必须是可序列化的
|
||||
|
||||
## 6. 字段规范
|
||||
- 字段类型:
|
||||
- 整数类型:可使用 `Integer` 包装类型或 `int` 原始类型
|
||||
- 布尔类型:可使用 `Boolean` 包装类型或 `boolean` 原始类型
|
||||
- 时间类型:使用 `java.time.LocalDate`(日期)或 `java.time.LocalDateTime`(日期时间)
|
||||
- 字符串类型:使用 `String`
|
||||
- 浮点数类型:使用 `double` 或 `Double`
|
||||
- 关联关系:
|
||||
- 通常只包含关联实体的ID字段,如 `companyId`、`project`、`contractId` 等
|
||||
- 不包含实体对象的直接引用
|
||||
- 默认值:
|
||||
- 布尔类型字段通常有默认值(如 `false`)
|
||||
- 其他类型根据业务需求设置默认值
|
||||
|
||||
## 7. 注释规范
|
||||
- 类注释:使用JavaDoc格式,描述VO类的用途,如 `/** 项目报价视图对象 */`
|
||||
- 字段注释:使用JavaDoc格式,描述字段的含义、用途或业务规则
|
||||
- 关键字段(如外键、状态字段)应提供清晰的注释说明
|
||||
|
||||
## 8. 最佳实践
|
||||
- VO类应保持简洁,只包含数据和基本的数据访问方法
|
||||
- 避免在VO类中包含复杂的业务逻辑
|
||||
- 字段命名应与对应的实体类保持一致或有明确的映射关系
|
||||
- 确保所有字段都是可序列化的
|
||||
- 对于有默认值的字段,应在声明时初始化
|
||||
|
||||
## 9. 与实体类的区别
|
||||
- **序列化**:VO类必须实现 `Serializable` 接口并包含 `serialVersionUID` 字段,而实体类不包含
|
||||
- **用途**:VO类主要用于数据传输和展示,实体类主要用于持久化
|
||||
- **关联关系**:VO类通常只包含关联实体的ID,实体类包含实体对象的引用
|
||||
- **注解**:VO类主要使用Lombok注解,实体类使用JPA注解和Lombok注解
|
||||
- **方法**:VO类通常只有getter/setter方法,实体类可能包含更多业务相关方法
|
||||
@@ -6,12 +6,12 @@
|
||||
<parent>
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>Contract-Manager</artifactId>
|
||||
<version>0.0.99-SNAPSHOT</version>
|
||||
<version>0.0.100-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>client</artifactId>
|
||||
<version>0.0.99-SNAPSHOT</version>
|
||||
<version>0.0.100-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>0.0.99-SNAPSHOT</version>
|
||||
<version>0.0.100-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -120,7 +120,8 @@ public class WebSocketClientService {
|
||||
if (errorCode == WebSocketConstant.ERROR_CODE_UNAUTHORIZED) {
|
||||
|
||||
// 调用所有的 callbacks 和 session 失败并且移除
|
||||
callbacks.keySet().stream().toList().forEach(key -> callbacks.remove(key).completeExceptionally(new Exception("未授权")));
|
||||
callbacks.keySet().stream().toList()
|
||||
.forEach(key -> callbacks.remove(key).completeExceptionally(new Exception("未授权")));
|
||||
sessions.values().stream().toList().forEach(session -> {
|
||||
session.updateMessage(java.util.logging.Level.SEVERE, "未授权");
|
||||
session.close();
|
||||
@@ -131,11 +132,11 @@ public class WebSocketClientService {
|
||||
|
||||
// 处理未授权错误,重新登录
|
||||
OkHttpLoginController controller = new OkHttpLoginController();
|
||||
controller.setHttpClient(Desktop.instance.getHttpClient());
|
||||
controller.setProperties(SpringApp.getBean(MyProperties.class));
|
||||
controller.tryLogin();
|
||||
controller.tryLogin().get();
|
||||
// 需要把窗口顶置
|
||||
isActive = true;
|
||||
scheduleReconnect();
|
||||
initWebSocket();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -120,7 +121,7 @@ public class WebSocketClientSession {
|
||||
private void handleAsMessage(JsonNode args) {
|
||||
String level = args.get(0).asText();
|
||||
String message = args.get(1).asText();
|
||||
updateMessage(java.util.logging.Level.parse(level), "[R] "+message);
|
||||
updateMessage(java.util.logging.Level.parse(level), "[R] " + message);
|
||||
}
|
||||
|
||||
public void updateMessage(Level level, String message) {
|
||||
|
||||
@@ -61,28 +61,10 @@ public class OkHttpLoginController implements MessageHolder {
|
||||
private MyProperties properties;
|
||||
@Setter
|
||||
private OkHttpClient httpClient;
|
||||
private WebSocket webSocket;
|
||||
private SimpleStringProperty serverUrl = new SimpleStringProperty();
|
||||
private String webSocketUrl;
|
||||
|
||||
public OkHttpLoginController() {
|
||||
this.httpClient = new OkHttpClient().newBuilder().cookieJar(new CookieJar() {
|
||||
private final List<Cookie> cookies = new java.util.ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
|
||||
// 保存服务器返回的Cookie(如JSESSIONID)
|
||||
this.cookies.addAll(cookies);
|
||||
System.out.println("保存Cookie: " + cookies);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Cookie> loadForRequest(HttpUrl url) {
|
||||
// 请求时自动携带Cookie
|
||||
return cookies;
|
||||
}
|
||||
|
||||
}).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,21 +357,6 @@ public class OkHttpLoginController implements MessageHolder {
|
||||
});
|
||||
}
|
||||
|
||||
// WebSocket消息发送方法
|
||||
public void sendMessage(String message) {
|
||||
if (webSocket != null) {
|
||||
webSocket.send(message);
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭WebSocket连接
|
||||
public void closeWebSocket() {
|
||||
if (webSocket != null) {
|
||||
webSocket.close(1000, "正常关闭");
|
||||
webSocket = null;
|
||||
}
|
||||
}
|
||||
|
||||
static class MacIP {
|
||||
String mac;
|
||||
String ip;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CloudTycManagerSkin
|
||||
|
||||
controller.cloudIdColumn.setCellValueFactory(param -> param.getValue().getCloudId());
|
||||
|
||||
controller.latestUpdateColumn.setCellValueFactory(param -> param.getValue().getLatest());
|
||||
controller.latestUpdateColumn.setCellValueFactory(param -> param.getValue().getLatestUpdate());
|
||||
controller.latestUpdateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||
|
||||
controller.cloudLatestColumn.setCellValueFactory(param -> param.getValue().getCloudLatest());
|
||||
|
||||
@@ -41,7 +41,7 @@ public class YongYouU8ManagerSkin
|
||||
|
||||
controller.cloudIdColumn.setCellValueFactory(param -> param.getValue().getCloudId());
|
||||
|
||||
controller.latestUpdateColumn.setCellValueFactory(param -> param.getValue().getLatest());
|
||||
controller.latestUpdateColumn.setCellValueFactory(param -> param.getValue().getLatestUpdate());
|
||||
controller.latestUpdateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||
|
||||
controller.cloudLatestColumn.setCellValueFactory(param -> param.getValue().getCloudLatest());
|
||||
|
||||
@@ -1,32 +1,13 @@
|
||||
package com.ecep.contract.controller.company;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ecep.contract.controller.BaseController;
|
||||
import com.ecep.contract.model.CompanyContact;
|
||||
import com.ecep.contract.service.CompanyContactService;
|
||||
import com.ecep.contract.util.FxmlUtils;
|
||||
import com.ecep.contract.util.UITools;
|
||||
import com.ecep.contract.vm.CompanyContactViewModel;
|
||||
import com.ecep.contract.vo.CompanyContactVo;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.DatePicker;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
@@ -35,6 +16,16 @@ import javafx.stage.WindowEvent;
|
||||
import javafx.util.converter.LocalDateStringConverter;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Lazy
|
||||
@Scope("prototype")
|
||||
|
||||
@@ -134,9 +134,9 @@ public class ContractTabSkinExtendVendorInfo extends AbstContractBasedTabSkin {
|
||||
ExtendVendorInfoVo vendorInfo = loadedFuture.join();
|
||||
if (viewModel.copyTo(vendorInfo)) {
|
||||
// 注意:这里需要根据实际service接口实现调整,可能需要调用不同的方法
|
||||
// ExtendVendorInfoVo saved = getExtendVendorInfoService().saveVo(vendorInfo);
|
||||
// updateViewModel(saved);
|
||||
// loadedFuture = CompletableFuture.completedFuture(saved);
|
||||
ExtendVendorInfoVo saved = getExtendVendorInfoService().save(vendorInfo);
|
||||
updateViewModel(saved);
|
||||
loadedFuture = CompletableFuture.completedFuture(saved);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,17 +11,12 @@ import java.util.stream.Collectors;
|
||||
import com.ecep.contract.ContractPayWay;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractItem;
|
||||
import com.ecep.contract.model.HistoryPrice;
|
||||
import com.ecep.contract.model.Inventory;
|
||||
import com.ecep.contract.model.InventoryHistoryPrice;
|
||||
import com.ecep.contract.service.ContractItemService;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.service.InventoryHistoryPriceService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.util.ProxyUtils;
|
||||
import com.ecep.contract.vm.InventoryHistoryPriceViewModel;
|
||||
import com.ecep.contract.vm.InventoryViewModel;
|
||||
import com.ecep.contract.vo.ContractItemVo;
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.ecep.contract.controller.project;
|
||||
|
||||
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.service.ProjectService;
|
||||
import com.ecep.contract.vm.ProjectViewModel;
|
||||
import com.ecep.contract.vo.ProjectVo;
|
||||
|
||||
@@ -12,8 +12,6 @@ import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||
import com.ecep.contract.converter.CompanyStringConverter;
|
||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||
import com.ecep.contract.model.CompanyCustomerEvaluationFormFile;
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.service.CompanyCustomerFileService;
|
||||
import com.ecep.contract.service.CompanyCustomerService;
|
||||
import com.ecep.contract.service.CompanyService;
|
||||
@@ -36,7 +34,7 @@ public class ProjectTabSkinBid
|
||||
|
||||
public TableColumn<ProjectBidViewModel, Number> idColumn;
|
||||
public TableColumn<ProjectBidViewModel, Number> versionColumn;
|
||||
public TableColumn<ProjectBidViewModel, CompanyCustomerEvaluationFormFile> evaluationFileColumn;
|
||||
public TableColumn<ProjectBidViewModel, Integer> evaluationFileColumn;
|
||||
|
||||
public TableColumn<ProjectBidViewModel, String> descriptionColumn;
|
||||
public TableColumn<ProjectBidViewModel, Integer> applicantColumn;
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.ecep.contract.controller.project.cost.ProjectCostWindowController;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||
import com.ecep.contract.model.ProjectCostItem;
|
||||
import com.ecep.contract.service.ContractItemService;
|
||||
import com.ecep.contract.service.ProjectCostItemService;
|
||||
import com.ecep.contract.service.ProjectCostService;
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
package com.ecep.contract.controller.project;
|
||||
|
||||
import org.controlsfx.control.textfield.AutoCompletionBinding;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.converter.EntityStringConverter;
|
||||
import com.ecep.contract.model.CompanyContact;
|
||||
import com.ecep.contract.model.CompanyInvoiceInfo;
|
||||
import com.ecep.contract.service.BankService;
|
||||
import com.ecep.contract.service.CompanyBankAccountService;
|
||||
import com.ecep.contract.service.CompanyContactService;
|
||||
import com.ecep.contract.service.CompanyInvoiceInfoService;
|
||||
import com.ecep.contract.service.CompanyService;
|
||||
import com.ecep.contract.service.*;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
import com.ecep.contract.util.UITools;
|
||||
import com.ecep.contract.vo.BankVo;
|
||||
import com.ecep.contract.vo.CompanyBankAccountVo;
|
||||
import com.ecep.contract.vo.CompanyContactVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
|
||||
import com.ecep.contract.vo.*;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.fxml.FXML;
|
||||
@@ -27,6 +14,8 @@ import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TextField;
|
||||
import org.controlsfx.control.textfield.AutoCompletionBinding;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@FxmlPath("/ui/project/project-tab-customer.fxml")
|
||||
public class ProjectTabSkinCustomerInfo
|
||||
@@ -101,7 +90,7 @@ public class ProjectTabSkinCustomerInfo
|
||||
private void initInvoiceInfoField() {
|
||||
invoiceInfoAutoCompletion(invoiceInfoField, invoiceInfoLabel, viewModel.getInvoiceInfo())
|
||||
.setOnAutoCompleted(event -> {
|
||||
CompanyInvoiceInfo invoiceInfo = event.getCompletion();
|
||||
CompanyInvoiceInfoVo invoiceInfo = event.getCompletion();
|
||||
viewModel.getInvoiceInfo().set(invoiceInfo.getId());
|
||||
});
|
||||
}
|
||||
@@ -199,16 +188,16 @@ public class ProjectTabSkinCustomerInfo
|
||||
return UITools.autoCompletion(textField, property, getBankAccountService());
|
||||
}
|
||||
|
||||
private AutoCompletionBinding<CompanyInvoiceInfo> invoiceInfoAutoCompletion(TextField textField, Label label,
|
||||
SimpleObjectProperty<Integer> property) {
|
||||
EntityStringConverter<CompanyInvoiceInfo> converter = new EntityStringConverter<>();
|
||||
private AutoCompletionBinding<CompanyInvoiceInfoVo> invoiceInfoAutoCompletion(TextField textField, Label label,
|
||||
SimpleObjectProperty<Integer> property) {
|
||||
EntityStringConverter<CompanyInvoiceInfoVo> converter = new EntityStringConverter<>();
|
||||
converter.setInitialized(info -> getInvoiceInfoService().findById(info.getId()));
|
||||
|
||||
label.textProperty().bind(property.map(infoId -> {
|
||||
if (infoId == null) {
|
||||
return "未选择";
|
||||
}
|
||||
CompanyInvoiceInfo info = getInvoiceInfoService().findById(infoId);
|
||||
CompanyInvoiceInfoVo info = getInvoiceInfoService().findById(infoId);
|
||||
if (info == null) {
|
||||
return "#" + infoId;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ import com.ecep.contract.ContractPayWay;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||
import com.ecep.contract.controller.table.cell.NumberTableCell;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectFundPlan;
|
||||
import com.ecep.contract.service.ContractPayPlanService;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.service.ProjectFundPlanService;
|
||||
|
||||
@@ -90,6 +90,8 @@ public class ProjectTabSkinQuotation
|
||||
@Override
|
||||
public void initializeTable() {
|
||||
super.initializeTable();
|
||||
|
||||
idColumn.setCellValueFactory(param -> param.getValue().getId());
|
||||
levelColumn.setCellValueFactory(param -> param.getValue().getLevel());
|
||||
levelColumn.setCellFactory(param -> new LevelTableCell());
|
||||
standardPayWayColumn.setCellValueFactory(param -> param.getValue().getStandardPayWay()
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.ecep.contract.controller.project;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import com.ecep.contract.service.ProjectSaleTypeService;
|
||||
import com.ecep.contract.util.ProxyUtils;
|
||||
import com.ecep.contract.vo.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -12,15 +11,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.controller.AbstEntityController;
|
||||
import com.ecep.contract.model.DeliverySignMethod;
|
||||
import com.ecep.contract.model.ProductType;
|
||||
import com.ecep.contract.model.ProductUsage;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectIndustry;
|
||||
import com.ecep.contract.model.ProjectSaleType;
|
||||
import com.ecep.contract.model.ProjectType;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.service.EmployeeService;
|
||||
import com.ecep.contract.service.ProjectService;
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.constant.ContractConstant;
|
||||
import com.ecep.contract.model.ProjectCostItem;
|
||||
import com.ecep.contract.service.ProductTypeService;
|
||||
import com.ecep.contract.service.ProjectCostItemService;
|
||||
import com.ecep.contract.service.ProjectCostService;
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.ecep.contract.DesktopUtils;
|
||||
import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
import com.ecep.contract.model.ContractFile;
|
||||
import com.ecep.contract.service.ContractFileService;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.service.ProjectService;
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
package com.ecep.contract.controller.project.cost;
|
||||
|
||||
import com.ecep.contract.util.ProxyUtils;
|
||||
import com.ecep.contract.vo.ProjectCostVo;
|
||||
import com.ecep.contract.vo.ProjectVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ecep.contract.controller.AbstEntityController;
|
||||
import com.ecep.contract.model.Project;
|
||||
import com.ecep.contract.model.ProjectCost;
|
||||
import com.ecep.contract.service.ProjectCostService;
|
||||
import com.ecep.contract.service.ProjectService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.ecep.contract.BlackReasonType;
|
||||
import com.ecep.contract.controller.company.AbstCompanyTableTabSkin;
|
||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||
import com.ecep.contract.model.CompanyBlackReason;
|
||||
import com.ecep.contract.service.CloudRkService;
|
||||
import com.ecep.contract.service.CompanyBlackReasonService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.ecep.contract.controller.company.AbstCompanyTableTabSkin;
|
||||
import com.ecep.contract.controller.company.CompanyContactWindowController;
|
||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||
import com.ecep.contract.model.CompanyContact;
|
||||
import com.ecep.contract.service.CompanyContactService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
import com.ecep.contract.vm.CompanyContactViewModel;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -14,16 +13,15 @@ import org.springframework.util.StringUtils;
|
||||
import org.w3c.dom.html.HTMLDocument;
|
||||
|
||||
import com.ecep.contract.DesktopUtils;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.constant.CloudServiceConstant;
|
||||
import com.ecep.contract.controller.company.AbstCompanyBasedTabSkin;
|
||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.service.CloudRkService;
|
||||
import com.ecep.contract.service.CloudTycService;
|
||||
import com.ecep.contract.service.CompanyExtendInfoService;
|
||||
import com.ecep.contract.service.YongYouU8Service;
|
||||
import com.ecep.contract.task.CompanyRkUpdateTasker;
|
||||
import com.ecep.contract.util.DelayOnceExecutor;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
import com.ecep.contract.util.UITools;
|
||||
@@ -234,22 +232,18 @@ public class CompanyTabSkinOther
|
||||
* @see #onCloudRkUpdateButtonClickedAction(ActionEvent)
|
||||
*/
|
||||
private void onCloudRkUpdateButtonClicked(ActionEvent actionEvent) throws IOException {
|
||||
Button button = (Button) actionEvent.getSource();
|
||||
CompanyVo company = getEntity();
|
||||
MessageHolder holder = (level, message) -> {
|
||||
setStatus(message);
|
||||
if (level == Level.WARNING) {
|
||||
logger.warn("{} {}", getEntity().getName(), message);
|
||||
}
|
||||
if (level == Level.SEVERE) {
|
||||
logger.error("{} {}", getEntity().getName(), message);
|
||||
}
|
||||
};
|
||||
|
||||
CloudRkVo cloudRk = getCloudRkService().updateCloudRk(company, holder);
|
||||
CompanyRkUpdateTasker task = new CompanyRkUpdateTasker();
|
||||
task.setCompany(getEntity());
|
||||
Platform.runLater(() -> {
|
||||
UITools.showTaskDialogAndWait("更新企业信息", task, null);
|
||||
|
||||
CloudRkVo cloudRk = getCloudRkService().findByCompany(company);
|
||||
|
||||
rkCloudInfoViewModel.update(cloudRk);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private CloudRkService.EntInfo showEnterpriseChooser(List<CloudRkService.EntInfo> entInfos) {
|
||||
@@ -384,7 +378,7 @@ public class CompanyTabSkinOther
|
||||
cloudTycIdField.textProperty().bind(tycCloudInfoViewModel.getId().asString());
|
||||
// 平台编号
|
||||
cloudTycCloudIdField.textProperty().bindBidirectional(tycCloudInfoViewModel.getCloudId());
|
||||
cloudTycLatestField.textProperty().bind(tycCloudInfoViewModel.getLatest().map(MyDateTimeUtils::format));
|
||||
cloudTycLatestField.textProperty().bind(tycCloudInfoViewModel.getLatestUpdate().map(MyDateTimeUtils::format));
|
||||
cloudTycVersionLabel.textProperty().bind(tycCloudInfoViewModel.getVersion().asString("Ver:%s"));
|
||||
|
||||
TextField cloudIdField = cloudTycCloudIdField;
|
||||
@@ -424,7 +418,7 @@ public class CompanyTabSkinOther
|
||||
|
||||
cloudYuIdField.textProperty().bind(yuCloudInfoViewModel.getId().asString());
|
||||
cloudYuCloudIdField.textProperty().bindBidirectional(yuCloudInfoViewModel.getCloudId());
|
||||
cloudYuLatestField.textProperty().bind(yuCloudInfoViewModel.getLatest().map(MyDateTimeUtils::format));
|
||||
cloudYuLatestField.textProperty().bind(yuCloudInfoViewModel.getLatestUpdate().map(MyDateTimeUtils::format));
|
||||
cloudYuVersionLabel.textProperty().bind(yuCloudInfoViewModel.getVersion().asString("Ver:%s"));
|
||||
|
||||
Button button = yuCloudPaneSaveButton;
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||
import com.ecep.contract.controller.table.cell.InvoiceTableCell;
|
||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||
import com.ecep.contract.model.Invoice;
|
||||
import com.ecep.contract.service.InvoiceService;
|
||||
import com.ecep.contract.service.PurchaseBillVoucherService;
|
||||
import com.ecep.contract.service.YongYouU8Service;
|
||||
@@ -23,7 +22,6 @@ import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||
import com.ecep.contract.controller.table.cell.InventoryTableCell;
|
||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.service.ContractItemService;
|
||||
import com.ecep.contract.service.InventoryService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
@@ -169,33 +168,6 @@ public class ContractTabSkinItemsV2
|
||||
return inventoryService;
|
||||
}
|
||||
|
||||
private void sum(ContractItemComposeViewModel model, Contract contract,
|
||||
HashMap<String, ContractItemComposeViewModel> map) {
|
||||
double inQuantity = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getQuantity().set(inQuantity));
|
||||
|
||||
double inTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getTaxAmount().set(inTaxAmount));
|
||||
|
||||
double inExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getExclusiveTaxAmount().set(inExclusiveTaxAmount));
|
||||
|
||||
double outQuantity = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getQuantity().set(outQuantity));
|
||||
|
||||
double outTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getTaxAmount().set(outTaxAmount));
|
||||
|
||||
double outExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createContextMenu(ContextMenu contextMenu) {
|
||||
super.createContextMenu(contextMenu);
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package com.ecep.contract.controller.tab;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.ecep.contract.controller.contract.AbstContractTableTabSkin;
|
||||
import com.ecep.contract.controller.contract.ContractWindowController;
|
||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||
import com.ecep.contract.model.ContractPayPlan;
|
||||
import com.ecep.contract.service.ContractPayPlanService;
|
||||
import com.ecep.contract.service.ViewModelService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
||||
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TableColumn;
|
||||
@@ -21,6 +14,10 @@ import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.util.converter.CurrencyStringConverter;
|
||||
import javafx.util.converter.NumberStringConverter;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@FxmlPath("/ui/contract/contract-tab-pay-plan.fxml")
|
||||
public class ContractTabSkinPayPlan extends AbstContractTableTabSkin<ContractPayPlanVo, ContractPayPlanViewModel> {
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import com.ecep.contract.controller.table.cell.LocalDateFieldTableCell;
|
||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||
import com.ecep.contract.service.SaleOrdersService;
|
||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.model.SalesOrder;
|
||||
|
||||
import com.ecep.contract.vo.SalesOrderVo;
|
||||
import javafx.scene.control.Button;
|
||||
@@ -21,7 +19,6 @@ import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.controller.tab;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.service.ContractFileService;
|
||||
import org.controlsfx.control.textfield.TextFields;
|
||||
|
||||
import com.ecep.contract.ContractPayWay;
|
||||
@@ -85,7 +86,7 @@ public class ContractTabSkinVendorBid
|
||||
bidVendorTable_companyColumn.setCellValueFactory(param -> param.getValue().getCompanyId());
|
||||
bidVendorTable_companyColumn.setCellFactory(CompanyTableCell.forTableColumn(getCompanyService()));
|
||||
bidVendorTable_quotationSheetColumn.setCellValueFactory(param -> param.getValue().getQuotationSheetFileId());
|
||||
bidVendorTable_quotationSheetColumn.setCellFactory(ContractFileTableCell.forTableColumn(getContractService()));
|
||||
bidVendorTable_quotationSheetColumn.setCellFactory(ContractFileTableCell.forTableColumn(SpringApp.getBean(ContractFileService.class)));
|
||||
|
||||
super.initializeTab();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.controller.contract.sale_order.SalesOrderWindowController;
|
||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.model.SalesOrder;
|
||||
import com.ecep.contract.service.CompanyService;
|
||||
import com.ecep.contract.service.ContractFileService;
|
||||
import com.ecep.contract.util.UITools;
|
||||
|
||||
@@ -5,33 +5,26 @@ import com.ecep.contract.controller.contract.sale_order.SalesOrderWindowControll
|
||||
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
||||
import com.ecep.contract.controller.table.cell.EmployeeTableCell;
|
||||
import com.ecep.contract.converter.EmployeeStringConverter;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractItem;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.service.SaleOrdersService;
|
||||
import com.ecep.contract.service.SalesBillVoucherService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.util.ProxyUtils;
|
||||
import com.ecep.contract.vm.ContractItemComposeViewModel;
|
||||
import com.ecep.contract.vm.SalesBillVoucherViewModel;
|
||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||
import com.ecep.contract.vo.ContractItemVo;
|
||||
import com.ecep.contract.vo.ContractVo;
|
||||
import com.ecep.contract.vo.SalesBillVoucherVo;
|
||||
import com.ecep.contract.vo.SalesOrderVo;
|
||||
import javafx.application.Platform;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.util.Callback;
|
||||
import javafx.util.Duration;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -129,37 +122,6 @@ public class SalesOrderTabSkinBillVoucher
|
||||
return getCachedBean(EmployeeStringConverter.class);
|
||||
}
|
||||
|
||||
private void sum(ContractItemComposeViewModel model, Contract contract,
|
||||
HashMap<String, ContractItemComposeViewModel> map) {
|
||||
double inQuantity = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getQuantity().set(inQuantity));
|
||||
|
||||
double inTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getTaxAmount().set(inTaxAmount));
|
||||
|
||||
double inExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getExclusiveTaxAmount().set(inExclusiveTaxAmount));
|
||||
|
||||
double outQuantity = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getQuantity().set(outQuantity));
|
||||
|
||||
double outTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getTaxAmount().set(outTaxAmount));
|
||||
|
||||
double outExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
||||
}
|
||||
|
||||
String makeKey(ContractItem item) {
|
||||
return item.getTitle() + "-" + item.getSpecification();
|
||||
}
|
||||
|
||||
static class NumberTableCell extends TableCell<SalesBillVoucherViewModel, Double> {
|
||||
// "%.1f"
|
||||
private final String format;
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.controller.contract.sale_order.SalesOrderWindowController;
|
||||
import com.ecep.contract.controller.table.AbstEntityTableTabSkin;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.service.SaleOrdersService;
|
||||
import com.ecep.contract.service.SalesOrderItemService;
|
||||
@@ -193,33 +192,6 @@ public class SalesOrderTabSkinItems
|
||||
contextMenu.getItems().addAll(item2, item3);
|
||||
}
|
||||
|
||||
private void sum(ContractItemComposeViewModel model, Contract contract,
|
||||
HashMap<String, ContractItemComposeViewModel> map) {
|
||||
double inQuantity = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getQuantity().set(inQuantity));
|
||||
|
||||
double inTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getTaxAmount().set(inTaxAmount));
|
||||
|
||||
double inExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getIn)
|
||||
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getIn().getExclusiveTaxAmount().set(inExclusiveTaxAmount));
|
||||
|
||||
double outQuantity = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getQuantity().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getQuantity().set(outQuantity));
|
||||
|
||||
double outTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getTaxAmount().set(outTaxAmount));
|
||||
|
||||
double outExclusiveTaxAmount = map.values().stream().map(ContractItemComposeViewModel::getOut)
|
||||
.mapToDouble(v -> v.getExclusiveTaxAmount().get()).sum();
|
||||
Platform.runLater(() -> model.getOut().getExclusiveTaxAmount().set(outExclusiveTaxAmount));
|
||||
}
|
||||
|
||||
String makeKey(ContractItemVo item) {
|
||||
return item.getTitle() + "-" + item.getSpecification();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.ecep.contract.controller.table.cell;
|
||||
|
||||
import static com.ecep.contract.SpringApp.getBean;
|
||||
|
||||
import com.ecep.contract.service.ContractFileService;
|
||||
import com.ecep.contract.service.ContractService;
|
||||
import com.ecep.contract.vo.ContractFileVo;
|
||||
import com.ecep.contract.vo.ContractVo;
|
||||
|
||||
import javafx.scene.control.TableCell;
|
||||
@@ -11,56 +13,56 @@ import javafx.util.Callback;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
public class ContractFileTableCell<V> extends AsyncUpdateTableCell<V, Integer, ContractVo> {
|
||||
public class ContractFileTableCell<V> extends AsyncUpdateTableCell<V, Integer, ContractFileVo> {
|
||||
|
||||
/**
|
||||
* 创建一个ContractFileTableCell的TableCell工厂,自动获取ContractService实例
|
||||
*
|
||||
*
|
||||
* @param <S> 表格行类型
|
||||
* @return TableCell工厂回调
|
||||
*/
|
||||
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn() {
|
||||
return forTableColumn(getBean(ContractService.class));
|
||||
return forTableColumn(getBean(ContractFileService.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一个ContractFileTableCell的TableCell工厂,使用提供的ContractService实例
|
||||
*
|
||||
* 创建一个ContractFileTableCell的TableCell工厂,使用提供的ContractFileService实例
|
||||
*
|
||||
* @param <S> 表格行类型
|
||||
* @param service ContractService实例
|
||||
* @return TableCell工厂回调
|
||||
*/
|
||||
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn(ContractService service) {
|
||||
public static <S> Callback<TableColumn<S, Integer>, TableCell<S, Integer>> forTableColumn(ContractFileService service) {
|
||||
return param -> new ContractFileTableCell<S>(service);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用指定的ContractService创建ContractFileTableCell实例
|
||||
*
|
||||
* 使用指定的ContractFileService创建ContractFileTableCell实例
|
||||
*
|
||||
* @param contractService ContractService实例
|
||||
*/
|
||||
public ContractFileTableCell(ContractService contractService) {
|
||||
public ContractFileTableCell(ContractFileService contractService) {
|
||||
setService(contractService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取ContractService实例
|
||||
*
|
||||
*
|
||||
* @return ContractService实例
|
||||
*/
|
||||
@Override
|
||||
protected ContractService getServiceBean() {
|
||||
return getBean(ContractService.class);
|
||||
protected ContractFileService getServiceBean() {
|
||||
return getBean(ContractFileService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化ContractVo对象为显示文本
|
||||
*
|
||||
*
|
||||
* @param entity ContractVo对象
|
||||
* @return 格式化后的文本
|
||||
*/
|
||||
@Override
|
||||
public String format(ContractVo entity) {
|
||||
return entity.getCode() + " " + entity.getName();
|
||||
public String format(ContractFileVo entity) {
|
||||
return entity.getFileName();
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class VendorTabSkinFile
|
||||
.observableMap(getCachedBean(VendorFileTypeService.class).findAll(getLocale()));
|
||||
|
||||
fileTable_typeColumn.setCellValueFactory(param -> Bindings.valueAt(observableMapByLocal,
|
||||
param.getValue().getType()).map(BaseEnumEntity::getValue));
|
||||
param.getValue().getType()).map(VendorFileTypeLocalVo::getValue));
|
||||
|
||||
fileTable_filePathColumn.setCellValueFactory(param -> param.getValue().getFilePath());
|
||||
fileTable_filePathColumn.setCellFactory(param -> new FileTableFilePathTableCell());
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.VendorFileType;
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.model.Vendor;
|
||||
import com.ecep.contract.service.VendorService;
|
||||
import com.ecep.contract.task.Tasker;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
@@ -408,7 +407,6 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
* @param item 供方名录中供应商的条目
|
||||
* @param holder 消息输出器
|
||||
* @return true if qualified
|
||||
* @see #findAllEvaluationFormFiles(Vendor, LocalDate)
|
||||
*/
|
||||
private boolean checkAsQualifiedVendorByEvaluationFormFiles(
|
||||
VendorVo vendor, VendorApprovedItemVo item, MessageHolder holder) {
|
||||
|
||||
@@ -13,8 +13,8 @@ public class BankStringConverter extends StringConverter<BankVo> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(BankVo object) {
|
||||
return object == null ? "" : object.getCode() + " " + object.getName();
|
||||
public String toString(BankVo bank) {
|
||||
return bank == null ? "" : bank.getCode() + " " + bank.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.Desktop;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.task.CloudRkSyncTask;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CloudRkViewModel;
|
||||
@@ -48,11 +47,6 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
||||
}, 1, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
public CloudRkVo updateCloudRk(CompanyVo company, MessageHolder holder) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'updateCloudRk'");
|
||||
}
|
||||
|
||||
public CloudRkVo getOrCreateCloudRk(CompanyVo company) {
|
||||
CloudRkVo cloudRk = findByCompany(company);
|
||||
if (cloudRk == null) {
|
||||
|
||||
@@ -4,14 +4,14 @@ import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.vm.CompanyBankAccountViewModel;
|
||||
import com.ecep.contract.vo.CompanyBankAccountVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
|
||||
@Service
|
||||
public class CompanyBankAccountService extends QueryService<CompanyBankAccountVo, CompanyBankAccountViewModel> {
|
||||
|
||||
public List<CompanyBankAccountVo> searchByCompany(Company company, String searchText) {
|
||||
public List<CompanyBankAccountVo> searchByCompany(CompanyVo company, String searchText) {
|
||||
throw new UnsupportedOperationException("未实现");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.util.ParamUtils.Builder;
|
||||
import com.ecep.contract.vm.CompanyContactViewModel;
|
||||
@@ -16,7 +15,7 @@ import com.ecep.contract.vo.CompanyVo;
|
||||
@Service
|
||||
public class CompanyContactService extends QueryService<CompanyContactVo, CompanyContactViewModel> {
|
||||
|
||||
public List<CompanyContactVo> searchByCompany(Company company, String searchText) {
|
||||
public List<CompanyContactVo> searchByCompany(CompanyVo company, String searchText) {
|
||||
Builder params = getSpecification(searchText);
|
||||
params.equals("company", company);
|
||||
List<CompanyContactVo> list = findAll(params.build(), Pageable.ofSize(10)).getContent();
|
||||
|
||||
@@ -16,8 +16,6 @@ import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.CompanyCustomerConstant;
|
||||
import com.ecep.contract.model.CompanyCustomer;
|
||||
import com.ecep.contract.model.CompanyCustomerEvaluationFormFile;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CompanyCustomerFileViewModel;
|
||||
import com.ecep.contract.vo.CompanyCustomerFileVo;
|
||||
|
||||
@@ -1,32 +1,17 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.ecep.contract.vo.CompanyOldNameVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.CompanyFileType;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.CloudServiceConstant;
|
||||
import com.ecep.contract.constant.CompanyConstant;
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyFile;
|
||||
import com.ecep.contract.model.CompanyOldName;
|
||||
import com.ecep.contract.util.FileUtils;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CompanyFileViewModel;
|
||||
import com.ecep.contract.vo.CompanyFileVo;
|
||||
|
||||
@@ -6,10 +6,7 @@ import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CompanyFileTypeLocalViewModel;
|
||||
import com.ecep.contract.vo.CompanyFileTypeLocalVo;
|
||||
import javafx.util.StringConverter;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
import org.springframework.cache.annotation.*;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -36,13 +33,21 @@ public class CompanyFileTypeService extends QueryService<CompanyFileTypeLocalVo,
|
||||
return super.findAll();
|
||||
}
|
||||
|
||||
@Caching(put = { @CachePut(key = "#p0.id"), @CachePut(key = "'all'") })
|
||||
@Caching(put = {@CachePut(key = "#p0.id")},
|
||||
evict = {
|
||||
@CacheEvict(key = "'type-'+#p0.lang+'-'+#p0.type.name()"),
|
||||
@CacheEvict(key = "'all'")
|
||||
})
|
||||
@Override
|
||||
public CompanyFileTypeLocalVo save(CompanyFileTypeLocalVo entity) {
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Caching(put = { @CachePut(key = "#p0.id"), @CachePut(key = "'all'") })
|
||||
@Caching(evict = {
|
||||
@CacheEvict(key = "#p0.id"),
|
||||
@CacheEvict(key = "'type-'+#p0.lang+'-'+#p0.type.name()"),
|
||||
@CacheEvict(key = "'all'")
|
||||
})
|
||||
@Override
|
||||
public void delete(CompanyFileTypeLocalVo entity) {
|
||||
super.delete(entity);
|
||||
@@ -61,7 +66,7 @@ public class CompanyFileTypeService extends QueryService<CompanyFileTypeLocalVo,
|
||||
|
||||
/**
|
||||
* 根据语言标签和参数查找单个 CompanyFileTypeLocalVo 对象
|
||||
*
|
||||
*
|
||||
* @param locale 语言区域
|
||||
* @param key 参数键
|
||||
* @param value 参数值
|
||||
@@ -77,6 +82,7 @@ public class CompanyFileTypeService extends QueryService<CompanyFileTypeLocalVo,
|
||||
return findOneByLang(locale, "value", string);
|
||||
}
|
||||
|
||||
@Cacheable(key = "'type-'+#p0.toLanguageTag()+'-'+#p1.name()")
|
||||
public CompanyFileTypeLocalVo findByLocaleAndType(Locale locale, CompanyFileType type) {
|
||||
return findOneByLang(locale, "type", type);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.model.Company;
|
||||
import com.ecep.contract.model.CompanyInvoiceInfo;
|
||||
import com.ecep.contract.vm.CompanyInvoiceInfoViewModel;
|
||||
import com.ecep.contract.vo.CompanyInvoiceInfoVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -12,9 +12,9 @@ import java.util.Map;
|
||||
|
||||
@Service
|
||||
|
||||
public class CompanyInvoiceInfoService extends QueryService<CompanyInvoiceInfo, CompanyInvoiceInfoViewModel> {
|
||||
public class CompanyInvoiceInfoService extends QueryService<CompanyInvoiceInfoVo, CompanyInvoiceInfoViewModel> {
|
||||
|
||||
public List<CompanyInvoiceInfo> searchByCompany(Company company, String searchText) {
|
||||
public List<CompanyInvoiceInfoVo> searchByCompany(CompanyVo company, String searchText) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("company", company);
|
||||
params.put("searchText", searchText);
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.ContractPayPlanViewModel;
|
||||
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||
@@ -14,11 +13,7 @@ import com.ecep.contract.vo.ContractVo;
|
||||
@Service
|
||||
public class ContractPayPlanService extends QueryService<ContractPayPlanVo, ContractPayPlanViewModel> {
|
||||
|
||||
public List<ContractPayPlanVo> findAllByContract(Contract contract) {
|
||||
return findAll(ParamUtils.builder()
|
||||
.equals("contract", contract.getId())
|
||||
.build(), Pageable.unpaged()).getContent();
|
||||
}
|
||||
|
||||
|
||||
public List<ContractPayPlanVo> findAllByContract(ContractVo contract) {
|
||||
return findAll(ParamUtils.builder()
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ExtendVendorInfoService extends QueryService<ExtendVendorInfoVo, Ex
|
||||
|
||||
public ExtendVendorInfoVo findByContract(ContractVo contract) {
|
||||
Page<ExtendVendorInfoVo> page = findAll(ParamUtils.builder()
|
||||
.equals("contract", contract).build(),
|
||||
.equals("contract", contract).build(),
|
||||
Pageable.ofSize(1));
|
||||
if (page.isEmpty()) {
|
||||
return null;
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ProductType;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.ProductTypeViewModel;
|
||||
import com.ecep.contract.vo.ProductTypeVo;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -13,6 +14,12 @@ import com.ecep.contract.vo.ProjectTypeVo;
|
||||
@CacheConfig(cacheNames = "project-type")
|
||||
public class ProjectTypeService extends QueryService<ProjectTypeVo, ProjectTypeViewModel> {
|
||||
|
||||
@Cacheable(key = "#p0")
|
||||
@Override
|
||||
public ProjectTypeVo findById(Integer id) {
|
||||
return super.findById(id);
|
||||
}
|
||||
|
||||
public ProjectTypeVo findByName(String name) {
|
||||
Page<ProjectTypeVo> page = findAll(ParamUtils.builder().equals("name", name).build(), Pageable.ofSize(1));
|
||||
if (page.isEmpty()) {
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.ecep.contract.service;
|
||||
import com.ecep.contract.vo.SalesOrderVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.SalesOrder;
|
||||
import com.ecep.contract.vm.SalesOrderViewModel;
|
||||
|
||||
@Service
|
||||
|
||||
@@ -47,6 +47,6 @@ public class VendorEntityService extends QueryService<VendorEntityVo, CompanyVen
|
||||
@Override
|
||||
public String getBeanName() {
|
||||
// 确保返回正确的服务名称
|
||||
return "companyVendorEntityService";
|
||||
return "vendorEntityService";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.VendorFileType;
|
||||
import com.ecep.contract.model.Vendor;
|
||||
import com.ecep.contract.model.VendorFileTypeLocal;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CompanyVendorFileViewModel;
|
||||
@@ -27,11 +26,6 @@ public class VendorFileService extends QueryService<VendorFileVo, CompanyVendorF
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getNextSignDate'");
|
||||
}
|
||||
public LocalDate getNextSignDate(Vendor vendor, Consumer<String> state) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getNextSignDate'");
|
||||
}
|
||||
|
||||
public Map<VendorFileType, VendorFileTypeLocal> getFileTypeLocalMap(Locale locale) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getFileTypeLocalMap'");
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.constant.CompanyVendorConstant;
|
||||
import com.ecep.contract.model.Vendor;
|
||||
import com.ecep.contract.model.VendorCatalog;
|
||||
import com.ecep.contract.util.CompanyUtils;
|
||||
import com.ecep.contract.util.FileUtils;
|
||||
@@ -71,11 +70,6 @@ public class VendorService extends QueryService<VendorVo, CompanyVendorViewModel
|
||||
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
|
||||
}
|
||||
|
||||
public boolean reBuildingFiles(Vendor vendor, MessageHolder messageHolder) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
|
||||
}
|
||||
|
||||
public void verify(ContractVo contract, MessageHolder holder) {
|
||||
CompanyVo company = companyService.findById(contract.getCompanyId());
|
||||
if (company == null) {
|
||||
|
||||
@@ -4,18 +4,38 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 集团相关方平台同步任务
|
||||
* <p>
|
||||
* 定时任务,每30分钟同步一次集团相关方平台的相关方信息
|
||||
* <p>
|
||||
* 任务执行时,会调用集团相关方平台的API,获取相关方信息,并更新到数据库中。
|
||||
*/
|
||||
public class CloudRkSyncTask extends Tasker<Object> {
|
||||
public class CloudRkSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CloudRkSyncTask.class);
|
||||
|
||||
@Setter
|
||||
private CompanyVo company;
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("集团相关方平台");
|
||||
updateProgress(1, 1);
|
||||
return null;
|
||||
updateTitle(String.format("集团相关方平台同步任务[%s]", company.getName()));
|
||||
return callRemoteTask(holder, getLocale(), company.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(long workDone, long max) {
|
||||
super.updateProgress(workDone, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "CloudRkSyncTask";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ecep.contract.task;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
public class CompanyRkUpdateTasker extends Tasker<Object> implements WebSocketClientTasker {
|
||||
|
||||
@Setter
|
||||
CompanyVo company;
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "CompanyRkUpdateTasker";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(long workDone, long max) {
|
||||
super.updateProgress(workDone, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("合并更新 " + company.getName());
|
||||
return callRemoteTask(holder, getLocale(), company.getId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +1,24 @@
|
||||
package com.ecep.contract.task;
|
||||
|
||||
import com.ecep.contract.*;
|
||||
import com.ecep.contract.controller.project.cost.ProjectCostImportItemsFromContractsTasker;
|
||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||
import com.ecep.contract.service.*;
|
||||
import com.ecep.contract.vo.*;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.collections.ObservableMap;
|
||||
import javafx.util.converter.NumberStringConverter;
|
||||
import lombok.Data;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.NumberFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.DoubleSummaryStatistics;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ecep.contract.service.*;
|
||||
import com.ecep.contract.vo.*;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.ContractFileType;
|
||||
import com.ecep.contract.ContractPayWay;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.MyDateTimeUtils;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.controller.project.cost.ProjectCostImportItemsFromContractsTasker;
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||
import com.ecep.contract.service.VendorService;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.collections.ObservableMap;
|
||||
import javafx.util.converter.NumberStringConverter;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ContractVerifyComm {
|
||||
// Project
|
||||
@@ -208,7 +194,6 @@ public class ContractVerifyComm {
|
||||
*/
|
||||
private ObservableMap<ContractFileType, ContractFileTypeLocal> fileTypeLocalMap = null;
|
||||
private Locale locale = Locale.getDefault();
|
||||
private Contract contract;
|
||||
|
||||
/**
|
||||
* 是否验证企业存储目录
|
||||
@@ -380,17 +365,15 @@ public class ContractVerifyComm {
|
||||
vendorInfo = getExtendVendorInfoService().save(info);
|
||||
holder.info("创建供应商信息 #" + vendorInfo.getId());
|
||||
}
|
||||
Integer groupId = vendorInfo.getGroupId();
|
||||
VendorGroupVo group = vendorGroupService.findById(groupId);
|
||||
VendorGroupVo group = null;
|
||||
if (vendorInfo.getGroupId() != null) {
|
||||
group = getVendorGroupService().findById(vendorInfo.getGroupId());
|
||||
}
|
||||
boolean assignedProvider = vendorInfo.isAssignedProvider();
|
||||
if (assignedProvider) {
|
||||
holder.debug("采购信息中设定为指定供应商");
|
||||
}
|
||||
|
||||
if (group != null) {
|
||||
group = getVendorGroupService().findById(groupId);
|
||||
vendorInfo.setGroupId(group.getId());
|
||||
}
|
||||
if (verifyCustomerSubContractDate.get()) {
|
||||
// 检查子合同日期是否在销售合同之后
|
||||
if (!vendorInfo.isPrePurchase()) {
|
||||
@@ -424,7 +407,7 @@ public class ContractVerifyComm {
|
||||
ContractFileService fileService = getContractFileService();
|
||||
List<ContractFileVo> files = fileService.findAllByContract(contract);
|
||||
List<VendorGroupRequireFileTypeVo> list = getVendorGroupRequireFileTypeService().findByGroupId(group.getId());
|
||||
if (list != null && !list.isEmpty()) {
|
||||
if (list != null) {
|
||||
for (VendorGroupRequireFileTypeVo item : list) {
|
||||
ContractFileType fileType = item.getFileType();
|
||||
if (fileType == null) {
|
||||
@@ -453,26 +436,42 @@ public class ContractVerifyComm {
|
||||
holder.error("未上报供应商比价");
|
||||
} else {
|
||||
for (ContractBidVendorVo bidVendor : bidVendors) {
|
||||
if (bidVendor.getCompanyId() == null) {
|
||||
holder.warn("供应商比价:#" + bidVendor.getId() + " 未关联供应商");
|
||||
continue;
|
||||
}
|
||||
|
||||
CompanyVo company = getCompanyService().findById(bidVendor.getCompanyId());
|
||||
ContractFileVo contractFile = fileService.findById(bidVendor.getQuotationSheetFileId());
|
||||
// 报价表文件不存在
|
||||
if (contractFile == null) {
|
||||
if (requireQuotation && bidVendor.getCompanyId().equals(contract.getCompanyId())) {
|
||||
holder.debug("供应商类型启用了允许选中供应商不必须要有报价表");
|
||||
} else {
|
||||
CompanyVo company = getCompanyService().findById(bidVendor.getCompanyId());
|
||||
holder.error("供应商比价:" + company.getName() + " 未上传/关联报价表");
|
||||
loseFile = true;
|
||||
}
|
||||
} else {
|
||||
contractFile = fileService.findById(contractFile.getId());
|
||||
ContractFileType type = contractFile.getType();
|
||||
if (type == null) {
|
||||
continue;
|
||||
}
|
||||
if (type != ContractFileType.QuotationSheet) {
|
||||
holder.error("供应商比价:" + contractFile.getFileName() + " 报价表记录异常,类型错误");
|
||||
}
|
||||
File file = new File(contract.getPath(), contractFile.getFileName());
|
||||
if (!file.exists()) {
|
||||
holder.error("供应商比价:" + file.getName() + " 报价表记录异常,文件不存在");
|
||||
loseFile = true;
|
||||
} else {
|
||||
if (StringUtils.hasText(contractFile.getFileName())) {
|
||||
File file = new File(contract.getPath(), contractFile.getFileName());
|
||||
if (!file.exists()) {
|
||||
holder.error("供应商比价:" + file.getName() + " 报价表记录异常,文件不存在");
|
||||
loseFile = true;
|
||||
}
|
||||
} else {
|
||||
holder.error("供应商比价:" + company.getName() + " 报价表记录异常");
|
||||
loseFile = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,6 +260,10 @@ public class UITools {
|
||||
|
||||
// 监听 property 变化
|
||||
idProperty.addListener((observable, oldValue, newValue) -> {
|
||||
if (newValue == null) {
|
||||
textField.textProperty().set(null);
|
||||
return;
|
||||
}
|
||||
T newEntity = queryService.findById(newValue);
|
||||
textField.textProperty().set(converter.toString(newEntity));
|
||||
});
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.vo.CloudRkVo;
|
||||
|
||||
@@ -95,7 +96,7 @@ public class CloudRkViewModel extends IdentityViewModel<CloudRkVo> {
|
||||
vm.updateFrom(v);
|
||||
return vm;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CloudRkVo v) {
|
||||
super.updateFrom(v);
|
||||
@@ -122,24 +123,78 @@ public class CloudRkViewModel extends IdentityViewModel<CloudRkVo> {
|
||||
@Override
|
||||
public boolean copyTo(CloudRkVo v) {
|
||||
boolean result = super.copyTo(v);
|
||||
v.setCloudId(cloudId.get());
|
||||
v.setUpdateDays(updateDays.get());
|
||||
v.setAutoUpdate(autoUpdate.get());
|
||||
v.setDescription(description.get());
|
||||
v.setRank(rank.get());
|
||||
v.setRankDescription(rankDescription.get());
|
||||
v.setCustomerGrade(customerGrade.get());
|
||||
v.setCustomerDescription(customerDescription.get());
|
||||
v.setCustomerScore(customerScore.get());
|
||||
v.setVendorGrade(vendorGrade.get());
|
||||
v.setVendorDescription(vendorDescription.get());
|
||||
v.setVendorScore(vendorScore.get());
|
||||
v.setCompanyId(company.get());
|
||||
v.setLatestUpdate(latestUpdate.get());
|
||||
v.setCloudEntUpdate(cloudEntUpdate.get());
|
||||
v.setCloudBlackListUpdated(cloudBlackListUpdated.get());
|
||||
v.setCloudLatest(cloudLatest.get());
|
||||
v.setVersion(version.get());
|
||||
if (!Objects.equals(v.getCloudId(), cloudId.get())) {
|
||||
v.setCloudId(cloudId.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getUpdateDays(), updateDays.get())) {
|
||||
v.setUpdateDays(updateDays.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.isAutoUpdate(), autoUpdate.get())) {
|
||||
v.setAutoUpdate(autoUpdate.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getDescription(), description.get())) {
|
||||
v.setDescription(description.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getRank(), rank.get())) {
|
||||
v.setRank(rank.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getRankDescription(), rankDescription.get())) {
|
||||
v.setRankDescription(rankDescription.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCustomerGrade(), customerGrade.get())) {
|
||||
v.setCustomerGrade(customerGrade.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCustomerDescription(), customerDescription.get())) {
|
||||
v.setCustomerDescription(customerDescription.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCustomerScore(), customerScore.get())) {
|
||||
v.setCustomerScore(customerScore.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getVendorGrade(), vendorGrade.get())) {
|
||||
v.setVendorGrade(vendorGrade.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getVendorDescription(), vendorDescription.get())) {
|
||||
v.setVendorDescription(vendorDescription.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getVendorScore(), vendorScore.get())) {
|
||||
v.setVendorScore(vendorScore.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCompanyId(), company.get())) {
|
||||
v.setCompanyId(company.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getLatestUpdate(), latestUpdate.get())) {
|
||||
v.setLatestUpdate(latestUpdate.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCloudEntUpdate(), cloudEntUpdate.get())) {
|
||||
v.setCloudEntUpdate(cloudEntUpdate.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCloudBlackListUpdated(), cloudBlackListUpdated.get())) {
|
||||
v.setCloudBlackListUpdated(cloudBlackListUpdated.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getCloudLatest(), cloudLatest.get())) {
|
||||
v.setCloudLatest(cloudLatest.get());
|
||||
result = true;
|
||||
}
|
||||
if (!Objects.equals(v.getVersion(), version.get())) {
|
||||
v.setVersion(version.get());
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,57 +16,52 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CloudTycInfoViewModel extends IdentityViewModel<CloudTycVo> {
|
||||
/**
|
||||
* 云端Id
|
||||
*/
|
||||
private SimpleStringProperty cloudId = new SimpleStringProperty();
|
||||
/**
|
||||
* 公司, Company
|
||||
*/
|
||||
private SimpleObjectProperty<Integer> company = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 云端Id
|
||||
*/
|
||||
private SimpleStringProperty cloudId = new SimpleStringProperty();
|
||||
/**
|
||||
* 天眼查得分
|
||||
*/
|
||||
private SimpleIntegerProperty score = new SimpleIntegerProperty();
|
||||
private SimpleObjectProperty<LocalDateTime> cloudLatest = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 最后更新日期
|
||||
*/
|
||||
private SimpleObjectProperty<LocalDateTime> latest = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<LocalDateTime> latestUpdate = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
||||
private SimpleIntegerProperty score = new SimpleIntegerProperty();
|
||||
private SimpleObjectProperty<LocalDateTime> cloudLatest = new SimpleObjectProperty<>();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CloudTycVo info) {
|
||||
super.updateFrom(info);
|
||||
update_((CloudTycVo) info);
|
||||
}
|
||||
|
||||
private void update_(CloudTycVo info) {
|
||||
score.set(info.getScore());
|
||||
|
||||
cloudId.set(info.getCloudId());
|
||||
company.set(info.getCompanyId());
|
||||
if (info.getCloudLatest() != null) {
|
||||
ZoneId zone = ZoneId.systemDefault();
|
||||
ZonedDateTime zonedDateTime = info.getCloudLatest().atZone(zone);
|
||||
LocalDateTime localDateTime = zonedDateTime.toLocalDateTime();
|
||||
cloudLatest.set(localDateTime);
|
||||
cloudLatest.set(info.getCloudLatest());
|
||||
} else {
|
||||
cloudLatest.set(null);
|
||||
}
|
||||
latestUpdate.set(info.getLatestUpdate());
|
||||
version.set(info.getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CloudTycVo info) {
|
||||
boolean modified = super.copyTo(info);
|
||||
if (copyTo_((CloudTycVo) info)) {
|
||||
if (!Objects.equals(info.getCompanyId(), getCompany().get())) {
|
||||
info.setCompanyId(getCompany().get());
|
||||
modified = true;
|
||||
}
|
||||
return modified;
|
||||
}
|
||||
|
||||
private boolean copyTo_(CloudTycVo info) {
|
||||
boolean modified = super.copyTo(info);
|
||||
if (!Objects.equals(info.getId(), getId().get())) {
|
||||
info.setId(getId().get());
|
||||
if (!Objects.equals(info.getCloudId(), cloudId.get())) {
|
||||
info.setCloudId(cloudId.get());
|
||||
modified = true;
|
||||
}
|
||||
|
||||
@@ -79,6 +74,14 @@ public class CloudTycInfoViewModel extends IdentityViewModel<CloudTycVo> {
|
||||
info.setCloudLatest(cloudLatest.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getLatestUpdate(), latestUpdate.get())) {
|
||||
info.setLatestUpdate(latestUpdate.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getVersion(), version.get())) {
|
||||
info.setVersion(version.get());
|
||||
modified = true;
|
||||
}
|
||||
|
||||
return modified;
|
||||
}
|
||||
|
||||
@@ -26,11 +26,8 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
/**
|
||||
* 最后更新日期
|
||||
*/
|
||||
private SimpleObjectProperty<LocalDateTime> latest = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
||||
private SimpleObjectProperty<LocalDateTime> latestUpdate = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleStringProperty vendorCode = new SimpleStringProperty();
|
||||
private SimpleStringProperty vendorClassCode = new SimpleStringProperty();
|
||||
private SimpleObjectProperty<LocalDate> vendorDevelopDate = new SimpleObjectProperty<>();
|
||||
@@ -41,17 +38,20 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
|
||||
private SimpleObjectProperty<LocalDateTime> cloudLatest = new SimpleObjectProperty<>();
|
||||
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CloudYuVo info) {
|
||||
super.updateFrom(info);
|
||||
update_((CloudYuVo) info);
|
||||
}
|
||||
|
||||
private void update_(CloudYuVo info) {
|
||||
vendorCode.set(info.getExceptionMessage());
|
||||
vendorDevelopDate.set(info.getVendorUpdateDate());
|
||||
customerDevelopDate.set(info.getCustomerUpdateDate());
|
||||
cloudLatest.set(info.getCloudLatest());
|
||||
latestUpdate.set(info.getLatestUpdate());
|
||||
version.set(info.getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,6 +82,14 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
info.setCloudLatest(cloudLatest.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getLatestUpdate(), latestUpdate.get())) {
|
||||
info.setLatestUpdate(latestUpdate.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getVersion(), version.get())) {
|
||||
info.setVersion(version.get());
|
||||
modified = true;
|
||||
}
|
||||
|
||||
return modified;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.CompanyContact;
|
||||
import com.ecep.contract.vo.CompanyContactVo;
|
||||
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CompanyContactViewModel extends IdentityViewModel<CompanyContactVo> {
|
||||
|
||||
@@ -1,13 +1,45 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.vo.CustomerFileTypeLocalVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CompanyCustomerFileTypeLocalViewModel extends EnumViewModel<CustomerFileType, CustomerFileTypeLocalVo> {
|
||||
public class CompanyCustomerFileTypeLocalViewModel extends IdentityViewModel<CustomerFileTypeLocalVo> {
|
||||
private SimpleObjectProperty<CustomerFileType> type = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty lang = new SimpleStringProperty();
|
||||
private SimpleStringProperty value = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CustomerFileTypeLocalVo v) {
|
||||
super.updateFrom(v);
|
||||
type.set(v.getType());
|
||||
lang.set(v.getLang());
|
||||
value.set(v.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CustomerFileTypeLocalVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(v.getType(), type.get())) {
|
||||
v.setType(type.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getLang(), lang.get())) {
|
||||
v.setLang(lang.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getValue(), value.get())) {
|
||||
v.setValue(value.get());
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.CompanyExtendInfo;
|
||||
import com.ecep.contract.vo.CompanyExtendInfoVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CompanyExtendInfoViewModel extends IdentityViewModel<CompanyExtendInfoVo> {
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CompanyFileType;
|
||||
import com.ecep.contract.model.CompanyFile;
|
||||
import com.ecep.contract.vo.CompanyFileVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* View Model for {@link CompanyFile}
|
||||
* View Model for {@link CompanyFileVo}
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.CompanyInvoiceInfo;
|
||||
|
||||
import com.ecep.contract.vo.CompanyInvoiceInfoVo;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CompanyInvoiceInfoViewModel extends IdentityViewModel<CompanyInvoiceInfo> {
|
||||
public class CompanyInvoiceInfoViewModel extends IdentityViewModel<CompanyInvoiceInfoVo> {
|
||||
private SimpleStringProperty name = new SimpleStringProperty();
|
||||
private SimpleStringProperty taxId = new SimpleStringProperty();
|
||||
private SimpleStringProperty address = new SimpleStringProperty();
|
||||
@@ -19,7 +18,7 @@ public class CompanyInvoiceInfoViewModel extends IdentityViewModel<CompanyInvoic
|
||||
private SimpleStringProperty bankAccount = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CompanyInvoiceInfo v) {
|
||||
protected void updateFrom(CompanyInvoiceInfoVo v) {
|
||||
super.updateFrom(v);
|
||||
name.set(v.getName());
|
||||
taxId.set(v.getTaxId());
|
||||
@@ -30,7 +29,7 @@ public class CompanyInvoiceInfoViewModel extends IdentityViewModel<CompanyInvoic
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CompanyInvoiceInfo v) {
|
||||
public boolean copyTo(CompanyInvoiceInfoVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(name.get(), v.getName())) {
|
||||
v.setName(name.get());
|
||||
|
||||
@@ -33,7 +33,6 @@ public class ContractBidVendorViewModel extends IdentityViewModel<ContractBidVen
|
||||
getContractId().set(v.getContractId() != null ? v.getContractId() : 0);
|
||||
getCompanyId().set(v.getCompanyId() != null ? v.getCompanyId() : 0);
|
||||
getQuotationSheetFileId().set(v.getQuotationSheetFileId() != null ? v.getQuotationSheetFileId() : 0);
|
||||
getQuotationSheetFileName().set(v.getQuotationSheetFileName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,10 +50,6 @@ public class ContractBidVendorViewModel extends IdentityViewModel<ContractBidVen
|
||||
v.setQuotationSheetFileId(getQuotationSheetFileId().get() != 0 ? getQuotationSheetFileId().get() : null);
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(getQuotationSheetFileName().get(), v.getQuotationSheetFileName())) {
|
||||
v.setQuotationSheetFileName(getQuotationSheetFileName().get());
|
||||
modified = true;
|
||||
}
|
||||
return modified;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@ package com.ecep.contract.vm;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.ContractFileType;
|
||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||
|
||||
import com.ecep.contract.vo.ContractFileTypeLocalVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
@@ -13,18 +12,36 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ContractFileTypeLocalViewModel extends EnumViewModel<ContractFileType, ContractFileTypeLocalVo> {
|
||||
public class ContractFileTypeLocalViewModel extends IdentityViewModel<ContractFileTypeLocalVo> {
|
||||
private SimpleObjectProperty<ContractFileType> type = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty lang = new SimpleStringProperty();
|
||||
private SimpleStringProperty value = new SimpleStringProperty();
|
||||
private SimpleStringProperty suggestFileName = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(ContractFileTypeLocalVo v) {
|
||||
super.updateFrom(v);
|
||||
type.set(v.getType());
|
||||
lang.set(v.getLang());
|
||||
value.set(v.getValue());
|
||||
suggestFileName.set(v.getSuggestFileName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(ContractFileTypeLocalVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(type.get(), v.getType())) {
|
||||
v.setType(type.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(lang.get(), v.getLang())) {
|
||||
v.setLang(lang.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(value.get(), v.getValue())) {
|
||||
v.setValue(value.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(suggestFileName.get(), v.getSuggestFileName())) {
|
||||
v.setSuggestFileName(suggestFileName.get());
|
||||
ret = true;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import com.ecep.contract.model.ContractItem;
|
||||
import com.ecep.contract.vo.ContractItemVo;
|
||||
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleListProperty;
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.ContractPayPlan;
|
||||
import com.ecep.contract.vo.ContractPayPlanVo;
|
||||
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
|
||||
@@ -1,11 +1,45 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.vo.CustomerFileTypeLocalVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CustomerFileTypeLocalViewModel extends EnumViewModel<CustomerFileType, CustomerFileTypeLocalVo> {
|
||||
public class CustomerFileTypeLocalViewModel extends IdentityViewModel<CustomerFileTypeLocalVo> {
|
||||
private SimpleObjectProperty<CustomerFileType> type = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty lang = new SimpleStringProperty();
|
||||
private SimpleStringProperty value = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CustomerFileTypeLocalVo v) {
|
||||
super.updateFrom(v);
|
||||
type.set(v.getType());
|
||||
lang.set(v.getLang());
|
||||
value.set(v.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CustomerFileTypeLocalVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(v.getType(), type.get())) {
|
||||
v.setType(type.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getLang(), lang.get())) {
|
||||
v.setLang(lang.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getValue(), value.get())) {
|
||||
v.setValue(value.get());
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import com.ecep.contract.model.Price;
|
||||
import com.ecep.contract.model.VolumeSize;
|
||||
import com.ecep.contract.vo.InventoryVo;
|
||||
|
||||
import com.ecep.contract.vo.VolumeSizeVo;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
import javafx.beans.property.SimpleFloatProperty;
|
||||
@@ -102,13 +103,13 @@ public class InventoryViewModel extends IdentityViewModel<InventoryVo> {
|
||||
getWeight().set(v.getWeight());
|
||||
getPackagedWeight().set(v.getPackagedWeight());
|
||||
|
||||
VolumeSize volumeSize = v.getVolumeSize();
|
||||
VolumeSizeVo volumeSize = v.getVolumeSize();
|
||||
getSizeLength().set(volumeSize.getLength());
|
||||
getSizeWidth().set(volumeSize.getWidth());
|
||||
getSizeHeight().set(volumeSize.getHeight());
|
||||
getVolume().set(volumeSize.getVolume());
|
||||
|
||||
VolumeSize packagedVolumeSize = v.getPackagedVolumeSize();
|
||||
VolumeSizeVo packagedVolumeSize = v.getPackagedVolumeSize();
|
||||
getPackagedSizeLength().set(packagedVolumeSize.getLength());
|
||||
getPackagedSizeWidth().set(packagedVolumeSize.getWidth());
|
||||
getPackagedSizeHeight().set(packagedVolumeSize.getHeight());
|
||||
@@ -208,7 +209,7 @@ public class InventoryViewModel extends IdentityViewModel<InventoryVo> {
|
||||
modified = true;
|
||||
}
|
||||
|
||||
VolumeSize volumeSize = v.getVolumeSize();
|
||||
VolumeSizeVo volumeSize = v.getVolumeSize();
|
||||
if (!Objects.equals(getSizeLength().get(), volumeSize.getLength())) {
|
||||
volumeSize.setLength(getSizeLength().get());
|
||||
modified = true;
|
||||
@@ -226,7 +227,7 @@ public class InventoryViewModel extends IdentityViewModel<InventoryVo> {
|
||||
modified = true;
|
||||
}
|
||||
|
||||
VolumeSize packagedVolumeSize = v.getPackagedVolumeSize();
|
||||
VolumeSizeVo packagedVolumeSize = v.getPackagedVolumeSize();
|
||||
if (!Objects.equals(getPackagedSizeHeight().get(), packagedVolumeSize.getHeight())) {
|
||||
packagedVolumeSize.setHeight(getPackagedSizeHeight().get());
|
||||
modified = true;
|
||||
|
||||
@@ -1,12 +1,45 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.ProjectFileType;
|
||||
import com.ecep.contract.vo.ProjectFileTypeLocalVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ProjectFileTypeLocalViewModel extends EnumViewModel<ProjectFileType, ProjectFileTypeLocalVo> {
|
||||
public class ProjectFileTypeLocalViewModel extends IdentityViewModel<ProjectFileTypeLocalVo> {
|
||||
private SimpleObjectProperty<ProjectFileType> type = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty lang = new SimpleStringProperty();
|
||||
private SimpleStringProperty value = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(ProjectFileTypeLocalVo v) {
|
||||
super.updateFrom(v);
|
||||
type.set(v.getType());
|
||||
lang.set(v.getLang());
|
||||
value.set(v.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(ProjectFileTypeLocalVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(v.getType(), type.get())) {
|
||||
v.setType(type.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getLang(), lang.get())) {
|
||||
v.setLang(lang.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getValue(), value.get())) {
|
||||
v.setValue(value.get());
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,6 @@ package com.ecep.contract.vm;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.Contract;
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.model.SalesOrder;
|
||||
|
||||
import com.ecep.contract.vo.SalesOrderVo;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
|
||||
@@ -1,38 +1,34 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.Vendor;
|
||||
import com.ecep.contract.model.VendorEntity;
|
||||
import com.ecep.contract.model.Employee;
|
||||
import com.ecep.contract.model.VendorCatalog;
|
||||
|
||||
import com.ecep.contract.vo.VendorEntityVo;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class VendorEntityViewModel extends IdentityViewModel<VendorEntity> {
|
||||
public class VendorEntityViewModel extends IdentityViewModel<VendorEntityVo> {
|
||||
private SimpleStringProperty name = new SimpleStringProperty();
|
||||
private SimpleStringProperty abbName = new SimpleStringProperty();
|
||||
private SimpleStringProperty code = new SimpleStringProperty();
|
||||
/**
|
||||
* 分组
|
||||
*/
|
||||
private SimpleObjectProperty<VendorCatalog> catalog = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Integer> catalog = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 关联的企业
|
||||
*/
|
||||
private SimpleObjectProperty<Vendor> vendor = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Integer> vendor = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 发展日期
|
||||
*/
|
||||
private SimpleObjectProperty<LocalDate> developDate = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Employee> creator = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Employee> modifier = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Integer> creator = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Integer> modifier = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<LocalDate> modifyDate = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 从U8系统同步时间
|
||||
@@ -40,30 +36,29 @@ public class VendorEntityViewModel extends IdentityViewModel<VendorEntity> {
|
||||
private SimpleObjectProperty<LocalDate> updatedDate = new SimpleObjectProperty<>();
|
||||
|
||||
|
||||
|
||||
public static VendorEntityViewModel from(VendorEntity cc) {
|
||||
public static VendorEntityViewModel from(VendorEntityVo cc) {
|
||||
VendorEntityViewModel model = new VendorEntityViewModel();
|
||||
model.update(cc);
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateFrom(VendorEntity v) {
|
||||
protected void updateFrom(VendorEntityVo v) {
|
||||
super.updateFrom(v);
|
||||
getName().set(v.getName());
|
||||
getAbbName().set(v.getAbbName());
|
||||
getCode().set(v.getCode());
|
||||
getCatalog().set(v.getCatalog());
|
||||
getVendor().set(v.getVendor());
|
||||
getCatalog().set(v.getCatalogId());
|
||||
getVendor().set(v.getVendorId());
|
||||
getDevelopDate().set(v.getDevelopDate());
|
||||
getCreator().set(v.getCreator());
|
||||
getModifier().set(v.getModifier());
|
||||
getCreator().set(v.getCreatorId());
|
||||
getModifier().set(v.getModifierId());
|
||||
getModifyDate().set(v.getModifyDate());
|
||||
getUpdatedDate().set(v.getUpdatedDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(VendorEntity v) {
|
||||
public boolean copyTo(VendorEntityVo v) {
|
||||
boolean modified = super.copyTo(v);
|
||||
if (!Objects.equals(name.get(), v.getName())) {
|
||||
v.setName(name.get());
|
||||
@@ -77,24 +72,24 @@ public class VendorEntityViewModel extends IdentityViewModel<VendorEntity> {
|
||||
v.setCode(code.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(catalog.get(), v.getCatalog())) {
|
||||
v.setCatalog(catalog.get());
|
||||
if (!Objects.equals(catalog.get(), v.getCatalogId())) {
|
||||
v.setCatalogId(catalog.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(vendor.get(), v.getVendor())) {
|
||||
v.setVendor(vendor.get());
|
||||
if (!Objects.equals(vendor.get(), v.getVendorId())) {
|
||||
v.setVendorId(vendor.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(developDate.get(), v.getDevelopDate())) {
|
||||
v.setDevelopDate(developDate.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(creator.get(), v.getCreator())) {
|
||||
v.setCreator(creator.get());
|
||||
if (!Objects.equals(creator.get(), v.getCreatorId())) {
|
||||
v.setCreatorId(creator.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(modifier.get(), v.getModifier())) {
|
||||
v.setModifier(modifier.get());
|
||||
if (!Objects.equals(modifier.get(), v.getModifierId())) {
|
||||
v.setModifierId(modifier.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(modifyDate.get(), v.getModifyDate())) {
|
||||
|
||||
@@ -1,11 +1,45 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.VendorFileType;
|
||||
import com.ecep.contract.vo.VendorFileTypeLocalVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VendorFileTypeLocalViewModel extends EnumViewModel<VendorFileType, VendorFileTypeLocalVo> {
|
||||
public class VendorFileTypeLocalViewModel extends IdentityViewModel<VendorFileTypeLocalVo> {
|
||||
private SimpleObjectProperty<VendorFileType> type = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty lang = new SimpleStringProperty();
|
||||
private SimpleStringProperty value = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(VendorFileTypeLocalVo v) {
|
||||
super.updateFrom(v);
|
||||
type.set(v.getType());
|
||||
lang.set(v.getLang());
|
||||
value.set(v.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(VendorFileTypeLocalVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(v.getType(), type.get())) {
|
||||
v.setType(type.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getLang(), lang.get())) {
|
||||
v.setLang(lang.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getValue(), value.get())) {
|
||||
v.setValue(value.get());
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,45 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.vo.VendorTypeLocalVo;
|
||||
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class VendorTypeLocalViewModel extends EnumViewModel<VendorType, VendorTypeLocalVo> {
|
||||
public class VendorTypeLocalViewModel extends IdentityViewModel<VendorTypeLocalVo> {
|
||||
private SimpleObjectProperty<VendorType> type = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty lang = new SimpleStringProperty();
|
||||
private SimpleStringProperty value = new SimpleStringProperty();
|
||||
|
||||
@Override
|
||||
protected void updateFrom(VendorTypeLocalVo v) {
|
||||
super.updateFrom(v);
|
||||
type.set(v.getType());
|
||||
lang.set(v.getLang());
|
||||
value.set(v.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(VendorTypeLocalVo v) {
|
||||
boolean ret = super.copyTo(v);
|
||||
if (!Objects.equals(v.getType(), type.get())) {
|
||||
v.setType(type.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getLang(), lang.get())) {
|
||||
v.setLang(lang.get());
|
||||
ret = true;
|
||||
}
|
||||
if (!Objects.equals(v.getValue(), value.get())) {
|
||||
v.setValue(value.get());
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
@@ -29,7 +30,7 @@
|
||||
<Menu mnemonicParsing="false" text="用友U8">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#createNewU8ContractSyncTaskAction"
|
||||
text="同步合同"/>
|
||||
text="同步合同"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#openYongYouResourceWindow" text="用友U8…"/>
|
||||
</items>
|
||||
</Menu>
|
||||
@@ -49,10 +50,9 @@
|
||||
</Menu>
|
||||
<Menu text="帮助(_H)">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#openInBrowse" text="国家企业信用信息公示系统"
|
||||
userData="https://www.gsxt.gov.cn/"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#openInBrowse" text="天眼查-商业查询平台"
|
||||
userData="https://www.tianyancha.com/"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#openInBrowse" text="信用中国" userData="https://www.creditchina.gov.cn/"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#openInBrowse" text="国家企业信用信息公示系统" userData="https://www.gsxt.gov.cn/"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#openInBrowse" text="天眼查-商业查询平台" userData="https://www.tianyancha.com/"/>
|
||||
<MenuItem mnemonicParsing="false" text="关于"/>
|
||||
</items>
|
||||
</Menu>
|
||||
@@ -61,7 +61,7 @@
|
||||
<ToolBar prefHeight="40.0" prefWidth="200.0">
|
||||
<items>
|
||||
<Button fx:id="openCompanyManagerWindow" mnemonicParsing="false" style="-fx-padding: 6px;"
|
||||
userData="com.ecep.contract.manager.ds.company.controller.CompanyManagerWindowController">
|
||||
userData="com.ecep.contract.manager.ds.company.controller.CompanyManagerWindowController">
|
||||
<graphic>
|
||||
<VBox alignment="CENTER">
|
||||
<children>
|
||||
@@ -141,7 +141,7 @@
|
||||
</Button>
|
||||
<!-- 客户 -->
|
||||
<Button fx:id="openCustomManagerWindow" layoutX="138.0" layoutY="10.0" mnemonicParsing="false"
|
||||
style="-fx-padding: 6px;">
|
||||
style="-fx-padding: 6px;">
|
||||
<graphic>
|
||||
<VBox alignment="CENTER">
|
||||
<children>
|
||||
@@ -175,7 +175,7 @@
|
||||
<Label fx:id="leftStatusLabel" text="Label" wrapText="true"/>
|
||||
<Pane prefHeight="12.0" prefWidth="12.0" HBox.hgrow="ALWAYS"/>
|
||||
<Label fx:id="rightStatusLabel" layoutX="10.0" layoutY="10.0" text="-" wrapText="true"
|
||||
HBox.hgrow="SOMETIMES">
|
||||
HBox.hgrow="SOMETIMES">
|
||||
<HBox.margin>
|
||||
<Insets left="6.0"/>
|
||||
</HBox.margin>
|
||||
@@ -184,7 +184,7 @@
|
||||
<Label fx:id="webSocketMonitorLabel" text="WebSocket"/>
|
||||
<Label fx:id="taskMonitorLabel" text="任务监控"/>
|
||||
<Label fx:id="employeeStatusLabel" layoutX="711.0" layoutY="10.0" text="管理员" wrapText="true"
|
||||
HBox.hgrow="SOMETIMES">
|
||||
HBox.hgrow="SOMETIMES">
|
||||
<HBox.margin>
|
||||
<Insets left="6.0"/>
|
||||
</HBox.margin>
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<parent>
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>Contract-Manager</artifactId>
|
||||
<version>0.0.99-SNAPSHOT</version>
|
||||
<version>0.0.100-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>0.0.99-SNAPSHOT</version>
|
||||
<version>0.0.100-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -15,20 +14,29 @@ import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 银行实体类
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "BANK", schema = "supplier_ms")
|
||||
public class Bank implements BasedEntity, IdentityEntity, Serializable, Voable<BankVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class Bank implements BasedEntity, IdentityEntity, Voable<BankVo> {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 银行编码
|
||||
*/
|
||||
@Column(name = "CODE")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 银行名称
|
||||
*/
|
||||
@Column(name = "NAME")
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.MappedSuperclass;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.proxy.HibernateProxy;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
@MappedSuperclass
|
||||
@ToString
|
||||
public abstract class BaseEnumEntity<T extends Enum<?>> implements IdentityEntity {
|
||||
@@ -34,5 +30,19 @@ public abstract class BaseEnumEntity<T extends Enum<?>> implements IdentityEntit
|
||||
@Column(name = "VALUE")
|
||||
private String value;
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null) return false;
|
||||
Class<?> oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
|
||||
Class<?> thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass();
|
||||
if (thisEffectiveClass != oEffectiveClass) return false;
|
||||
BaseEnumEntity<?> that = (BaseEnumEntity<?>) o;
|
||||
return getId() != null && Objects.equals(getId(), that.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CompanyFileType;
|
||||
@@ -18,26 +17,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "COMPANY_FILE_TYPE_LOCAL")
|
||||
@ToString
|
||||
public class CompanyFileTypeLocal extends BaseEnumEntity<CompanyFileType> implements Serializable, Voable<CompanyFileTypeLocalVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object object) {
|
||||
if (this == object)
|
||||
return true;
|
||||
if (object == null)
|
||||
return false;
|
||||
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
|
||||
return false;
|
||||
}
|
||||
CompanyFileTypeLocal that = (CompanyFileTypeLocal) object;
|
||||
return getId() != null && Objects.equals(getId(), that.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return HibernateProxyUtils.hashCode(this);
|
||||
}
|
||||
public class CompanyFileTypeLocal extends BaseEnumEntity<CompanyFileType> implements Voable<CompanyFileTypeLocalVo> {
|
||||
|
||||
@Override
|
||||
public CompanyFileTypeLocalVo toVo() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -24,8 +23,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "CONTRACT_CATALOG", schema = "supplier_ms")
|
||||
public class ContractCatalog implements IdentityEntity, NamedEntity, Serializable, Voable<ContractCatalogVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class ContractCatalog implements IdentityEntity, NamedEntity, Voable<ContractCatalogVo> {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.ContractFileType;
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
import com.ecep.contract.vo.ContractFileTypeLocalVo;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
@@ -22,8 +18,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "CONTRACT_FILE_TYPE_LOCAL")
|
||||
@ToString(callSuper = true)
|
||||
public class ContractFileTypeLocal extends BaseEnumEntity<ContractFileType> implements Serializable, Voable<ContractFileTypeLocalVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class ContractFileTypeLocal extends BaseEnumEntity<ContractFileType> implements Voable<ContractFileTypeLocalVo> {
|
||||
/**
|
||||
* 建议的文件名
|
||||
*/
|
||||
@@ -33,24 +28,6 @@ public class ContractFileTypeLocal extends BaseEnumEntity<ContractFileType> impl
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object object) {
|
||||
if (this == object)
|
||||
return true;
|
||||
if (object == null)
|
||||
return false;
|
||||
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
|
||||
return false;
|
||||
}
|
||||
ContractFileTypeLocal that = (ContractFileTypeLocal) object;
|
||||
return getId() != null && Objects.equals(getId(), that.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return HibernateProxyUtils.hashCode(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractFileTypeLocalVo toVo() {
|
||||
ContractFileTypeLocalVo vo = new ContractFileTypeLocalVo();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -22,8 +21,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "CONTRACT_GROUP", schema = "supplier_ms")
|
||||
public class ContractGroup implements IdentityEntity, NamedEntity, Serializable, Voable<ContractGroupVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class ContractGroup implements IdentityEntity, NamedEntity, Voable<ContractGroupVo> {
|
||||
@Id
|
||||
@Column(name = "ID", nullable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -24,8 +23,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "CONTRACT_KIND", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class ContractKind implements IdentityEntity, NamedEntity, Serializable, Voable<ContractKindVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class ContractKind implements IdentityEntity, NamedEntity, Voable<ContractKindVo> {
|
||||
@Id
|
||||
@Column(name = "ID", nullable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -24,8 +23,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "CONTRACT_TYPE", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class ContractType implements IdentityEntity, NamedEntity, Serializable, Voable<ContractTypeVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class ContractType implements IdentityEntity, NamedEntity, Voable<ContractTypeVo> {
|
||||
@Id
|
||||
@Column(name = "ID", nullable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -24,8 +23,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "CUSTOMER_CATALOG", schema = "supplier_ms")
|
||||
@ToString
|
||||
public class CustomerCatalog implements BasedEntity, IdentityEntity, Serializable, Voable<CustomerCatalogVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class CustomerCatalog implements BasedEntity, IdentityEntity, Voable<CustomerCatalogVo> {
|
||||
@Id
|
||||
@Column(name = "ID", nullable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
import com.ecep.contract.vo.CustomerFileTypeLocalVo;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -19,30 +15,9 @@ import lombok.ToString;
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "CUSTOMER_FILE_TYPE_LOCAL")
|
||||
@Table(name = "COMPANY_CUSTOMER_FILE_TYPE_LOCAL")
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerFileTypeLocal extends BaseEnumEntity<CustomerFileType> implements Serializable, Voable<CustomerFileTypeLocalVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public final boolean equals(Object object) {
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
if (object == null) {
|
||||
return false;
|
||||
}
|
||||
if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
|
||||
return false;
|
||||
}
|
||||
CustomerFileTypeLocal that = (CustomerFileTypeLocal) object;
|
||||
return getId() != null && Objects.equals(getId(), that.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return HibernateProxyUtils.hashCode(this);
|
||||
}
|
||||
public class CustomerFileTypeLocal extends BaseEnumEntity<CustomerFileType> implements Voable<CustomerFileTypeLocalVo> {
|
||||
|
||||
@Override
|
||||
public CustomerFileTypeLocalVo toVo() {
|
||||
|
||||
@@ -26,8 +26,7 @@ import lombok.ToString;
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "PRODUCT_DELIVERY_SIGN_METHOD", schema = "supplier_ms")
|
||||
public class DeliverySignMethod implements BasedEntity, IdentityEntity , Serializable, Voable<DeliverySignMethodVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class DeliverySignMethod implements BasedEntity, IdentityEntity, Voable<DeliverySignMethodVo> {
|
||||
@Id
|
||||
@Column(name = "ID", nullable = false)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -22,8 +21,7 @@ import lombok.ToString;
|
||||
@Setter
|
||||
@jakarta.persistence.Entity
|
||||
@Table(name = "DEPARTMENT", schema = "supplier_ms")
|
||||
public class Department implements BasedEntity, IdentityEntity, Serializable, Voable<DepartmentVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class Department implements BasedEntity, IdentityEntity, Voable<DepartmentVo> {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -31,8 +30,7 @@ import lombok.ToString;
|
||||
@Setter
|
||||
@jakarta.persistence.Entity
|
||||
@Table(name = "EMPLOYEE", schema = "supplier_ms")
|
||||
public class Employee implements BasedEntity, IdentityEntity, NamedEntity, Serializable, Voable<EmployeeVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class Employee implements BasedEntity, IdentityEntity, NamedEntity, Voable<EmployeeVo> {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -23,8 +22,7 @@ import lombok.ToString;
|
||||
@Setter
|
||||
@jakarta.persistence.Entity
|
||||
@Table(name = "EMPLOYEE_AUTH_BIND", schema = "supplier_ms")
|
||||
public class EmployeeAuthBind implements BasedEntity, IdentityEntity, Serializable, Voable<EmployeeAuthBindVo> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class EmployeeAuthBind implements BasedEntity, IdentityEntity, Voable<EmployeeAuthBindVo> {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -22,9 +21,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@jakarta.persistence.Entity
|
||||
@Table(name = "EMPLOYEE_LOGIN_HISTORY", schema = "supplier_ms")
|
||||
public class EmployeeLoginHistory implements BasedEntity, IdentityEntity, Serializable, Voable<EmployeeLoginHistoryVo> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class EmployeeLoginHistory implements BasedEntity, IdentityEntity, Voable<EmployeeLoginHistoryVo> {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -27,9 +26,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@jakarta.persistence.Entity
|
||||
@Table(name = "EMPLOYEE_ROLE", schema = "supplier_ms")
|
||||
public class EmployeeRole implements IdentityEntity, NamedEntity, Serializable, Voable<EmployeeRoleVo> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class EmployeeRole implements IdentityEntity, NamedEntity, Voable<EmployeeRoleVo> {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
@@ -18,9 +17,9 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@jakarta.persistence.Entity
|
||||
@Table(name = "FUNC", schema = "supplier_ms")
|
||||
public class Function implements IdentityEntity, NamedEntity, Serializable, Voable<FunctionVo> {
|
||||
public class Function implements IdentityEntity, NamedEntity, Voable<FunctionVo> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "ID", nullable = false)
|
||||
|
||||
@@ -3,13 +3,11 @@ package com.ecep.contract.model;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.MonthDay;
|
||||
|
||||
@Embeddable
|
||||
@Data
|
||||
public class HistoryPrice implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class HistoryPrice {
|
||||
/**
|
||||
* 税率,1% =1,100% =100
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.ecep.contract.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -22,8 +21,7 @@ import lombok.ToString;
|
||||
@Entity
|
||||
@Table(name = "HOLIDAY_TABLE")
|
||||
@ToString
|
||||
public class HolidayTable implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class HolidayTable {
|
||||
@Id
|
||||
@Column(name = "ID", nullable = false)
|
||||
@JdbcTypeCode(SqlTypes.DATE)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user