Compare commits
21 Commits
02afa189f8
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 643338f4b0 | |||
| 880671a5a9 | |||
| 4e738bea3c | |||
| 3cf3a717be | |||
| e8c8305f40 | |||
| be63ff62a4 | |||
| 18057a657e | |||
| db07befffe | |||
| 94030a5a39 | |||
| 7e59f2c17e | |||
| c8b0d57f22 | |||
| 6eebdb1744 | |||
| 9dc90507cb | |||
| 0c26d329c6 | |||
| e3661630fe | |||
| 5d6fb961b6 | |||
| 72edb07798 | |||
| 330418cfd6 | |||
| c10bd369c0 | |||
| f0e85c5a18 | |||
| a784438e97 |
1
.env
1
.env
@@ -0,0 +1 @@
|
|||||||
|
PLAYWRIGHT_MCP_EXTENSION_TOKEN=TB7T39NhEbruyS7L-E7RXIGYk39PVK7eu1h-WP8M1Cg
|
||||||
@@ -86,8 +86,8 @@ public interface WebSocketServerTasker extends Callable<Object> {
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"CustomTasker": "com.ecep.contract.service.tasker.CustomTasker"
|
"CustomTasker": "com.ecep.contract.service.tasker.CustomTasker",
|
||||||
// 其他已注册任务...
|
"OtherTasker": "..."
|
||||||
},
|
},
|
||||||
"descriptions": "任务注册信息, 客户端的任务可以通过 WebSocket 调用"
|
"descriptions": "任务注册信息, 客户端的任务可以通过 WebSocket 调用"
|
||||||
}
|
}
|
||||||
@@ -137,6 +137,7 @@ WebSocketServerTaskManager类在启动时会读取`tasker_mapper.json`文件,
|
|||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
// 调用父类初始化
|
// 调用父类初始化
|
||||||
super.execute(holder);
|
super.execute(holder);
|
||||||
|
updateTitle("同步修复所有合同");
|
||||||
// 执行具体业务逻辑
|
// 执行具体业务逻辑
|
||||||
repair(holder);
|
repair(holder);
|
||||||
return null; // 通常返回 null 或处理结果
|
return null; // 通常返回 null 或处理结果
|
||||||
@@ -146,7 +147,6 @@ WebSocketServerTaskManager类在启动时会读取`tasker_mapper.json`文件,
|
|||||||
5. **使用更新方法提供状态反馈**:在执行过程中使用 `updateTitle`、`updateProgress` 等方法提供实时反馈
|
5. **使用更新方法提供状态反馈**:在执行过程中使用 `updateTitle`、`updateProgress` 等方法提供实时反馈
|
||||||
|
|
||||||
```java
|
```java
|
||||||
updateTitle("同步修复所有合同");
|
|
||||||
updateProgress(counter.incrementAndGet(), total);
|
updateProgress(counter.incrementAndGet(), total);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
182
.trae/rules/tasker_implementation_guide.md
Normal file
182
.trae/rules/tasker_implementation_guide.md
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
# Tasker实现规范指南
|
||||||
|
|
||||||
|
## 1. Tasker架构概述
|
||||||
|
|
||||||
|
Tasker是系统中用于执行异步任务的核心框架,主要用于处理耗时操作并提供实时进度反馈。Tasker架构包括:
|
||||||
|
|
||||||
|
- **Tasker基类**:提供任务执行的基础框架和通信功能
|
||||||
|
- **WebSocketServerTasker接口**:定义WebSocket通信任务的规范
|
||||||
|
- **MessageHolder**:用于在任务执行过程中传递消息和更新进度
|
||||||
|
|
||||||
|
## 2. 服务器端Tasker实现规范
|
||||||
|
|
||||||
|
### 2.1 基本结构
|
||||||
|
|
||||||
|
服务器端Tasker实现应遵循以下结构:
|
||||||
|
|
||||||
|
```java
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class YourTaskNameTask extends Tasker<Object> implements WebSocketServerTasker {
|
||||||
|
// 服务依赖
|
||||||
|
@Setter
|
||||||
|
private YourService service;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(JsonNode argsNode) {
|
||||||
|
// 初始化任务标题
|
||||||
|
updateTitle("任务标题");
|
||||||
|
// 初始化参数
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
|
// 实现业务逻辑
|
||||||
|
// 使用holder.info()、holder.error()等方法反馈消息
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2.2 关键注意事项
|
||||||
|
|
||||||
|
1. **继承与实现**:
|
||||||
|
- 必须继承`Tasker<Object>`基类
|
||||||
|
- 必须实现`WebSocketServerTasker`接口
|
||||||
|
|
||||||
|
2. **方法实现**:
|
||||||
|
- **不要重复实现**Tasker基类已提供的handler设置方法:`setMessageHandler`、`setTitleHandler`、`setPropertyHandler`、`setProgressHandler`
|
||||||
|
- 必须实现`init`方法,设置任务标题和初始化参数
|
||||||
|
- 必须实现`execute`方法,实现具体业务逻辑
|
||||||
|
|
||||||
|
3. **进度和消息反馈**:
|
||||||
|
- 使用`updateProgress`方法提供进度更新
|
||||||
|
- 使用`MessageHolder`的`info`、`error`、`debug`等方法提供消息反馈
|
||||||
|
|
||||||
|
4. **任务取消**:
|
||||||
|
- 在适当的地方检查`isCancelled()`状态,支持任务取消
|
||||||
|
|
||||||
|
5. **注册要求**:
|
||||||
|
- 任务类必须在`tasker_mapper.json`中注册
|
||||||
|
|
||||||
|
## 3. 客户端Tasker实现规范
|
||||||
|
|
||||||
|
客户端Tasker实现应遵循:
|
||||||
|
|
||||||
|
```java
|
||||||
|
public class YourTaskNameTask extends Tasker<Object> {
|
||||||
|
@Override
|
||||||
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
|
// 客户端任务逻辑
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. 通信规范
|
||||||
|
|
||||||
|
### 4.1 命名规范
|
||||||
|
|
||||||
|
- 客户端和服务器端对应的Tasker类应使用**相同的类名**
|
||||||
|
- 示例:客户端的`ContractSyncAllTask`对应服务器端的`ContractSyncAllTask`
|
||||||
|
|
||||||
|
### 4.2 消息传递
|
||||||
|
|
||||||
|
- 使用`MessageHolder`进行消息传递
|
||||||
|
- 支持不同级别的消息:INFO、ERROR、DEBUG
|
||||||
|
|
||||||
|
## 5. 最佳实践
|
||||||
|
|
||||||
|
1. **任务拆分**:
|
||||||
|
- 将大型任务拆分为多个小任务,提高可维护性
|
||||||
|
|
||||||
|
2. **异常处理**:
|
||||||
|
- 捕获并正确处理异常,使用`holder.error()`提供详细错误信息
|
||||||
|
|
||||||
|
3. **资源管理**:
|
||||||
|
- 确保及时释放资源,特别是在任务取消的情况下
|
||||||
|
|
||||||
|
4. **日志记录**:
|
||||||
|
- 使用`holder.debug()`记录调试信息
|
||||||
|
- 使用`holder.info()`记录进度信息
|
||||||
|
|
||||||
|
5. **状态检查**:
|
||||||
|
- 定期检查`isCancelled()`状态,确保任务可以被及时取消
|
||||||
|
|
||||||
|
## 6. 代码示例
|
||||||
|
|
||||||
|
### 6.1 服务器端Tasker示例
|
||||||
|
|
||||||
|
```java
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ExampleSyncTask extends Tasker<Object> implements WebSocketServerTasker {
|
||||||
|
@Setter
|
||||||
|
private ExampleService exampleService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(JsonNode argsNode) {
|
||||||
|
updateTitle("示例同步任务");
|
||||||
|
// 从argsNode初始化参数
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
|
try {
|
||||||
|
// 获取总记录数
|
||||||
|
long total = exampleService.getTotalCount();
|
||||||
|
holder.info("开始同步数据,共" + total + "条记录");
|
||||||
|
|
||||||
|
// 分批处理
|
||||||
|
long processed = 0;
|
||||||
|
List<ExampleEntity> entities = exampleService.getAllEntities();
|
||||||
|
|
||||||
|
for (ExampleEntity entity : entities) {
|
||||||
|
// 检查是否取消
|
||||||
|
if (isCancelled()) {
|
||||||
|
holder.info("任务已取消");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理单个实体
|
||||||
|
exampleService.processEntity(entity);
|
||||||
|
processed++;
|
||||||
|
|
||||||
|
// 更新进度
|
||||||
|
updateProgress(processed, total);
|
||||||
|
if (processed % 100 == 0) {
|
||||||
|
holder.info("已处理" + processed + "/" + total + "条记录");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.info("同步完成,共处理" + processed + "条记录");
|
||||||
|
return processed;
|
||||||
|
} catch (Exception e) {
|
||||||
|
holder.error("同步失败: " + e.getMessage());
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 7. 常见错误和避免方法
|
||||||
|
|
||||||
|
1. **重复实现handler方法**:
|
||||||
|
- 错误:在子类中重复实现setMessageHandler等方法
|
||||||
|
- 解决:删除子类中的这些方法,直接使用Tasker基类提供的实现
|
||||||
|
|
||||||
|
2. **缺少任务注册**:
|
||||||
|
- 错误:任务类没有在tasker_mapper.json中注册
|
||||||
|
- 解决:确保所有服务器端Tasker类都在配置文件中正确注册
|
||||||
|
|
||||||
|
3. **类名不匹配**:
|
||||||
|
- 错误:客户端和服务器端Tasker类名不一致
|
||||||
|
- 解决:确保两端使用相同的类名
|
||||||
|
|
||||||
|
4. **进度更新不正确**:
|
||||||
|
- 错误:进度计算错误或没有更新
|
||||||
|
- 解决:正确计算和更新进度,提高用户体验
|
||||||
|
|
||||||
|
5. **资源泄漏**:
|
||||||
|
- 错误:未及时关闭数据库连接等资源
|
||||||
|
- 解决:使用try-with-resources或在finally块中关闭资源
|
||||||
@@ -178,8 +178,11 @@ Contract-Manager/
|
|||||||
2. 配置连接到服务端的WebSocket地址
|
2. 配置连接到服务端的WebSocket地址
|
||||||
3. 打包为可执行jar或使用jpackage创建安装包
|
3. 打包为可执行jar或使用jpackage创建安装包
|
||||||
|
|
||||||
## 开发环境要求
|
## Tasker实现规范指南
|
||||||
|
|
||||||
|
有关Tasker框架的详细实现规范,请参阅 [Tasker实现规范指南](docs/task/tasker_implementation_guide.md)。
|
||||||
|
|
||||||
|
## 开发环境要求
|
||||||
- JDK 21
|
- JDK 21
|
||||||
- Maven 3.6+
|
- Maven 3.6+
|
||||||
- MySQL 8.0+
|
- MySQL 8.0+
|
||||||
@@ -193,6 +196,3 @@ Contract-Manager/
|
|||||||
3. 增强系统安全机制
|
3. 增强系统安全机制
|
||||||
4. 改进用户界面体验
|
4. 改进用户界面体验
|
||||||
5. 扩展更多云端服务集成
|
5. 扩展更多云端服务集成
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ecep.contract</groupId>
|
<groupId>com.ecep.contract</groupId>
|
||||||
<artifactId>Contract-Manager</artifactId>
|
<artifactId>Contract-Manager</artifactId>
|
||||||
<version>0.0.134-SNAPSHOT</version>
|
<version>0.0.135-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>com.ecep.contract</groupId>
|
<groupId>com.ecep.contract</groupId>
|
||||||
<artifactId>client</artifactId>
|
<artifactId>client</artifactId>
|
||||||
<version>0.0.134-SNAPSHOT</version>
|
<version>0.0.135-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ecep.contract</groupId>
|
<groupId>com.ecep.contract</groupId>
|
||||||
<artifactId>common</artifactId>
|
<artifactId>common</artifactId>
|
||||||
<version>0.0.134-SNAPSHOT</version>
|
<version>0.0.135-SNAPSHOT</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|||||||
@@ -206,6 +206,12 @@ public class WebSocketClientService {
|
|||||||
send(objectMapper.writeValueAsString(message));
|
send(objectMapper.writeValueAsString(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WebSocketServerCallbackManage#onMessage 负责接收处理
|
||||||
|
*
|
||||||
|
* @param msg
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public CompletableFuture<JsonNode> send(SimpleMessage msg) {
|
public CompletableFuture<JsonNode> send(SimpleMessage msg) {
|
||||||
CompletableFuture<JsonNode> future = new CompletableFuture<>();
|
CompletableFuture<JsonNode> future = new CompletableFuture<>();
|
||||||
try {
|
try {
|
||||||
@@ -353,14 +359,6 @@ public class WebSocketClientService {
|
|||||||
return online;
|
return online;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void withSession(Consumer<WebSocketClientSession> sessionConsumer) {
|
|
||||||
WebSocketClientSession session = createSession();
|
|
||||||
try {
|
|
||||||
sessionConsumer.accept(session);
|
|
||||||
} finally {
|
|
||||||
// closeSession(session);vvvv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void closeSession(WebSocketClientSession session) {
|
public void closeSession(WebSocketClientSession session) {
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
|
|||||||
@@ -1,22 +1,19 @@
|
|||||||
package com.ecep.contract;
|
package com.ecep.contract;
|
||||||
|
|
||||||
|
import com.ecep.contract.constant.WebSocketConstant;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
import java.beans.PropertyDescriptor;
|
import java.beans.PropertyDescriptor;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
|
|
||||||
import com.ecep.contract.constant.WebSocketConstant;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -27,6 +24,8 @@ public class WebSocketClientSession {
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
private final String sessionId = UUID.randomUUID().toString();
|
private final String sessionId = UUID.randomUUID().toString();
|
||||||
|
@Getter
|
||||||
|
private boolean done = false;
|
||||||
|
|
||||||
private WebSocketClientTasker tasker;
|
private WebSocketClientTasker tasker;
|
||||||
|
|
||||||
@@ -69,6 +68,8 @@ public class WebSocketClientSession {
|
|||||||
handleAsStart(args);
|
handleAsStart(args);
|
||||||
} else if (type.equals("done")) {
|
} else if (type.equals("done")) {
|
||||||
handleAsDone(args);
|
handleAsDone(args);
|
||||||
|
done = true;
|
||||||
|
close();
|
||||||
} else {
|
} else {
|
||||||
tasker.updateMessage(java.util.logging.Level.INFO, "未知的消息类型: " + node.toString());
|
tasker.updateMessage(java.util.logging.Level.INFO, "未知的消息类型: " + node.toString());
|
||||||
}
|
}
|
||||||
@@ -83,7 +84,6 @@ public class WebSocketClientSession {
|
|||||||
|
|
||||||
private void handleAsDone(JsonNode args) {
|
private void handleAsDone(JsonNode args) {
|
||||||
tasker.updateMessage(java.util.logging.Level.INFO, "任务完成");
|
tasker.updateMessage(java.util.logging.Level.INFO, "任务完成");
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleAsProgress(JsonNode args) {
|
private void handleAsProgress(JsonNode args) {
|
||||||
|
|||||||
@@ -5,17 +5,19 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocket客户端任务接口
|
* WebSocket客户端任务接口
|
||||||
* 定义了所有通过WebSocket与服务器通信的任务的通用方法
|
* 定义了所有通过WebSocket与服务器通信的任务的通用方法
|
||||||
* 包括任务名称、更新消息、更新标题、更新进度等操作
|
* 包括任务名称、更新消息、更新标题、更新进度等操作
|
||||||
*
|
* <p>
|
||||||
* 所有通过WebSocket与服务器通信的任务类都应实现此接口, 文档参考 .trace/rules/client_task_rules.md
|
* 所有通过WebSocket与服务器通信的任务类都应实现此接口, 文档参考 .trace/rules/client_task_rules.md
|
||||||
*/
|
*/
|
||||||
public interface WebSocketClientTasker {
|
public interface WebSocketClientTasker {
|
||||||
/**s
|
/**
|
||||||
|
* s
|
||||||
* 获取任务名称
|
* 获取任务名称
|
||||||
* 任务名称用于唯一标识任务, 服务器端会根据任务名称来调用对应的任务处理函数
|
* 任务名称用于唯一标识任务, 服务器端会根据任务名称来调用对应的任务处理函数
|
||||||
*
|
*
|
||||||
@@ -55,6 +57,9 @@ public interface WebSocketClientTasker {
|
|||||||
*/
|
*/
|
||||||
default void cancelTask() {
|
default void cancelTask() {
|
||||||
// 默认实现为空,由具体任务重写
|
// 默认实现为空,由具体任务重写
|
||||||
|
// 需要获取到 session
|
||||||
|
// 发送 cancel 指令
|
||||||
|
// 关闭 session.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,16 +81,25 @@ public interface WebSocketClientTasker {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
webSocketService.withSession(session -> {
|
WebSocketClientSession session = webSocketService.createSession();
|
||||||
try {
|
try {
|
||||||
session.submitTask(this, locale, args);
|
session.submitTask(this, locale, args);
|
||||||
holder.info("已提交任务到服务器: " + getTaskName());
|
holder.info("已提交任务到服务器: " + getTaskName());
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
String errorMsg = "任务提交失败: " + e.getMessage();
|
String errorMsg = "任务提交失败: " + e.getMessage();
|
||||||
holder.warn(errorMsg);
|
holder.warn(errorMsg);
|
||||||
throw new RuntimeException("任务提交失败: " + e.getMessage(), e);
|
throw new RuntimeException("任务提交失败: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
// while (!session.isDone()) {
|
||||||
|
// // 使用TimeUnit
|
||||||
|
// try {
|
||||||
|
// TimeUnit.SECONDS.sleep(1);
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// Thread.currentThread().interrupt();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,15 +45,33 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
|||||||
protected CompletableFuture<T> loadedFuture;
|
protected CompletableFuture<T> loadedFuture;
|
||||||
private final ObservableList<TabSkin> tabSkins = FXCollections.observableArrayList();
|
private final ObservableList<TabSkin> tabSkins = FXCollections.observableArrayList();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShown(WindowEvent windowEvent) {
|
public void onShown(WindowEvent windowEvent) {
|
||||||
super.onShown(windowEvent);
|
super.onShown(windowEvent);
|
||||||
|
// 载数据
|
||||||
|
initializeData();
|
||||||
|
// 注册 skin
|
||||||
|
registerTabSkins();
|
||||||
|
// 初始化保存按钮
|
||||||
|
initializeSaveBtn();
|
||||||
|
// 安装 skin
|
||||||
|
installTabSkins();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initializeSaveBtn() {
|
||||||
|
if (saveBtn != null) {
|
||||||
|
saveBtn.disableProperty().bind(createTabSkinChangedBindings().not());
|
||||||
|
saveBtn.setOnAction(event -> saveTabSkins());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initializeData() {
|
||||||
ViewModelService<T, TV> service = getViewModelService();
|
ViewModelService<T, TV> service = getViewModelService();
|
||||||
|
|
||||||
if (service instanceof QueryService<T, TV> queryService) {
|
if (service instanceof QueryService<T, TV> queryService) {
|
||||||
setStatus("读取...");
|
setStatus("读取...");
|
||||||
loadedFuture = queryService.asyncFindById(viewModel.getId().get());
|
loadedFuture = queryService.asyncFindById(viewModel.getId().get());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
loadedFuture = CompletableFuture.supplyAsync(() -> {
|
loadedFuture = CompletableFuture.supplyAsync(() -> {
|
||||||
return getViewModelService().findById(viewModel.getId().get());
|
return getViewModelService().findById(viewModel.getId().get());
|
||||||
@@ -72,14 +90,6 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
|||||||
handleException("载入失败,#" + viewModel.getId().get(), ex);
|
handleException("载入失败,#" + viewModel.getId().get(), ex);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
registerTabSkins();
|
|
||||||
if (saveBtn != null) {
|
|
||||||
saveBtn.disableProperty().bind(createTabSkinChangedBindings().not());
|
|
||||||
saveBtn.setOnAction(event -> saveTabSkins());
|
|
||||||
}
|
|
||||||
|
|
||||||
installTabSkins();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateViewModel(T entity) {
|
protected void updateViewModel(T entity) {
|
||||||
@@ -105,6 +115,19 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
|||||||
return saved;
|
return saved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void save() {
|
||||||
|
T entity = getEntity();
|
||||||
|
if (entity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (viewModel.copyTo(entity)) {
|
||||||
|
save(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册 skin
|
||||||
|
*/
|
||||||
protected void registerTabSkins() {
|
protected void registerTabSkins() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,6 +139,9 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安装 skin
|
||||||
|
*/
|
||||||
protected void installTabSkins() {
|
protected void installTabSkins() {
|
||||||
for (TabSkin tabSkin : tabSkins) {
|
for (TabSkin tabSkin : tabSkins) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.ecep.contract.controller.AbstEntityManagerSkin;
|
|||||||
import com.ecep.contract.controller.ManagerSkin;
|
import com.ecep.contract.controller.ManagerSkin;
|
||||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||||
import com.ecep.contract.controller.table.cell.CompanyTableCell;
|
import com.ecep.contract.controller.table.cell.CompanyTableCell;
|
||||||
|
import com.ecep.contract.controller.table.cell.LocalDateFieldTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateTimeTableCell;
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.YongYouU8Service;
|
import com.ecep.contract.service.YongYouU8Service;
|
||||||
@@ -15,6 +16,7 @@ import javafx.collections.ObservableList;
|
|||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.scene.control.ContextMenu;
|
import javafx.scene.control.ContextMenu;
|
||||||
import javafx.scene.control.MenuItem;
|
import javafx.scene.control.MenuItem;
|
||||||
|
import javafx.scene.control.cell.CheckBoxTableCell;
|
||||||
|
|
||||||
public class YongYouU8ManagerSkin
|
public class YongYouU8ManagerSkin
|
||||||
extends
|
extends
|
||||||
@@ -36,10 +38,9 @@ public class YongYouU8ManagerSkin
|
|||||||
@Override
|
@Override
|
||||||
public void initializeTable() {
|
public void initializeTable() {
|
||||||
controller.idColumn.setCellValueFactory(param -> param.getValue().getId());
|
controller.idColumn.setCellValueFactory(param -> param.getValue().getId());
|
||||||
controller.companyColumn.setCellValueFactory(param -> param.getValue().getCompany());
|
|
||||||
controller.companyColumn.setCellFactory(param -> new CompanyTableCell<>(getCompanyService()));
|
|
||||||
|
|
||||||
controller.cloudIdColumn.setCellValueFactory(param -> param.getValue().getCloudId());
|
controller.companyColumn.setCellValueFactory(param -> param.getValue().getCompany());
|
||||||
|
controller.companyColumn.setCellFactory( CompanyTableCell.forTableColumn(getCompanyService()));
|
||||||
|
|
||||||
controller.latestUpdateColumn.setCellValueFactory(param -> param.getValue().getLatestUpdate());
|
controller.latestUpdateColumn.setCellValueFactory(param -> param.getValue().getLatestUpdate());
|
||||||
controller.latestUpdateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
controller.latestUpdateColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
@@ -47,7 +48,14 @@ public class YongYouU8ManagerSkin
|
|||||||
controller.cloudLatestColumn.setCellValueFactory(param -> param.getValue().getCloudLatest());
|
controller.cloudLatestColumn.setCellValueFactory(param -> param.getValue().getCloudLatest());
|
||||||
controller.cloudLatestColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
controller.cloudLatestColumn.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||||
|
|
||||||
controller.descriptionColumn.setCellValueFactory(param -> param.getValue().getVendorCode());
|
controller.cloudVendorUpdateDateColumn.setCellValueFactory(param -> param.getValue().getVendorUpdateDate());
|
||||||
|
|
||||||
|
controller.cloudCustomerUpdateDateColumn.setCellValueFactory(param -> param.getValue().getCustomerUpdateDate());
|
||||||
|
|
||||||
|
controller.activeColumn.setCellValueFactory(param -> param.getValue().getActive());
|
||||||
|
controller.activeColumn.setCellFactory(CheckBoxTableCell.forTableColumn(controller.activeColumn));
|
||||||
|
|
||||||
|
controller.descriptionColumn.setCellValueFactory(param -> param.getValue().getExceptionMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,7 +81,7 @@ public class YongYouU8ManagerSkin
|
|||||||
}
|
}
|
||||||
for (CloudYuInfoViewModel selectedItem : selectedItems) {
|
for (CloudYuInfoViewModel selectedItem : selectedItems) {
|
||||||
CloudYuVo yongYouU8Vo = getU8Service().findById(selectedItem.getId().get());
|
CloudYuVo yongYouU8Vo = getU8Service().findById(selectedItem.getId().get());
|
||||||
selectedItem.getCustomerCode().set("");
|
selectedItem.getExceptionMessage().set("");
|
||||||
if (selectedItem.copyTo(yongYouU8Vo)) {
|
if (selectedItem.copyTo(yongYouU8Vo)) {
|
||||||
CloudYuVo saved = getU8Service().save(yongYouU8Vo);
|
CloudYuVo saved = getU8Service().save(yongYouU8Vo);
|
||||||
selectedItem.update(saved);
|
selectedItem.update(saved);
|
||||||
|
|||||||
@@ -37,8 +37,10 @@ public class YongYouU8ManagerWindowController
|
|||||||
public TableColumn<CloudYuInfoViewModel, Number> idColumn;
|
public TableColumn<CloudYuInfoViewModel, Number> idColumn;
|
||||||
public TableColumn<CloudYuInfoViewModel, LocalDateTime> latestUpdateColumn;
|
public TableColumn<CloudYuInfoViewModel, LocalDateTime> latestUpdateColumn;
|
||||||
public TableColumn<CloudYuInfoViewModel, Integer> companyColumn;
|
public TableColumn<CloudYuInfoViewModel, Integer> companyColumn;
|
||||||
public TableColumn<CloudYuInfoViewModel, String> cloudIdColumn;
|
|
||||||
public TableColumn<CloudYuInfoViewModel, LocalDateTime> cloudLatestColumn;
|
public TableColumn<CloudYuInfoViewModel, LocalDateTime> cloudLatestColumn;
|
||||||
|
public TableColumn<CloudYuInfoViewModel, java.time.LocalDate> cloudVendorUpdateDateColumn;
|
||||||
|
public TableColumn<CloudYuInfoViewModel, java.time.LocalDate> cloudCustomerUpdateDateColumn;
|
||||||
|
public TableColumn<CloudYuInfoViewModel, Boolean> activeColumn;
|
||||||
public TableColumn<CloudYuInfoViewModel, String> descriptionColumn;
|
public TableColumn<CloudYuInfoViewModel, String> descriptionColumn;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,27 +93,32 @@ public class YongYouU8ManagerWindowController
|
|||||||
|
|
||||||
public void onContractGroupSyncAction(ActionEvent event) {
|
public void onContractGroupSyncAction(ActionEvent event) {
|
||||||
ContractGroupSyncTask task = new ContractGroupSyncTask();
|
ContractGroupSyncTask task = new ContractGroupSyncTask();
|
||||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
UITools.showTaskDialogAndWait("合同组数据同步", task, null);
|
||||||
|
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onContractTypeSyncAction(ActionEvent event) {
|
public void onContractTypeSyncAction(ActionEvent event) {
|
||||||
ContractTypeSyncTask task = new ContractTypeSyncTask();
|
ContractTypeSyncTask task = new ContractTypeSyncTask();
|
||||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
UITools.showTaskDialogAndWait("合同类型数据同步", task, null);
|
||||||
|
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onContractKindSyncAction(ActionEvent event) {
|
public void onContractKindSyncAction(ActionEvent event) {
|
||||||
ContractKindSyncTask task = new ContractKindSyncTask();
|
ContractKindSyncTask task = new ContractKindSyncTask();
|
||||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
UITools.showTaskDialogAndWait("合同类型数据同步", task, null);
|
||||||
|
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onVendorClassSyncAction(ActionEvent event) {
|
public void onVendorClassSyncAction(ActionEvent event) {
|
||||||
VendorClassSyncTask task = new VendorClassSyncTask();
|
VendorClassSyncTask task = new VendorClassSyncTask();
|
||||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
UITools.showTaskDialogAndWait("客户分类数据同步", task, null);
|
||||||
|
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCustomerClassSyncAction(ActionEvent event) {
|
public void onCustomerClassSyncAction(ActionEvent event) {
|
||||||
CustomerClassSyncTask task = new CustomerClassSyncTask();
|
CustomerClassSyncTask task = new CustomerClassSyncTask();
|
||||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
UITools.showTaskDialogAndWait("客户分类数据同步", task, null);
|
||||||
|
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.ecep.contract.controller.tab.TabSkin;
|
|||||||
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
import com.ecep.contract.controller.table.EditableEntityTableTabSkin;
|
||||||
import com.ecep.contract.controller.table.cell.ContractFileTypeTableCell;
|
import com.ecep.contract.controller.table.cell.ContractFileTypeTableCell;
|
||||||
import com.ecep.contract.controller.table.cell.LocalDateFieldTableCell;
|
import com.ecep.contract.controller.table.cell.LocalDateFieldTableCell;
|
||||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
|
||||||
import com.ecep.contract.service.ContractFileService;
|
import com.ecep.contract.service.ContractFileService;
|
||||||
import com.ecep.contract.service.ContractFileTypeService;
|
import com.ecep.contract.service.ContractFileTypeService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
@@ -22,7 +21,6 @@ import javafx.event.ActionEvent;
|
|||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
import javafx.scene.control.cell.TextFieldTableCell;
|
import javafx.scene.control.cell.TextFieldTableCell;
|
||||||
import javafx.stage.WindowEvent;
|
import javafx.stage.WindowEvent;
|
||||||
import javafx.util.StringConverter;
|
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.apache.pdfbox.Loader;
|
import org.apache.pdfbox.Loader;
|
||||||
import org.apache.pdfbox.io.IOUtils;
|
import org.apache.pdfbox.io.IOUtils;
|
||||||
@@ -95,21 +93,6 @@ public class ContractTabSkinFiles
|
|||||||
return controller.fileTab;
|
return controller.fileTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ContractFileTypeLocalStringConverter extends StringConverter<ContractFileTypeLocal> {
|
|
||||||
@Override
|
|
||||||
public String toString(ContractFileTypeLocal local) {
|
|
||||||
if (local == null) {
|
|
||||||
return "-";
|
|
||||||
}
|
|
||||||
return local.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContractFileTypeLocal fromString(String string) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initializeTab() {
|
public void initializeTab() {
|
||||||
TableView<ContractFileViewModel> table = getTableView();
|
TableView<ContractFileViewModel> table = getTableView();
|
||||||
@@ -135,6 +118,7 @@ public class ContractTabSkinFiles
|
|||||||
.setCellFactory(ContractFileTypeTableCell.forTableColumn(getCachedBean(ContractFileTypeService.class)));
|
.setCellFactory(ContractFileTypeTableCell.forTableColumn(getCachedBean(ContractFileTypeService.class)));
|
||||||
fileTable_typeColumn.setEditable(false);
|
fileTable_typeColumn.setEditable(false);
|
||||||
|
|
||||||
|
|
||||||
/* 文件名编辑器 */
|
/* 文件名编辑器 */
|
||||||
fileTable_filePathColumn.setCellValueFactory(param -> param.getValue().getFileName());
|
fileTable_filePathColumn.setCellValueFactory(param -> param.getValue().getFileName());
|
||||||
fileTable_filePathColumn.setCellFactory(TextFieldTableCell.forTableColumn());
|
fileTable_filePathColumn.setCellFactory(TextFieldTableCell.forTableColumn());
|
||||||
@@ -194,6 +178,34 @@ public class ContractTabSkinFiles
|
|||||||
createVendorContractRequestByTemplateUpdateMenuItem(),
|
createVendorContractRequestByTemplateUpdateMenuItem(),
|
||||||
createVendorContractApplyByTemplateUpdateMenuItem());
|
createVendorContractApplyByTemplateUpdateMenuItem());
|
||||||
|
|
||||||
|
|
||||||
|
runAsync(() -> {
|
||||||
|
getCachedBean(ContractFileTypeService.class).findAll(getLocale()).forEach((k, v) -> {
|
||||||
|
if (isCustomer && !k.isSupportCustomer()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isVendor && !k.isSupportVendor()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
MenuItem item = new MenuItem();
|
||||||
|
item.setText(v.getValue());
|
||||||
|
item.getProperties().put("typeLocal", v);
|
||||||
|
item.setOnAction(this::onFileTableContextMenuChangeTypeAndNameAction);
|
||||||
|
fileTable_menu_change_type.getItems().add(item);
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(v.getSuggestFileName())) {
|
||||||
|
MenuItem item = new MenuItem();
|
||||||
|
item.setText(v.getValue());
|
||||||
|
item.getProperties().put("typeLocal", v);
|
||||||
|
item.getProperties().put("rename", true);
|
||||||
|
item.setOnAction(this::onFileTableContextMenuChangeTypeAndNameAction);
|
||||||
|
fileTable_menu_change_type_and_name.getItems().add(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
super.initializeTab();
|
super.initializeTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -541,13 +553,13 @@ public class ContractTabSkinFiles
|
|||||||
//
|
//
|
||||||
fileTable_menu_change_type.setVisible(true);
|
fileTable_menu_change_type.setVisible(true);
|
||||||
for (MenuItem item : fileTable_menu_change_type.getItems()) {
|
for (MenuItem item : fileTable_menu_change_type.getItems()) {
|
||||||
ContractFileTypeLocal typeLocal = (ContractFileTypeLocal) item.getProperties().get("typeLocal");
|
ContractFileTypeLocalVo typeLocal = (ContractFileTypeLocalVo) item.getProperties().get("typeLocal");
|
||||||
item.setVisible(typeLocal.getType() != selectedItem.getType().get());
|
item.setVisible(typeLocal.getType() != selectedItem.getType().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
fileTable_menu_change_type_and_name.setVisible(true);
|
fileTable_menu_change_type_and_name.setVisible(true);
|
||||||
for (MenuItem item : fileTable_menu_change_type.getItems()) {
|
for (MenuItem item : fileTable_menu_change_type.getItems()) {
|
||||||
ContractFileTypeLocal typeLocal = (ContractFileTypeLocal) item.getProperties().get("typeLocal");
|
ContractFileTypeLocalVo typeLocal = (ContractFileTypeLocalVo) item.getProperties().get("typeLocal");
|
||||||
item.setVisible(typeLocal.getType() != selectedItem.getType().get());
|
item.setVisible(typeLocal.getType() != selectedItem.getType().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,7 +572,7 @@ public class ContractTabSkinFiles
|
|||||||
if (selectedItems == null || selectedItems.isEmpty()) {
|
if (selectedItems == null || selectedItems.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ContractFileTypeLocal typeLocal = (ContractFileTypeLocal) item.getProperties().get("typeLocal");
|
ContractFileTypeLocalVo typeLocal = (ContractFileTypeLocalVo) item.getProperties().get("typeLocal");
|
||||||
if (typeLocal == null) {
|
if (typeLocal == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import javafx.scene.Node;
|
||||||
|
import javafx.scene.control.*;
|
||||||
|
import org.controlsfx.control.PopOver;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -50,13 +53,6 @@ import javafx.collections.ObservableList;
|
|||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.CheckMenuItem;
|
|
||||||
import javafx.scene.control.DatePicker;
|
|
||||||
import javafx.scene.control.Label;
|
|
||||||
import javafx.scene.control.TableCell;
|
|
||||||
import javafx.scene.control.TableColumn;
|
|
||||||
import javafx.scene.control.TableView;
|
|
||||||
import javafx.scene.layout.HBox;
|
import javafx.scene.layout.HBox;
|
||||||
import javafx.stage.FileChooser;
|
import javafx.stage.FileChooser;
|
||||||
import javafx.stage.Modality;
|
import javafx.stage.Modality;
|
||||||
@@ -79,6 +75,7 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
return super.show(loader, owner, modality);
|
return super.show(loader, owner, modality);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Getter
|
@Getter
|
||||||
public static class MessageExt extends Message {
|
public static class MessageExt extends Message {
|
||||||
@@ -90,12 +87,16 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class Model implements MessageHolder {
|
public static class Model {
|
||||||
private SimpleStringProperty code = new SimpleStringProperty();
|
private SimpleStringProperty code = new SimpleStringProperty();
|
||||||
private SimpleStringProperty name = new SimpleStringProperty();
|
private SimpleStringProperty name = new SimpleStringProperty();
|
||||||
private SimpleObjectProperty<Integer> employee = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<Integer> employee = new SimpleObjectProperty<>();
|
||||||
private SimpleObjectProperty<LocalDate> setupDate = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<LocalDate> setupDate = new SimpleObjectProperty<>();
|
||||||
private SimpleListProperty<MessageExt> messages = new SimpleListProperty<>(FXCollections.observableArrayList());
|
private SimpleListProperty<MessageExt> messages = new SimpleListProperty<>(FXCollections.observableArrayList());
|
||||||
|
}
|
||||||
|
|
||||||
|
static class MessageHolderImpl implements MessageHolder {
|
||||||
|
List<MessageExt> messages = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addMessage(Level level, String message) {
|
public void addMessage(Level level, String message) {
|
||||||
@@ -261,6 +262,8 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
long total = contractService.count(params);
|
long total = contractService.count(params);
|
||||||
setStatus("合同:" + total + " 条");
|
setStatus("合同:" + total + " 条");
|
||||||
|
|
||||||
|
MessageHolderImpl messageHolder = new MessageHolderImpl();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (isCloseRequested()) {
|
if (isCloseRequested()) {
|
||||||
break;
|
break;
|
||||||
@@ -268,6 +271,7 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
|
|
||||||
Page<ContractVo> page = contractService.findAll(params, pageRequest);
|
Page<ContractVo> page = contractService.findAll(params, pageRequest);
|
||||||
for (ContractVo contract : page) {
|
for (ContractVo contract : page) {
|
||||||
|
messageHolder.messages.clear();
|
||||||
if (isCloseRequested()) {
|
if (isCloseRequested()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -285,11 +289,11 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
model.getName().set(contract.getName());
|
model.getName().set(contract.getName());
|
||||||
model.getSetupDate().set(contract.getSetupDate());
|
model.getSetupDate().set(contract.getSetupDate());
|
||||||
|
|
||||||
comm.verify(contract, model);
|
comm.verify(contract, messageHolder);
|
||||||
setStatus("合同验证进度:" + counter.get() + " / " + total);
|
setStatus("合同验证进度:" + counter.get() + " / " + total);
|
||||||
// 移除中间消息
|
// 移除中间消息
|
||||||
if (!model.getMessages().isEmpty()) {
|
if (!messageHolder.messages.isEmpty()) {
|
||||||
model.getMessages().removeIf(msg -> msg.getLevel().intValue() <= Level.INFO.intValue());
|
model.getMessages().setAll(messageHolder.messages.stream().filter(msg -> msg.getLevel().intValue() > Level.INFO.intValue()).limit(50).toList());
|
||||||
}
|
}
|
||||||
if (model.getMessages().isEmpty()) {
|
if (model.getMessages().isEmpty()) {
|
||||||
if (onlyShowVerifiedChecker.isSelected()) {
|
if (onlyShowVerifiedChecker.isSelected()) {
|
||||||
@@ -325,6 +329,7 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
}
|
}
|
||||||
runAsync(() -> {
|
runAsync(() -> {
|
||||||
ContractVo contract = null;
|
ContractVo contract = null;
|
||||||
|
MessageHolderImpl messageHolder = new MessageHolderImpl();
|
||||||
try {
|
try {
|
||||||
contract = contractService.findByCode(contractCode);
|
contract = contractService.findByCode(contractCode);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -336,17 +341,18 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
}
|
}
|
||||||
model.getMessages().clear();
|
model.getMessages().clear();
|
||||||
try {
|
try {
|
||||||
comm.verify(contract, model);
|
comm.verify(contract, messageHolder);
|
||||||
// 移除中间消息
|
|
||||||
if (!model.getMessages().isEmpty()) {
|
|
||||||
model.getMessages().removeIf(msg -> msg.getLevel().intValue() <= Level.INFO.intValue());
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(model.getCode().get(), e);
|
logger.error(model.getCode().get(), e);
|
||||||
model.error(e.getMessage());
|
messageHolder.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model.getMessages().isEmpty()) {
|
// 移除中间消息
|
||||||
|
if (!messageHolder.messages.isEmpty()) {
|
||||||
|
model.getMessages().setAll(messageHolder.messages.stream().filter(msg -> msg.getLevel().intValue() > Level.INFO.intValue()).limit(50).toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (messageHolder.messages.isEmpty()) {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
viewTableDataSet.remove(model);
|
viewTableDataSet.remove(model);
|
||||||
});
|
});
|
||||||
@@ -380,6 +386,38 @@ public class ContractVerifyWindowController extends BaseController {
|
|||||||
ContractWindowController.show(contract, viewTable.getScene().getWindow());
|
ContractWindowController.show(contract, viewTable.getScene().getWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onShowVerifyStatusAction(ActionEvent event) {
|
||||||
|
|
||||||
|
// 在新新窗口中显示 状态消息 Model# messages
|
||||||
|
|
||||||
|
Model selectedItem = viewTable.getSelectionModel().getSelectedItem();
|
||||||
|
if (selectedItem == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView<MessageExt> listView = new ListView<>();
|
||||||
|
listView.setItems(selectedItem.messages);
|
||||||
|
listView.setCellFactory(v -> new ListCell<>() {
|
||||||
|
@Override
|
||||||
|
protected void updateItem(MessageExt item, boolean empty) {
|
||||||
|
super.updateItem(item, empty);
|
||||||
|
if (item == null || empty) {
|
||||||
|
setText(null);
|
||||||
|
setGraphic(null);
|
||||||
|
} else {
|
||||||
|
setText(item.getMessage());
|
||||||
|
setGraphic(new Label(item.getPrefix()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
PopOver popOver = new PopOver(listView);
|
||||||
|
popOver.setArrowLocation(PopOver.ArrowLocation.TOP_LEFT);
|
||||||
|
MenuItem menuItem = (MenuItem) event.getSource();
|
||||||
|
Node node = viewTable.lookup(".table-row-cell:selected");
|
||||||
|
popOver.show(node);
|
||||||
|
}
|
||||||
|
|
||||||
public void onExportVerifyResultAsFileAction(ActionEvent e) {
|
public void onExportVerifyResultAsFileAction(ActionEvent e) {
|
||||||
FileChooser chooser = new FileChooser();
|
FileChooser chooser = new FileChooser();
|
||||||
chooser.setTitle("导出核验结果");
|
chooser.setTitle("导出核验结果");
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.controller.contract;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import javafx.scene.control.*;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -26,13 +27,6 @@ import com.ecep.contract.vo.ContractVo;
|
|||||||
|
|
||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
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.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import javafx.stage.Window;
|
import javafx.stage.Window;
|
||||||
import javafx.stage.WindowEvent;
|
import javafx.stage.WindowEvent;
|
||||||
@@ -44,6 +38,8 @@ import javafx.stage.WindowEvent;
|
|||||||
public class ContractWindowController
|
public class ContractWindowController
|
||||||
extends AbstEntityController<ContractVo, ContractViewModel> {
|
extends AbstEntityController<ContractVo, ContractViewModel> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void show(ContractVo contract, Window owner) {
|
public static void show(ContractVo contract, Window owner) {
|
||||||
show(ContractViewModel.from(contract), owner);
|
show(ContractViewModel.from(contract), owner);
|
||||||
}
|
}
|
||||||
@@ -69,6 +65,7 @@ public class ContractWindowController
|
|||||||
public Button openRelativeCompanyVendorBtn;
|
public Button openRelativeCompanyVendorBtn;
|
||||||
|
|
||||||
public TextField nameField;
|
public TextField nameField;
|
||||||
|
public CheckBox contractNameLockedCk;
|
||||||
public TextField guidField;
|
public TextField guidField;
|
||||||
public TextField codeField;
|
public TextField codeField;
|
||||||
public TextField parentCodeField;
|
public TextField parentCodeField;
|
||||||
|
|||||||
@@ -1,14 +1,26 @@
|
|||||||
package com.ecep.contract.controller.customer;
|
package com.ecep.contract.controller.customer;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import com.ecep.contract.controller.AbstEntityController;
|
import com.ecep.contract.controller.AbstEntityController;
|
||||||
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
|
import com.ecep.contract.service.CompanyCustomerFileTypeService;
|
||||||
import com.ecep.contract.service.ViewModelService;
|
import com.ecep.contract.service.ViewModelService;
|
||||||
import com.ecep.contract.util.FxmlPath;
|
import com.ecep.contract.util.FxmlPath;
|
||||||
|
import com.ecep.contract.vo.CustomerFileTypeLocalVo;
|
||||||
|
import javafx.beans.binding.BooleanBinding;
|
||||||
|
import javafx.beans.property.*;
|
||||||
|
import javafx.scene.input.MouseButton;
|
||||||
|
import javafx.scene.paint.Color;
|
||||||
|
import javafx.scene.text.FontWeight;
|
||||||
|
import javafx.util.converter.LocalDateStringConverter;
|
||||||
import org.apache.pdfbox.Loader;
|
import org.apache.pdfbox.Loader;
|
||||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
import org.apache.pdfbox.rendering.PDFRenderer;
|
import org.apache.pdfbox.rendering.PDFRenderer;
|
||||||
@@ -18,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.FileSystemUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.ecep.contract.controller.BaseController;
|
import com.ecep.contract.controller.BaseController;
|
||||||
@@ -32,11 +45,9 @@ import com.ecep.contract.vm.CustomerFileViewModel;
|
|||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.geometry.Bounds;
|
import javafx.geometry.Bounds;
|
||||||
|
import javafx.scene.canvas.GraphicsContext;
|
||||||
import javafx.scene.control.CheckBox;
|
import javafx.scene.control.CheckBox;
|
||||||
import javafx.scene.control.DatePicker;
|
import javafx.scene.control.DatePicker;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
@@ -58,8 +69,16 @@ import javafx.stage.WindowEvent;
|
|||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
@Component
|
@Component
|
||||||
@FxmlPath("/ui/company/customer/customer_evaluation_form.fxml")
|
@FxmlPath("/ui/company/customer/customer_evaluation_form.fxml")
|
||||||
public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntityController<CompanyCustomerEvaluationFormFileVo, CompanyCustomerEvaluationFormFileViewModel> {
|
public class CompanyCustomerEvaluationFormFileWindowController
|
||||||
private static final Logger logger = LoggerFactory.getLogger(CompanyCustomerEvaluationFormFileWindowController.class);
|
extends AbstEntityController<CompanyCustomerEvaluationFormFileVo, CompanyCustomerEvaluationFormFileViewModel> {
|
||||||
|
private static final Logger logger = LoggerFactory
|
||||||
|
.getLogger(CompanyCustomerEvaluationFormFileWindowController.class);
|
||||||
|
|
||||||
|
public static void show(CustomerFileViewModel item, Window window) {
|
||||||
|
show(CompanyCustomerEvaluationFormFileWindowController.class, window, controller -> {
|
||||||
|
controller.fileViewModel = item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static void show(CompanyCustomerEvaluationFormFileVo saved, Window window) {
|
public static void show(CompanyCustomerEvaluationFormFileVo saved, Window window) {
|
||||||
show(CompanyCustomerEvaluationFormFileViewModel.from(saved), window);
|
show(CompanyCustomerEvaluationFormFileViewModel.from(saved), window);
|
||||||
@@ -69,7 +88,6 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
show(CompanyCustomerEvaluationFormFileWindowController.class, viewModel, window);
|
show(CompanyCustomerEvaluationFormFileWindowController.class, viewModel, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Label idField;
|
public Label idField;
|
||||||
public TextField filePathField;
|
public TextField filePathField;
|
||||||
public CheckBox validField;
|
public CheckBox validField;
|
||||||
@@ -88,67 +106,66 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
public ScrollPane leftPane;
|
public ScrollPane leftPane;
|
||||||
public Label totalCreditScoreLabel;
|
public Label totalCreditScoreLabel;
|
||||||
|
|
||||||
private final SimpleStringProperty catalogProperty = new SimpleStringProperty("");
|
|
||||||
private final SimpleStringProperty levelProperty = new SimpleStringProperty("");
|
|
||||||
private final SimpleIntegerProperty score1Property = new SimpleIntegerProperty(-1);
|
|
||||||
private final SimpleIntegerProperty score2Property = new SimpleIntegerProperty(-1);
|
|
||||||
private final SimpleIntegerProperty score3Property = new SimpleIntegerProperty(-1);
|
|
||||||
private final SimpleIntegerProperty score4Property = new SimpleIntegerProperty(-1);
|
|
||||||
private final SimpleIntegerProperty score5Property = new SimpleIntegerProperty(-1);
|
|
||||||
private final SimpleIntegerProperty creditLevelProperty = new SimpleIntegerProperty(-1);
|
|
||||||
private final SimpleIntegerProperty totalCreditScoreProperty = new SimpleIntegerProperty(-1);
|
private final SimpleIntegerProperty totalCreditScoreProperty = new SimpleIntegerProperty(-1);
|
||||||
|
|
||||||
private SimpleObjectProperty<Image> imageProperty = new SimpleObjectProperty<>();
|
private CustomerFileViewModel fileViewModel;
|
||||||
|
|
||||||
private SimpleStringProperty filePathProperty = new SimpleStringProperty();
|
private SimpleBooleanProperty changed = new SimpleBooleanProperty(false);
|
||||||
private SimpleStringProperty editFilePathProperty = new SimpleStringProperty();
|
|
||||||
|
|
||||||
@Lazy
|
|
||||||
@Autowired
|
|
||||||
private CompanyCustomerFileService companyCustomerFileService;
|
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private CompanyCustomerEvaluationFormFileService evaluationFormFileService;
|
private CompanyCustomerEvaluationFormFileService evaluationFormFileService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show(Stage stage) {
|
public void show(Stage stage) {
|
||||||
super.show(stage);
|
super.show(stage);
|
||||||
stage.setFullScreen(false);
|
stage.setFullScreen(false);
|
||||||
// Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
|
|
||||||
//
|
|
||||||
// stage.setX(screenBounds.getMinX());
|
|
||||||
// stage.setY(screenBounds.getMinY());
|
|
||||||
// stage.setWidth(screenBounds.getWidth());
|
|
||||||
// stage.setHeight(screenBounds.getHeight());
|
|
||||||
//
|
|
||||||
// stage.isMaximized();
|
|
||||||
stage.setMaximized(true);
|
stage.setMaximized(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShown(WindowEvent windowEvent) {
|
||||||
|
super.onShown(windowEvent);
|
||||||
getTitle().set("客户评估表单");
|
getTitle().set("客户评估表单");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void registerTabSkins() {
|
|
||||||
initializePane();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void updateViewModel(CompanyCustomerEvaluationFormFileVo entity) {
|
|
||||||
super.updateViewModel(entity);
|
|
||||||
CustomerFileVo file = companyCustomerFileService.findById(entity.getCustomerFile());
|
|
||||||
Platform.runLater(() -> {
|
|
||||||
filePathProperty.set(file.getFilePath());
|
|
||||||
editFilePathProperty.set(file.getEditFilePath());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ViewModelService<CompanyCustomerEvaluationFormFileVo, CompanyCustomerEvaluationFormFileViewModel> getViewModelService() {
|
public ViewModelService<CompanyCustomerEvaluationFormFileVo, CompanyCustomerEvaluationFormFileViewModel> getViewModelService() {
|
||||||
return evaluationFormFileService;
|
return evaluationFormFileService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initializeData() {
|
||||||
|
CompanyCustomerEvaluationFormFileViewModel viewModel = new CompanyCustomerEvaluationFormFileViewModel();
|
||||||
|
setViewModel(viewModel);
|
||||||
|
runAsync(() -> {
|
||||||
|
CompanyCustomerEvaluationFormFileVo item = getCachedBean(CompanyCustomerEvaluationFormFileService.class)
|
||||||
|
.findByCustomerFile(fileViewModel.getId().get());
|
||||||
|
viewModel.getId().set(item.getId());
|
||||||
|
updateViewModel(item);
|
||||||
|
super.initializeData();
|
||||||
|
Platform.runLater(this::initializePane);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateViewModel(CompanyCustomerEvaluationFormFileVo entity) {
|
||||||
|
super.updateViewModel(entity);
|
||||||
|
changed.set(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BooleanBinding createTabSkinChangedBindings() {
|
||||||
|
return viewModel.getChanged().or(fileViewModel.getChanged()).or(changed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveTabSkins() {
|
||||||
|
save();
|
||||||
|
changed.setValue(false);
|
||||||
|
}
|
||||||
|
|
||||||
BiConsumer<ToggleGroup, String> stringRadioGroupUpdater = (group, newValue) -> {
|
BiConsumer<ToggleGroup, String> stringRadioGroupUpdater = (group, newValue) -> {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
for (Toggle toggle : group.getToggles()) {
|
for (Toggle toggle : group.getToggles()) {
|
||||||
@@ -164,14 +181,15 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
changed.set(true);
|
||||||
}
|
}
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
group.selectToggle(null);
|
group.selectToggle(null);
|
||||||
// Toggle first = group.getToggles().getFirst();
|
// Toggle first = group.getToggles().getFirst();
|
||||||
// first.setSelected(true);
|
// first.setSelected(true);
|
||||||
// first.setSelected(false);
|
// first.setSelected(false);
|
||||||
// RadioButton btn = (RadioButton) first;
|
// RadioButton btn = (RadioButton) first;
|
||||||
// btn.setText(newValue);
|
// btn.setText(newValue);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -182,9 +200,11 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
}
|
}
|
||||||
String data = (String) toggle.getUserData();
|
String data = (String) toggle.getUserData();
|
||||||
property.set(data);
|
property.set(data);
|
||||||
|
changed.set(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
BiConsumer<ToggleGroup, Number> numberRadioGroupUpdater = (group, newValue) -> {
|
BiConsumer<ToggleGroup, Number> numberRadioGroupUpdater = (group, newValue) -> {
|
||||||
|
System.out.println("group = " + group + ", newValue = " + newValue);
|
||||||
String value = String.valueOf(newValue);
|
String value = String.valueOf(newValue);
|
||||||
for (Toggle toggle : group.getToggles()) {
|
for (Toggle toggle : group.getToggles()) {
|
||||||
String data = (String) toggle.getUserData();
|
String data = (String) toggle.getUserData();
|
||||||
@@ -195,12 +215,13 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
}
|
}
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
group.selectToggle(null);
|
group.selectToggle(null);
|
||||||
// Toggle first = group.getToggles().getFirst();
|
// Toggle first = group.getToggles().getFirst();
|
||||||
// first.setSelected(true);
|
// first.setSelected(true);
|
||||||
// first.setSelected(false);
|
// first.setSelected(false);
|
||||||
// RadioButton btn = (RadioButton) first;
|
// RadioButton btn = (RadioButton) first;
|
||||||
// btn.setText(String.valueOf(newValue));
|
// btn.setText(String.valueOf(newValue));
|
||||||
});
|
});
|
||||||
|
changed.set(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
BiConsumer<SimpleIntegerProperty, Toggle> numberPropertyUpdater = (property, toggle) -> {
|
BiConsumer<SimpleIntegerProperty, Toggle> numberPropertyUpdater = (property, toggle) -> {
|
||||||
@@ -210,9 +231,9 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
}
|
}
|
||||||
String data = (String) toggle.getUserData();
|
String data = (String) toggle.getUserData();
|
||||||
property.set(Integer.parseInt(data));
|
property.set(Integer.parseInt(data));
|
||||||
|
changed.set(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int totalScoreToLevel(int score) {
|
int totalScoreToLevel(int score) {
|
||||||
if (score >= 200) {
|
if (score >= 200) {
|
||||||
return 4;
|
return 4;
|
||||||
@@ -227,63 +248,73 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean calcValid() {
|
boolean calcValid() {
|
||||||
if (creditLevelProperty.get() <= 0) {
|
if (viewModel.getCreditLevel().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!StringUtils.hasText(catalogProperty.get())) {
|
if (!StringUtils.hasText(viewModel.getCatalog().get())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!StringUtils.hasText(levelProperty.get())) {
|
if (!StringUtils.hasText(viewModel.getLevel().get())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (score1Property.get() <= 0) {
|
|
||||||
|
if (viewModel.getScore1().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (score2Property.get() <= 0) {
|
if (viewModel.getScore2().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (score3Property.get() <= 0) {
|
if (viewModel.getScore3().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (score4Property.get() <= 0) {
|
if (viewModel.getScore4().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (score5Property.get() <= 0) {
|
if (viewModel.getScore5().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (creditLevelProperty.get() <= 0) {
|
if (viewModel.getCreditLevel().get() <= 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializePane() {
|
private void initializePane() {
|
||||||
|
setStatus("");
|
||||||
idField.textProperty().bind(viewModel.getId().asString());
|
idField.textProperty().bind(viewModel.getId().asString());
|
||||||
filePathField.textProperty().bind(filePathProperty);
|
filePathField.textProperty().bind(fileViewModel.getFilePath());
|
||||||
editFilePathField.textProperty().bind(editFilePathProperty);
|
editFilePathField.textProperty().bind(fileViewModel.getEditFilePath());
|
||||||
// signDateField.valueProperty().bindBidirectional(viewModel.getSignDate());
|
String pattern = "yyyy-MM-dd";
|
||||||
// validField.selectedProperty().bindBidirectional(viewModel.getValid());
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
signDateField.setConverter(new LocalDateStringConverter(formatter, null));
|
||||||
initializeRadioGroup(catalog, catalogProperty);
|
signDateField.valueProperty().bindBidirectional(fileViewModel.getSignDate());
|
||||||
initializeRadioGroup(level, levelProperty);
|
signDateField.valueProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
|
changed.set(true);
|
||||||
initializeRadioGroup(score1, score1Property);
|
|
||||||
initializeRadioGroup(score2, score2Property);
|
|
||||||
initializeRadioGroup(score3, score3Property);
|
|
||||||
initializeRadioGroup(score4, score4Property);
|
|
||||||
initializeRadioGroup(score5, score5Property);
|
|
||||||
|
|
||||||
creditLevelProperty.addListener((observable, oldValue, newValue) -> {
|
|
||||||
numberRadioGroupUpdater.accept(creditLevel, newValue);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
SimpleIntegerProperty[] scores = new SimpleIntegerProperty[]{score1Property, score2Property, score3Property, score4Property, score5Property};
|
initializeRadioGroup(catalog, viewModel.getCatalog());
|
||||||
|
initializeRadioGroup(level, viewModel.getLevel());
|
||||||
|
|
||||||
|
initializeRadioGroup(score1, viewModel.getScore1());
|
||||||
|
initializeRadioGroup(score2, viewModel.getScore2());
|
||||||
|
initializeRadioGroup(score3, viewModel.getScore3());
|
||||||
|
initializeRadioGroup(score4, viewModel.getScore4());
|
||||||
|
initializeRadioGroup(score5, viewModel.getScore5());
|
||||||
|
|
||||||
|
// 信用等级
|
||||||
|
viewModel.getCreditLevel().addListener((observable, oldValue, newValue) -> {
|
||||||
|
numberRadioGroupUpdater.accept(creditLevel, newValue);
|
||||||
|
});
|
||||||
|
numberRadioGroupUpdater.accept(creditLevel, viewModel.getCreditLevel().get());
|
||||||
|
|
||||||
|
SimpleIntegerProperty[] scores = new SimpleIntegerProperty[]{viewModel.getScore1(), viewModel.getScore2(),
|
||||||
|
viewModel.getScore3(), viewModel.getScore4(), viewModel.getScore5()};
|
||||||
totalCreditScoreProperty.bind(Bindings.createIntegerBinding(() -> {
|
totalCreditScoreProperty.bind(Bindings.createIntegerBinding(() -> {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for (SimpleIntegerProperty score : scores) {
|
for (SimpleIntegerProperty score : scores) {
|
||||||
total += score.get();
|
total += score.get();
|
||||||
}
|
}
|
||||||
creditLevelProperty.set(totalScoreToLevel(total));
|
viewModel.getCreditLevel().set(totalScoreToLevel(total));
|
||||||
return total;
|
return total;
|
||||||
}, scores));
|
}, scores));
|
||||||
|
|
||||||
@@ -291,70 +322,205 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
return "合计总分:" + score;
|
return "合计总分:" + score;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Bindings.createBooleanBinding(() -> {
|
Bindings.createBooleanBinding(this::calcValid, viewModel.getCatalog(), viewModel.getLevel(),
|
||||||
boolean valid = calcValid();
|
viewModel.getScore1(), viewModel.getScore2(), viewModel.getScore3(), viewModel.getScore4(),
|
||||||
// viewModel.getValid().set(valid);
|
viewModel.getScore5(), viewModel.getCreditLevel())
|
||||||
return valid;
|
.addListener((observable, oldValue, newValue) -> {
|
||||||
}, catalogProperty, levelProperty, score1Property, score2Property, score3Property, score4Property, score5Property, creditLevelProperty).addListener(((observable, oldValue, newValue) -> {
|
fileViewModel.getValid().set(newValue);
|
||||||
logger.info("valid:{}", newValue);
|
changed.set(true);
|
||||||
}));
|
});
|
||||||
|
validField.selectedProperty().bindBidirectional(fileViewModel.getValid());
|
||||||
|
validField.setSelected(fileViewModel.getValid().getValue());
|
||||||
|
|
||||||
|
fileViewModel.getFilePath().addListener((observable, oldValue, newValue) -> {
|
||||||
imageView.imageProperty().bind(filePathProperty.map(path -> {
|
File file = new File(newValue);
|
||||||
if (FileUtils.withExtensions(path, FileUtils.PDF)) {
|
loadFile(file);
|
||||||
File pdfFile = new File(path);
|
});
|
||||||
try (PDDocument pdDocument = Loader.loadPDF(pdfFile)) {
|
if (StringUtils.hasText(fileViewModel.getFilePath().get())) {
|
||||||
PDFRenderer pdfRenderer = new PDFRenderer(pdDocument);
|
loadFile(new File(fileViewModel.getFilePath().get()));
|
||||||
BufferedImage bufferedImage = pdfRenderer.renderImageWithDPI(0, 300);
|
}
|
||||||
|
|
||||||
// 获取 BufferedImage 的宽度和高度
|
|
||||||
int width = bufferedImage.getWidth();
|
|
||||||
int height = bufferedImage.getHeight();
|
|
||||||
WritableImage writableImage = new WritableImage(width, height);
|
|
||||||
PixelWriter pixelWriter = writableImage.getPixelWriter();
|
|
||||||
// 将 BufferedImage 的像素数据复制到 WritableImage
|
|
||||||
for (int y = 0; y < height; y++) {
|
|
||||||
for (int x = 0; x < width; x++) {
|
|
||||||
int argb = bufferedImage.getRGB(x, y);
|
|
||||||
pixelWriter.setArgb(x, y, argb);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return writableImage;
|
|
||||||
} catch (Exception e) {
|
|
||||||
setStatus(e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
File file = new File(path);
|
|
||||||
Image image = new Image(file.toURI().toString());
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
leftPane.widthProperty().addListener((observable, oldValue, newValue) -> {
|
leftPane.widthProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
imageView.setFitWidth(leftPane.getWidth());
|
imageView.setFitWidth(leftPane.getWidth());
|
||||||
imageView.setFitHeight(leftPane.getHeight());
|
imageView.setFitHeight(-1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
imageView.setFitWidth(leftPane.getWidth());
|
imageView.setFitWidth(leftPane.getWidth());
|
||||||
imageView.setFitHeight(leftPane.getHeight());
|
imageView.setFitHeight(-1);
|
||||||
|
|
||||||
imageView.setOnScroll(event -> {
|
imageView.setOnScroll(event -> {
|
||||||
System.out.println("event = " + event);
|
|
||||||
System.out.println("event.getDeltaY() = " + event.getDeltaY());
|
|
||||||
Bounds bounds = imageView.getBoundsInLocal();
|
Bounds bounds = imageView.getBoundsInLocal();
|
||||||
// Bounds latestBounds = (Bounds) imageView.getProperties().get("latestBounds");
|
|
||||||
// if (latestBounds != null) {
|
|
||||||
// double latestBoundsWidth = latestBounds.getWidth();
|
|
||||||
// }
|
|
||||||
// if (bounds.getWidth() < leftPane.getWidth()) {
|
|
||||||
imageView.setFitWidth(bounds.getWidth() + event.getDeltaY());
|
imageView.setFitWidth(bounds.getWidth() + event.getDeltaY());
|
||||||
// } else {
|
imageView.setFitHeight(-1);
|
||||||
imageView.setFitHeight(bounds.getHeight() + event.getDeltaY());
|
event.consume();
|
||||||
// }
|
});
|
||||||
|
|
||||||
|
imageView.setOnMouseClicked(event -> {
|
||||||
|
System.out.println("imageView.getFitWidth() = " + imageView.getFitWidth());
|
||||||
|
System.out.println("imageView.getFitHeight() = " + imageView.getFitHeight());
|
||||||
|
|
||||||
|
System.out.println("leftPane.getWidth() = " + leftPane.getWidth());
|
||||||
|
System.out.println("leftPane.getViewportBounds().getWidth() = " + leftPane.getViewportBounds().getWidth());
|
||||||
|
|
||||||
|
if (event.getClickCount() == 2 && event.getButton() == MouseButton.PRIMARY) {
|
||||||
|
Image image = imageView.getImage();
|
||||||
|
if (image != null) {
|
||||||
|
System.out.println("image.getWidth() = " + image.getWidth());
|
||||||
|
if (image.getWidth() > imageView.getFitWidth()) {
|
||||||
|
imageView.setFitWidth(image.getWidth());
|
||||||
|
} else {
|
||||||
|
imageView.setFitWidth(leftPane.getWidth());
|
||||||
|
}
|
||||||
|
imageView.setFitHeight(-1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadFile(File file) {
|
||||||
|
setStatus("文件" + file.getAbsolutePath() + " 加载中...");
|
||||||
|
if (FileUtils.withExtensions(file.getName(), FileUtils.PDF)) {
|
||||||
|
loadPdf(file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Image image = new Image(file.toURI().toString(), true);
|
||||||
|
imageView.setImage(image);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPdf(File pdfFile) {
|
||||||
|
// 绘制文字, 等待加载
|
||||||
|
// 创建画布并绘制备用占位文字
|
||||||
|
javafx.scene.canvas.Canvas canvas = new javafx.scene.canvas.Canvas(leftPane.getWidth(), leftPane.getHeight());
|
||||||
|
GraphicsContext gc = canvas.getGraphicsContext2D();
|
||||||
|
gc.setFill(javafx.scene.paint.Color.RED);
|
||||||
|
var h1 = javafx.scene.text.Font.font("Microsoft YaHei", FontWeight.BOLD, 24);
|
||||||
|
var h2 = javafx.scene.text.Font.font("Microsoft YaHei", FontWeight.NORMAL, 18);
|
||||||
|
gc.setFont(h1);
|
||||||
|
gc.fillText(fileViewModel.getType().get().name(), 50, 100);
|
||||||
|
|
||||||
|
Runnable updateImage = () -> {
|
||||||
|
WritableImage writableImage = new WritableImage((int) canvas.getWidth(), (int) canvas.getHeight());
|
||||||
|
// 将画布内容转为图像
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
canvas.snapshot(null, writableImage);
|
||||||
|
imageView.setImage(writableImage);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
runAsync(() -> {
|
||||||
|
CustomerFileTypeLocalVo localVo = getCachedBean(CompanyCustomerFileTypeService.class).findByLocaleAndType(getLocale(), fileViewModel.getType().get());
|
||||||
|
gc.setFill(Color.WHITE);
|
||||||
|
// 覆盖 fileViewModel.getType() 文字
|
||||||
|
gc.fillRect(0, 55, canvas.getWidth(), 55);
|
||||||
|
|
||||||
|
// 绘制 文件类型
|
||||||
|
gc.setFill(javafx.scene.paint.Color.RED);
|
||||||
|
gc.setFont(h1);
|
||||||
|
gc.fillText(localVo.getValue(), 50, 100);
|
||||||
|
|
||||||
|
updateImage.run();
|
||||||
|
});
|
||||||
|
|
||||||
|
gc.setStroke(javafx.scene.paint.Color.BLACK);
|
||||||
|
gc.setFont(h2);
|
||||||
|
gc.strokeText("正在加载文件..." + pdfFile.getName(), 50, 150);
|
||||||
|
updateImage.run();
|
||||||
|
|
||||||
|
runAsync(() -> {
|
||||||
|
|
||||||
|
//FileSystemUtils.
|
||||||
|
long fileSize = pdfFile.length();
|
||||||
|
byte[] bytes = new byte[0];
|
||||||
|
try (java.io.FileInputStream fis = new java.io.FileInputStream(pdfFile);
|
||||||
|
java.io.BufferedInputStream bis = new java.io.BufferedInputStream(fis)) {
|
||||||
|
|
||||||
|
bytes = new byte[(int) fileSize];
|
||||||
|
int totalBytesRead = 0;
|
||||||
|
int bytesRead;
|
||||||
|
byte[] buffer = new byte[8192]; // 8KB buffer
|
||||||
|
|
||||||
|
while ((bytesRead = bis.read(buffer)) != -1) {
|
||||||
|
System.arraycopy(buffer, 0, bytes, totalBytesRead, bytesRead);
|
||||||
|
totalBytesRead += bytesRead;
|
||||||
|
|
||||||
|
// 更新进度
|
||||||
|
double progress = (double) totalBytesRead / fileSize * 100;
|
||||||
|
final String status = String.format("正在加载文件... %s (%.1f%%)",
|
||||||
|
pdfFile.getName(), progress);
|
||||||
|
|
||||||
|
gc.setFill(Color.WHITE);
|
||||||
|
gc.fillRect(0, 200, canvas.getWidth(), 80);
|
||||||
|
|
||||||
|
|
||||||
|
gc.setFill(Color.BLACK);
|
||||||
|
gc.setFont(h2);
|
||||||
|
gc.fillText(status, 50, 250);
|
||||||
|
|
||||||
|
|
||||||
|
// 绘制进度条背景
|
||||||
|
gc.setFill(Color.LIGHTGRAY);
|
||||||
|
gc.fillRect(50, 270, 400, 20);
|
||||||
|
|
||||||
|
// 绘制进度条
|
||||||
|
gc.setFill(Color.GREEN);
|
||||||
|
gc.fillRect(50, 270, 400 * (totalBytesRead / (double) fileSize), 20);
|
||||||
|
|
||||||
|
// 绘制进度条边框
|
||||||
|
gc.setStroke(Color.BLACK);
|
||||||
|
gc.setLineWidth(1);
|
||||||
|
gc.strokeRect(50, 270, 400, 20);
|
||||||
|
|
||||||
|
|
||||||
|
updateImage.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
gc.setFill(Color.BLACK);
|
||||||
|
gc.setFont(h2);
|
||||||
|
gc.fillText("Loading file: " + pdfFile.getName() + ", size: " + bytes.length + " bytes", 50, 320);
|
||||||
|
updateImage.run();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try (PDDocument pdDocument = Loader.loadPDF(bytes)) {
|
||||||
|
gc.setFill(Color.BLACK);
|
||||||
|
gc.setFont(h2);
|
||||||
|
gc.fillText("PDF has " + pdDocument.getNumberOfPages() + " pages", 50, 380);
|
||||||
|
updateImage.run();
|
||||||
|
|
||||||
|
PDFRenderer pdfRenderer = new PDFRenderer(pdDocument);
|
||||||
|
|
||||||
|
BufferedImage bufferedImage = pdfRenderer.renderImageWithDPI(0, 300);
|
||||||
|
|
||||||
|
// 获取 BufferedImage 的宽度和高度
|
||||||
|
int width = bufferedImage.getWidth();
|
||||||
|
int height = bufferedImage.getHeight();
|
||||||
|
canvas.resize(width, height);
|
||||||
|
GraphicsContext graphic = canvas.getGraphicsContext2D();
|
||||||
|
|
||||||
|
WritableImage writableImage1 = new WritableImage(width, height);
|
||||||
|
|
||||||
|
PixelWriter pixelWriter = writableImage1.getPixelWriter();
|
||||||
|
// 将 BufferedImage 的像素数据复制到 WritableImage
|
||||||
|
for (int y = 0; y < height; y++) {
|
||||||
|
for (int x = 0; x < width; x++) {
|
||||||
|
int argb = bufferedImage.getRGB(x, y);
|
||||||
|
pixelWriter.setArgb(x, y, argb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setStatus();
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
imageView.setImage(writableImage1);
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
setStatus(e.getMessage());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,6 +531,7 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
|
toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
stringPropertyUpdater.accept(property, newValue);
|
stringPropertyUpdater.accept(property, newValue);
|
||||||
});
|
});
|
||||||
|
stringRadioGroupUpdater.accept(toggleGroup, property.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeRadioGroup(ToggleGroup toggleGroup, SimpleIntegerProperty property) {
|
private void initializeRadioGroup(ToggleGroup toggleGroup, SimpleIntegerProperty property) {
|
||||||
@@ -375,21 +542,8 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
|||||||
toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
|
toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
numberPropertyUpdater.accept(property, newValue);
|
numberPropertyUpdater.accept(property, newValue);
|
||||||
});
|
});
|
||||||
|
numberRadioGroupUpdater.accept(toggleGroup, property.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void update(CompanyCustomerEvaluationFormFileVo formFile) {
|
|
||||||
|
|
||||||
viewModel.update(formFile);
|
|
||||||
|
|
||||||
// formFile.getScoreTemplateVersion();
|
|
||||||
|
|
||||||
catalogProperty.set(formFile.getCatalog());
|
|
||||||
levelProperty.set(formFile.getLevel());
|
|
||||||
score1Property.set(formFile.getScore1());
|
|
||||||
score2Property.set(formFile.getScore2());
|
|
||||||
score3Property.set(formFile.getScore3());
|
|
||||||
score4Property.set(formFile.getScore4());
|
|
||||||
score5Property.set(formFile.getScore5());
|
|
||||||
creditLevelProperty.set(formFile.getCreditLevel());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,9 +161,7 @@ public class CustomerTabSkinFile
|
|||||||
// 文件不是 Excel 文件时,打开编辑UI
|
// 文件不是 Excel 文件时,打开编辑UI
|
||||||
if (!FileUtils.withExtensions(item.getFilePath().get(), FileUtils.XLS,
|
if (!FileUtils.withExtensions(item.getFilePath().get(), FileUtils.XLS,
|
||||||
FileUtils.XLSX)) {
|
FileUtils.XLSX)) {
|
||||||
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getEvaluationFormFileService()
|
CompanyCustomerEvaluationFormFileWindowController.show(item,
|
||||||
.findByCustomerFile(item.getId().get());
|
|
||||||
CompanyCustomerEvaluationFormFileWindowController.show(evaluationFormFile,
|
|
||||||
controller.root.getScene().getWindow());
|
controller.root.getScene().getWindow());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -211,10 +209,7 @@ public class CustomerTabSkinFile
|
|||||||
model.update(saved);
|
model.update(saved);
|
||||||
dataSet.add(model);
|
dataSet.add(model);
|
||||||
|
|
||||||
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getCachedBean(
|
CompanyCustomerEvaluationFormFileWindowController.show(model,
|
||||||
CompanyCustomerEvaluationFormFileService.class).findByCustomerFile(saved);
|
|
||||||
|
|
||||||
CompanyCustomerEvaluationFormFileWindowController.show(evaluationFormFile,
|
|
||||||
getTableView().getScene().getWindow());
|
getTableView().getScene().getWindow());
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class EmployeeManagerSkin
|
|||||||
controller.accountColumn.setCellValueFactory(param -> param.getValue().getAccount());
|
controller.accountColumn.setCellValueFactory(param -> param.getValue().getAccount());
|
||||||
|
|
||||||
controller.departmentColumn.setCellValueFactory(param -> param.getValue().getDepartment());
|
controller.departmentColumn.setCellValueFactory(param -> param.getValue().getDepartment());
|
||||||
controller.departmentColumn.setCellFactory(param -> new DepartmentTableCell<>(getDepartmentService()));
|
controller.departmentColumn.setCellFactory(DepartmentTableCell.forTableColumn(getDepartmentService()));
|
||||||
|
|
||||||
controller.emailColumn.setCellValueFactory(param -> param.getValue().getEmail());
|
controller.emailColumn.setCellValueFactory(param -> param.getValue().getEmail());
|
||||||
controller.createdColumn.setCellValueFactory(param -> param.getValue().getCreated());
|
controller.createdColumn.setCellValueFactory(param -> param.getValue().getCreated());
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package com.ecep.contract.controller.employee;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import com.ecep.contract.controller.tab.TabSkin;
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
@@ -48,7 +50,7 @@ public class EmployeeTabSkinRole
|
|||||||
|
|
||||||
private void initializeListView() {
|
private void initializeListView() {
|
||||||
// 非系统内置账户
|
// 非系统内置账户
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
Map<String, Object> params = ParamUtils.builder().build();
|
||||||
List<EmployeeRoleVo> roles = getEmployeeRoleService().findAll(params, Pageable.ofSize(500)).getContent();
|
List<EmployeeRoleVo> roles = getEmployeeRoleService().findAll(params, Pageable.ofSize(500)).getContent();
|
||||||
|
|
||||||
controller.rolesField.getSourceItems().setAll(roles);
|
controller.rolesField.getSourceItems().setAll(roles);
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
|
import com.ecep.contract.controller.tab.AbstEntityBasedTabSkin;
|
||||||
|
import com.ecep.contract.service.FunctionService;
|
||||||
|
import com.ecep.contract.service.PermissionService;
|
||||||
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
|
||||||
|
public abstract class AbstEmployeeFunctionBasedTabSkin
|
||||||
|
extends AbstEntityBasedTabSkin<EmployeeFunctionWindowController, FunctionVo, FunctionViewModel> {
|
||||||
|
|
||||||
|
public AbstEmployeeFunctionBasedTabSkin(EmployeeFunctionWindowController controller) {
|
||||||
|
super(controller);
|
||||||
|
}
|
||||||
|
|
||||||
|
FunctionService getFunctionService() {
|
||||||
|
return getCachedBean(FunctionService.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PermissionService getPermissionService() {
|
||||||
|
return controller.permissionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
|
import com.ecep.contract.controller.tab.TabSkin;
|
||||||
|
|
||||||
|
import javafx.scene.control.Tab;
|
||||||
|
|
||||||
|
public class EmployeeFunctionTabSkinBase extends AbstEmployeeFunctionBasedTabSkin implements TabSkin {
|
||||||
|
|
||||||
|
public EmployeeFunctionTabSkinBase(EmployeeFunctionWindowController controller) {
|
||||||
|
super(controller);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Tab getTab() {
|
||||||
|
return controller.baseInfoTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initializeTab() {
|
||||||
|
controller.nameField.textProperty().bindBidirectional(viewModel.getName());
|
||||||
|
controller.keyField.textProperty().bindBidirectional(viewModel.getKey());
|
||||||
|
controller.controllerField.textProperty().bindBidirectional(viewModel.getController());
|
||||||
|
controller.iconField.textProperty().bindBidirectional(viewModel.getIcon());
|
||||||
|
controller.descriptionField.textProperty().bindBidirectional(viewModel.getDescription());
|
||||||
|
controller.activeField.selectedProperty().bindBidirectional(viewModel.getActive());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.ecep.contract.controller.permission;
|
||||||
|
|
||||||
|
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.AbstEntityController;
|
||||||
|
import com.ecep.contract.service.FunctionService;
|
||||||
|
import com.ecep.contract.service.PermissionService;
|
||||||
|
import com.ecep.contract.util.FxmlPath;
|
||||||
|
import com.ecep.contract.vm.FunctionViewModel;
|
||||||
|
import com.ecep.contract.vo.FunctionVo;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.CheckBox;
|
||||||
|
import javafx.scene.control.DatePicker;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
|
import javafx.scene.control.Tab;
|
||||||
|
import javafx.scene.control.TabPane;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import javafx.scene.layout.BorderPane;
|
||||||
|
import javafx.stage.Window;
|
||||||
|
import javafx.stage.WindowEvent;
|
||||||
|
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Scope("prototype")
|
||||||
|
@Component
|
||||||
|
@FxmlPath("/ui/employee/function.fxml")
|
||||||
|
public class EmployeeFunctionWindowController extends AbstEntityController<FunctionVo, FunctionViewModel> {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EmployeeFunctionWindowController.class);
|
||||||
|
|
||||||
|
|
||||||
|
public static void show(FunctionViewModel viewModel, Window window) {
|
||||||
|
show(EmployeeFunctionWindowController.class, viewModel, window);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BorderPane root;
|
||||||
|
public TabPane tabPane;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 基本信息标签页
|
||||||
|
*/
|
||||||
|
public Tab baseInfoTab;
|
||||||
|
public TextField nameField;
|
||||||
|
public TextField keyField;
|
||||||
|
public TextField controllerField;
|
||||||
|
public TextField iconField;
|
||||||
|
public TextField descriptionField;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public CheckBox activeField;
|
||||||
|
public Label versionLabel;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 权限标签页
|
||||||
|
*/
|
||||||
|
public Tab permissionTab;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PermissionService permissionService;
|
||||||
|
@Autowired
|
||||||
|
FunctionService functionService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShown(WindowEvent windowEvent) {
|
||||||
|
super.onShown(windowEvent);
|
||||||
|
getTitle().bind(viewModel.getName().map(name -> "[" + viewModel.getId().get() + "] " + name + " 功能详情"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void registerTabSkins() {
|
||||||
|
registerTabSkin(baseInfoTab, tab -> new EmployeeFunctionTabSkinBase(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FunctionService getViewModelService() {
|
||||||
|
return functionService;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -61,8 +61,6 @@ public class EmployeeFunctionsManagerWindowController
|
|||||||
public void onCreateNewAction(ActionEvent event) {
|
public void onCreateNewAction(ActionEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReBuildFilesAction(ActionEvent event) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FunctionService getViewModelService() {
|
public FunctionService getViewModelService() {
|
||||||
|
|||||||
@@ -54,9 +54,6 @@ public class EmployeeRoleManagerWindowController
|
|||||||
public void onCreateNewAction(ActionEvent event) {
|
public void onCreateNewAction(ActionEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReBuildFilesAction(ActionEvent event) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EmployeeRoleService getViewModelService() {
|
public EmployeeRoleService getViewModelService() {
|
||||||
return employeeRoleService;
|
return employeeRoleService;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class EmployeeRoleTabSkinFunctions extends AbstEmployeeRoleBasedTabSkin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadSelectedRoles() {
|
private void loadSelectedRoles() {
|
||||||
List<FunctionVo> selectedRoles = getRoleService().getFunctionsByRoleId(viewModel.getId().get());
|
List<FunctionVo> selectedRoles = getRoleService().getFunctionsByRole(getEntity());
|
||||||
if (selectedRoles != null) {
|
if (selectedRoles != null) {
|
||||||
functionsField.getTargetItems().setAll(selectedRoles);
|
functionsField.getTargetItems().setAll(selectedRoles);
|
||||||
}
|
}
|
||||||
@@ -100,8 +100,7 @@ public class EmployeeRoleTabSkinFunctions extends AbstEmployeeRoleBasedTabSkin {
|
|||||||
|
|
||||||
private void saveRoles(ActionEvent event) {
|
private void saveRoles(ActionEvent event) {
|
||||||
EmployeeRoleVo entity = getEntity();
|
EmployeeRoleVo entity = getEntity();
|
||||||
entity.setFunctions(functionsField.getTargetItems());
|
getRoleService().saveRoleFunctions(entity, functionsField.getTargetItems());
|
||||||
save(entity);
|
|
||||||
loadSelectedRoles();
|
loadSelectedRoles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,11 +69,6 @@ public class CompanyTabSkinBankAccount
|
|||||||
bankAccountTable_openingBankColumn.setCellValueFactory(param -> param.getValue().getOpeningBank());
|
bankAccountTable_openingBankColumn.setCellValueFactory(param -> param.getValue().getOpeningBank());
|
||||||
bankAccountTable_accountColumn.setCellValueFactory(param -> param.getValue().getAccount());
|
bankAccountTable_accountColumn.setCellValueFactory(param -> param.getValue().getAccount());
|
||||||
|
|
||||||
|
|
||||||
bankAccountTable_menu_refresh.setOnAction(this::onTableRefreshAction);
|
|
||||||
bankAccountTable_menu_add.setOnAction(this::onTableAddAction);
|
|
||||||
bankAccountTable_menu_del.setOnAction(this::onTableDeleteAction);
|
|
||||||
|
|
||||||
super.initializeTab();
|
super.initializeTab();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,12 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import com.ecep.contract.task.CompanyMergeClientTasker;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
|
import com.ecep.contract.util.UITools;
|
||||||
import com.ecep.contract.vo.CompanyOldNameVo;
|
import com.ecep.contract.vo.CompanyOldNameVo;
|
||||||
import com.ecep.contract.vo.CompanyVo;
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@@ -138,53 +142,20 @@ public class CompanyTabSkinOldName
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onTableMergeAction(ActionEvent event) {
|
private void onTableMergeAction(ActionEvent event) {
|
||||||
CompanyVo updater = getParent();
|
// 收集所有曾用名
|
||||||
HashSet<String> nameSet = new HashSet<>();
|
List<String> nameList = dataSet.stream()
|
||||||
nameSet.add(updater.getName());
|
.map(viewModel -> viewModel.getName().get())
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.toList();
|
||||||
|
|
||||||
List<CompanyOldNameViewModel> removes = new ArrayList<>();
|
// 创建独立的WebSocket客户端任务器
|
||||||
for (CompanyOldNameViewModel viewModel : dataSet) {
|
CompanyMergeClientTasker task = new CompanyMergeClientTasker();
|
||||||
|
|
||||||
if (!nameSet.add(viewModel.getName().get())) {
|
task.setCompany(getParent());
|
||||||
// fixed 曾用名中有重复时,删除重复的
|
task.setNameList(nameList);
|
||||||
deleteRow(viewModel);
|
UITools.showTaskDialogAndWait("合并曾用名", task, null);
|
||||||
removes.add(viewModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!removes.isEmpty()) {
|
|
||||||
Platform.runLater(() -> {
|
|
||||||
dataSet.removeAll(removes);
|
|
||||||
});
|
|
||||||
setStatus("移除重复的曾用名" + removes.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
int size = nameSet.size();
|
loadTableDataSet();
|
||||||
int count = 1;
|
|
||||||
int merge = 0;
|
|
||||||
for (String name : nameSet) {
|
|
||||||
controller.setRightStatus(count + "/" + size);
|
|
||||||
if (StringUtils.hasText(name)) {
|
|
||||||
List<CompanyVo> list = getParentService().findAllByName(name);
|
|
||||||
for (CompanyVo company : list) {
|
|
||||||
// fixed 曾用名中有可能有 updater 的名字,会导致自己删除自己
|
|
||||||
if (Objects.equals(company.getId(), updater.getId())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
getCompanyService().merge(company, updater);
|
|
||||||
setStatus("并户 " + company.getName() + "[" + company.getId() + "] 到当前公司");
|
|
||||||
merge++;
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException("合并 " + company.getName() + " -> " + updater.getName() + " 失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
if (merge == 0) {
|
|
||||||
setStatus("没有需要并户的公司");
|
|
||||||
}
|
|
||||||
controller.setRightStatus("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -201,7 +172,7 @@ public class CompanyTabSkinOldName
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String path = viewModel.getPath().get();
|
String path = viewModel.getPath().get();
|
||||||
if (StringUtils.hasText(path)) {
|
if (org.springframework.util.StringUtils.hasText(path)) {
|
||||||
if (item.startsWith(path)) {
|
if (item.startsWith(path)) {
|
||||||
item = "~" + item.substring(path.length());
|
item = "~" + item.substring(path.length());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,8 +97,10 @@ public class CompanyTabSkinOther
|
|||||||
// Yu //
|
// Yu //
|
||||||
public TitledPane yuCloudPane;
|
public TitledPane yuCloudPane;
|
||||||
public TextField cloudYuIdField;
|
public TextField cloudYuIdField;
|
||||||
public TextField cloudYuCloudIdField;
|
|
||||||
public TextField cloudYuLatestField;
|
public TextField cloudYuLatestField;
|
||||||
|
public TextField cloudYuVendorUpdateDateField;
|
||||||
|
public TextField cloudYuCustomerUpdateDateField;
|
||||||
|
public CheckBox cloudYuActiveField;
|
||||||
public Label cloudYuVersionLabel;
|
public Label cloudYuVersionLabel;
|
||||||
public Button yuCloudPaneSaveButton;
|
public Button yuCloudPaneSaveButton;
|
||||||
|
|
||||||
@@ -417,8 +419,10 @@ public class CompanyTabSkinOther
|
|||||||
}
|
}
|
||||||
|
|
||||||
cloudYuIdField.textProperty().bind(yuCloudInfoViewModel.getId().asString());
|
cloudYuIdField.textProperty().bind(yuCloudInfoViewModel.getId().asString());
|
||||||
cloudYuCloudIdField.textProperty().bindBidirectional(yuCloudInfoViewModel.getCloudId());
|
|
||||||
cloudYuLatestField.textProperty().bind(yuCloudInfoViewModel.getLatestUpdate().map(MyDateTimeUtils::format));
|
cloudYuLatestField.textProperty().bind(yuCloudInfoViewModel.getLatestUpdate().map(MyDateTimeUtils::format));
|
||||||
|
cloudYuVendorUpdateDateField.textProperty().bind(yuCloudInfoViewModel.getVendorUpdateDate().map(MyDateTimeUtils::format));
|
||||||
|
cloudYuCustomerUpdateDateField.textProperty().bind(yuCloudInfoViewModel.getCustomerUpdateDate().map(MyDateTimeUtils::format));
|
||||||
|
cloudYuActiveField.selectedProperty().bindBidirectional(yuCloudInfoViewModel.getActive());
|
||||||
cloudYuVersionLabel.textProperty().bind(yuCloudInfoViewModel.getVersion().asString("Ver:%s"));
|
cloudYuVersionLabel.textProperty().bind(yuCloudInfoViewModel.getVersion().asString("Ver:%s"));
|
||||||
|
|
||||||
Button button = yuCloudPaneSaveButton;
|
Button button = yuCloudPaneSaveButton;
|
||||||
@@ -436,6 +440,34 @@ public class CompanyTabSkinOther
|
|||||||
button.setDisable(false);
|
button.setDisable(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
DelayOnceExecutor saveExecutor = new DelayOnceExecutor(() -> {
|
||||||
|
save(yuCloudInfoViewModel);
|
||||||
|
cloudYuActiveField.setBorder(null);
|
||||||
|
}, 2, TimeUnit.SECONDS).exception(e -> logger.error(e.getMessage(), e));
|
||||||
|
cloudYuActiveField.setOnMouseClicked(event -> {
|
||||||
|
cloudYuActiveField.setBorder(Border.stroke(Color.RED));
|
||||||
|
saveExecutor.tick();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(CloudYuInfoViewModel viewModel) {
|
||||||
|
int infoId = viewModel.getId().get();
|
||||||
|
YongYouU8Service service = getYongYouU8Service();
|
||||||
|
CloudYuVo cloudYu = service.findById(infoId);
|
||||||
|
if (cloudYu == null) {
|
||||||
|
throw new RuntimeException("CloudTyc not found");
|
||||||
|
}
|
||||||
|
if (viewModel.copyTo(cloudYu)) {
|
||||||
|
CloudYuVo saved = service.save(cloudYu);
|
||||||
|
if (Platform.isFxApplicationThread()) {
|
||||||
|
viewModel.update(saved);
|
||||||
|
} else {
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
viewModel.update(saved);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCloudYuUpdateButtonClicked(ActionEvent event) {
|
private void onCloudYuUpdateButtonClicked(ActionEvent event) {
|
||||||
@@ -516,9 +548,11 @@ public class CompanyTabSkinOther
|
|||||||
CompanyExtendInfoViewModel viewModel = extendInfoViewModel;
|
CompanyExtendInfoViewModel viewModel = extendInfoViewModel;
|
||||||
CompanyExtendInfoService service = getExtendInfoService();
|
CompanyExtendInfoService service = getExtendInfoService();
|
||||||
CompanyExtendInfoVo extendInfo = service.findByCompany(company);
|
CompanyExtendInfoVo extendInfo = service.findByCompany(company);
|
||||||
Platform.runLater(() -> {
|
if (extendInfo != null) {
|
||||||
viewModel.update(extendInfo);
|
Platform.runLater(() -> {
|
||||||
});
|
viewModel.update(extendInfo);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CloudRkService getCloudRkService() {
|
CloudRkService getCloudRkService() {
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
|
|
||||||
controller.payWayField.textProperty().bind(viewModel.getPayWay().map(ContractPayWay::getText));
|
controller.payWayField.textProperty().bind(viewModel.getPayWay().map(ContractPayWay::getText));
|
||||||
|
|
||||||
controller.nameField.textProperty().bind(viewModel.getName());
|
controller.nameField.textProperty().bindBidirectional(viewModel.getName());
|
||||||
|
controller.nameField.editableProperty().bind(viewModel.getNameLocked());
|
||||||
|
controller.contractNameLockedCk.selectedProperty().bindBidirectional(viewModel.getNameLocked());
|
||||||
controller.codeField.textProperty().bind(viewModel.getCode());
|
controller.codeField.textProperty().bind(viewModel.getCode());
|
||||||
|
|
||||||
controller.parentCodeField.textProperty().bindBidirectional(viewModel.getParentCode());
|
controller.parentCodeField.textProperty().bindBidirectional(viewModel.getParentCode());
|
||||||
@@ -351,17 +353,20 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
|||||||
}
|
}
|
||||||
if (initialDirectory == null) {
|
if (initialDirectory == null) {
|
||||||
if (entity.getPayWay() == ContractPayWay.RECEIVE) {
|
if (entity.getPayWay() == ContractPayWay.RECEIVE) {
|
||||||
// 根据项目设置初始目录
|
Integer projectId = entity.getProject();
|
||||||
ProjectVo project = getProjectService().findById(entity.getProject());
|
if (projectId != null) {
|
||||||
if (project != null) {
|
// 根据项目设置初始目录
|
||||||
// 根据项目销售方式设置初始目录
|
ProjectVo project = getProjectService().findById(projectId);
|
||||||
ProjectSaleTypeVo saleType = getSaleTypeService().findById(project.getSaleTypeId());
|
if (project != null) {
|
||||||
if (saleType != null) {
|
// 根据项目销售方式设置初始目录
|
||||||
File dir = new File(saleType.getPath());
|
ProjectSaleTypeVo saleType = getSaleTypeService().findById(project.getSaleTypeId());
|
||||||
if (saleType.isStoreByYear()) {
|
if (saleType != null) {
|
||||||
dir = new File(dir, "20" + project.getCodeYear());
|
File dir = new File(saleType.getPath());
|
||||||
|
if (saleType.isStoreByYear()) {
|
||||||
|
dir = new File(dir, "20" + project.getCodeYear());
|
||||||
|
}
|
||||||
|
initialDirectory = dir;
|
||||||
}
|
}
|
||||||
initialDirectory = dir;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (entity.getPayWay() == ContractPayWay.PAY) {
|
} else if (entity.getPayWay() == ContractPayWay.PAY) {
|
||||||
|
|||||||
@@ -4,10 +4,15 @@ import com.ecep.contract.SpringApp;
|
|||||||
import com.ecep.contract.service.DepartmentService;
|
import com.ecep.contract.service.DepartmentService;
|
||||||
import com.ecep.contract.vo.DepartmentVo;
|
import com.ecep.contract.vo.DepartmentVo;
|
||||||
|
|
||||||
|
import javafx.scene.control.TableCell;
|
||||||
|
import javafx.scene.control.TableColumn;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class DepartmentTableCell<T> extends AsyncUpdateTableCell<T, Integer, DepartmentVo> {
|
public class DepartmentTableCell<T> extends AsyncUpdateTableCell<T, Integer, DepartmentVo> {
|
||||||
|
|
||||||
public DepartmentTableCell(DepartmentService service) {
|
public DepartmentTableCell(DepartmentService service) {
|
||||||
setService(service);
|
setService(service);
|
||||||
}
|
}
|
||||||
@@ -17,4 +22,20 @@ public class DepartmentTableCell<T> extends AsyncUpdateTableCell<T, Integer, Dep
|
|||||||
return SpringApp.getBean(DepartmentService.class);
|
return SpringApp.getBean(DepartmentService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为表格列创建 DepartmentTableCell 的工厂方法
|
||||||
|
*
|
||||||
|
* @param service 部门服务
|
||||||
|
* @param <T> 表格行数据类型
|
||||||
|
* @return 表格列的回调函数
|
||||||
|
*/
|
||||||
|
public static <T> Callback<TableColumn<T, Integer>, TableCell<T, Integer>> forTableColumn(DepartmentService service) {
|
||||||
|
return column -> new DepartmentTableCell<>(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String format(DepartmentVo entity) {
|
||||||
|
return getService().getStringConverter().toString(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public class VendorTypeTableCell<T> extends AsyncUpdateTableCell<T, VendorType,
|
|||||||
protected VendorTypeLocalVo initialize() {
|
protected VendorTypeLocalVo initialize() {
|
||||||
VendorType item = getItem();
|
VendorType item = getItem();
|
||||||
VendorTypeLocalVo localVo = getServiceBean().findByType(item);
|
VendorTypeLocalVo localVo = getServiceBean().findByType(item);
|
||||||
System.out.println("item = " + item + ", localVo = " + getServiceBean().getStringConverter().toString(localVo));
|
|
||||||
return localVo;
|
return localVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ public class VendorApprovedListTabSkinVendors
|
|||||||
task.setEveryYearMinContracts(qualifiedVendorEveryYearMinContractsSpinner.getValue());
|
task.setEveryYearMinContracts(qualifiedVendorEveryYearMinContractsSpinner.getValue());
|
||||||
|
|
||||||
UITools.showTaskDialogAndWait("导入供方", task, null);
|
UITools.showTaskDialogAndWait("导入供方", task, null);
|
||||||
|
loadTableDataSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onVendorTableRefreshAction(ActionEvent event) {
|
public void onVendorTableRefreshAction(ActionEvent event) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import java.util.Objects;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.ecep.contract.constant.CompanyVendorConstant;
|
||||||
import com.ecep.contract.service.*;
|
import com.ecep.contract.service.*;
|
||||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
@@ -119,7 +120,8 @@ public class VendorApprovedListVendorExportTask extends Tasker<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private File getVendorApprovedListTemplate() {
|
private File getVendorApprovedListTemplate() {
|
||||||
return getVendorService().getVendorApprovedListTemplate();
|
String path = getConfService().getString(CompanyVendorConstant.KEY_APPROVED_LIST_TEMPLATE);
|
||||||
|
return new File(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
service = getBean(VendorApprovedService.class);
|
service = getBean(VendorApprovedService.class);
|
||||||
|
// 检索供方
|
||||||
VendorService vendorService = getBean(VendorService.class);
|
VendorService vendorService = getBean(VendorService.class);
|
||||||
Page<VendorVo> page = vendorService.findAll(
|
Page<VendorVo> page = vendorService.findAll(
|
||||||
ParamUtils.builder()
|
ParamUtils.builder()
|
||||||
@@ -136,7 +137,17 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
|||||||
// 明确 company 实例
|
// 明确 company 实例
|
||||||
CompanyVo company = initializedVendorCompany(vendor);
|
CompanyVo company = initializedVendorCompany(vendor);
|
||||||
if (company == null) {
|
if (company == null) {
|
||||||
// 无效
|
// 无效, 删除异常数据
|
||||||
|
holder.error("供方(#" + vendor.getId() + ")无对应的公司消息");
|
||||||
|
List<VendorApprovedItemVo> items = getItemService().findAllByListAndVendor(approvedList, vendor);
|
||||||
|
if (items != null && !items.isEmpty()) {
|
||||||
|
// 删除
|
||||||
|
MessageHolder subHolder = holder.sub(" - ");
|
||||||
|
items.forEach(item -> {
|
||||||
|
getItemService().delete(item);
|
||||||
|
subHolder.info("删除 #" + item.getId() + ", " + item.getVendorName());
|
||||||
|
});
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,15 +155,15 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
|||||||
|
|
||||||
VendorType vendorType = vendor.getType();
|
VendorType vendorType = vendor.getType();
|
||||||
if (vendorType == null) {
|
if (vendorType == null) {
|
||||||
subHolder.error("供方的分类为空");
|
subHolder.debug("供方分类未设置");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确认供方的developDate 是否在供方名录的发布日期之后
|
// 确认供方的developDate 是否在供方名录的发布日期之后
|
||||||
LocalDate developDate = vendor.getDevelopDate();
|
LocalDate developDate = vendor.getDevelopDate();
|
||||||
if (developDate == null) {
|
if (developDate == null) {
|
||||||
subHolder.error("供方的开发日期为空");
|
subHolder.error("开发日期未设置");
|
||||||
} else if (developDate.isAfter(approvedList.getPublishDate())) {
|
} else if (developDate.isAfter(approvedList.getPublishDate())) {
|
||||||
|
subHolder.info("开发日期在供方名录发布之后, 跳过...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,108 +171,13 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
|||||||
List<VendorApprovedItemVo> items = getItemService().findAllByListAndVendor(approvedList, vendor);
|
List<VendorApprovedItemVo> items = getItemService().findAllByListAndVendor(approvedList, vendor);
|
||||||
if (items == null || items.isEmpty()) {
|
if (items == null || items.isEmpty()) {
|
||||||
// 供方不在供方名录中时,新建一个
|
// 供方不在供方名录中时,新建一个
|
||||||
VendorApprovedItemVo item = new VendorApprovedItemVo();
|
syncWhenNoItem(vendor, company, subHolder);
|
||||||
item.setListId(approvedList.getId());
|
|
||||||
item.setVendorId(vendor.getId());
|
|
||||||
|
|
||||||
// 当前供应商分类是不合格供应商时
|
|
||||||
if (vendorType == VendorType.UNQUALIFIED) {
|
|
||||||
// 检索查看供方的评价表, 看与发布日期期间是否有评价表
|
|
||||||
if (!checkAsQualifiedVendorByEvaluationFormFiles(vendor, item, subHolder)) {
|
|
||||||
// 不合同供方,跳过
|
|
||||||
if (logUnqualifiedVendor) {
|
|
||||||
subHolder.info("供方是不合格供方, 不纳入名录");
|
|
||||||
}
|
|
||||||
// 上一年度的供方目录中是否有此供应商
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
item.setDescription("");
|
|
||||||
}
|
|
||||||
// 当前供应商分类是合格供方时
|
|
||||||
else if (vendorType == VendorType.TYPICALLY) {
|
|
||||||
// 协议经销商,认定为合格供方
|
|
||||||
if (vendor.isProtocolProvider()) {
|
|
||||||
item.setType(VendorType.QUALIFIED);
|
|
||||||
item.setDescription("协议经销商");
|
|
||||||
}
|
|
||||||
// 非协议经销商
|
|
||||||
else {
|
|
||||||
// 查看供方的合同,看近3年期间是否有合同
|
|
||||||
List<ContractVo> contracts = findAllVendorContracts(vendor, approvedList.getPublishDate());
|
|
||||||
if (contracts.isEmpty()) {
|
|
||||||
// 没有合同,应该归入不合格供应商
|
|
||||||
// 保持一般供应商分类,后期流程处理是否变更分类
|
|
||||||
item.setType(VendorType.TYPICALLY);
|
|
||||||
if (logTypicallyVendorNoThreeYearContract) {
|
|
||||||
subHolder.warn("供方近" + vendorContractMinusYear + "年没有合作, 应该转为不合格供应商");
|
|
||||||
}
|
|
||||||
item.setDescription(STR_MEET_UNQUALIFIED);
|
|
||||||
} else {
|
|
||||||
// 检查近3年期间是否都有合同
|
|
||||||
if (checkAllYearHasContract(contracts, approvedList.getPublishDate())) {
|
|
||||||
// 每年都有合同,合同数是否符合合格供方标准
|
|
||||||
if (checkAllYearMinHasContract(contracts, approvedList.getPublishDate())) {
|
|
||||||
// 保持一般供应商分类,后期流程处理是否变更分类
|
|
||||||
item.setType(VendorType.TYPICALLY);
|
|
||||||
subHolder.info("供方近" + vendorContractMinusYear + "年每年都有合作, 符合合格供方标准");
|
|
||||||
item.setDescription(STR_MEET_QUALIFIED);
|
|
||||||
} else {
|
|
||||||
item.setType(VendorType.TYPICALLY);
|
|
||||||
subHolder.warn("供方近" + vendorContractMinusYear + "年每年都有合作, 但是合同数不足, 应转为一般供应商");
|
|
||||||
item.setDescription(STR_MEET_TYPICALLY);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
item.setType(VendorType.TYPICALLY);
|
|
||||||
item.setDescription("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 当前供应商分类是合格供方时
|
|
||||||
else if (vendorType == VendorType.QUALIFIED) {
|
|
||||||
// 查看供方的合同,看近3年期间是否有合同
|
|
||||||
List<ContractVo> contracts = findAllVendorContracts(vendor, approvedList.getPublishDate());
|
|
||||||
item.setType(vendorType);
|
|
||||||
if (contracts.isEmpty()) {
|
|
||||||
if (logTypicallyVendorNoThreeYearContract) {
|
|
||||||
subHolder.warn("供方近" + vendorContractMinusYear + "年没有合作, 应该转为不合格供应商");
|
|
||||||
}
|
|
||||||
item.setDescription(STR_MEET_UNQUALIFIED);
|
|
||||||
} else {
|
|
||||||
// 检查近3年期间是否都有合同
|
|
||||||
if (checkAllYearHasContract(contracts, approvedList.getPublishDate())) {
|
|
||||||
// 每年都有合同,合同数是否符合合格供方标准
|
|
||||||
if (checkAllYearMinHasContract(contracts, approvedList.getPublishDate())) {
|
|
||||||
item.setDescription("");
|
|
||||||
} else {
|
|
||||||
subHolder.warn("供方近" + vendorContractMinusYear + "年每年都有合作, 但是合同数不足, 应转为一般供应商");
|
|
||||||
item.setDescription(STR_MEET_TYPICALLY);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
subHolder.warn("供方近" + vendorContractMinusYear + "年非每年都有合作");
|
|
||||||
item.setDescription("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 未知分类时
|
|
||||||
else {
|
|
||||||
item.setDescription("未知供方分类");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 匹配的历史名称
|
|
||||||
updateVendorNameWithOldName(vendor, item);
|
|
||||||
getItemService().save(item);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (items.size() == 1) {
|
VendorApprovedItemVo first = items.getFirst();
|
||||||
VendorApprovedItemVo first = items.getFirst();
|
syncItem(vendor, company, first, subHolder);
|
||||||
if (!StringUtils.hasText(first.getVendorName())) {
|
|
||||||
updateVendorNameWithOldName(vendor, first);
|
|
||||||
}
|
|
||||||
updateItem(vendor, first, subHolder);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 1; i < items.size(); i++) {
|
for (int i = 1; i < items.size(); i++) {
|
||||||
VendorApprovedItemVo item = items.get(i);
|
VendorApprovedItemVo item = items.get(i);
|
||||||
@@ -270,11 +186,123 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateVendorNameWithOldName(VendorVo vendor, VendorApprovedItemVo item) {
|
/**
|
||||||
CompanyVo company = initializedVendorCompany(vendor);
|
* 当没有匹配的供方名录项时
|
||||||
if (company == null) {
|
*
|
||||||
|
* @param vendor
|
||||||
|
* @param company
|
||||||
|
* @param subHolder
|
||||||
|
*/
|
||||||
|
private void syncWhenNoItem(VendorVo vendor, CompanyVo company, MessageHolder subHolder) {
|
||||||
|
VendorType vendorType = vendor.getType();
|
||||||
|
if (vendorType == null) {
|
||||||
|
subHolder.debug("供方分类未设置");
|
||||||
|
}
|
||||||
|
|
||||||
|
VendorApprovedItemVo item = new VendorApprovedItemVo();
|
||||||
|
item.setListId(approvedList.getId());
|
||||||
|
item.setVendorId(vendor.getId());
|
||||||
|
|
||||||
|
// 当前供应商分类是不合格供应商时
|
||||||
|
if (vendorType == VendorType.UNQUALIFIED) {
|
||||||
|
// 检索查看供方的评价表, 看与发布日期期间是否有评价表
|
||||||
|
if (!checkAsQualifiedVendorByEvaluationFormFiles(vendor, item, subHolder)) {
|
||||||
|
// 不合同供方,跳过
|
||||||
|
if (logUnqualifiedVendor) {
|
||||||
|
subHolder.info("供方是不合格供方, 不纳入名录");
|
||||||
|
}
|
||||||
|
// 上一年度的供方目录中是否有此供应商
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setDescription("");
|
||||||
|
}
|
||||||
|
// 当前供应商分类是合格供方时
|
||||||
|
else if (vendorType == VendorType.TYPICALLY) {
|
||||||
|
// 协议经销商,认定为合格供方
|
||||||
|
if (vendor.isProtocolProvider()) {
|
||||||
|
item.setType(VendorType.QUALIFIED);
|
||||||
|
item.setDescription("协议经销商");
|
||||||
|
}
|
||||||
|
// 非协议经销商
|
||||||
|
else {
|
||||||
|
// 查看供方的合同,看近3年期间是否有合同
|
||||||
|
List<ContractVo> contracts = findAllVendorContracts(vendor, approvedList.getPublishDate());
|
||||||
|
if (contracts.isEmpty()) {
|
||||||
|
// 没有合同,应该归入不合格供应商
|
||||||
|
// 保持一般供应商分类,后期流程处理是否变更分类
|
||||||
|
item.setType(VendorType.TYPICALLY);
|
||||||
|
if (logTypicallyVendorNoThreeYearContract) {
|
||||||
|
subHolder.warn("供方近" + vendorContractMinusYear + "年没有合作, 应该转为不合格供应商");
|
||||||
|
}
|
||||||
|
item.setDescription(STR_MEET_UNQUALIFIED + "(缺合同1)");
|
||||||
|
} else {
|
||||||
|
// 检查近3年期间是否都有合同
|
||||||
|
if (checkAllYearHasContract(contracts, approvedList.getPublishDate())) {
|
||||||
|
// 每年都有合同,合同数是否符合合格供方标准
|
||||||
|
if (checkAllYearMinHasContract(contracts, approvedList.getPublishDate())) {
|
||||||
|
// 保持一般供应商分类,后期流程处理是否变更分类
|
||||||
|
item.setType(VendorType.TYPICALLY);
|
||||||
|
subHolder.info("供方近" + vendorContractMinusYear + "年每年都有合作, 符合合格供方标准");
|
||||||
|
item.setDescription(STR_MEET_QUALIFIED);
|
||||||
|
} else {
|
||||||
|
item.setType(VendorType.TYPICALLY);
|
||||||
|
subHolder.warn("供方近" + vendorContractMinusYear + "年每年都有合作, 但是合同数不足, 应转为一般供应商");
|
||||||
|
item.setDescription(STR_MEET_TYPICALLY);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
item.setType(VendorType.TYPICALLY);
|
||||||
|
item.setDescription("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 当前供应商分类是合格供方时
|
||||||
|
else if (vendorType == VendorType.QUALIFIED) {
|
||||||
|
// 查看供方的合同,看近3年期间是否有合同
|
||||||
|
List<ContractVo> contracts = findAllVendorContracts(vendor, approvedList.getPublishDate());
|
||||||
|
item.setType(vendorType);
|
||||||
|
if (contracts.isEmpty()) {
|
||||||
|
if (logTypicallyVendorNoThreeYearContract) {
|
||||||
|
subHolder.warn("供方近" + vendorContractMinusYear + "年没有合作, 应该转为不合格供应商");
|
||||||
|
}
|
||||||
|
item.setDescription(STR_MEET_UNQUALIFIED + "(缺合同2)");
|
||||||
|
} else {
|
||||||
|
// 检查近3年期间是否都有合同
|
||||||
|
if (checkAllYearHasContract(contracts, approvedList.getPublishDate())) {
|
||||||
|
// 每年都有合同,合同数是否符合合格供方标准
|
||||||
|
if (checkAllYearMinHasContract(contracts, approvedList.getPublishDate())) {
|
||||||
|
item.setDescription("");
|
||||||
|
} else {
|
||||||
|
subHolder.warn("供方近" + vendorContractMinusYear + "年每年都有合作, 但是合同数不足, 应转为一般供应商");
|
||||||
|
item.setDescription(STR_MEET_TYPICALLY);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
subHolder.warn("供方近" + vendorContractMinusYear + "年非每年都有合作");
|
||||||
|
item.setDescription("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 未知分类时
|
||||||
|
else {
|
||||||
|
item.setDescription("未知供方分类");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 匹配的历史名称
|
||||||
|
updateVendorNameWithOldName(company, item);
|
||||||
|
getItemService().save(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 匹配历史名称,当前供方名称为空时
|
||||||
|
* @param company
|
||||||
|
* @param item
|
||||||
|
*/
|
||||||
|
private void updateVendorNameWithOldName(CompanyVo company, VendorApprovedItemVo item) {
|
||||||
|
if (StringUtils.hasText(item.getVendorName())) {
|
||||||
|
// 已经有供方名称时,不更新
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompanyOldNameVo companyOldName = getCompanyOldNameService().findMatchByDate(company,
|
CompanyOldNameVo companyOldName = getCompanyOldNameService().findMatchByDate(company,
|
||||||
approvedList.getPublishDate());
|
approvedList.getPublishDate());
|
||||||
if (companyOldName != null) {
|
if (companyOldName != null) {
|
||||||
@@ -288,11 +316,12 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
|||||||
@Setter
|
@Setter
|
||||||
private boolean logUnqualifiedVendorRemove = true;
|
private boolean logUnqualifiedVendorRemove = true;
|
||||||
|
|
||||||
private void updateItem(
|
private void syncItem(
|
||||||
VendorVo vendor, VendorApprovedItemVo item, MessageHolder holder) {
|
VendorVo vendor, CompanyVo company, VendorApprovedItemVo item, MessageHolder holder) {
|
||||||
VendorType t1 = item.getType();
|
VendorType t1 = item.getType();
|
||||||
VendorType vendorType = vendor.getType();
|
VendorType vendorType = vendor.getType();
|
||||||
VendorApprovedItemService itemService = getItemService();
|
VendorApprovedItemService itemService = getItemService();
|
||||||
|
updateVendorNameWithOldName(company, item);
|
||||||
if (t1 != vendorType) {
|
if (t1 != vendorType) {
|
||||||
holder.warn("注意分类不一致, " + t1 + ", " + vendorType + ".");
|
holder.warn("注意分类不一致, " + t1 + ", " + vendorType + ".");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.controller.vendor.approved_list;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import com.ecep.contract.task.VendorApprovedListMakePathTask;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -104,15 +105,13 @@ public class VendorApprovedListWindowController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onApprovedListCreatePathAction(ActionEvent event) {
|
public void onApprovedListCreatePathAction(ActionEvent event) {
|
||||||
|
VendorApprovedListMakePathTask task = new VendorApprovedListMakePathTask();
|
||||||
|
task.setApprovedList(getEntity());
|
||||||
|
UITools.showTaskDialogAndWait("创建目录", task, null);
|
||||||
|
|
||||||
int id = viewModel.getId().get();
|
int id = viewModel.getId().get();
|
||||||
VendorApprovedVo list = service.findById(id);
|
VendorApprovedVo list = service.findById(id);
|
||||||
|
viewModel.update(list);
|
||||||
if (service.makePathAbsent(list)) {
|
|
||||||
VendorApprovedVo saved = service.save(list);
|
|
||||||
viewModel.update(saved);
|
|
||||||
} else {
|
|
||||||
setStatus("目录存在或创建失败");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onApprovedListChangePathAction(ActionEvent event) {
|
public void onApprovedListChangePathAction(ActionEvent event) {
|
||||||
@@ -123,8 +122,4 @@ public class VendorApprovedListWindowController
|
|||||||
task.setApprovedList(getEntity());
|
task.setApprovedList(getEntity());
|
||||||
UITools.showTaskDialogAndWait("导出供方", task, null);
|
UITools.showTaskDialogAndWait("导出供方", task, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void save(ActionEvent event) {
|
|
||||||
saveTabSkins();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,37 @@
|
|||||||
package com.ecep.contract.converter;
|
package com.ecep.contract.converter;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.ecep.contract.service.DepartmentService;
|
import com.ecep.contract.service.DepartmentService;
|
||||||
import com.ecep.contract.vo.DepartmentVo;
|
import com.ecep.contract.vo.DepartmentVo;
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
/**
|
||||||
|
* 部门字符串转换器
|
||||||
@Lazy
|
*/
|
||||||
@Component
|
public class DepartmentStringConverter extends StringConverter<DepartmentVo> {
|
||||||
public class DepartmentStringConverter extends EntityStringConverter<DepartmentVo> {
|
|
||||||
@Lazy
|
|
||||||
@Autowired
|
|
||||||
private DepartmentService service;
|
private DepartmentService service;
|
||||||
|
|
||||||
public DepartmentStringConverter() {
|
public DepartmentStringConverter() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
public DepartmentStringConverter(DepartmentService service) {
|
||||||
private void init() {
|
this.service = service;
|
||||||
setInitialized(department -> service.findById(department.getId()));
|
|
||||||
setSuggestion(service::search);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(DepartmentVo department) {
|
||||||
|
if (department == null) {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
return department.getCode() + " " + department.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DepartmentVo fromString(String string) {
|
||||||
|
if (service == null || string == null || string.trim().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return service.findByCode(string.trim());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,9 @@ public class VendorCatalogStringConverter extends StringConverter<VendorCatalogV
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(VendorCatalogVo object) {
|
public String toString(VendorCatalogVo object) {
|
||||||
|
if (object == null) {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
return object.getName();
|
return object.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,26 @@
|
|||||||
package com.ecep.contract.converter;
|
package com.ecep.contract.converter;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import javafx.util.StringConverter;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.ecep.contract.service.VendorGroupService;
|
import com.ecep.contract.service.VendorGroupService;
|
||||||
import com.ecep.contract.vo.VendorGroupVo;
|
import com.ecep.contract.vo.VendorGroupVo;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
@Lazy
|
public class VendorGroupStringConverter extends StringConverter<VendorGroupVo> {
|
||||||
@Component
|
|
||||||
public class VendorGroupStringConverter extends EntityStringConverter<VendorGroupVo> {
|
|
||||||
@Lazy
|
|
||||||
@Autowired
|
|
||||||
private VendorGroupService service;
|
private VendorGroupService service;
|
||||||
|
|
||||||
public VendorGroupStringConverter() {
|
public VendorGroupStringConverter(VendorGroupService service) {
|
||||||
|
this.service = service;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@Override
|
||||||
private void init() {
|
public String toString(VendorGroupVo object) {
|
||||||
setInitialized(group -> service.findById(group.getId()));
|
return object == null ? "" : object.getCode() + " " + object.getName();
|
||||||
setSuggestion(service::search);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VendorGroupVo fromString(String string) {
|
||||||
|
return service.findByCode(string);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.controlsfx.control.TaskProgressView;
|
import org.controlsfx.control.TaskProgressView;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -21,6 +23,8 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public static class EntInfo {
|
public static class EntInfo {
|
||||||
@@ -69,6 +73,10 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
|||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Page<CloudRkVo> findAllByCompany(CompanyVo company) {
|
||||||
|
return findAll(ParamUtils.builder().equals("company", company.getId()).build(), Pageable.unpaged());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean checkBlackListUpdateElapse(CompanyVo company, CloudRkVo cloudRk) {
|
public boolean checkBlackListUpdateElapse(CompanyVo company, CloudRkVo cloudRk) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'checkBlackListUpdateElapse'");
|
throw new UnsupportedOperationException("Unimplemented method 'checkBlackListUpdateElapse'");
|
||||||
@@ -78,4 +86,12 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'updateBlackList'");
|
throw new UnsupportedOperationException("Unimplemented method 'updateBlackList'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
List<CloudRkVo> list = findAllByCompany(from).getContent();
|
||||||
|
for (CloudRkVo item : list) {
|
||||||
|
item.setCompanyId(to.getId());
|
||||||
|
save(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@@ -77,4 +79,16 @@ public class CloudTycService extends QueryService<CloudTycVo, CloudTycInfoViewMo
|
|||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Page<CloudTycVo> findAllByCompany(CompanyVo company) {
|
||||||
|
return findAll(ParamUtils.builder().equals("company", company.getId()).build(), Pageable.unpaged());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
List<CloudTycVo> list = findAllByCompany(from).getContent();
|
||||||
|
for (CloudTycVo item : list) {
|
||||||
|
item.setCompanyId(to.getId());
|
||||||
|
save(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@@ -32,4 +33,21 @@ public class CompanyContactService extends QueryService<CompanyContactVo, Compan
|
|||||||
return page.getContent().getFirst();
|
return page.getContent().getFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<CompanyContactVo> findAllByCompany(CompanyVo company, LocalDate beginDate, LocalDate endDate) {
|
||||||
|
return findAll(ParamUtils.builder()
|
||||||
|
.equals("company", company.getId())
|
||||||
|
.between("setupDate", beginDate, endDate)
|
||||||
|
.build(), Pageable.unpaged()).getContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
List<CompanyContactVo> contacts = findAllByCompany(from, LocalDate.MIN, LocalDate.MAX);
|
||||||
|
if (contacts == null || contacts.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (CompanyContactVo contact : contacts) {
|
||||||
|
contact.setCompanyId(to.getId());
|
||||||
|
save(contact);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,12 @@ public class CompanyCustomerEntityService extends QueryService<CompanyCustomerEn
|
|||||||
.equals("customer", customer.getId()).build(), Pageable.unpaged())
|
.equals("customer", customer.getId()).build(), Pageable.unpaged())
|
||||||
.getContent();
|
.getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CustomerVo from, CustomerVo to) {
|
||||||
|
List<CompanyCustomerEntityVo> fromEntities = findAllByCustomer(from);
|
||||||
|
for (CompanyCustomerEntityVo fromEntity : fromEntities) {
|
||||||
|
fromEntity.setCustomerId(to.getId());
|
||||||
|
save(fromEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,18 +29,11 @@ public class CompanyCustomerEvaluationFormFileService
|
|||||||
* 根据客户文件查找评估表文件
|
* 根据客户文件查找评估表文件
|
||||||
*/
|
*/
|
||||||
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(CustomerFileVo customerFile) {
|
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(CustomerFileVo customerFile) {
|
||||||
return findByCustomerFile(customerFile.getId());
|
return findOneByProperty("customerFile", customerFile.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(Integer customerFileId) {
|
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(Integer customerFileId) {
|
||||||
List<CompanyCustomerEvaluationFormFileVo> page = findAll(ParamUtils.builder()
|
return findOneByProperty("customerFile", customerFileId);
|
||||||
.equals("customerFile", customerFileId)
|
|
||||||
.build(), Pageable.ofSize(1))
|
|
||||||
.getContent();
|
|
||||||
if (page.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return page.getFirst();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CompanyCustomerEvaluationFormFileVo> searchByCompany(Integer companyId, String searchText) {
|
public List<CompanyCustomerEvaluationFormFileVo> searchByCompany(Integer companyId, String searchText) {
|
||||||
|
|||||||
@@ -121,4 +121,12 @@ public class CompanyCustomerFileService extends QueryService<CustomerFileVo, Cus
|
|||||||
public CustomerFileVo save(CustomerFileVo entity) {
|
public CustomerFileVo save(CustomerFileVo entity) {
|
||||||
return super.save(entity);
|
return super.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CustomerVo from, CustomerVo to) {
|
||||||
|
List<CustomerFileVo> fromFiles = findAllByCustomer(from);
|
||||||
|
for (CustomerFileVo fromFile : fromFiles) {
|
||||||
|
fromFile.setCustomer(to.getId());
|
||||||
|
save(fromFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import javafx.util.StringConverter;
|
|||||||
@CacheConfig(cacheNames = "company-customer-file-type")
|
@CacheConfig(cacheNames = "company-customer-file-type")
|
||||||
public class CompanyCustomerFileTypeService
|
public class CompanyCustomerFileTypeService
|
||||||
extends QueryService<CustomerFileTypeLocalVo, CompanyCustomerFileTypeLocalViewModel> {
|
extends QueryService<CustomerFileTypeLocalVo, CompanyCustomerFileTypeLocalViewModel> {
|
||||||
private final StringConverter<CustomerFileTypeLocalVo> stringConverter = new CustomerFileTypeStringConverter(this);
|
private final CustomerFileTypeStringConverter stringConverter = new CustomerFileTypeStringConverter(this);
|
||||||
|
|
||||||
@Cacheable(key = "#p0")
|
@Cacheable(key = "#p0")
|
||||||
@Override
|
@Override
|
||||||
@@ -39,13 +39,13 @@ public class CompanyCustomerFileTypeService
|
|||||||
return super.findAll();
|
return super.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(put = { @CachePut(key = "#p0.id"), @CachePut(key = "'all'") })
|
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||||
@Override
|
@Override
|
||||||
public CustomerFileTypeLocalVo save(CustomerFileTypeLocalVo entity) {
|
public CustomerFileTypeLocalVo save(CustomerFileTypeLocalVo entity) {
|
||||||
return super.save(entity);
|
return super.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(put = { @CachePut(key = "#p0.id"), @CachePut(key = "'all'") })
|
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||||
@Override
|
@Override
|
||||||
public void delete(CustomerFileTypeLocalVo entity) {
|
public void delete(CustomerFileTypeLocalVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
@@ -53,8 +53,7 @@ public class CompanyCustomerFileTypeService
|
|||||||
|
|
||||||
@Cacheable
|
@Cacheable
|
||||||
public Map<CustomerFileType, CustomerFileTypeLocalVo> findAll(Locale locale) {
|
public Map<CustomerFileType, CustomerFileTypeLocalVo> findAll(Locale locale) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = ParamUtils.builder().equals("lang", locale.toLanguageTag()).build();
|
||||||
params.put("lang", locale.toLanguageTag());
|
|
||||||
return findAll(params, Pageable.unpaged()).stream()
|
return findAll(params, Pageable.unpaged()).stream()
|
||||||
.collect(Collectors.toMap(CustomerFileTypeLocalVo::getType, Function.identity()));
|
.collect(Collectors.toMap(CustomerFileTypeLocalVo::getType, Function.identity()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.CompanyInvoiceInfoViewModel;
|
import com.ecep.contract.vm.CompanyInvoiceInfoViewModel;
|
||||||
import com.ecep.contract.vo.CompanyInvoiceInfoVo;
|
import com.ecep.contract.vo.CompanyInvoiceInfoVo;
|
||||||
import com.ecep.contract.vo.CompanyVo;
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
@@ -15,9 +16,8 @@ import java.util.Map;
|
|||||||
public class CompanyInvoiceInfoService extends QueryService<CompanyInvoiceInfoVo, CompanyInvoiceInfoViewModel> {
|
public class CompanyInvoiceInfoService extends QueryService<CompanyInvoiceInfoVo, CompanyInvoiceInfoViewModel> {
|
||||||
|
|
||||||
public List<CompanyInvoiceInfoVo> searchByCompany(CompanyVo company, String searchText) {
|
public List<CompanyInvoiceInfoVo> searchByCompany(CompanyVo company, String searchText) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = ParamUtils.builder().equals("company", company.getId())
|
||||||
params.put("company", company);
|
.search(searchText).build();
|
||||||
params.put("searchText", searchText);
|
|
||||||
return findAll(params, Pageable.unpaged()).getContent();
|
return findAll(params, Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.io.File;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.MyStringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -70,24 +71,29 @@ public class CompanyOldNameService extends QueryService<CompanyOldNameVo, Compan
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CompanyOldNameVo findMatchByDate(CompanyVo company, LocalDate localDate) {
|
public CompanyOldNameVo findMatchByDate(CompanyVo company, LocalDate localDate) {
|
||||||
Page<CompanyOldNameVo> page = findAll(ParamUtils.builder()
|
findAll(ParamUtils.builder()
|
||||||
.equals("ambiguity", false)
|
|
||||||
.equals("company", company.getId())
|
.equals("company", company.getId())
|
||||||
.and(b -> b.isNotNull("beginDate").greaterThan("beginDate", localDate))
|
.equals("ambiguity", true)
|
||||||
.and(b -> b.isNotNull("endDate").lessThan("endDate", localDate))
|
.isNotNull("beginDate")
|
||||||
.build(), Pageable.ofSize(1));
|
.build(), Pageable.unpaged()).getContent();
|
||||||
if (page.isEmpty()) {
|
return null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return page.getContent().getFirst();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CompanyOldNameVo> findAllByCompanyAndName(CompanyVo company, String oldName) {
|
public List<CompanyOldNameVo> findAllByCompanyAndName(CompanyVo company, String oldName) {
|
||||||
return findAll(ParamUtils.builder().equals("company", company.getId()).equals("oldName", oldName).build(),
|
return findAll(ParamUtils.builder().equals("company", company.getId()).equals("name", oldName).build(),
|
||||||
Pageable.unpaged()).getContent();
|
Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CompanyOldNameVo> findAllByCompany(IdentityEntity company) {
|
public List<CompanyOldNameVo> findAllByCompany(IdentityEntity company) {
|
||||||
return findAll(ParamUtils.equal("company", company.getId()), Pageable.unpaged()).getContent();
|
return findAll(ParamUtils.equal("company", company.getId()), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
List<CompanyOldNameVo> fromOldNames = findAllByCompany(from);
|
||||||
|
for (CompanyOldNameVo fromOldName : fromOldNames) {
|
||||||
|
fromOldName.setMemo(MyStringUtils.appendIfAbsent(fromOldName.getMemo(), "转自 " + from.getId()));
|
||||||
|
fromOldName.setCompanyId(to.getId());
|
||||||
|
save(fromOldName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.ecep.contract.SpringApp;
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
@@ -57,14 +59,26 @@ public class CompanyService extends QueryService<CompanyVo, CompanyViewModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<CompanyVo> findAllByName(String name) {
|
public List<CompanyVo> findAllByName(String name) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = ParamUtils.builder().equals("name", name).build();
|
||||||
params.put("name", name);
|
|
||||||
return findAll(params, Pageable.unpaged()).getContent();
|
return findAll(params, Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void merge(CompanyVo company, CompanyVo updater) {
|
public void merge(CompanyVo from, CompanyVo to) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'merge'");
|
SpringApp.getBean(CloudRkService.class).mergeTo(from, to);
|
||||||
|
SpringApp.getBean(CloudTycService.class).mergeTo(from, to);
|
||||||
|
SpringApp.getBean(YongYouU8Service.class).mergeTo(from, to);
|
||||||
|
|
||||||
|
SpringApp.getBean(CompanyOldNameService.class).mergeTo(from, to);
|
||||||
|
SpringApp.getBean(CompanyContactService.class).mergeTo(from, to);
|
||||||
|
|
||||||
|
// 供应商和客户
|
||||||
|
SpringApp.getBean(VendorService.class).mergeTo(from, to);
|
||||||
|
SpringApp.getBean(CustomerService.class).mergeTo(from, to);
|
||||||
|
|
||||||
|
SpringApp.getBean(ContractService.class).mergeTo(from, to);
|
||||||
|
SpringApp.getBean(CompanyContactService.class).mergeTo(from, to);
|
||||||
|
delete(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompanyVo createNewCompany(String newCompanyName) {
|
public CompanyVo createNewCompany(String newCompanyName) {
|
||||||
|
|||||||
@@ -13,6 +13,12 @@ import com.ecep.contract.vo.ContractVo;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ContractFileService extends QueryService<ContractFileVo, ContractFileViewModel> {
|
public class ContractFileService extends QueryService<ContractFileVo, ContractFileViewModel> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractFileVo findById(Integer id) {
|
||||||
|
return super.findById(id);
|
||||||
|
}
|
||||||
|
|
||||||
public List<ContractFileVo> findAllByContract(ContractVo contract) {
|
public List<ContractFileVo> findAllByContract(ContractVo contract) {
|
||||||
return findAll(ParamUtils.equal("contract", contract.getId()), Pageable.unpaged()).getContent();
|
return findAll(ParamUtils.equal("contract", contract.getId()), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.service;
|
|||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ import org.springframework.cache.annotation.CacheConfig;
|
|||||||
import org.springframework.cache.annotation.CachePut;
|
import org.springframework.cache.annotation.CachePut;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.cache.annotation.Caching;
|
import org.springframework.cache.annotation.Caching;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -37,13 +39,13 @@ public class ContractFileTypeService extends QueryService<ContractFileTypeLocalV
|
|||||||
return super.findAll();
|
return super.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(put = { @CachePut(key = "#p0.id"), @CachePut(key = "'all'") })
|
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||||
@Override
|
@Override
|
||||||
public ContractFileTypeLocalVo save(ContractFileTypeLocalVo entity) {
|
public ContractFileTypeLocalVo save(ContractFileTypeLocalVo entity) {
|
||||||
return super.save(entity);
|
return super.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(put = { @CachePut(key = "#p0.id"), @CachePut(key = "'all'") })
|
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||||
@Override
|
@Override
|
||||||
public void delete(ContractFileTypeLocalVo entity) {
|
public void delete(ContractFileTypeLocalVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
@@ -55,6 +57,10 @@ public class ContractFileTypeService extends QueryService<ContractFileTypeLocalV
|
|||||||
.collect(Collectors.toMap(ContractFileTypeLocalVo::getType, Function.identity()));
|
.collect(Collectors.toMap(ContractFileTypeLocalVo::getType, Function.identity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CompletableFuture<Page<ContractFileTypeLocalVo>> asyncFindAll(Locale locale) {
|
||||||
|
return asyncFindAll(ParamUtils.builder().equals("lang", locale.toLanguageTag()).build(), Pageable.unpaged());
|
||||||
|
}
|
||||||
|
|
||||||
@Cacheable
|
@Cacheable
|
||||||
public ContractFileTypeLocalVo findByType(Locale locale, ContractFileType type) {
|
public ContractFileTypeLocalVo findByType(Locale locale, ContractFileType type) {
|
||||||
return findAll(ParamUtils.builder().equals("lang", locale.toLanguageTag()).equals("type", type).build(), Pageable.ofSize(1)).stream().findFirst().orElse(null);
|
return findAll(ParamUtils.builder().equals("lang", locale.toLanguageTag()).equals("type", type).build(), Pageable.ofSize(1)).stream().findFirst().orElse(null);
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import java.time.LocalDate;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import com.ecep.contract.SpringApp;
|
||||||
|
import com.ecep.contract.util.MyStringUtils;
|
||||||
|
import com.ecep.contract.vo.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
@@ -20,10 +23,6 @@ import com.ecep.contract.constant.ContractConstant;
|
|||||||
import com.ecep.contract.util.ContractUtils;
|
import com.ecep.contract.util.ContractUtils;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.ContractViewModel;
|
import com.ecep.contract.vm.ContractViewModel;
|
||||||
import com.ecep.contract.vo.ContractFileVo;
|
|
||||||
import com.ecep.contract.vo.ContractVo;
|
|
||||||
import com.ecep.contract.vo.ProjectVo;
|
|
||||||
import com.ecep.contract.vo.VendorVo;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "contract")
|
@CacheConfig(cacheNames = "contract")
|
||||||
@@ -158,10 +157,24 @@ public class ContractService extends QueryService<ContractVo, ContractViewModel>
|
|||||||
.build(), Pageable.unpaged()).getContent();
|
.build(), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ContractVo> findAllByCompanyCustomer(CustomerVo customer, LocalDate beginDate, LocalDate endDate) {
|
||||||
|
return findAll(ParamUtils.builder()
|
||||||
|
.equals("company", customer.getCompanyId())
|
||||||
|
.between("setupDate", beginDate, endDate)
|
||||||
|
.build(), Pageable.unpaged()).getContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ContractVo> findAllByCompany(CompanyVo company, LocalDate beginDate, LocalDate endDate) {
|
||||||
|
return findAll(ParamUtils.builder()
|
||||||
|
.equals("company", company.getId())
|
||||||
|
.between("setupDate", beginDate, endDate)
|
||||||
|
.build(), Pageable.unpaged()).getContent();
|
||||||
|
}
|
||||||
|
|
||||||
public List<ContractVo> findAllSalesByProject(ProjectVo project) {
|
public List<ContractVo> findAllSalesByProject(ProjectVo project) {
|
||||||
return findAll(ParamUtils.builder()
|
return findAll(ParamUtils.builder()
|
||||||
.equals("parentCode", "")
|
.equals("parentCode", "")
|
||||||
.equals("project", project.getId()).build(),
|
.equals("project", project.getId()).build(),
|
||||||
Pageable.unpaged()).getContent();
|
Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,4 +196,18 @@ public class ContractService extends QueryService<ContractVo, ContractViewModel>
|
|||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'syncContractFile'");
|
throw new UnsupportedOperationException("Unimplemented method 'syncContractFile'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
|
||||||
|
List<ContractVo> contracts = findAllByCompany(from, LocalDate.MIN, LocalDate.MAX);
|
||||||
|
if (contracts == null || contracts.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ContractVo contract : contracts) {
|
||||||
|
contract.setDescription(MyStringUtils.appendIfAbsent(contract.getDescription(), "转自 " + from.getId()));
|
||||||
|
contract.setCompanyId(to.getId());
|
||||||
|
save(contract);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.ecep.contract.vm.ContractTypeViewModel;
|
import com.ecep.contract.vm.ContractTypeViewModel;
|
||||||
import com.ecep.contract.vo.ContractTypeVo;
|
import com.ecep.contract.vo.ContractTypeVo;
|
||||||
|
|
||||||
import javafx.util.StringConverter;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "contract-type")
|
@CacheConfig(cacheNames = "contract-type")
|
||||||
public class ContractTypeService extends QueryService<ContractTypeVo, ContractTypeViewModel> {
|
public class ContractTypeService extends QueryService<ContractTypeVo, ContractTypeViewModel> {
|
||||||
|
|||||||
@@ -30,11 +30,7 @@ public class CustomerService extends QueryService<CustomerVo, CompanyCustomerVie
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CustomerVo findByCompany(CompanyVo company) {
|
public CustomerVo findByCompany(CompanyVo company) {
|
||||||
Page<CustomerVo> page = findAll(ParamUtils.equal("company", company.getId()), Pageable.ofSize(1));
|
return findOneByProperty("company", company.getId());
|
||||||
if (page.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return page.getContent().getFirst();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,4 +136,43 @@ public class CustomerService extends QueryService<CustomerVo, CompanyCustomerVie
|
|||||||
// 替换文件名中的非法字符
|
// 替换文件名中的非法字符
|
||||||
return fileName.replaceAll("[/\\:*?\"<>|]", "_");
|
return fileName.replaceAll("[/\\:*?\"<>|]", "_");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
CustomerVo fromCustomer = findByCompany(from);
|
||||||
|
if (fromCustomer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomerVo toCustomer = findByCompany(to);
|
||||||
|
if (toCustomer == null) {
|
||||||
|
// 直接修改关联
|
||||||
|
fromCustomer.setCompanyId(to.getId());
|
||||||
|
save(fromCustomer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mergeTo(fromCustomer, toCustomer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合并客户
|
||||||
|
* 1. 删除源客户对象
|
||||||
|
* 2. 删除源客户对象关联的文件
|
||||||
|
* 3. 修改目标客户对象的关联公司
|
||||||
|
* 4. 修改目标客户对象的关联文件
|
||||||
|
*
|
||||||
|
* @param from
|
||||||
|
* @param to
|
||||||
|
*/
|
||||||
|
public void mergeTo(CustomerVo from, CustomerVo to) {
|
||||||
|
// file
|
||||||
|
CompanyCustomerFileService companyCustomerFileService = SpringApp.getBean(CompanyCustomerFileService.class);
|
||||||
|
companyCustomerFileService.mergeTo(from, to);
|
||||||
|
// entity
|
||||||
|
CompanyCustomerEntityService companyCustomerEntityService = SpringApp.getBean(CompanyCustomerEntityService.class);
|
||||||
|
companyCustomerEntityService.mergeTo(from, to);
|
||||||
|
// 删除源客户对象
|
||||||
|
delete(from);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,81 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.cache.annotation.Caching;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.ecep.contract.converter.DepartmentStringConverter;
|
||||||
import com.ecep.contract.vm.DepartmentViewModel;
|
import com.ecep.contract.vm.DepartmentViewModel;
|
||||||
import com.ecep.contract.vo.DepartmentVo;
|
import com.ecep.contract.vo.DepartmentVo;
|
||||||
|
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@CacheConfig(cacheNames = "department")
|
||||||
public class DepartmentService extends QueryService<DepartmentVo, DepartmentViewModel> {
|
public class DepartmentService extends QueryService<DepartmentVo, DepartmentViewModel> {
|
||||||
|
|
||||||
|
private final DepartmentStringConverter stringConverter = new DepartmentStringConverter(this);
|
||||||
|
|
||||||
|
@Cacheable(key = "#p0")
|
||||||
|
@Override
|
||||||
|
public DepartmentVo findById(Integer id) {
|
||||||
|
return super.findById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DepartmentVo findByName(String name) {
|
||||||
|
try {
|
||||||
|
return async("findByName", name, String.class).handle((response, ex) -> {
|
||||||
|
DepartmentVo newEntity = createNewEntity();
|
||||||
|
return updateValue(newEntity, response);
|
||||||
|
}).get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("查询实体失败" + name, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DepartmentVo findByCode(String code) {
|
||||||
|
try {
|
||||||
|
return async("findByCode", code, String.class).handle((response, ex) -> {
|
||||||
|
if (ex != null) {
|
||||||
|
throw new RuntimeException("远程方法+findByCode+调用失败", ex);
|
||||||
|
}
|
||||||
|
DepartmentVo newEntity = createNewEntity();
|
||||||
|
return updateValue(newEntity, response);
|
||||||
|
}).get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("查询实体失败" + code, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Cacheable(key = "'departments'")
|
||||||
|
@Override
|
||||||
|
public List<DepartmentVo> findAll() {
|
||||||
|
return super.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Caching(evict = {
|
||||||
|
@CacheEvict(key = "#p0.id"), @CacheEvict(key = "'departments'"),
|
||||||
|
})
|
||||||
|
@Override
|
||||||
|
public void delete(DepartmentVo entity) {
|
||||||
|
super.delete(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Caching(evict = {
|
||||||
|
@CacheEvict(key = "#p0.id"), @CacheEvict(key = "'departments'"),
|
||||||
|
})
|
||||||
|
@Override
|
||||||
|
public DepartmentVo save(DepartmentVo entity) {
|
||||||
|
return super.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StringConverter<DepartmentVo> getStringConverter() {
|
||||||
|
return stringConverter;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ecep.contract.vo.DepartmentVo;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
||||||
@@ -11,11 +15,38 @@ import com.ecep.contract.vo.FunctionVo;
|
|||||||
@Service
|
@Service
|
||||||
public class EmployeeRoleService extends QueryService<EmployeeRoleVo, EmployeeRoleViewModel> {
|
public class EmployeeRoleService extends QueryService<EmployeeRoleVo, EmployeeRoleViewModel> {
|
||||||
|
|
||||||
public List<FunctionVo> getFunctionsByRoleId(int roleId) {
|
public List<FunctionVo> getFunctionsByRole(EmployeeRoleVo role) {
|
||||||
// TODO Auto-generated method stub
|
try {
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'getFunctionsByRoleId'");
|
return async("getFunctionsByRoleId", role.getId(), Integer.class).handle((response, ex) -> {
|
||||||
|
if (ex != null) {
|
||||||
|
throw new RuntimeException("远程方法+getFunctionsByRoleId+调用失败", ex);
|
||||||
|
}
|
||||||
|
List<FunctionVo> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
objectMapper.readerForUpdating(list)
|
||||||
|
.forType(objectMapper.getTypeFactory().constructCollectionType(List.class, FunctionVo.class))
|
||||||
|
.readValue(response);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}).get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("查询实体失败, Function#" + role.getId(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void saveRoleFunctions(EmployeeRoleVo role, List<FunctionVo> functions) {
|
||||||
|
try {
|
||||||
|
async("saveRoleFunctions", new Object[]{role.getId(), functions.stream().mapToInt(FunctionVo::getId).toArray()}, new Object[]{Integer.class, Integer[].class}).handle((response, ex) -> {
|
||||||
|
if (ex != null) {
|
||||||
|
throw new RuntimeException("远程方法+saveRoleFunctions+调用失败", ex);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}).get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("保存角色的功能失败, 角色#" + role.getId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ public class ProjectSaleTypeService extends QueryService<ProjectSaleTypeVo, Proj
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ProjectSaleTypeVo findByCode(String code) {
|
public ProjectSaleTypeVo findByCode(String code) {
|
||||||
return findAll(ParamUtils.builder().equals("code", code).build(), Pageable.ofSize(1)).getContent().getFirst();
|
return findOneByProperty("code", code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectSaleTypeVo findByName(String name) {
|
public ProjectSaleTypeVo findByName(String name) {
|
||||||
return findAll(ParamUtils.builder().equals("name", name).build(), Pageable.ofSize(1)).getContent().getFirst();
|
return findOneByProperty("name", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Caching(evict = {@CacheEvict(key = "#p0.id")})
|
@Caching(evict = {@CacheEvict(key = "#p0.id")})
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.ecep.contract.service;
|
|||||||
import com.ecep.contract.PageArgument;
|
import com.ecep.contract.PageArgument;
|
||||||
import com.ecep.contract.PageContent;
|
import com.ecep.contract.PageContent;
|
||||||
import com.ecep.contract.WebSocketClientService;
|
import com.ecep.contract.WebSocketClientService;
|
||||||
|
import com.ecep.contract.constant.ServiceConstant;
|
||||||
import com.ecep.contract.model.IdentityEntity;
|
import com.ecep.contract.model.IdentityEntity;
|
||||||
import com.ecep.contract.model.NamedEntity;
|
import com.ecep.contract.model.NamedEntity;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
@@ -67,7 +68,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
@Override
|
@Override
|
||||||
public T save(T entity) {
|
public T save(T entity) {
|
||||||
try {
|
try {
|
||||||
return async("save", entity, entity.getClass().getName()).handle((response, ex) -> {
|
return async(ServiceConstant.SAVE_METHOD_NAME, entity, entity.getClass().getName()).handle((response, ex) -> {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
throw new RuntimeException("保存实体失败", ex);
|
throw new RuntimeException("保存实体失败", ex);
|
||||||
}
|
}
|
||||||
@@ -88,7 +89,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
@Override
|
@Override
|
||||||
public void delete(T entity) {
|
public void delete(T entity) {
|
||||||
try {
|
try {
|
||||||
async("delete", entity, entity.getClass().getName()).handle((response, ex) -> {
|
async(ServiceConstant.DELETE_METHOD_NAME, entity, entity.getClass().getName()).handle((response, ex) -> {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
throw new RuntimeException("删除实体失败", ex);
|
throw new RuntimeException("删除实体失败", ex);
|
||||||
}
|
}
|
||||||
@@ -117,7 +118,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<T> asyncFindById(Integer id) {
|
public CompletableFuture<T> asyncFindById(Integer id) {
|
||||||
return async("findById", id, Integer.class).handle((response, ex) -> {
|
return async(ServiceConstant.FIND_BY_ID_METHOD_NAME, id, Integer.class).handle((response, ex) -> {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
throw new RuntimeException("查询实体失败", ex);
|
throw new RuntimeException("查询实体失败", ex);
|
||||||
}
|
}
|
||||||
@@ -149,7 +150,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
*/
|
*/
|
||||||
public CompletableFuture<Page<T>> asyncFindAll(Map<String, Object> params, Pageable pageable) {
|
public CompletableFuture<Page<T>> asyncFindAll(Map<String, Object> params, Pageable pageable) {
|
||||||
// 调用async方法发送WebSocket请求,获取异步响应结果
|
// 调用async方法发送WebSocket请求,获取异步响应结果
|
||||||
return async("findAll", params, PageArgument.of(pageable)).handle((response, ex) -> {
|
return async(ServiceConstant.FIND_ALL_METHOD_NAME, params, PageArgument.of(pageable)).handle((response, ex) -> {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
throw new RuntimeException("远程方法+findAll+调用失败", ex);
|
throw new RuntimeException("远程方法+findAll+调用失败", ex);
|
||||||
}
|
}
|
||||||
@@ -188,8 +189,9 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
public T findOneByProperty(String propertyName, Object propertyValue) {
|
public T findOneByProperty(String propertyName, Object propertyValue) {
|
||||||
return findAll(ParamUtils.builder().equals(propertyName, propertyValue).build(), Pageable.ofSize(1)).stream()
|
ParamUtils.Builder paramBuilder = ParamUtils.builder().equals(propertyName, propertyValue);
|
||||||
.findFirst().orElse(null);
|
Page<T> page = findAll(paramBuilder.build(), Pageable.ofSize(1));
|
||||||
|
return page.stream().findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,7 +203,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
|||||||
public CompletableFuture<Long> asyncCount(Map<String, Object> params) {
|
public CompletableFuture<Long> asyncCount(Map<String, Object> params) {
|
||||||
// 调用async方法执行名为"count"的异步操作,传入参数params
|
// 调用async方法执行名为"count"的异步操作,传入参数params
|
||||||
// 使用handle方法处理异步操作的结果或异常
|
// 使用handle方法处理异步操作的结果或异常
|
||||||
return async("count", params).handle((response, ex) -> {
|
return async(ServiceConstant.COUNT_METHOD_NAME, params).handle((response, ex) -> {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
throw new RuntimeException("远程方法+count+调用失败", ex);
|
throw new RuntimeException("远程方法+count+调用失败", ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class SysConfService {
|
|||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
throw new RuntimeException("远程方法+findById+调用失败", ex);
|
throw new RuntimeException("远程方法+findById+调用失败", ex);
|
||||||
}
|
}
|
||||||
|
if (response == null || response.isNull()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
SysConf newEntity = new SysConf();
|
SysConf newEntity = new SysConf();
|
||||||
try {
|
try {
|
||||||
objectMapper.updateValue(newEntity, response);
|
objectMapper.updateValue(newEntity, response);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import com.ecep.contract.util.ParamUtils;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
@@ -12,13 +14,14 @@ public class VendorApprovedFileService
|
|||||||
extends QueryService<VendorApprovedFileVo, CompanyVendorApprovedFileViewModel> {
|
extends QueryService<VendorApprovedFileVo, CompanyVendorApprovedFileViewModel> {
|
||||||
|
|
||||||
public VendorApprovedFileVo findByName(VendorApprovedVo approvedList, String name) {
|
public VendorApprovedFileVo findByName(VendorApprovedVo approvedList, String name) {
|
||||||
// TODO Auto-generated method stub
|
return findOneByProperty(approvedList, "fileName", name);
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean reBuildingFiles(VendorApprovedVo list, MessageHolder holder) {
|
public VendorApprovedFileVo findOneByProperty(VendorApprovedVo list, String propertyName, Object propertyValue) {
|
||||||
// TODO Auto-generated method stub
|
return findAll(ParamUtils.builder()
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
|
.equals("list", list.getId())
|
||||||
|
.equals(propertyName, propertyValue)
|
||||||
|
.build(), Pageable.ofSize(1)).stream()
|
||||||
|
.findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ecep.contract.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ecep.contract.vo.VendorApprovedFileVo;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -23,4 +24,12 @@ public class VendorApprovedItemService
|
|||||||
.build(), Pageable.unpaged()).getContent();
|
.build(), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VendorApprovedItemVo findOneByProperty(VendorApprovedVo list, String propertyName, Object propertyValue) {
|
||||||
|
return findAll(ParamUtils.builder()
|
||||||
|
.equals("list", list.getId())
|
||||||
|
.equals(propertyName, propertyValue)
|
||||||
|
.build(), Pageable.ofSize(1)).stream()
|
||||||
|
.findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,23 +6,23 @@ import com.ecep.contract.MessageHolder;
|
|||||||
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
|
import com.ecep.contract.vm.CompanyVendorApprovedListViewModel;
|
||||||
import com.ecep.contract.vo.VendorApprovedVo;
|
import com.ecep.contract.vo.VendorApprovedVo;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class VendorApprovedService
|
public class VendorApprovedService
|
||||||
extends QueryService<VendorApprovedVo, CompanyVendorApprovedListViewModel> {
|
extends QueryService<VendorApprovedVo, CompanyVendorApprovedListViewModel> {
|
||||||
|
|
||||||
public boolean makePathAbsent(VendorApprovedVo list) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'makePathAbsent'");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean reBuildingFiles(VendorApprovedVo list, MessageHolder holder) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean existPath(VendorApprovedVo entity) {
|
public boolean existPath(VendorApprovedVo entity) {
|
||||||
// TODO Auto-generated method stub
|
try {
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'existPath'");
|
return async("existPath", entity.getId(), Integer.class).handle((response, ex) -> {
|
||||||
|
if (ex != null) {
|
||||||
|
throw new RuntimeException("远程方法+existPath+调用失败", ex);
|
||||||
|
}
|
||||||
|
return response != null && response.isBoolean() && response.asBoolean();
|
||||||
|
}).get();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,4 +49,12 @@ public class VendorEntityService extends QueryService<VendorEntityVo, CompanyVen
|
|||||||
// 确保返回正确的服务名称
|
// 确保返回正确的服务名称
|
||||||
return "vendorEntityService";
|
return "vendorEntityService";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(VendorVo from, VendorVo to) {
|
||||||
|
List<VendorEntityVo> fromEntities = findByVendor(from);
|
||||||
|
for (VendorEntityVo fromEntity : fromEntities) {
|
||||||
|
fromEntity.setVendorId(to.getId());
|
||||||
|
save(fromEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,33 +97,13 @@ public class VendorFileService extends QueryService<VendorFileVo, CompanyVendorF
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void verify(VendorVo companyVendor, LocalDate verifyDate, MessageHolder holder) {
|
public void verify(VendorVo companyVendor, LocalDate verifyDate, MessageHolder holder) {
|
||||||
// 查询所有评价表
|
|
||||||
List<VendorFileVo> files = findAllByVendorAndType(companyVendor, VendorFileType.EvaluationForm);
|
|
||||||
if (files == null || files.isEmpty()) {
|
|
||||||
holder.error("未见供应商评价");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检索 验证日期最近一年内的有效评价表,日期宽限7天
|
}
|
||||||
LocalDate begin = verifyDate.plusYears(-1);
|
|
||||||
VendorFileVo vendorFile = files.stream()
|
|
||||||
.filter(v -> v.getSignDate() != null && v.isValid())
|
|
||||||
.filter(v -> MyDateTimeUtils.dateValidFilter(v.getSignDate(), begin, verifyDate, 7))
|
|
||||||
.findFirst().orElse(null);
|
|
||||||
if (vendorFile == null) {
|
|
||||||
// 检索最后一个有效评价表
|
|
||||||
VendorFileVo latestFile = files.stream()
|
|
||||||
.filter(v -> v.getSignDate() != null && v.isValid())
|
|
||||||
.max(Comparator.comparing(VendorFileVo::getSignDate))
|
|
||||||
.orElse(null);
|
|
||||||
|
|
||||||
if (latestFile == null) {
|
public List<VendorFileVo> findAllByVendor(VendorVo vendor) {
|
||||||
holder.error("未匹配的供应商评价");
|
return findAll(ParamUtils.builder()
|
||||||
return;
|
.equals("vendor", vendor.getId())
|
||||||
}
|
.build(), Pageable.unpaged()).getContent();
|
||||||
// 提示评价表已过期
|
|
||||||
holder.error("供应商评价已过期:" + latestFile.getSignDate() + ", 检测日期:" + verifyDate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<VendorFileVo> findAllByVendorAndType(VendorVo vendor, VendorFileType type) {
|
public List<VendorFileVo> findAllByVendorAndType(VendorVo vendor, VendorFileType type) {
|
||||||
@@ -132,4 +112,12 @@ public class VendorFileService extends QueryService<VendorFileVo, CompanyVendorF
|
|||||||
.equals("type", type.name())
|
.equals("type", type.name())
|
||||||
.build(), Pageable.unpaged()).getContent();
|
.build(), Pageable.unpaged()).getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(VendorVo from, VendorVo to) {
|
||||||
|
List<VendorFileVo> fromFiles = findAllByVendor(from);
|
||||||
|
for (VendorFileVo fromFile : fromFiles) {
|
||||||
|
fromFile.setVendorId(to.getId());
|
||||||
|
save(fromFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
|
import com.ecep.contract.converter.VendorGroupStringConverter;
|
||||||
import com.ecep.contract.model.VendorGroup;
|
import com.ecep.contract.model.VendorGroup;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
import com.ecep.contract.util.ParamUtils;
|
||||||
import com.ecep.contract.vm.VendorGroupViewModel;
|
import com.ecep.contract.vm.VendorGroupViewModel;
|
||||||
import com.ecep.contract.vo.VendorGroupVo;
|
import com.ecep.contract.vo.VendorGroupVo;
|
||||||
|
import javafx.util.StringConverter;
|
||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
@@ -15,6 +17,8 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "vendor-group")
|
@CacheConfig(cacheNames = "vendor-group")
|
||||||
public class VendorGroupService extends QueryService<VendorGroupVo, VendorGroupViewModel> {
|
public class VendorGroupService extends QueryService<VendorGroupVo, VendorGroupViewModel> {
|
||||||
|
|
||||||
|
private VendorGroupStringConverter stringConverter = new VendorGroupStringConverter(this);
|
||||||
@Cacheable(key = "#id")
|
@Cacheable(key = "#id")
|
||||||
@Override
|
@Override
|
||||||
public VendorGroupVo findById(Integer id) {
|
public VendorGroupVo findById(Integer id) {
|
||||||
@@ -53,4 +57,9 @@ public class VendorGroupService extends QueryService<VendorGroupVo, VendorGroupV
|
|||||||
public void delete(VendorGroupVo entity) {
|
public void delete(VendorGroupVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VendorGroupStringConverter getStringConverter() {
|
||||||
|
return stringConverter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,5 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.cache.annotation.CacheConfig;
|
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
|
||||||
import org.springframework.cache.annotation.Caching;
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.SpringApp;
|
import com.ecep.contract.SpringApp;
|
||||||
import com.ecep.contract.VendorType;
|
import com.ecep.contract.VendorType;
|
||||||
@@ -21,11 +8,20 @@ import com.ecep.contract.model.VendorCatalog;
|
|||||||
import com.ecep.contract.util.CompanyUtils;
|
import com.ecep.contract.util.CompanyUtils;
|
||||||
import com.ecep.contract.util.FileUtils;
|
import com.ecep.contract.util.FileUtils;
|
||||||
import com.ecep.contract.util.MyStringUtils;
|
import com.ecep.contract.util.MyStringUtils;
|
||||||
import com.ecep.contract.util.ParamUtils;
|
|
||||||
import com.ecep.contract.vm.CompanyVendorViewModel;
|
import com.ecep.contract.vm.CompanyVendorViewModel;
|
||||||
import com.ecep.contract.vo.VendorVo;
|
|
||||||
import com.ecep.contract.vo.CompanyVo;
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
import com.ecep.contract.vo.ContractVo;
|
import com.ecep.contract.vo.ContractVo;
|
||||||
|
import com.ecep.contract.vo.VendorVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.cache.annotation.Caching;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@CacheConfig(cacheNames = "vendor")
|
@CacheConfig(cacheNames = "vendor")
|
||||||
@@ -47,22 +43,9 @@ public class VendorService extends QueryService<VendorVo, CompanyVendorViewModel
|
|||||||
return basePath;
|
return basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getVendorApprovedListTemplate() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'getVendorApprovedListTemplate'");
|
|
||||||
}
|
|
||||||
|
|
||||||
public VendorCatalog findCatalogById(Integer id) {
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'findCatalogById'");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Cacheable(key = "'company-'+#p0.id")
|
@Cacheable(key = "'company-'+#p0.id")
|
||||||
public VendorVo findByCompany(CompanyVo company) {
|
public VendorVo findByCompany(CompanyVo company) {
|
||||||
Page<VendorVo> page = findAll(ParamUtils.equal("company", company.getId()), Pageable.ofSize(1));
|
return findOneByProperty("company", company.getId());
|
||||||
if (page.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return page.getContent().getFirst();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void verify(ContractVo contract, MessageHolder holder) {
|
public void verify(ContractVo contract, MessageHolder holder) {
|
||||||
@@ -189,4 +172,32 @@ public class VendorService extends QueryService<VendorVo, CompanyVendorViewModel
|
|||||||
public void delete(VendorVo entity) {
|
public void delete(VendorVo entity) {
|
||||||
super.delete(entity);
|
super.delete(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
VendorVo fromCustomer = findByCompany(from);
|
||||||
|
if (fromCustomer == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
VendorVo toCustomer = findByCompany(to);
|
||||||
|
if (toCustomer == null) {
|
||||||
|
// 直接修改关联
|
||||||
|
fromCustomer.setCompanyId(to.getId());
|
||||||
|
save(fromCustomer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mergeTo(fromCustomer, toCustomer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mergeTo(VendorVo from, VendorVo to) {
|
||||||
|
// file
|
||||||
|
VendorFileService companyVendorFileService = SpringApp.getBean(VendorFileService.class);
|
||||||
|
companyVendorFileService.mergeTo(from, to);
|
||||||
|
// entity
|
||||||
|
VendorEntityService companyCustomerEntityService = SpringApp.getBean(VendorEntityService.class);
|
||||||
|
companyCustomerEntityService.mergeTo(from, to);
|
||||||
|
// 删除源客户对象
|
||||||
|
delete(from);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.ecep.contract.service;
|
package com.ecep.contract.service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.controlsfx.control.TaskProgressView;
|
import org.controlsfx.control.TaskProgressView;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -78,4 +81,15 @@ public class YongYouU8Service extends QueryService<CloudYuVo, CloudYuInfoViewMod
|
|||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Page<CloudYuVo> findAllByCompany(CompanyVo company) {
|
||||||
|
return findAll(ParamUtils.builder().equals("company", company.getId()).build(), Pageable.unpaged());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mergeTo(CompanyVo from, CompanyVo to) {
|
||||||
|
List<CloudYuVo> list = findAllByCompany(from).getContent();
|
||||||
|
for (CloudYuVo item : list) {
|
||||||
|
item.setCompanyId(to.getId());
|
||||||
|
save(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.vo.CompanyVo;
|
||||||
|
import javafx.application.Platform;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司合并客户端任务器
|
||||||
|
* 通过WebSocket连接与服务器端通信,执行公司合并操作
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CompanyMergeClientTasker extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private CompanyVo company;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private List<String> nameList;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return "CompanyMergeTask";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
|
return callRemoteTask(holder, getLocale(), company.getId(), nameList.toArray());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,21 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
public class ContractGroupSyncTask extends Tasker<Object>{
|
public class ContractGroupSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
@Override
|
@Override
|
||||||
public Object execute(MessageHolder holder) {
|
public String getTaskName() {
|
||||||
return null;
|
return "ContractGroupSyncTask";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object execute(MessageHolder holder) {
|
||||||
|
return callRemoteTask(holder, getLocale());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,23 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
|
public class ContractKindSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
public static final String TASK_NAME = "ContractKindSyncTask";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return TASK_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long workDone, long max) {
|
||||||
|
super.updateProgress(workDone, max);
|
||||||
|
}
|
||||||
|
|
||||||
public class ContractKindSyncTask extends Tasker<Object> {
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(MessageHolder holder) {
|
public Object execute(MessageHolder holder) {
|
||||||
return null;
|
return callRemoteTask(holder, getLocale());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,6 @@ public class ContractRepairAllTasker extends Tasker<Object> implements WebSocket
|
|||||||
super.updateProgress(current, total);
|
super.updateProgress(current, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateTitle(String title) {
|
|
||||||
// 使用Tasker的updateTitle方法更新标题
|
|
||||||
super.updateTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTaskName() {
|
public String getTaskName() {
|
||||||
return "ContractRepairAllTask";
|
return "ContractRepairAllTask";
|
||||||
@@ -34,6 +28,7 @@ public class ContractRepairAllTasker extends Tasker<Object> implements WebSocket
|
|||||||
logger.info("开始执行合同修复任务");
|
logger.info("开始执行合同修复任务");
|
||||||
updateTitle("合同数据修复");
|
updateTitle("合同数据修复");
|
||||||
Object result = callRemoteTask(holder, getLocale());
|
Object result = callRemoteTask(holder, getLocale());
|
||||||
|
|
||||||
logger.info("合同修复任务执行完成");
|
logger.info("合同修复任务执行完成");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,41 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同全量同步任务
|
||||||
|
* 通过WebSocket与服务器进行通信,实现合同数据的全量同步
|
||||||
|
*/
|
||||||
|
public class ContractSyncAllTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
private static final String TASK_NAME = "ContractSyncAllTask";
|
||||||
|
|
||||||
public class ContractSyncAllTask extends Tasker<Object> {
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(MessageHolder holder) {
|
public String getTaskName() {
|
||||||
return null;
|
return TASK_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object execute(MessageHolder holder) {
|
||||||
|
// 更新任务状态信息
|
||||||
|
updateTitle("开始合同全量同步任务");
|
||||||
|
holder.info("准备连接服务器进行合同数据同步...");
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 调用远程任务
|
||||||
|
Object result = callRemoteTask(holder, Locale.getDefault());
|
||||||
|
holder.info("合同全量同步任务完成");
|
||||||
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
holder.error("同步失败: " + e.getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
import com.ecep.contract.SpringApp;
|
|
||||||
import com.ecep.contract.WebSocketClientTasker;
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
import com.ecep.contract.service.YongYouU8Service;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同同步任务
|
* 合同同步任务
|
||||||
@@ -14,15 +12,6 @@ import com.ecep.contract.service.YongYouU8Service;
|
|||||||
public class ContractSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
public class ContractSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ContractSyncTask.class);
|
private static final Logger logger = LoggerFactory.getLogger(ContractSyncTask.class);
|
||||||
|
|
||||||
private YongYouU8Service yongYouU8Service;
|
|
||||||
|
|
||||||
private YongYouU8Service getYongYouU8Service() {
|
|
||||||
if (yongYouU8Service == null) {
|
|
||||||
yongYouU8Service = SpringApp.getBean(YongYouU8Service.class);
|
|
||||||
}
|
|
||||||
return yongYouU8Service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTaskName() {
|
public String getTaskName() {
|
||||||
return "ContractSyncTask";
|
return "ContractSyncTask";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,27 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同类型同步任务
|
||||||
|
*/
|
||||||
|
public class ContractTypeSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return "ContractTypeSyncTask";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
public class ContractTypeSyncTask extends Tasker<Object> {
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(MessageHolder holder) {
|
public Object execute(MessageHolder holder) {
|
||||||
return null;
|
// 调用远程WebSocket任务
|
||||||
|
return callRemoteTask(holder, Locale.getDefault());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,7 +373,10 @@ public class ContractVerifyComm implements BeanContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CompanyVo company = getCompanyService().findById(bidVendor.getCompanyId());
|
CompanyVo company = getCompanyService().findById(bidVendor.getCompanyId());
|
||||||
ContractFileVo contractFile = fileService.findById(bidVendor.getQuotationSheetFileId());
|
ContractFileVo contractFile = null;
|
||||||
|
if (bidVendor.getQuotationSheetFileId() != null) {
|
||||||
|
contractFile = fileService.findById(bidVendor.getQuotationSheetFileId());
|
||||||
|
}
|
||||||
// 报价表文件不存在
|
// 报价表文件不存在
|
||||||
if (contractFile == null) {
|
if (contractFile == null) {
|
||||||
if (requireQuotation && bidVendor.getCompanyId().equals(contract.getCompanyId())) {
|
if (requireQuotation && bidVendor.getCompanyId().equals(contract.getCompanyId())) {
|
||||||
|
|||||||
@@ -1,13 +1,32 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class CustomerClassSyncTask extends Tasker<Object> {
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
|
public class CustomerClassSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
public static final String TASK_NAME = "CustomerClassSyncTask";
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(CustomerClassSyncTask.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return TASK_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
// TODO Auto-generated method stub
|
updateTitle("用友U8系统-同步客户分类");
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'execute'");
|
return callRemoteTask(holder, Locale.getDefault());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显式重写 updateProgress 以解决方法隐藏冲突
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long workDone, long max) {
|
||||||
|
super.updateProgress(workDone, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,36 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同步客户任务
|
* 同步客户任务
|
||||||
*/
|
*/
|
||||||
public class CustomerSyncTask extends Tasker<Object> {
|
public class CustomerSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
|
||||||
|
public static final String TASK_NAME = "CustomerSyncTask";
|
||||||
private static final Logger logger = LoggerFactory.getLogger(CustomerSyncTask.class);
|
private static final Logger logger = LoggerFactory.getLogger(CustomerSyncTask.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return TASK_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显式重写 updateProgress 以解决方法隐藏冲突
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long workDone, long max) {
|
||||||
|
super.updateProgress(workDone, max);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
updateTitle("用友U8系统-同步客户");
|
updateTitle("用友U8系统-同步客户");
|
||||||
return null;
|
return callRemoteTask(holder, Locale.getDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,37 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class EmployeesSyncTask extends Tasker<Object> {
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工同步任务客户端实现
|
||||||
|
* 用于通过WebSocket与服务器通信,执行用友U8系统员工信息同步
|
||||||
|
*/
|
||||||
|
public class EmployeesSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EmployeesSyncTask.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return "EmployeesSyncTask";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
// TODO Auto-generated method stub
|
// 设置任务标题
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'execute'");
|
updateTitle("用友U8系统-同步员工信息");
|
||||||
}
|
|
||||||
|
|
||||||
|
// 更新任务消息
|
||||||
|
updateMessage("开始执行员工信息同步...");
|
||||||
|
|
||||||
|
// 调用远程WebSocket任务
|
||||||
|
return callRemoteTask(holder, getLocale());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,11 @@ import java.util.HashMap;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import com.ecep.contract.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
|
||||||
import com.ecep.contract.Desktop;
|
|
||||||
import com.ecep.contract.Message;
|
|
||||||
import com.ecep.contract.MessageHolder;
|
|
||||||
import com.ecep.contract.SpringApp;
|
|
||||||
import com.ecep.contract.service.CompanyService;
|
import com.ecep.contract.service.CompanyService;
|
||||||
import com.ecep.contract.service.EmployeeService;
|
import com.ecep.contract.service.EmployeeService;
|
||||||
import com.ecep.contract.service.SysConfService;
|
import com.ecep.contract.service.SysConfService;
|
||||||
@@ -63,6 +60,22 @@ public abstract class Tasker<T> extends Task<T> {
|
|||||||
return currentUser;
|
return currentUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (this instanceof WebSocketClientTasker) {
|
||||||
|
this.getState();
|
||||||
|
}
|
||||||
|
super.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean cancel(boolean mayInterruptIfRunning) {
|
||||||
|
if (this instanceof WebSocketClientTasker) {
|
||||||
|
((WebSocketClientTasker) this).cancelTask();
|
||||||
|
}
|
||||||
|
return super.cancel(mayInterruptIfRunning);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected T call() throws Exception {
|
protected T call() throws Exception {
|
||||||
MessageHolderImpl holder = new MessageHolderImpl();
|
MessageHolderImpl holder = new MessageHolderImpl();
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
import com.ecep.contract.vo.VendorApprovedVo;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合格供方名录生成路径任务器客户端实现
|
||||||
|
* 用于通过WebSocket与服务器通信,为合格供方名录生成文件路径
|
||||||
|
*/
|
||||||
|
public class VendorApprovedListMakePathTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(VendorApprovedListMakePathTask.class);
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
private VendorApprovedVo approvedList;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
protected boolean modified = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return "VendorApprovedListMakePathTask";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
|
updateTitle("生成合格供方名录文件路径");
|
||||||
|
if (approvedList == null) {
|
||||||
|
holder.addMessage(java.util.logging.Level.SEVERE, "合格供方名录信息不能为空");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return callRemoteTask(holder, getLocale(), approvedList.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理从服务器返回的修改状态
|
||||||
|
* 当服务器端更新此属性时,客户端会接收到更新
|
||||||
|
*
|
||||||
|
* @param modified 文件是否被修改
|
||||||
|
*/
|
||||||
|
public void setModified(boolean modified) {
|
||||||
|
this.modified = modified;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +1,28 @@
|
|||||||
package com.ecep.contract.task;
|
package com.ecep.contract.task;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
|
public class VendorClassSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
|
public static final String TASK_NAME = "VendorClassSyncTask";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return TASK_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
// 直接使用父类的updateProgress方法
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
public class VendorClassSyncTask extends Tasker<Object> {
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(MessageHolder holder) {
|
public Object execute(MessageHolder holder) {
|
||||||
return null;
|
// 使用callRemoteTask调用远程任务
|
||||||
|
updateTitle("用友U8系统-同步供应商分类");
|
||||||
|
return callRemoteTask(holder, Locale.getDefault());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,28 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.ecep.contract.MessageHolder;
|
import com.ecep.contract.MessageHolder;
|
||||||
|
import com.ecep.contract.WebSocketClientTasker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商同步任务
|
* 供应商同步任务
|
||||||
*/
|
*/
|
||||||
public class VendorSyncTask extends Tasker<Object> {
|
public class VendorSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(VendorSyncTask.class);
|
private static final Logger logger = LoggerFactory.getLogger(VendorSyncTask.class);
|
||||||
|
private static final String TASK_NAME = "VendorSyncTask";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTaskName() {
|
||||||
|
return TASK_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProgress(long current, long total) {
|
||||||
|
super.updateProgress(current, total);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object execute(MessageHolder holder) throws Exception {
|
protected Object execute(MessageHolder holder) throws Exception {
|
||||||
updateTitle("用友U8系统-同步供应商");
|
updateTitle("用友U8系统-同步供应商");
|
||||||
return null;
|
return callRemoteTask(holder, getLocale());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ package com.ecep.contract.util;
|
|||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import com.ecep.contract.constant.ServiceConstant;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import com.ecep.contract.constant.ParamConstant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数工具类,用于构建查询条件参数
|
* 参数工具类,用于构建查询条件参数
|
||||||
@@ -15,64 +17,65 @@ public class ParamUtils {
|
|||||||
/**
|
/**
|
||||||
* 创建日期范围查询参数
|
* 创建日期范围查询参数
|
||||||
*
|
*
|
||||||
* @param key 查询字段名
|
* @param field 查询字段名
|
||||||
* @param begin 开始日期
|
* @param begin 开始日期
|
||||||
* @param end 结束日期
|
* @param end 结束日期
|
||||||
* @return 包含日期范围的查询参数Map
|
* @return 包含日期范围的查询参数Map
|
||||||
*/
|
*/
|
||||||
public static Map<String, Object> between(String key, LocalDate begin, LocalDate end) {
|
public static Map<String, Object> between(String field, LocalDate begin, LocalDate end) {
|
||||||
return Map.of(key, Map.of(
|
Builder builder = builder();
|
||||||
"begin", begin,
|
builder.between(field, begin, end);
|
||||||
"end", end));
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建等于条件查询参数
|
* 创建等于条件查询参数
|
||||||
*
|
*
|
||||||
* @param key 查询字段名
|
* @param field 查询字段名
|
||||||
* @param value 查询值
|
* @param value 查询值
|
||||||
* @return 包含等于条件的查询参数Map
|
* @return 包含等于条件的查询参数Map
|
||||||
*/
|
*/
|
||||||
public static Map<String, Object> equal(String key, Object value) {
|
public static Map<String, Object> equal(String field, Object value) {
|
||||||
return Map.of(key, value);
|
Builder builder = builder();
|
||||||
|
builder.equals(field, value);
|
||||||
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建字符串模糊查询参数
|
* 创建字符串模糊查询参数
|
||||||
*
|
*
|
||||||
* @param key 查询字段名
|
* @param field 查询字段名
|
||||||
* @param value 模糊查询的字符串值
|
* @param value 模糊查询的字符串值
|
||||||
* @return 包含模糊查询条件的查询参数Map
|
* @return 包含模糊查询条件的查询参数Map
|
||||||
*/
|
*/
|
||||||
public static Map<String, Object> like(String key, String value) {
|
public static Map<String, Object> contains(String field, String value, boolean caseSensitive) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Builder builder = builder();
|
||||||
params.put(key, "%" + value + "%");
|
builder.and().like(field, value, ParamConstant.Mode.CONTAINS, caseSensitive, false);
|
||||||
return params;
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static Map<String, Object> startsWith(String field, String value, boolean caseSensitive) {
|
||||||
* 创建日期模糊查询参数
|
Builder builder = builder();
|
||||||
*
|
builder.and().like(field, value, ParamConstant.Mode.STARTS_WITH, caseSensitive, false);
|
||||||
* @param key 查询字段名
|
return builder.build();
|
||||||
* @param value 模糊查询的日期值
|
}
|
||||||
* @return 包含日期模糊查询条件的查询参数Map
|
|
||||||
*/
|
public static Map<String, Object> endsWith(String field, String value, boolean caseSensitive) {
|
||||||
public static Map<String, Object> like(String key, LocalDate value) {
|
Builder builder = builder();
|
||||||
Map<String, Object> params = new HashMap<>();
|
builder.and().like(field, value, ParamConstant.Mode.ENDS_WITH, caseSensitive, false);
|
||||||
params.put(key, "%" + value + "%");
|
return builder.build();
|
||||||
return params;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建非空条件查询参数
|
* 创建非空条件查询参数
|
||||||
*
|
*
|
||||||
* @param key 查询字段名
|
* @param field 查询字段名
|
||||||
* @return 包含非空条件的查询参数Map
|
* @return 包含非空条件的查询参数Map
|
||||||
*/
|
*/
|
||||||
public static Map<String, Object> isNotNull(String key) {
|
public static Map<String, Object> isNotNull(String field) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Builder builder = builder();
|
||||||
params.put(key, Map.of("isNotNull", true));
|
builder.isNotNull(field);
|
||||||
return params;
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,9 +86,22 @@ public class ParamUtils {
|
|||||||
* @return 包含小于条件的查询参数Map
|
* @return 包含小于条件的查询参数Map
|
||||||
*/
|
*/
|
||||||
public static Map<String, Object> lessThan(String key, LocalDate value) {
|
public static Map<String, Object> lessThan(String key, LocalDate value) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Builder builder = builder();
|
||||||
params.put(key, Map.of("lessThan", value));
|
builder.lessThan(key, value);
|
||||||
return params;
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建大于条件的日期查询参数
|
||||||
|
*
|
||||||
|
* @param key 查询字段名
|
||||||
|
* @param value 比较的日期值
|
||||||
|
* @return 包含大于条件的查询参数Map
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> greaterThan(String key, LocalDate value) {
|
||||||
|
Builder builder = builder();
|
||||||
|
builder.greaterThan(key, value);
|
||||||
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +119,8 @@ public class ParamUtils {
|
|||||||
*/
|
*/
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
// 存储构建的查询参数
|
// 存储构建的查询参数
|
||||||
private Map<String, Object> params = new HashMap<>();
|
private String searchText;
|
||||||
|
private FilterGroup group;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 私有构造方法,防止外部直接实例化
|
* 私有构造方法,防止外部直接实例化
|
||||||
@@ -119,7 +136,7 @@ public class ParamUtils {
|
|||||||
* @return 当前Builder实例,支持链式调用
|
* @return 当前Builder实例,支持链式调用
|
||||||
*/
|
*/
|
||||||
public Builder isNotNull(String key) {
|
public Builder isNotNull(String key) {
|
||||||
params.put(key, Map.of("isNotNull", true));
|
getDefaultGroup().isNotNull(key);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +148,7 @@ public class ParamUtils {
|
|||||||
* @return 当前Builder实例,支持链式调用
|
* @return 当前Builder实例,支持链式调用
|
||||||
*/
|
*/
|
||||||
public Builder lessThan(String key, LocalDate value) {
|
public Builder lessThan(String key, LocalDate value) {
|
||||||
params.put(key, Map.of("lessThan", value));
|
getDefaultGroup().lessThan(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +160,7 @@ public class ParamUtils {
|
|||||||
* @return 当前Builder实例,支持链式调用
|
* @return 当前Builder实例,支持链式调用
|
||||||
*/
|
*/
|
||||||
public Builder greaterThan(String key, LocalDate value) {
|
public Builder greaterThan(String key, LocalDate value) {
|
||||||
params.put(key, Map.of("greaterThan", value));
|
getDefaultGroup().greaterThan(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +172,7 @@ public class ParamUtils {
|
|||||||
* @return 当前Builder实例,支持链式调用
|
* @return 当前Builder实例,支持链式调用
|
||||||
*/
|
*/
|
||||||
public Builder equals(String key, Object value) {
|
public Builder equals(String key, Object value) {
|
||||||
params.put(key, value);
|
getDefaultGroup().equals(key, value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,13 +185,16 @@ public class ParamUtils {
|
|||||||
* @return 当前Builder实例,支持链式调用
|
* @return 当前Builder实例,支持链式调用
|
||||||
*/
|
*/
|
||||||
public Builder between(String key, LocalDate begin, LocalDate end) {
|
public Builder between(String key, LocalDate begin, LocalDate end) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
getDefaultGroup().between(key, begin, end);
|
||||||
params.put("begin", begin);
|
|
||||||
params.put("end", end);
|
|
||||||
this.params.put(key, params);
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FilterGroup getDefaultGroup() {
|
||||||
|
if (group != null) {
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
return and();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加全文搜索条件到构建器
|
* 添加全文搜索条件到构建器
|
||||||
@@ -183,45 +203,343 @@ public class ParamUtils {
|
|||||||
* @return 当前Builder实例,支持链式调用
|
* @return 当前Builder实例,支持链式调用
|
||||||
*/
|
*/
|
||||||
public Builder search(String searchText) {
|
public Builder search(String searchText) {
|
||||||
params.put(ServiceConstant.KEY_SEARCH_TEXT, searchText);
|
this.searchText = searchText;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建并返回查询参数Map
|
* 构建并返回查询参数Map
|
||||||
|
* 推荐的结构(仅为契约示例,服务端需配套解析):
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* "searchText": "关键词",
|
||||||
|
* "filter": {
|
||||||
|
* "op": "and",
|
||||||
|
* "conditions": [
|
||||||
|
* { "field": "code", "op": "equal", "value": "V-0001" },
|
||||||
|
* {
|
||||||
|
* "field": "createdDate",
|
||||||
|
* "op": "between",
|
||||||
|
* "value": {
|
||||||
|
* "begin": "2024-01-01",
|
||||||
|
* "end": "2024-12-31",
|
||||||
|
* "includeBegin": true,
|
||||||
|
* "includeEnd": false
|
||||||
|
* }
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "field": "name",
|
||||||
|
* "op": "like",
|
||||||
|
* "value": "元素",
|
||||||
|
* "mode": "contains",
|
||||||
|
* "caseSensitive": false
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "op": "or",
|
||||||
|
* "conditions": [
|
||||||
|
* { "field": "name", "op": "like", "value": "元素", "mode": "contains", "caseSensitive": false },
|
||||||
|
* { "field": "abbName", "op": "like", "value": "元素", "mode": "contains", "caseSensitive": false }
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* ]
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* 约定说明:
|
||||||
|
* - 分组节点:{ op: "and"|"or", conditions: [...] }
|
||||||
|
* - 叶子条件:{ field: "路径", op: "equal"|"between"|..., value: ... }
|
||||||
|
* - like 扩展:支持 mode("contains"|"startsWith"|"endsWith") 和
|
||||||
|
* caseSensitive(boolean)
|
||||||
|
* - between 扩展:value 为对象,支持包含边界 includeBegin/includeEnd
|
||||||
*
|
*
|
||||||
* @return 包含所有添加条件的查询参数Map
|
* @return 包含所有添加条件的查询参数Map
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> build() {
|
public Map<String, Object> build() {
|
||||||
return params;
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
if (StringUtils.hasText(searchText)) {
|
||||||
|
map.put(ParamConstant.KEY_SEARCH_TEXT, searchText);
|
||||||
|
}
|
||||||
|
if (group != null) {
|
||||||
|
Map<String, Object> filter = new HashMap<>();
|
||||||
|
filter.put(ParamConstant.KEY_OPERATOR, group.operator.name().toLowerCase());
|
||||||
|
filter.put(ParamConstant.KEY_CONDITIONS, group.conditions);
|
||||||
|
map.put(ParamConstant.KEY_FILTER, filter);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加AND逻辑条件组到构建器
|
* 添加AND逻辑条件组到构建器
|
||||||
*
|
*
|
||||||
* @param consumer Builder消费者,用于构建子条件
|
* @return 新建的分组实例,支持链式调用添加子条件
|
||||||
* @return 当前Builder实例,支持链式调用
|
|
||||||
*/
|
*/
|
||||||
public Builder and(Consumer<Builder> consumer) {
|
public FilterGroup and() {
|
||||||
Builder builder = new Builder();
|
if (group == null) {
|
||||||
consumer.accept(builder);
|
group = new FilterGroup(ParamConstant.Operator.AND);
|
||||||
params.put("and", builder);
|
} else {
|
||||||
return this;
|
if (group.operator != ParamConstant.Operator.AND) {
|
||||||
|
throw new IllegalArgumentException(" 当前是 " + group.operator + " 条件组不允许修改为 AND 条件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加OR逻辑条件组到构建器
|
* 添加OR逻辑条件组到构建器
|
||||||
*
|
*
|
||||||
* @param consumer Builder消费者,用于构建子条件
|
* @return 新建的分组实例,支持链式调用添加子条件
|
||||||
* @return 当前Builder实例,支持链式调用
|
|
||||||
*/
|
*/
|
||||||
public Builder or(Consumer<Builder> consumer) {
|
public FilterGroup or() {
|
||||||
Builder builder = new Builder();
|
if (group == null) {
|
||||||
consumer.accept(builder);
|
group = new FilterGroup(ParamConstant.Operator.OR);
|
||||||
params.put("or", builder);
|
} else {
|
||||||
return this;
|
if (group.operator != ParamConstant.Operator.OR) {
|
||||||
|
throw new IllegalArgumentException(" 当前是 " + group.operator + " 条件组不允许修改为 OR 条件");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤条件组,支持 AND/OR 逻辑组合
|
||||||
|
*/
|
||||||
|
public static class FilterGroup {
|
||||||
|
private ParamConstant.Operator operator = ParamConstant.Operator.AND;
|
||||||
|
List<Map<String, Object>> conditions = new java.util.ArrayList<>();
|
||||||
|
|
||||||
|
public FilterGroup(ParamConstant.Operator operator) {
|
||||||
|
this.operator = operator;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:equal(支持 ignoreNull)
|
||||||
|
public FilterGroup equals(String field, Object value) {
|
||||||
|
return equals(field, value, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup equals(String field, Object value, boolean ignoreNull) {
|
||||||
|
if (ignoreNull && isNullOrEmpty(value)) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_equal);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, value);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:between(对象形式 + 边界 + ignoreNull)
|
||||||
|
public FilterGroup between(String field, LocalDate begin, LocalDate end) {
|
||||||
|
return between(field, begin, end, true, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup between(String field, LocalDate begin, LocalDate end,
|
||||||
|
boolean includeBegin, boolean includeEnd, boolean ignoreNull) {
|
||||||
|
boolean noBegin = begin == null;
|
||||||
|
boolean noEnd = end == null;
|
||||||
|
if (ignoreNull && noBegin && noEnd) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> value = new HashMap<>();
|
||||||
|
if (!noBegin) {
|
||||||
|
value.put(ParamConstant.KEY_between_begin, begin);
|
||||||
|
}
|
||||||
|
if (!noEnd) {
|
||||||
|
value.put(ParamConstant.KEY_between_end, end);
|
||||||
|
}
|
||||||
|
value.put(ParamConstant.KEY_INCLUDE_BEGIN, includeBegin);
|
||||||
|
value.put(ParamConstant.KEY_INCLUDE_END, includeEnd);
|
||||||
|
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_BETWEEN);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, value);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:lessThan(支持 ignoreNull)
|
||||||
|
public FilterGroup lessThan(String field, LocalDate value) {
|
||||||
|
return lessThan(field, value, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup lessThan(String field, LocalDate value, boolean ignoreNull) {
|
||||||
|
if (ignoreNull && value == null) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_lessThan);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, value);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:greaterThan(支持 ignoreNull)
|
||||||
|
public FilterGroup greaterThan(String field, LocalDate value) {
|
||||||
|
return greaterThan(field, value, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup greaterThan(String field, LocalDate value, boolean ignoreNull) {
|
||||||
|
if (ignoreNull && value == null) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_greaterThan);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, value);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:isNotNull
|
||||||
|
public FilterGroup isNotNull(String field) {
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_isNotNull);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, true);
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:like(支持 mode/caseSensitive/ignoreNull)
|
||||||
|
public FilterGroup like(String field, String value) {
|
||||||
|
return like(field, value, ParamConstant.Mode.CONTAINS, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup like(String field, String value, ParamConstant.Mode mode, boolean caseSensitive,
|
||||||
|
boolean ignoreNull) {
|
||||||
|
if (ignoreNull && isNullOrEmpty(value)) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_like);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, value);
|
||||||
|
// 使用枚举值作为模式输出
|
||||||
|
leaf.put(ParamConstant.KEY_MODE, mode.name());
|
||||||
|
leaf.put(ParamConstant.KEY_CASE_SENSITIVE, caseSensitive);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:notLike(支持 mode/caseSensitive/ignoreNull)
|
||||||
|
public FilterGroup notLike(String field, String value) {
|
||||||
|
return notLike(field, value, ParamConstant.Mode.CONTAINS, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup notLike(String field, String value, ParamConstant.Mode mode, boolean caseSensitive,
|
||||||
|
boolean ignoreNull) {
|
||||||
|
if (ignoreNull && isNullOrEmpty(value)) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_notLike);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, value);
|
||||||
|
// 使用枚举值作为模式输出
|
||||||
|
leaf.put(ParamConstant.KEY_MODE, mode.name());
|
||||||
|
leaf.put(ParamConstant.KEY_CASE_SENSITIVE, caseSensitive);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:in(空集合防护 + ignoreNull)
|
||||||
|
public FilterGroup in(String field, java.util.Collection<?> values) {
|
||||||
|
return in(field, values, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup in(String field, java.util.Collection<?> values, boolean ignoreNull) {
|
||||||
|
if (ignoreNull && (values == null || values.isEmpty())) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_in);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, values);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加叶子条件:notIn(空集合防护 + ignoreNull)
|
||||||
|
public FilterGroup notIn(String field, java.util.Collection<?> values) {
|
||||||
|
return notIn(field, values, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup notIn(String field, java.util.Collection<?> values, boolean ignoreNull) {
|
||||||
|
if (ignoreNull && (values == null || values.isEmpty())) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
Map<String, Object> leaf = new HashMap<>();
|
||||||
|
leaf.put(ParamConstant.KEY_FIELD, field);
|
||||||
|
leaf.put(ParamConstant.KEY_OPERATOR, ParamConstant.KEY_notIn);
|
||||||
|
leaf.put(ParamConstant.KEY_VALUE, values);
|
||||||
|
if (ignoreNull) {
|
||||||
|
leaf.put(ParamConstant.KEY_IGNORE_NULL, true);
|
||||||
|
}
|
||||||
|
conditions.add(leaf);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 嵌套分组:and / or(保持原有行为)
|
||||||
|
public FilterGroup and() {
|
||||||
|
FilterGroup group = new FilterGroup(ParamConstant.Operator.AND);
|
||||||
|
Map<String, Object> child = new HashMap<>();
|
||||||
|
child.put(ParamConstant.KEY_OPERATOR, ParamConstant.Operator.AND.name().toLowerCase());
|
||||||
|
child.put(ParamConstant.KEY_CONDITIONS, group.conditions);
|
||||||
|
conditions.add(child);
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGroup or() {
|
||||||
|
FilterGroup group = new FilterGroup(ParamConstant.Operator.OR);
|
||||||
|
Map<String, Object> child = new HashMap<>();
|
||||||
|
child.put(ParamConstant.KEY_OPERATOR, ParamConstant.Operator.OR.name().toLowerCase());
|
||||||
|
child.put(ParamConstant.KEY_CONDITIONS, group.conditions);
|
||||||
|
conditions.add(child);
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 辅助:空值判断(String/Collection/Array/null)
|
||||||
|
private boolean isNullOrEmpty(Object value) {
|
||||||
|
if (value == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (value instanceof String s) {
|
||||||
|
return !org.springframework.util.StringUtils.hasText(s);
|
||||||
|
}
|
||||||
|
if (value instanceof java.util.Collection<?> c) {
|
||||||
|
return c.isEmpty();
|
||||||
|
}
|
||||||
|
if (value.getClass().isArray()) {
|
||||||
|
return java.lang.reflect.Array.getLength(value) == 0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import java.io.PrintWriter;
|
|||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@@ -209,7 +211,6 @@ public class UITools {
|
|||||||
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
box.getChildren().add(progressBar);
|
box.getChildren().add(progressBar);
|
||||||
System.out.println("add progressBar = " + progressBar);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// progressBar.disabledProperty().bind(task.runningProperty());
|
// progressBar.disabledProperty().bind(task.runningProperty());
|
||||||
@@ -221,15 +222,17 @@ public class UITools {
|
|||||||
|
|
||||||
if (task instanceof Tasker<?> tasker) {
|
if (task instanceof Tasker<?> tasker) {
|
||||||
// 提交任务
|
// 提交任务
|
||||||
Desktop.instance.getExecutorService().submit(tasker);
|
new Thread(tasker).start();
|
||||||
|
// try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) {
|
||||||
|
// executor.submit(tasker);
|
||||||
|
// System.out.println("executor = " + executor);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
if (init != null) {
|
if (init != null) {
|
||||||
init.accept(consumer::test);
|
init.accept(consumer::test);
|
||||||
}
|
}
|
||||||
dialog.showAndWait();
|
dialog.showAndWait();
|
||||||
if (task.isRunning()) {
|
task.cancel();
|
||||||
task.cancel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String printStackTrace(Throwable e) {
|
private static String printStackTrace(Throwable e) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.Objects;
|
|||||||
|
|
||||||
import com.ecep.contract.vo.CloudYuVo;
|
import com.ecep.contract.vo.CloudYuVo;
|
||||||
|
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
@@ -15,10 +16,6 @@ import lombok.EqualsAndHashCode;
|
|||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||||
/**
|
|
||||||
* 云端Id
|
|
||||||
*/
|
|
||||||
private SimpleStringProperty cloudId = new SimpleStringProperty();
|
|
||||||
/**
|
/**
|
||||||
* 公司ID
|
* 公司ID
|
||||||
*/
|
*/
|
||||||
@@ -28,15 +25,16 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
|||||||
*/
|
*/
|
||||||
private SimpleObjectProperty<LocalDateTime> latestUpdate = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<LocalDateTime> latestUpdate = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
private SimpleStringProperty vendorCode = new SimpleStringProperty();
|
private SimpleStringProperty exceptionMessage = new SimpleStringProperty();
|
||||||
private SimpleStringProperty vendorClassCode = new SimpleStringProperty();
|
|
||||||
private SimpleObjectProperty<LocalDate> vendorDevelopDate = new SimpleObjectProperty<>();
|
|
||||||
|
|
||||||
private SimpleStringProperty customerCode = new SimpleStringProperty();
|
private SimpleObjectProperty<LocalDate> vendorUpdateDate = new SimpleObjectProperty<>();
|
||||||
private SimpleStringProperty customerClassCode = new SimpleStringProperty();
|
private SimpleObjectProperty<LocalDate> customerUpdateDate = new SimpleObjectProperty<>();
|
||||||
private SimpleObjectProperty<LocalDate> customerDevelopDate = new SimpleObjectProperty<>();
|
|
||||||
|
|
||||||
private SimpleObjectProperty<LocalDateTime> cloudLatest = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<LocalDateTime> cloudLatest = new SimpleObjectProperty<>();
|
||||||
|
/**
|
||||||
|
* 是否激活
|
||||||
|
*/
|
||||||
|
private SimpleBooleanProperty active = new SimpleBooleanProperty();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version
|
* Version
|
||||||
@@ -46,11 +44,13 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
|||||||
@Override
|
@Override
|
||||||
protected void updateFrom(CloudYuVo info) {
|
protected void updateFrom(CloudYuVo info) {
|
||||||
super.updateFrom(info);
|
super.updateFrom(info);
|
||||||
vendorCode.set(info.getExceptionMessage());
|
company.set(info.getCompanyId());
|
||||||
vendorDevelopDate.set(info.getVendorUpdateDate());
|
exceptionMessage.set(info.getExceptionMessage());
|
||||||
customerDevelopDate.set(info.getCustomerUpdateDate());
|
vendorUpdateDate.set(info.getVendorUpdateDate());
|
||||||
|
customerUpdateDate.set(info.getCustomerUpdateDate());
|
||||||
cloudLatest.set(info.getCloudLatest());
|
cloudLatest.set(info.getCloudLatest());
|
||||||
latestUpdate.set(info.getLatestUpdate());
|
latestUpdate.set(info.getLatestUpdate());
|
||||||
|
active.set(info.isActive());
|
||||||
version.set(info.getVersion());
|
version.set(info.getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,16 +65,20 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
|||||||
|
|
||||||
private boolean copyTo_(CloudYuVo info) {
|
private boolean copyTo_(CloudYuVo info) {
|
||||||
boolean modified = false;
|
boolean modified = false;
|
||||||
if (!Objects.equals(info.getExceptionMessage(), vendorCode.get())) {
|
if (!Objects.equals(info.getCompanyId(), company.get())) {
|
||||||
info.setExceptionMessage(vendorCode.get());
|
info.setCompanyId(company.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(info.getVendorUpdateDate(), vendorDevelopDate.get())) {
|
if (!Objects.equals(info.getExceptionMessage(), exceptionMessage.get())) {
|
||||||
info.setVendorUpdateDate(vendorDevelopDate.get());
|
info.setExceptionMessage(exceptionMessage.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
if (!Objects.equals(info.getCustomerUpdateDate(), customerDevelopDate.get())) {
|
if (!Objects.equals(info.getVendorUpdateDate(), vendorUpdateDate.get())) {
|
||||||
info.setCustomerUpdateDate(customerDevelopDate.get());
|
info.setVendorUpdateDate(vendorUpdateDate.get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(info.getCustomerUpdateDate(), customerUpdateDate.get())) {
|
||||||
|
info.setCustomerUpdateDate(customerUpdateDate.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +90,10 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
|||||||
info.setLatestUpdate(latestUpdate.get());
|
info.setLatestUpdate(latestUpdate.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(info.isActive(), active.get())) {
|
||||||
|
info.setActive(active.get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
if (!Objects.equals(info.getVersion(), version.get())) {
|
if (!Objects.equals(info.getVersion(), version.get())) {
|
||||||
info.setVersion(version.get());
|
info.setVersion(version.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
|||||||
|
|
||||||
import com.ecep.contract.vo.CompanyBankAccountVo;
|
import com.ecep.contract.vo.CompanyBankAccountVo;
|
||||||
|
|
||||||
|
import javafx.beans.property.SimpleBooleanProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
@@ -15,8 +16,6 @@ import lombok.EqualsAndHashCode;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAccountVo>
|
public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAccountVo>
|
||||||
implements CompanyBasedViewModel {
|
implements CompanyBasedViewModel {
|
||||||
private SimpleIntegerProperty id = new SimpleIntegerProperty();
|
|
||||||
|
|
||||||
private SimpleObjectProperty<Integer> companyId = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<Integer> companyId = new SimpleObjectProperty<>();
|
||||||
private SimpleObjectProperty<Integer> bankId = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<Integer> bankId = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
@@ -24,25 +23,27 @@ public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAc
|
|||||||
private SimpleStringProperty account = new SimpleStringProperty();
|
private SimpleStringProperty account = new SimpleStringProperty();
|
||||||
|
|
||||||
private SimpleObjectProperty<LocalDate> created = new SimpleObjectProperty<>();
|
private SimpleObjectProperty<LocalDate> created = new SimpleObjectProperty<>();
|
||||||
|
private SimpleStringProperty description = new SimpleStringProperty();
|
||||||
|
private SimpleBooleanProperty active = new SimpleBooleanProperty();
|
||||||
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateFrom(CompanyBankAccountVo v) {
|
protected void updateFrom(CompanyBankAccountVo v) {
|
||||||
getId().set(v.getId());
|
super.updateFrom(v);
|
||||||
companyId.set(v.getCompanyId());
|
companyId.set(v.getCompanyId());
|
||||||
bankId.set(v.getBankId());
|
bankId.set(v.getBankId());
|
||||||
getOpeningBank().set(v.getOpeningBank());
|
getOpeningBank().set(v.getOpeningBank());
|
||||||
getAccount().set(v.getAccount());
|
getAccount().set(v.getAccount());
|
||||||
|
created.set(v.getCreated());
|
||||||
|
description.set(v.getDescription());
|
||||||
|
active.set(v.isActive());
|
||||||
|
version.set(v.getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean copyTo(CompanyBankAccountVo v) {
|
public boolean copyTo(CompanyBankAccountVo v) {
|
||||||
boolean modified = super.copyTo(v);
|
boolean modified = super.copyTo(v);
|
||||||
if (!Objects.equals(id.get(), v.getId())) {
|
|
||||||
v.setId(id.get());
|
|
||||||
modified = true;
|
|
||||||
}
|
|
||||||
if (!Objects.equals(companyId.get(), v.getCompanyId())) {
|
if (!Objects.equals(companyId.get(), v.getCompanyId())) {
|
||||||
v.setCompanyId(companyId.get());
|
v.setCompanyId(companyId.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
@@ -59,6 +60,18 @@ public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAc
|
|||||||
v.setAccount(account.get());
|
v.setAccount(account.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(created.get(), v.getCreated())) {
|
||||||
|
v.setCreated(created.get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(description.get(), v.getDescription())) {
|
||||||
|
v.setDescription(description.get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
if (!Objects.equals(active.get(), v.isActive())) {
|
||||||
|
v.setActive(active.get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
|||||||
import com.ecep.contract.vo.CompanyCustomerEvaluationFormFileVo;
|
import com.ecep.contract.vo.CompanyCustomerEvaluationFormFileVo;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -13,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CompanyCustomerEvaluationFormFileViewModel extends IdentityViewModel<CompanyCustomerEvaluationFormFileVo> {
|
public class CompanyCustomerEvaluationFormFileViewModel extends IdentityViewModel<CompanyCustomerEvaluationFormFileVo> {
|
||||||
|
|
||||||
private SimpleIntegerProperty customerFile = new SimpleIntegerProperty();
|
private SimpleObjectProperty<Integer> customerFile = new SimpleObjectProperty<>();
|
||||||
private SimpleStringProperty catalog = new SimpleStringProperty();
|
private SimpleStringProperty catalog = new SimpleStringProperty();
|
||||||
private SimpleStringProperty level = new SimpleStringProperty();
|
private SimpleStringProperty level = new SimpleStringProperty();
|
||||||
private SimpleIntegerProperty creditLevel = new SimpleIntegerProperty(0);
|
private SimpleIntegerProperty creditLevel = new SimpleIntegerProperty(0);
|
||||||
@@ -65,6 +66,7 @@ public class CompanyCustomerEvaluationFormFileViewModel extends IdentityViewMode
|
|||||||
if (vo.getScoreTemplateVersion() != null) {
|
if (vo.getScoreTemplateVersion() != null) {
|
||||||
scoreTemplateVersion.set(vo.getScoreTemplateVersion());
|
scoreTemplateVersion.set(vo.getScoreTemplateVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ public class ContractViewModel extends IdentityViewModel<ContractVo> {
|
|||||||
|
|
||||||
private SimpleStringProperty code = new SimpleStringProperty();
|
private SimpleStringProperty code = new SimpleStringProperty();
|
||||||
private SimpleStringProperty name = new SimpleStringProperty();
|
private SimpleStringProperty name = new SimpleStringProperty();
|
||||||
|
/**
|
||||||
|
* 名称是否锁定
|
||||||
|
*/
|
||||||
|
private SimpleBooleanProperty nameLocked = new SimpleBooleanProperty();
|
||||||
private SimpleStringProperty state = new SimpleStringProperty();
|
private SimpleStringProperty state = new SimpleStringProperty();
|
||||||
/**
|
/**
|
||||||
* 分组
|
* 分组
|
||||||
@@ -138,6 +142,7 @@ public class ContractViewModel extends IdentityViewModel<ContractVo> {
|
|||||||
getPayWay().set(c.getPayWay());
|
getPayWay().set(c.getPayWay());
|
||||||
getCode().set(c.getCode());
|
getCode().set(c.getCode());
|
||||||
getName().set(c.getName());
|
getName().set(c.getName());
|
||||||
|
getNameLocked().set(c.isNameLocked());
|
||||||
getState().set(c.getState());
|
getState().set(c.getState());
|
||||||
|
|
||||||
getGroup().set(c.getGroupId());
|
getGroup().set(c.getGroupId());
|
||||||
@@ -198,6 +203,10 @@ public class ContractViewModel extends IdentityViewModel<ContractVo> {
|
|||||||
contract.setName(name.get());
|
contract.setName(name.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(nameLocked.get(), contract.isNameLocked())) {
|
||||||
|
contract.setNameLocked(nameLocked.get());
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
if (!Objects.equals(state.get(), contract.getState())) {
|
if (!Objects.equals(state.get(), contract.getState())) {
|
||||||
contract.setState(state.get());
|
contract.setState(state.get());
|
||||||
modified = true;
|
modified = true;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.ecep.contract.manager.cloud.rk.CloudRkManagerWindowController">
|
fx:controller="com.ecep.contract.controller.cloud.rk.CloudRkManagerWindowController">
|
||||||
<children>
|
<children>
|
||||||
<MenuBar VBox.vgrow="NEVER">
|
<MenuBar VBox.vgrow="NEVER">
|
||||||
<menus>
|
<menus>
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
<Menu mnemonicParsing="false" text="Help">
|
<Menu mnemonicParsing="false" text="Help">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" text="数据修复" onAction="#onDataRepairAction"/>
|
<MenuItem mnemonicParsing="false" text="数据修复" onAction="#onDataRepairAction"/>
|
||||||
<MenuItem mnemonicParsing="false" text="数据迁移" onAction="#onDateTransferAction"/>
|
|
||||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp"/>
|
<MenuItem mnemonicParsing="false" text="About MyHelloApp"/>
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.*?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.ecep.contract.manager.cloud.tyc.CloudTycManagerWindowController">
|
fx:controller="com.ecep.contract.controller.cloud.tyc.CloudTycManagerWindowController">
|
||||||
<children>
|
<children>
|
||||||
<MenuBar VBox.vgrow="NEVER">
|
<MenuBar VBox.vgrow="NEVER">
|
||||||
<menus>
|
<menus>
|
||||||
@@ -39,7 +39,6 @@
|
|||||||
</Menu>
|
</Menu>
|
||||||
<Menu mnemonicParsing="false" text="Help">
|
<Menu mnemonicParsing="false" text="Help">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#onDateTransferAction" text="数据迁移"/>
|
|
||||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp"/>
|
<MenuItem mnemonicParsing="false" text="About MyHelloApp"/>
|
||||||
</items>
|
</items>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -9,38 +9,42 @@
|
|||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import org.controlsfx.control.ToggleSwitch?>
|
<?import org.controlsfx.control.ToggleSwitch?>
|
||||||
|
|
||||||
<VBox prefHeight="400.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.manager.cloud.u8.YongYouU8ConfigWindowController">
|
<VBox prefHeight="400.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
<children>
|
fx:controller="com.ecep.contract.controller.cloud.u8.YongYouU8ConfigWindowController">
|
||||||
<GridPane>
|
<children>
|
||||||
<columnConstraints>
|
<GridPane>
|
||||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="50.0" prefWidth="250.0" />
|
<columnConstraints>
|
||||||
<ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" maxWidth="5.0" minWidth="5.0" prefWidth="5.0" />
|
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="50.0" prefWidth="250.0"/>
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
|
<ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" maxWidth="5.0" minWidth="5.0"
|
||||||
</columnConstraints>
|
prefWidth="5.0"/>
|
||||||
<rowConstraints>
|
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0"/>
|
||||||
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
</columnConstraints>
|
||||||
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
</rowConstraints>
|
<RowConstraints fillHeight="false" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<children>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<Label text="同步时公司未创建时, 公司开发日期在此之后的自动创建" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
</rowConstraints>
|
||||||
<DatePicker fx:id="auto_create_company_after" GridPane.columnIndex="2" />
|
<children>
|
||||||
<Label text="cloud.u8.contract.latestDate" GridPane.rowIndex="4" />
|
<Label text="同步时公司未创建时, 公司开发日期在此之后的自动创建" GridPane.columnIndex="2"
|
||||||
<TextField fx:id="contract_latest_date" GridPane.columnIndex="2" GridPane.rowIndex="4" />
|
GridPane.rowIndex="1"/>
|
||||||
<Label text="cloud.u8.contract.latestId" GridPane.rowIndex="5" />
|
<DatePicker fx:id="auto_create_company_after" GridPane.columnIndex="2"/>
|
||||||
<TextField fx:id="contract_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="5" />
|
<Label text="cloud.u8.contract.latestDate" GridPane.rowIndex="4"/>
|
||||||
<Label text="cloud.u8.sync.elapse" GridPane.rowIndex="6" />
|
<TextField fx:id="contract_latest_date" GridPane.columnIndex="2" GridPane.rowIndex="4"/>
|
||||||
<TextField fx:id="sync_elapse" GridPane.columnIndex="2" GridPane.rowIndex="6" />
|
<Label text="cloud.u8.contract.latestId" GridPane.rowIndex="5"/>
|
||||||
<Label text="创建在此之后日期的公司" />
|
<TextField fx:id="contract_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="5"/>
|
||||||
<ToggleSwitch fx:id="use_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
<Label text="cloud.u8.sync.elapse" GridPane.rowIndex="6"/>
|
||||||
<Label text="使用latestId同步" GridPane.rowIndex="2" />
|
<TextField fx:id="sync_elapse" GridPane.columnIndex="2" GridPane.rowIndex="6"/>
|
||||||
<Label text="合同同步时是否使用最后更新的Id来判断更新范围,否则使用最后更新的合同日期来判断更新范围" GridPane.columnIndex="2" GridPane.rowIndex="3" />
|
<Label text="创建在此之后日期的公司"/>
|
||||||
</children>
|
<ToggleSwitch fx:id="use_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
||||||
</GridPane>
|
<Label text="使用latestId同步" GridPane.rowIndex="2"/>
|
||||||
</children>
|
<Label text="合同同步时是否使用最后更新的Id来判断更新范围,否则使用最后更新的合同日期来判断更新范围"
|
||||||
|
GridPane.columnIndex="2" GridPane.rowIndex="3"/>
|
||||||
|
</children>
|
||||||
|
</GridPane>
|
||||||
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|||||||
@@ -61,9 +61,10 @@
|
|||||||
<TableColumn fx:id="idColumn" prefWidth="75.0" text="ID"/>
|
<TableColumn fx:id="idColumn" prefWidth="75.0" text="ID"/>
|
||||||
<TableColumn fx:id="companyColumn" prefWidth="200.0" text="公司"/>
|
<TableColumn fx:id="companyColumn" prefWidth="200.0" text="公司"/>
|
||||||
<TableColumn fx:id="latestUpdateColumn" prefWidth="160.0" text="更新日期"/>
|
<TableColumn fx:id="latestUpdateColumn" prefWidth="160.0" text="更新日期"/>
|
||||||
<TableColumn fx:id="cloudIdColumn" prefWidth="150.0" text="平台编号"/>
|
<TableColumn fx:id="cloudLatestColumn" prefWidth="160.0" text="平台更新日期"/>
|
||||||
<TableColumn fx:id="cloudLatestColumn" prefWidth="160.0"
|
<TableColumn fx:id="cloudVendorUpdateDateColumn" prefWidth="160.0" text="供方更新日期"/>
|
||||||
text="平台更新日期"/>
|
<TableColumn fx:id="cloudCustomerUpdateDateColumn" prefWidth="160.0" text="客户更新日期"/>
|
||||||
|
<TableColumn fx:id="activeColumn" text="启用"/>
|
||||||
<TableColumn fx:id="descriptionColumn" text="Description"/>
|
<TableColumn fx:id="descriptionColumn" text="Description"/>
|
||||||
</columns>
|
</columns>
|
||||||
</TableView>
|
</TableView>
|
||||||
|
|||||||
@@ -22,14 +22,5 @@
|
|||||||
<TableColumn fx:id="bankAccountTable_openingBankColumn" prefWidth="300" text="开户行"/>
|
<TableColumn fx:id="bankAccountTable_openingBankColumn" prefWidth="300" text="开户行"/>
|
||||||
<TableColumn fx:id="bankAccountTable_accountColumn" prefWidth="300.0" text="账号"/>
|
<TableColumn fx:id="bankAccountTable_accountColumn" prefWidth="300.0" text="账号"/>
|
||||||
</columns>
|
</columns>
|
||||||
<contextMenu>
|
|
||||||
<ContextMenu>
|
|
||||||
<items>
|
|
||||||
<MenuItem fx:id="bankAccountTable_menu_refresh" mnemonicParsing="false" text="刷新"/>
|
|
||||||
<MenuItem fx:id="bankAccountTable_menu_add" mnemonicParsing="false" text="新建"/>
|
|
||||||
<MenuItem fx:id="bankAccountTable_menu_del" mnemonicParsing="false" text="删除"/>
|
|
||||||
</items>
|
|
||||||
</ContextMenu>
|
|
||||||
</contextMenu>
|
|
||||||
</TableView>
|
</TableView>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
@@ -1,88 +1,75 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.control.CheckBox?>
|
||||||
<ScrollPane fitToWidth="true" minHeight="300.0" minWidth="400.0" xmlns="http://javafx.com/javafx/22"
|
<?import javafx.scene.control.Hyperlink?>
|
||||||
xmlns:fx="http://javafx.com/fxml/1"
|
<?import javafx.scene.control.Label?>
|
||||||
fx:controller="com.ecep.contract.controller.tab.CompanyTabSkinOther">
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.control.TitledPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
|
||||||
|
<ScrollPane fitToWidth="true" minHeight="300.0" minWidth="400.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.controller.tab.CompanyTabSkinOther">
|
||||||
<content>
|
<content>
|
||||||
<VBox spacing="5.0">
|
<VBox spacing="5.0">
|
||||||
<children>
|
<children>
|
||||||
<TitledPane fx:id="rkCloudPane" animated="false" collapsible="false" text="集团相关方平台"
|
<TitledPane fx:id="rkCloudPane" animated="false" collapsible="false" text="集团相关方平台" VBox.vgrow="NEVER">
|
||||||
VBox.vgrow="NEVER">
|
|
||||||
<content>
|
<content>
|
||||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
<ColumnConstraints halignment="CENTER" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
prefWidth="220.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints halignment="CENTER" maxWidth="200.0" minWidth="80.0"
|
|
||||||
prefWidth="120.0"/>
|
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
|
||||||
prefWidth="220.0"/>
|
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="记录编号"/>
|
<Label text="记录编号" />
|
||||||
<TextField fx:id="cloudRkIdField" editable="false" text="-" GridPane.columnIndex="1"/>
|
<TextField fx:id="cloudRkIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||||
<Label text="平台编号" GridPane.columnIndex="2"/>
|
<Label text="平台编号" GridPane.columnIndex="2" />
|
||||||
<TextField fx:id="cloudRkCloudIdField" layoutX="255.0" layoutY="14.0" text="-"
|
<TextField fx:id="cloudRkCloudIdField" layoutX="255.0" layoutY="14.0" text="-" GridPane.columnIndex="3" />
|
||||||
GridPane.columnIndex="3"/>
|
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="7" />
|
||||||
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="7"/>
|
<TextField fx:id="cloudRkLatestField" editable="false" layoutX="255.0" layoutY="44.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="7" />
|
||||||
<TextField fx:id="cloudRkLatestField" editable="false" layoutX="255.0" layoutY="44.0"
|
<Label text="客户评级" GridPane.rowIndex="2" />
|
||||||
text="-" GridPane.columnIndex="3" GridPane.rowIndex="7"/>
|
<TextField fx:id="cloudRkCustomerGradeField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||||
<Label text="客户评级" GridPane.rowIndex="2"/>
|
<Label text="客户得分" GridPane.rowIndex="3" />
|
||||||
<TextField fx:id="cloudRkCustomerGradeField" editable="false" text="-"
|
<TextField fx:id="cloudRkCustomerScoreField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
<Label text="企业资信评级" GridPane.rowIndex="1" />
|
||||||
<Label text="客户得分" GridPane.rowIndex="3"/>
|
<TextField fx:id="cloudRkCreditRankField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||||
<TextField fx:id="cloudRkCustomerScoreField" editable="false" text="-"
|
<Label layoutX="44.0" layoutY="58.0" text="企业资信评级说明" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="3"/>
|
<TextField fx:id="cloudRkCreditRankDescriptionField" editable="false" layoutX="140.0" layoutY="54.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||||
<Label text="企业资信评级" GridPane.rowIndex="1"/>
|
<Label text="平台更新日期" GridPane.rowIndex="5" />
|
||||||
<TextField fx:id="cloudRkCreditRankField" editable="false" text="-"
|
<TextField fx:id="cloudRkCloudLatestField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="5" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
<Label text="黑名单更新日期" GridPane.rowIndex="7" />
|
||||||
<Label layoutX="44.0" layoutY="58.0" text="企业资信评级说明" GridPane.columnIndex="2"
|
<TextField fx:id="cloudRkBlackListUpdatedField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
||||||
GridPane.rowIndex="1"/>
|
<Label text="供方评级" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||||
<TextField fx:id="cloudRkCreditRankDescriptionField" editable="false" layoutX="140.0"
|
<TextField fx:id="cloudRkVendorGradeField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||||
layoutY="54.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="1"/>
|
<Label text="供方得分" GridPane.columnIndex="2" GridPane.rowIndex="3" />
|
||||||
<Label text="平台更新日期" GridPane.rowIndex="5"/>
|
<TextField fx:id="cloudRkVendorScoreField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="3" />
|
||||||
<TextField fx:id="cloudRkCloudLatestField" editable="false" text="-"
|
<Label text="工商信息更新日期" wrapText="true" GridPane.rowIndex="6" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="5"/>
|
<TextField fx:id="cloudRkEntUpdateField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="6" />
|
||||||
<Label text="黑名单更新日期" GridPane.rowIndex="7"/>
|
<Label fx:id="cloudRkVersionLabel" text="\@Version" GridPane.rowIndex="8" />
|
||||||
<TextField fx:id="cloudRkBlackListUpdatedField" editable="false" text="-"
|
<Button mnemonicParsing="false" onAction="#onCloudRkUpdateButtonClickedAction" text="从平台更新" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="8" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="7"/>
|
<CheckBox fx:id="cloudRkAutoUpdateField" mnemonicParsing="false" text="自动更新" GridPane.columnIndex="1" GridPane.rowIndex="8" />
|
||||||
<Label text="供方评级" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
<Label text="客户评级说明" GridPane.rowIndex="4" />
|
||||||
<TextField fx:id="cloudRkVendorGradeField" editable="false" text="-"
|
<Label text="供方评级说明" GridPane.columnIndex="2" GridPane.rowIndex="4" />
|
||||||
GridPane.columnIndex="3" GridPane.rowIndex="2"/>
|
<TextField fx:id="cloudRkCustomerDescriptionField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||||
<Label text="供方得分" GridPane.columnIndex="2" GridPane.rowIndex="3"/>
|
<TextField fx:id="cloudRkVendorDescriptionField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="4" />
|
||||||
<TextField fx:id="cloudRkVendorScoreField" editable="false" text="-"
|
|
||||||
GridPane.columnIndex="3" GridPane.rowIndex="3"/>
|
|
||||||
<Label text="工商信息更新日期" wrapText="true" GridPane.rowIndex="6"/>
|
|
||||||
<TextField fx:id="cloudRkEntUpdateField" editable="false" text="-"
|
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
|
|
||||||
<Label fx:id="cloudRkVersionLabel" text="\@Version" GridPane.rowIndex="8"/>
|
|
||||||
<Button mnemonicParsing="false" onAction="#onCloudRkUpdateButtonClickedAction"
|
|
||||||
text="从平台更新" GridPane.columnIndex="3" GridPane.halignment="RIGHT"
|
|
||||||
GridPane.rowIndex="8"/>
|
|
||||||
<CheckBox fx:id="cloudRkAutoUpdateField" mnemonicParsing="false" text="自动更新"
|
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="8"/>
|
|
||||||
<Label text="客户评级说明" GridPane.rowIndex="4"/>
|
|
||||||
<Label text="供方评级说明" GridPane.columnIndex="2" GridPane.rowIndex="4"/>
|
|
||||||
<TextField fx:id="cloudRkCustomerDescriptionField" editable="false" text="-"
|
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="4"/>
|
|
||||||
<TextField fx:id="cloudRkVendorDescriptionField" editable="false" text="-"
|
|
||||||
GridPane.columnIndex="3" GridPane.rowIndex="4"/>
|
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</content>
|
</content>
|
||||||
@@ -91,43 +78,34 @@
|
|||||||
<content>
|
<content>
|
||||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
prefWidth="220.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
|
||||||
prefWidth="220.0"/>
|
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="记录编号"/>
|
<Label text="记录编号" />
|
||||||
<Label text="平台编号" GridPane.columnIndex="2"/>
|
<Label text="平台编号" GridPane.columnIndex="2" />
|
||||||
<Label text="天眼评分" GridPane.rowIndex="1"/>
|
<Label text="天眼评分" GridPane.rowIndex="1" />
|
||||||
<TextField fx:id="cloudTycIdField" editable="false" text="-" GridPane.columnIndex="1"/>
|
<TextField fx:id="cloudTycIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||||
<TextField fx:id="cloudTycCloudIdField" text="-" GridPane.columnIndex="3"/>
|
<TextField fx:id="cloudTycCloudIdField" text="-" GridPane.columnIndex="3" />
|
||||||
<TextField fx:id="cloudTycLatestField" editable="false" layoutX="255.0" layoutY="44.0"
|
<TextField fx:id="cloudTycLatestField" editable="false" layoutX="255.0" layoutY="44.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||||
text="-" GridPane.columnIndex="3" GridPane.rowIndex="2"/>
|
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||||
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
<TextField fx:id="tycCloudPaneCloudScore" text="-" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||||
<TextField fx:id="tycCloudPaneCloudScore" text="-" GridPane.columnIndex="1"
|
<Hyperlink onAction="#onTycCloudPaneHyperLinkClickedAction" text="浏览器打开" GridPane.columnIndex="3" GridPane.halignment="RIGHT" />
|
||||||
GridPane.rowIndex="1"/>
|
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="3">
|
||||||
<Hyperlink onAction="#onTycCloudPaneHyperLinkClickedAction" text="浏览器打开"
|
|
||||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT"/>
|
|
||||||
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1"
|
|
||||||
GridPane.columnSpan="3" GridPane.rowIndex="3">
|
|
||||||
<children>
|
<children>
|
||||||
<Button mnemonicParsing="false" onAction="#onCloudTycUpdateButtonClickedAction"
|
<Button mnemonicParsing="false" onAction="#onCloudTycUpdateButtonClickedAction" text="更新" />
|
||||||
text="更新"/>
|
<Button fx:id="tycCloudPaneSaveButton" mnemonicParsing="false" text="保存" />
|
||||||
<Button fx:id="tycCloudPaneSaveButton" mnemonicParsing="false" text="保存"/>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<Label fx:id="cloudTycVersionLabel" text="\@Version" GridPane.rowIndex="3"/>
|
<Label fx:id="cloudTycVersionLabel" text="\@Version" GridPane.rowIndex="3" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</content>
|
</content>
|
||||||
@@ -136,33 +114,30 @@
|
|||||||
<content>
|
<content>
|
||||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
prefWidth="220.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
|
||||||
prefWidth="220.0"/>
|
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="记录编号"/>
|
<Label text="记录编号" />
|
||||||
<TextField fx:id="cloudYuIdField" editable="false" text="-" GridPane.columnIndex="1"/>
|
<TextField fx:id="cloudYuIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||||
<Label text="U8编号" GridPane.columnIndex="2"/>
|
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||||
<TextField fx:id="cloudYuCloudIdField" text="-" GridPane.columnIndex="3"/>
|
<TextField fx:id="cloudYuLatestField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||||
<Label text="客户编号" GridPane.rowIndex="1"/>
|
<Button fx:id="yuCloudPaneSaveButton" mnemonicParsing="false" text="更新" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
||||||
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
<Label fx:id="cloudYuVersionLabel" text="\@Version" GridPane.rowIndex="3" />
|
||||||
<TextField fx:id="cloudYuLatestField" editable="false" text="-" GridPane.columnIndex="3"
|
<Label text="供方更新" GridPane.rowIndex="1" />
|
||||||
GridPane.rowIndex="2"/>
|
<Label text="客户更新" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||||
<Button fx:id="yuCloudPaneSaveButton" mnemonicParsing="false" text="更新"
|
<TextField fx:id="cloudYuVendorUpdateDateField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="3"/>
|
<TextField fx:id="cloudYuCustomerUpdateDateField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||||
<Label fx:id="cloudYuVersionLabel" text="\@Version" GridPane.rowIndex="3"/>
|
<Label text="启用" GridPane.rowIndex="2" />
|
||||||
|
<CheckBox fx:id="cloudYuActiveField" mnemonicParsing="false" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</content>
|
</content>
|
||||||
@@ -171,30 +146,23 @@
|
|||||||
<content>
|
<content>
|
||||||
<GridPane>
|
<GridPane>
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
prefWidth="220.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="200.0"
|
|
||||||
minWidth="80.0" prefWidth="120.0"/>
|
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0"
|
|
||||||
prefWidth="220.0"/>
|
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="记录编号"/>
|
<Label text="记录编号" />
|
||||||
<TextField fx:id="extendInfoIdField" editable="false" text="-"
|
<TextField fx:id="extendInfoIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||||
GridPane.columnIndex="1"/>
|
<Button fx:id="extendInfoPaneSaveButton" mnemonicParsing="false" text="更新" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||||
<Button fx:id="extendInfoPaneSaveButton" mnemonicParsing="false" text="更新"
|
<Label fx:id="extendInfoVersionLabel" text="\@Version" GridPane.rowIndex="2" />
|
||||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/>
|
<CheckBox fx:id="extendInfoDisableVerifyField" mnemonicParsing="false" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||||
<Label fx:id="extendInfoVersionLabel" text="\@Version" GridPane.rowIndex="2"/>
|
<Label text="禁用核验" GridPane.rowIndex="1" />
|
||||||
<CheckBox fx:id="extendInfoDisableVerifyField" mnemonicParsing="false"
|
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
|
||||||
<Label text="禁用核验" GridPane.rowIndex="1"/>
|
|
||||||
</children>
|
</children>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</content>
|
</content>
|
||||||
@@ -203,6 +171,6 @@
|
|||||||
</VBox>
|
</VBox>
|
||||||
</content>
|
</content>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0"/>
|
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
|
||||||
</padding>
|
</padding>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
|
|||||||
@@ -22,8 +22,9 @@
|
|||||||
<?import javafx.scene.layout.RowConstraints?>
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
<VBox prefHeight="800.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
<VBox prefHeight="800.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFormFileWindowController">
|
fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFormFileWindowController">
|
||||||
<children>
|
<children>
|
||||||
<MenuBar>
|
<MenuBar>
|
||||||
<menus>
|
<menus>
|
||||||
@@ -209,7 +210,7 @@ fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFo
|
|||||||
<Label text="★★★★≤200分,★★★≤150分,★★≤100分,★≤60分" />
|
<Label text="★★★★≤200分,★★★≤150分,★★≤100分,★≤60分" />
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
<Button mnemonicParsing="false" text="保存" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="10" />
|
<Button fx:id="saveBtn" mnemonicParsing="false" text="保存" GridPane.columnIndex="1" GridPane.halignment="CENTER" GridPane.rowIndex="10" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets right="5.0" />
|
<Insets right="5.0" />
|
||||||
@@ -217,5 +218,15 @@ fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFo
|
|||||||
</GridPane>
|
</GridPane>
|
||||||
</items>
|
</items>
|
||||||
</SplitPane>
|
</SplitPane>
|
||||||
|
<HBox alignment="CENTER_LEFT" prefWidth="500.0" spacing="1.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
|
<children>
|
||||||
|
<Pane HBox.hgrow="ALWAYS">
|
||||||
|
<children>
|
||||||
|
<Label fx:id="leftStatusLabel" contentDisplay="TOP" layoutX="3.0" layoutY="8.0" wrapText="true" />
|
||||||
|
</children>
|
||||||
|
</Pane>
|
||||||
|
</children>
|
||||||
|
</HBox>
|
||||||
|
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|||||||
@@ -11,39 +11,49 @@
|
|||||||
<?import javafx.scene.layout.GridPane?>
|
<?import javafx.scene.layout.GridPane?>
|
||||||
<?import javafx.scene.layout.RowConstraints?>
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
|
||||||
<TabPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" tabClosingPolicy="UNAVAILABLE" tabMinWidth="80.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.manager.ds.other.controller.SysConfWindowController">
|
<TabPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
|
||||||
|
prefWidth="600.0" tabClosingPolicy="UNAVAILABLE" tabMinWidth="80.0" xmlns="http://javafx.com/javafx/22"
|
||||||
|
xmlns:fx="http://javafx.com/fxml/1"
|
||||||
|
fx:controller="com.ecep.contract.controller.SysConfWindowController">
|
||||||
<tabs>
|
<tabs>
|
||||||
<Tab text="通用">
|
<Tab text="通用">
|
||||||
<content>
|
<content>
|
||||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||||
<children>
|
<children>
|
||||||
<GridPane layoutX="100.0" layoutY="96.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<GridPane layoutX="100.0" layoutY="96.0" AnchorPane.leftAnchor="0.0"
|
||||||
|
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0" prefWidth="110.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0"
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="200.0" prefWidth="432.0" />
|
prefWidth="110.0"/>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0" prefWidth="48.0" />
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="200.0"
|
||||||
|
prefWidth="432.0"/>
|
||||||
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0"
|
||||||
|
prefWidth="48.0"/>
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="通用的配置选项" GridPane.columnIndex="1" />
|
<Label text="通用的配置选项" GridPane.columnIndex="1"/>
|
||||||
<Label text="合同文件夹" GridPane.rowIndex="1" />
|
<Label text="合同文件夹" GridPane.rowIndex="1"/>
|
||||||
<Label text="Label" GridPane.rowIndex="2" />
|
<Label text="Label" GridPane.rowIndex="2"/>
|
||||||
<Label text="Label" GridPane.rowIndex="3" />
|
<Label text="Label" GridPane.rowIndex="3"/>
|
||||||
<Label text="Label" GridPane.rowIndex="4" />
|
<Label text="Label" GridPane.rowIndex="4"/>
|
||||||
<TextField prefHeight="23.0" prefWidth="251.0" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2" />
|
<TextField prefHeight="23.0" prefWidth="251.0" GridPane.columnIndex="1"
|
||||||
<TextField GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3" />
|
GridPane.columnSpan="2" GridPane.rowIndex="2"/>
|
||||||
<TextField GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="4" />
|
<TextField GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3"/>
|
||||||
<Label fx:id="companyContractPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<TextField GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="4"/>
|
||||||
<Button mnemonicParsing="false" onAction="#changeCompanyContractPath" text="更换" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
<Label fx:id="companyContractPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1"
|
||||||
|
GridPane.rowIndex="1"/>
|
||||||
|
<Button mnemonicParsing="false" onAction="#changeCompanyContractPath" text="更换"
|
||||||
|
GridPane.columnIndex="2" GridPane.rowIndex="1"/>
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
</padding>
|
</padding>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
@@ -56,30 +66,35 @@
|
|||||||
<children>
|
<children>
|
||||||
<GridPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<GridPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0" prefWidth="110.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0"
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="150.0" prefWidth="460.0" />
|
prefWidth="110.0"/>
|
||||||
|
<ColumnConstraints hgrow="ALWAYS" minWidth="150.0" prefWidth="460.0"/>
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="数据库名称" GridPane.rowIndex="2" />
|
<Label text="数据库名称" GridPane.rowIndex="2"/>
|
||||||
<Label text="数据库IP地址" GridPane.rowIndex="1" />
|
<Label text="数据库IP地址" GridPane.rowIndex="1"/>
|
||||||
<Label text="配置用友U8的数据库信息" GridPane.columnIndex="1" />
|
<Label text="配置用友U8的数据库信息" GridPane.columnIndex="1"/>
|
||||||
<Label text="数据库账户" GridPane.rowIndex="3" />
|
<Label text="数据库账户" GridPane.rowIndex="3"/>
|
||||||
<Label text="数据库账户密码" GridPane.rowIndex="4" />
|
<Label text="数据库账户密码" GridPane.rowIndex="4"/>
|
||||||
<TextField fx:id="u8DataBaseServerHostField" promptText="192.168.1.1" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<TextField fx:id="u8DataBaseServerHostField" promptText="192.168.1.1"
|
||||||
<TextField fx:id="u8DataBaseCatalogField" promptText="UF_DATA_001_2017" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||||
<TextField fx:id="u8DataBaseUserNameField" promptText="sa" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
<TextField fx:id="u8DataBaseCatalogField" promptText="UF_DATA_001_2017"
|
||||||
<TextField fx:id="u8DataBasePasswordField" promptText="密码" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
||||||
|
<TextField fx:id="u8DataBaseUserNameField" promptText="sa" GridPane.columnIndex="1"
|
||||||
|
GridPane.rowIndex="3"/>
|
||||||
|
<TextField fx:id="u8DataBasePasswordField" promptText="密码" GridPane.columnIndex="1"
|
||||||
|
GridPane.rowIndex="4"/>
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
</padding>
|
</padding>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
@@ -92,29 +107,36 @@
|
|||||||
<children>
|
<children>
|
||||||
<GridPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<GridPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0" prefWidth="130.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0"
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="428.0" />
|
prefWidth="130.0"/>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0" prefWidth="48.0" />
|
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="428.0"/>
|
||||||
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0"
|
||||||
|
prefWidth="48.0"/>
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="供应商的配置选项" GridPane.columnIndex="1" />
|
<Label text="供应商的配置选项" GridPane.columnIndex="1"/>
|
||||||
<Label text="供应商文件夹" GridPane.rowIndex="1" />
|
<Label text="供应商文件夹" GridPane.rowIndex="1"/>
|
||||||
<Label text="供方调查评价表模板" GridPane.rowIndex="2" />
|
<Label text="供方调查评价表模板" GridPane.rowIndex="2"/>
|
||||||
<Label fx:id="vendorPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<Label fx:id="vendorPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1"
|
||||||
<Label fx:id="vendorEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls" textOverrun="CLIP" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
GridPane.rowIndex="1"/>
|
||||||
<Button mnemonicParsing="false" onAction="#changeVendorPath" text="更换" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
<Label fx:id="vendorEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls"
|
||||||
<Button mnemonicParsing="false" onAction="#changeVendorEvaluationFormTemplate" text="更换" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
textOverrun="CLIP" wrapText="true" GridPane.columnIndex="1"
|
||||||
|
GridPane.rowIndex="2"/>
|
||||||
|
<Button mnemonicParsing="false" onAction="#changeVendorPath" text="更换"
|
||||||
|
GridPane.columnIndex="2" GridPane.rowIndex="1"/>
|
||||||
|
<Button mnemonicParsing="false" onAction="#changeVendorEvaluationFormTemplate"
|
||||||
|
text="更换" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
</padding>
|
</padding>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
@@ -125,33 +147,43 @@
|
|||||||
<content>
|
<content>
|
||||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||||
<children>
|
<children>
|
||||||
<GridPane layoutX="100.0" layoutY="96.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
<GridPane layoutX="100.0" layoutY="96.0" AnchorPane.leftAnchor="0.0"
|
||||||
|
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0" prefWidth="130.0" />
|
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0"
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" />
|
prefWidth="130.0"/>
|
||||||
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0" prefWidth="48.0" />
|
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0"/>
|
||||||
|
<ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0"
|
||||||
|
prefWidth="48.0"/>
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="客户的配置选项" GridPane.columnIndex="1" />
|
<Label text="客户的配置选项" GridPane.columnIndex="1"/>
|
||||||
<Label text="客户的文件夹" GridPane.rowIndex="1" />
|
<Label text="客户的文件夹" GridPane.rowIndex="1"/>
|
||||||
<Label text="客户资信评估表模板" GridPane.rowIndex="2" />
|
<Label text="客户资信评估表模板" GridPane.rowIndex="2"/>
|
||||||
<Label text="销售台账目录" GridPane.rowIndex="3" />
|
<Label text="销售台账目录" GridPane.rowIndex="3"/>
|
||||||
<Label fx:id="customerPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<Label fx:id="customerPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1"
|
||||||
<Label fx:id="customerEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls" textOverrun="CLIP" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
GridPane.rowIndex="1"/>
|
||||||
<Button mnemonicParsing="false" onAction="#changeCustomerPath" text="更换" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
<Label fx:id="customerEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls"
|
||||||
<Button mnemonicParsing="false" onAction="#changeCustomerEvaluationFormTemplate" text="更换" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
textOverrun="CLIP" wrapText="true" GridPane.columnIndex="1"
|
||||||
<Button mnemonicParsing="false" onAction="#changeCustomerSaleBookPath" text="更换" GridPane.columnIndex="2" GridPane.rowIndex="3" />
|
GridPane.rowIndex="2"/>
|
||||||
<Label fx:id="customerSaleBookPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
<Button mnemonicParsing="false" onAction="#changeCustomerPath" text="更换"
|
||||||
|
GridPane.columnIndex="2" GridPane.rowIndex="1"/>
|
||||||
|
<Button mnemonicParsing="false" onAction="#changeCustomerEvaluationFormTemplate"
|
||||||
|
text="更换" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
||||||
|
<Button mnemonicParsing="false" onAction="#changeCustomerSaleBookPath" text="更换"
|
||||||
|
GridPane.columnIndex="2" GridPane.rowIndex="3"/>
|
||||||
|
<Label fx:id="customerSaleBookPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1"
|
||||||
|
GridPane.rowIndex="3"/>
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
</padding>
|
</padding>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -105,9 +105,9 @@
|
|||||||
<contextMenu>
|
<contextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<items>
|
<items>
|
||||||
<MenuItem mnemonicParsing="false" onAction="#onShowContractDetailAction"
|
<MenuItem mnemonicParsing="false" onAction="#onShowContractDetailAction" text="合同详情"/>
|
||||||
text="合同详情"/>
|
|
||||||
<MenuItem mnemonicParsing="false" onAction="#onContractReVerifyAction" text="重新验证"/>
|
<MenuItem mnemonicParsing="false" onAction="#onContractReVerifyAction" text="重新验证"/>
|
||||||
|
<MenuItem mnemonicParsing="false" onAction="#onShowVerifyStatusAction" text="查看状态"/>
|
||||||
</items>
|
</items>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</contextMenu>
|
</contextMenu>
|
||||||
|
|||||||
@@ -1,36 +1,50 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<?import javafx.geometry.*?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.*?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.control.CheckBox?>
|
||||||
|
<?import javafx.scene.control.DatePicker?>
|
||||||
|
<?import javafx.scene.control.Label?>
|
||||||
|
<?import javafx.scene.control.ScrollPane?>
|
||||||
|
<?import javafx.scene.control.Tab?>
|
||||||
|
<?import javafx.scene.control.TabPane?>
|
||||||
|
<?import javafx.scene.control.TextArea?>
|
||||||
|
<?import javafx.scene.control.TextField?>
|
||||||
|
<?import javafx.scene.control.ToolBar?>
|
||||||
|
<?import javafx.scene.control.Tooltip?>
|
||||||
|
<?import javafx.scene.layout.BorderPane?>
|
||||||
|
<?import javafx.scene.layout.ColumnConstraints?>
|
||||||
|
<?import javafx.scene.layout.GridPane?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
|
<?import javafx.scene.layout.Pane?>
|
||||||
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import org.controlsfx.glyphfont.Glyph?>
|
<?import org.controlsfx.glyphfont.Glyph?>
|
||||||
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="561.0"
|
|
||||||
prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="561.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.controller.contract.ContractWindowController">
|
||||||
fx:controller="com.ecep.contract.controller.contract.ContractWindowController">
|
|
||||||
<top>
|
<top>
|
||||||
<ToolBar prefHeight="40.0" prefWidth="800.0" BorderPane.alignment="CENTER">
|
<ToolBar prefHeight="40.0" prefWidth="800.0" BorderPane.alignment="CENTER">
|
||||||
<items>
|
<items>
|
||||||
<Button onAction="#onContractOpenInExplorerAction" text="打开目录(_D)"/>
|
<Button onAction="#onContractOpenInExplorerAction" text="打开目录(_D)" />
|
||||||
<Button onAction="#onSyncContractAction" text="同步(_R)"/>
|
<Button onAction="#onSyncContractAction" text="同步(_R)" />
|
||||||
<Button fx:id="saveBtn" disable="true" text="保存(_S)">
|
<Button fx:id="saveBtn" disable="true" text="保存(_S)">
|
||||||
<graphic>
|
<graphic>
|
||||||
<Glyph fontFamily="FontAwesome" icon="SAVE"/>
|
<Glyph fontFamily="FontAwesome" icon="SAVE" />
|
||||||
</graphic>
|
</graphic>
|
||||||
</Button>
|
</Button>
|
||||||
<Button fx:id="verifyBtn" onAction="#onContractVerifyAction" text="合规(_V)">
|
<Button fx:id="verifyBtn" onAction="#onContractVerifyAction" text="合规(_V)">
|
||||||
<graphic>
|
<graphic>
|
||||||
<Glyph fontFamily="FontAwesome" icon="CHECK"/>
|
<Glyph fontFamily="FontAwesome" icon="CHECK" />
|
||||||
</graphic>
|
</graphic>
|
||||||
<tooltip>
|
<tooltip>
|
||||||
<Tooltip text="按照预定规则检测合同是否符合合规要求"/>
|
<Tooltip text="按照预定规则检测合同是否符合合规要求" />
|
||||||
</tooltip>
|
</tooltip>
|
||||||
</Button>
|
</Button>
|
||||||
</items>
|
</items>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</top>
|
</top>
|
||||||
<center>
|
<center>
|
||||||
<TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0"
|
<TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0" tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||||
tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
|
||||||
<tabs>
|
<tabs>
|
||||||
<Tab fx:id="baseInfoTab" text="基本信息">
|
<Tab fx:id="baseInfoTab" text="基本信息">
|
||||||
<content>
|
<content>
|
||||||
@@ -40,262 +54,190 @@
|
|||||||
<children>
|
<children>
|
||||||
<GridPane VBox.vgrow="NEVER">
|
<GridPane VBox.vgrow="NEVER">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints fillWidth="false" halignment="CENTER" hgrow="NEVER"
|
<ColumnConstraints fillWidth="false" halignment="CENTER" hgrow="NEVER" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
maxWidth="200.0" minWidth="80.0" prefWidth="120.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="180.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308"
|
<ColumnConstraints fillWidth="false" halignment="CENTER" hgrow="NEVER" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||||
minWidth="100.0" prefWidth="180.0"/>
|
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="180.0" />
|
||||||
<ColumnConstraints fillWidth="false" halignment="CENTER" hgrow="NEVER"
|
|
||||||
maxWidth="200.0" minWidth="80.0" prefWidth="120.0"/>
|
|
||||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308"
|
|
||||||
minWidth="100.0" prefWidth="180.0"/>
|
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308" minHeight="80.0" prefHeight="80.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308" minHeight="30.0" prefHeight="42.0" vgrow="NEVER" />
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308" minHeight="30.0" prefHeight="42.0" vgrow="NEVER" />
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" minHeight="30.0" prefHeight="30.0"
|
|
||||||
vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308"
|
|
||||||
minHeight="80.0" prefHeight="80.0" vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308"
|
|
||||||
minHeight="30.0" prefHeight="42.0" vgrow="NEVER"/>
|
|
||||||
<RowConstraints fillHeight="false" maxHeight="1.7976931348623157E308"
|
|
||||||
minHeight="30.0" prefHeight="42.0" vgrow="NEVER"/>
|
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="合同名称 *"/>
|
<Label text="合同名称 *" />
|
||||||
<Label text="合同编码 *" GridPane.rowIndex="2"/>
|
<Label text="合同编码 *" GridPane.rowIndex="2" />
|
||||||
<Label text="状态 *" GridPane.columnIndex="2" GridPane.rowIndex="4"/>
|
<Label text="状态 *" GridPane.columnIndex="2" GridPane.rowIndex="4" />
|
||||||
<TextField fx:id="codeField" GridPane.columnIndex="1"
|
<TextField fx:id="codeField" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||||
GridPane.rowIndex="2"/>
|
<TextField fx:id="stateField" GridPane.columnIndex="3" GridPane.rowIndex="4" />
|
||||||
<TextField fx:id="stateField" GridPane.columnIndex="3"
|
|
||||||
GridPane.rowIndex="4"/>
|
|
||||||
<HBox GridPane.columnIndex="1" GridPane.columnSpan="3">
|
<HBox GridPane.columnIndex="1" GridPane.columnSpan="3">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="nameField" HBox.hgrow="ALWAYS"/>
|
<TextField fx:id="nameField" HBox.hgrow="ALWAYS" />
|
||||||
<Button fx:id="contractRenameBtn" mnemonicParsing="false"
|
<CheckBox fx:id="contractNameLockedCk" mnemonicParsing="false">
|
||||||
text="合同更名"/>
|
<HBox.margin>
|
||||||
|
<Insets left="4.0" right="4.0" top="4.0" />
|
||||||
|
</HBox.margin>
|
||||||
|
<tooltip>
|
||||||
|
<Tooltip text="锁定合同名称" />
|
||||||
|
</tooltip>
|
||||||
|
</CheckBox>
|
||||||
|
<Button fx:id="contractRenameBtn" mnemonicParsing="false" text="合同更名" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<Label layoutX="20.0" layoutY="28.0" text="GUID *"
|
<Label layoutX="20.0" layoutY="28.0" text="GUID *" GridPane.columnIndex="2" GridPane.rowIndex="17" />
|
||||||
GridPane.columnIndex="2" GridPane.rowIndex="17"/>
|
<Label layoutX="20.0" layoutY="58.0" text="分组 *" GridPane.columnIndex="2" GridPane.rowIndex="3" />
|
||||||
<Label layoutX="20.0" layoutY="58.0" text="分组 *"
|
<Label layoutX="20.0" layoutY="28.0" text="备注" GridPane.rowIndex="18" />
|
||||||
GridPane.columnIndex="2" GridPane.rowIndex="3"/>
|
<TextField fx:id="groupField" layoutX="202.0" layoutY="114.0" GridPane.columnIndex="3" GridPane.rowIndex="3" />
|
||||||
<Label layoutX="20.0" layoutY="28.0" text="备注"
|
<TextField fx:id="guidField" GridPane.columnIndex="3" GridPane.rowIndex="17" />
|
||||||
GridPane.rowIndex="18"/>
|
<Label layoutX="56.0" layoutY="118.0" text="类型 *" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||||
<TextField fx:id="groupField" layoutX="202.0" layoutY="114.0"
|
<TextField fx:id="typeField" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||||
GridPane.columnIndex="3" GridPane.rowIndex="3"/>
|
<TextField fx:id="kindField" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||||
<TextField fx:id="guidField" GridPane.columnIndex="3"
|
<Label text="性质 *" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||||
GridPane.rowIndex="17"/>
|
<Label text="合同起止日期 *" GridPane.rowIndex="8" />
|
||||||
<Label layoutX="56.0" layoutY="118.0" text="类型 *"
|
<Label text="存储目录" GridPane.rowIndex="15" />
|
||||||
GridPane.columnIndex="2" GridPane.rowIndex="1"/>
|
<TextField fx:id="pathField" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="15">
|
||||||
<TextField fx:id="typeField" GridPane.columnIndex="3"
|
|
||||||
GridPane.rowIndex="1"/>
|
|
||||||
<TextField fx:id="kindField" GridPane.columnIndex="3"
|
|
||||||
GridPane.rowIndex="2"/>
|
|
||||||
<Label text="性质 *" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
|
||||||
<Label text="合同起止日期 *" GridPane.rowIndex="8"/>
|
|
||||||
<Label text="存储目录" GridPane.rowIndex="15"/>
|
|
||||||
<TextField fx:id="pathField" GridPane.columnIndex="1"
|
|
||||||
GridPane.columnSpan="3" GridPane.rowIndex="15">
|
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets/>
|
<Insets />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</TextField>
|
</TextField>
|
||||||
<Label text="创建日期" GridPane.rowIndex="17"/>
|
<Label text="创建日期" GridPane.rowIndex="17" />
|
||||||
<TextField fx:id="createdField" GridPane.columnIndex="1"
|
<TextField fx:id="createdField" GridPane.columnIndex="1" GridPane.rowIndex="17" />
|
||||||
GridPane.rowIndex="17"/>
|
|
||||||
<HBox GridPane.columnIndex="1" GridPane.rowIndex="8">
|
<HBox GridPane.columnIndex="1" GridPane.rowIndex="8">
|
||||||
<children>
|
<children>
|
||||||
<DatePicker fx:id="startDateField"
|
<DatePicker fx:id="startDateField" maxWidth="1.7976931348623157E308" promptText="启时日期" HBox.hgrow="ALWAYS">
|
||||||
maxWidth="1.7976931348623157E308"
|
|
||||||
promptText="启时日期" HBox.hgrow="ALWAYS">
|
|
||||||
<HBox.margin>
|
<HBox.margin>
|
||||||
<Insets right="6.0"/>
|
<Insets right="6.0" />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
<DatePicker fx:id="endDateField"
|
<DatePicker fx:id="endDateField" maxWidth="1.7976931348623157E308" promptText="截止日期" HBox.hgrow="ALWAYS" />
|
||||||
maxWidth="1.7976931348623157E308"
|
|
||||||
promptText="截止日期" HBox.hgrow="ALWAYS"/>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<TextArea fx:id="descriptionField" GridPane.columnIndex="1"
|
<TextArea fx:id="descriptionField" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="18" />
|
||||||
GridPane.columnSpan="3" GridPane.rowIndex="18"/>
|
<Label text="提交人 *" GridPane.columnIndex="2" GridPane.rowIndex="8" />
|
||||||
<Label text="提交人 *" GridPane.columnIndex="2" GridPane.rowIndex="8"/>
|
|
||||||
<HBox GridPane.columnIndex="3" GridPane.rowIndex="8">
|
<HBox GridPane.columnIndex="3" GridPane.rowIndex="8">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="setupPersonField" HBox.hgrow="SOMETIMES"/>
|
<TextField fx:id="setupPersonField" HBox.hgrow="SOMETIMES" />
|
||||||
<DatePicker fx:id="setupDateField" HBox.hgrow="SOMETIMES"/>
|
<DatePicker fx:id="setupDateField" HBox.hgrow="SOMETIMES" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<Label text="签订日期 *" GridPane.rowIndex="9"/>
|
<Label text="签订日期 *" GridPane.rowIndex="9" />
|
||||||
<DatePicker fx:id="orderDateField" maxWidth="1.7976931348623157E308"
|
<DatePicker fx:id="orderDateField" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="9" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="9"/>
|
<Label text="生效人 *" GridPane.columnIndex="2" GridPane.rowIndex="9" />
|
||||||
<Label text="生效人 *" GridPane.columnIndex="2" GridPane.rowIndex="9"/>
|
<Label text="修改人 *" GridPane.columnIndex="2" GridPane.rowIndex="10" />
|
||||||
<Label text="修改人 *" GridPane.columnIndex="2" GridPane.rowIndex="10"/>
|
|
||||||
<HBox GridPane.columnIndex="3" GridPane.rowIndex="9">
|
<HBox GridPane.columnIndex="3" GridPane.rowIndex="9">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="inurePersonField" HBox.hgrow="SOMETIMES"/>
|
<TextField fx:id="inurePersonField" HBox.hgrow="SOMETIMES" />
|
||||||
<DatePicker fx:id="inureDateField" HBox.hgrow="SOMETIMES"/>
|
<DatePicker fx:id="inureDateField" HBox.hgrow="SOMETIMES" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<HBox GridPane.columnIndex="3" GridPane.rowIndex="10">
|
<HBox GridPane.columnIndex="3" GridPane.rowIndex="10">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="varyPersonField" HBox.hgrow="SOMETIMES"/>
|
<TextField fx:id="varyPersonField" HBox.hgrow="SOMETIMES" />
|
||||||
<DatePicker fx:id="varyDateField" HBox.hgrow="SOMETIMES"/>
|
<DatePicker fx:id="varyDateField" HBox.hgrow="SOMETIMES" />
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<TextField fx:id="parentCodeField" GridPane.columnIndex="1"
|
<TextField fx:id="parentCodeField" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||||
GridPane.rowIndex="3"/>
|
<Label text="主合同编码" GridPane.rowIndex="3" />
|
||||||
<Label text="主合同编码" GridPane.rowIndex="3"/>
|
<Label fx:id="versionLabel" text="\@Version" GridPane.rowIndex="19" />
|
||||||
<Label fx:id="versionLabel" text="\@Version" GridPane.rowIndex="19"/>
|
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="16">
|
||||||
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1"
|
|
||||||
GridPane.columnSpan="3" GridPane.rowIndex="16">
|
|
||||||
<children>
|
<children>
|
||||||
<Button fx:id="contractPathCreateBtn" mnemonicParsing="false"
|
<Button fx:id="contractPathCreateBtn" mnemonicParsing="false" text="创建目录" />
|
||||||
text="创建目录"/>
|
<Button fx:id="contractPathChangeBtn" mnemonicParsing="false" text="变更目录" />
|
||||||
<Button fx:id="contractPathChangeBtn" mnemonicParsing="false"
|
<Button fx:id="contractPathAsNameBtn" mnemonicParsing="false" text="与合同名称同名" />
|
||||||
text="变更目录"/>
|
<Button fx:id="contractPathAsCodeBtn" mnemonicParsing="false" text="与合同号同名" />
|
||||||
<Button fx:id="contractPathAsNameBtn" mnemonicParsing="false"
|
|
||||||
text="与合同名称同名"/>
|
|
||||||
<Button fx:id="contractPathAsCodeBtn" mnemonicParsing="false"
|
|
||||||
text="与合同号同名"/>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1"
|
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="4">
|
||||||
GridPane.rowIndex="4">
|
|
||||||
<children>
|
<children>
|
||||||
<Button fx:id="openMainContractBtn" mnemonicParsing="false"
|
<Button fx:id="openMainContractBtn" mnemonicParsing="false" text="打开主合同" />
|
||||||
text="打开主合同"/>
|
<Button fx:id="calcMainContractNoBtn" mnemonicParsing="false" text="计算主合同编号" />
|
||||||
<Button fx:id="calcMainContractNoBtn" mnemonicParsing="false"
|
|
||||||
text="计算主合同编号"/>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<Label text="对方单位 *" GridPane.rowIndex="5"/>
|
<Label text="对方单位 *" GridPane.rowIndex="5" />
|
||||||
<HBox spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3"
|
<HBox spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="5">
|
||||||
GridPane.rowIndex="5">
|
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="companyField" HBox.hgrow="SOMETIMES"/>
|
<TextField fx:id="companyField" HBox.hgrow="SOMETIMES" />
|
||||||
<Button mnemonicParsing="false"
|
<Button mnemonicParsing="false" onAction="#onContractOpenRelativeCompanyAction" text="详情">
|
||||||
onAction="#onContractOpenRelativeCompanyAction"
|
|
||||||
text="详情">
|
|
||||||
<HBox.margin>
|
<HBox.margin>
|
||||||
<Insets/>
|
<Insets />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
</Button>
|
</Button>
|
||||||
<Button fx:id="openRelativeCompanyCustomerBtn"
|
<Button fx:id="openRelativeCompanyCustomerBtn" mnemonicParsing="false" text="客户">
|
||||||
mnemonicParsing="false" text="客户">
|
|
||||||
<HBox.margin>
|
<HBox.margin>
|
||||||
<Insets/>
|
<Insets />
|
||||||
</HBox.margin>
|
</HBox.margin>
|
||||||
</Button>
|
</Button>
|
||||||
<Button fx:id="openRelativeCompanyVendorBtn"
|
<Button fx:id="openRelativeCompanyVendorBtn" mnemonicParsing="false" text="供应商" />
|
||||||
mnemonicParsing="false" text="供应商"/>
|
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<Label text="业务员 *" GridPane.rowIndex="11"/>
|
<Label text="业务员 *" GridPane.rowIndex="11" />
|
||||||
<VBox GridPane.columnIndex="1" GridPane.rowIndex="11">
|
<VBox GridPane.columnIndex="1" GridPane.rowIndex="11">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="employeeField"/>
|
<TextField fx:id="employeeField" />
|
||||||
</children>
|
</children>
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="5.0" top="5.0"/>
|
<Insets bottom="5.0" top="5.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</VBox>
|
</VBox>
|
||||||
<Label text="经办人" GridPane.columnIndex="2" GridPane.rowIndex="11"/>
|
<Label text="经办人" GridPane.columnIndex="2" GridPane.rowIndex="11" />
|
||||||
<VBox GridPane.columnIndex="3" GridPane.rowIndex="11">
|
<VBox GridPane.columnIndex="3" GridPane.rowIndex="11">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="handlerField"/>
|
<TextField fx:id="handlerField" />
|
||||||
</children>
|
</children>
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="5.0" top="5.0"/>
|
<Insets bottom="5.0" top="5.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</VBox>
|
</VBox>
|
||||||
|
|
||||||
<Label text="归属项目" GridPane.rowIndex="1"/>
|
<Label text="归属项目" GridPane.rowIndex="1" />
|
||||||
<HBox GridPane.columnIndex="1" GridPane.rowIndex="1">
|
<HBox GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||||
<children>
|
<children>
|
||||||
<TextField fx:id="projectField" prefWidth="190.0"
|
<TextField fx:id="projectField" prefWidth="190.0" HBox.hgrow="ALWAYS" />
|
||||||
HBox.hgrow="ALWAYS"/>
|
<Button fx:id="linkContractProjectBtn" mnemonicParsing="false" text="关联" textOverrun="CLIP">
|
||||||
<Button fx:id="linkContractProjectBtn" mnemonicParsing="false"
|
|
||||||
text="关联" textOverrun="CLIP">
|
|
||||||
</Button>
|
</Button>
|
||||||
</children>
|
</children>
|
||||||
</HBox>
|
</HBox>
|
||||||
<Label text="1. (*) 字段数据同步自用友U8系统,同步时将被覆盖"
|
<Label text="1. (*) 字段数据同步自用友U8系统,同步时将被覆盖" textFill="#888888" wrapText="true" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="20" />
|
||||||
textFill="#888888" wrapText="true" GridPane.columnIndex="1"
|
<Label text="合同金额" GridPane.rowIndex="6" />
|
||||||
GridPane.columnSpan="3" GridPane.rowIndex="20"/>
|
<TextField fx:id="amountField" alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="6" />
|
||||||
<Label text="合同金额" GridPane.rowIndex="6"/>
|
<Label text="合同总数量 *" GridPane.rowIndex="12" />
|
||||||
<TextField fx:id="amountField" alignment="CENTER_RIGHT"
|
<Label text="合同总金额 *" GridPane.rowIndex="13" />
|
||||||
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
|
<Label text="不含税总金额 *" GridPane.rowIndex="14" />
|
||||||
<Label text="合同总数量 *" GridPane.rowIndex="12"/>
|
<Label text="执行总数量 *" GridPane.columnIndex="2" GridPane.rowIndex="12" />
|
||||||
<Label text="合同总金额 *" GridPane.rowIndex="13"/>
|
<Label text="执行总金额 *" GridPane.columnIndex="2" GridPane.rowIndex="13" />
|
||||||
<Label text="不含税总金额 *" GridPane.rowIndex="14"/>
|
<Label text="不含税总金额 *" GridPane.columnIndex="2" GridPane.rowIndex="14" />
|
||||||
<Label text="执行总数量 *" GridPane.columnIndex="2"
|
<TextField fx:id="totalQuantityField" alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="12" />
|
||||||
GridPane.rowIndex="12"/>
|
<TextField fx:id="totalAmountField" alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="13" />
|
||||||
<Label text="执行总金额 *" GridPane.columnIndex="2"
|
<TextField fx:id="totalUnTaxAmountField" alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="14" />
|
||||||
GridPane.rowIndex="13"/>
|
<TextField fx:id="execQuantityField" alignment="CENTER_RIGHT" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="12" />
|
||||||
<Label text="不含税总金额 *" GridPane.columnIndex="2"
|
<TextField fx:id="execAmountField" alignment="CENTER_RIGHT" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="13" />
|
||||||
GridPane.rowIndex="14"/>
|
<TextField fx:id="execUnTaxAmountField" alignment="CENTER_RIGHT" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="14" />
|
||||||
<TextField fx:id="totalQuantityField" alignment="CENTER_RIGHT"
|
<Label text="付款方向 *" GridPane.columnIndex="2" GridPane.rowIndex="6" />
|
||||||
GridPane.columnIndex="1" GridPane.halignment="RIGHT"
|
<TextField fx:id="payWayField" GridPane.columnIndex="3" GridPane.rowIndex="6" />
|
||||||
GridPane.rowIndex="12"/>
|
|
||||||
<TextField fx:id="totalAmountField" alignment="CENTER_RIGHT"
|
|
||||||
GridPane.columnIndex="1" GridPane.halignment="RIGHT"
|
|
||||||
GridPane.rowIndex="13"/>
|
|
||||||
<TextField fx:id="totalUnTaxAmountField" alignment="CENTER_RIGHT"
|
|
||||||
GridPane.columnIndex="1" GridPane.halignment="RIGHT"
|
|
||||||
GridPane.rowIndex="14"/>
|
|
||||||
<TextField fx:id="execQuantityField" alignment="CENTER_RIGHT"
|
|
||||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT"
|
|
||||||
GridPane.rowIndex="12"/>
|
|
||||||
<TextField fx:id="execAmountField" alignment="CENTER_RIGHT"
|
|
||||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT"
|
|
||||||
GridPane.rowIndex="13"/>
|
|
||||||
<TextField fx:id="execUnTaxAmountField" alignment="CENTER_RIGHT"
|
|
||||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT"
|
|
||||||
GridPane.rowIndex="14"/>
|
|
||||||
<Label text="付款方向 *" GridPane.columnIndex="2"
|
|
||||||
GridPane.rowIndex="6"/>
|
|
||||||
<TextField fx:id="payWayField" GridPane.columnIndex="3"
|
|
||||||
GridPane.rowIndex="6"/>
|
|
||||||
</children>
|
</children>
|
||||||
<VBox.margin>
|
<VBox.margin>
|
||||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
|
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<Pane prefHeight="50.0" prefWidth="200.0"/>
|
<Pane prefHeight="50.0" prefWidth="200.0" />
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
</content>
|
</content>
|
||||||
@@ -320,14 +262,13 @@
|
|||||||
<bottom>
|
<bottom>
|
||||||
<HBox id="HBox" alignment="CENTER_LEFT" prefWidth="800.0" spacing="5.0">
|
<HBox id="HBox" alignment="CENTER_LEFT" prefWidth="800.0" spacing="5.0">
|
||||||
<children>
|
<children>
|
||||||
<Label fx:id="leftStatusLabel" maxHeight="1.7976931348623157E308" text="Left status"
|
<Label fx:id="leftStatusLabel" maxHeight="1.7976931348623157E308" text="Left status" HBox.hgrow="ALWAYS">
|
||||||
HBox.hgrow="ALWAYS">
|
|
||||||
</Label>
|
</Label>
|
||||||
<Pane HBox.hgrow="ALWAYS"/>
|
<Pane HBox.hgrow="ALWAYS" />
|
||||||
<Label fx:id="rightStatusLabel" text="Right status" HBox.hgrow="NEVER"/>
|
<Label fx:id="rightStatusLabel" text="Right status" HBox.hgrow="NEVER" />
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
<padding>
|
||||||
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0"/>
|
<Insets bottom="3.0" left="3.0" right="3.0" top="3.0" />
|
||||||
</padding>
|
</padding>
|
||||||
</HBox>
|
</HBox>
|
||||||
</bottom>
|
</bottom>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<?import org.controlsfx.control.ListSelectionView?>
|
<?import org.controlsfx.control.ListSelectionView?>
|
||||||
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="500.0"
|
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="500.0"
|
||||||
prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.ecep.contract.controller.permission.EmployeeFunctionsManagerWindowController">
|
fx:controller="com.ecep.contract.controller.permission.EmployeeFunctionWindowController">
|
||||||
<center>
|
<center>
|
||||||
<TabPane fx:id="tabPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0"
|
<TabPane fx:id="tabPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0"
|
||||||
tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
<Menu text="文件(_F)">
|
<Menu text="文件(_F)">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem onAction="#onCreateNewAction" text="新建…(_N)"/>
|
<MenuItem onAction="#onCreateNewAction" text="新建…(_N)"/>
|
||||||
<MenuItem onAction="#onReBuildFilesAction" text="同步…(_R)"/>
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false"/>
|
<SeparatorMenuItem mnemonicParsing="false"/>
|
||||||
<MenuItem mnemonicParsing="false" text="Preferences…"/>
|
<MenuItem mnemonicParsing="false" text="Preferences…"/>
|
||||||
</items>
|
</items>
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<?import org.controlsfx.control.ListSelectionView?>
|
<?import org.controlsfx.control.ListSelectionView?>
|
||||||
|
|
||||||
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="500.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.controller.permission.EmployeeRoleManagerWindowController">
|
<BorderPane fx:id="root" maxHeight="900" maxWidth="1024" minHeight="300" minWidth="200" prefHeight="500.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/22"
|
||||||
|
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.ecep.contract.controller.permission.EmployeeRoleWindowController">
|
||||||
<center>
|
<center>
|
||||||
<TabPane fx:id="tabPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0" tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
<TabPane fx:id="tabPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0" tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||||
<tabs>
|
<tabs>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
<Menu text="文件(_F)">
|
<Menu text="文件(_F)">
|
||||||
<items>
|
<items>
|
||||||
<MenuItem onAction="#onCreateNewAction" text="新建…(_N)" />
|
<MenuItem onAction="#onCreateNewAction" text="新建…(_N)" />
|
||||||
<MenuItem onAction="#onReBuildFilesAction" text="同步…(_R)" />
|
|
||||||
<SeparatorMenuItem mnemonicParsing="false" />
|
<SeparatorMenuItem mnemonicParsing="false" />
|
||||||
<MenuItem mnemonicParsing="false" text="Preferences…" />
|
<MenuItem mnemonicParsing="false" text="Preferences…" />
|
||||||
</items>
|
</items>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user