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
|
||||
{
|
||||
"tasks": {
|
||||
"CustomTasker": "com.ecep.contract.service.tasker.CustomTasker"
|
||||
// 其他已注册任务...
|
||||
"CustomTasker": "com.ecep.contract.service.tasker.CustomTasker",
|
||||
"OtherTasker": "..."
|
||||
},
|
||||
"descriptions": "任务注册信息, 客户端的任务可以通过 WebSocket 调用"
|
||||
}
|
||||
@@ -137,6 +137,7 @@ WebSocketServerTaskManager类在启动时会读取`tasker_mapper.json`文件,
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
// 调用父类初始化
|
||||
super.execute(holder);
|
||||
updateTitle("同步修复所有合同");
|
||||
// 执行具体业务逻辑
|
||||
repair(holder);
|
||||
return null; // 通常返回 null 或处理结果
|
||||
@@ -146,7 +147,6 @@ WebSocketServerTaskManager类在启动时会读取`tasker_mapper.json`文件,
|
||||
5. **使用更新方法提供状态反馈**:在执行过程中使用 `updateTitle`、`updateProgress` 等方法提供实时反馈
|
||||
|
||||
```java
|
||||
updateTitle("同步修复所有合同");
|
||||
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地址
|
||||
3. 打包为可执行jar或使用jpackage创建安装包
|
||||
|
||||
## 开发环境要求
|
||||
## Tasker实现规范指南
|
||||
|
||||
有关Tasker框架的详细实现规范,请参阅 [Tasker实现规范指南](docs/task/tasker_implementation_guide.md)。
|
||||
|
||||
## 开发环境要求
|
||||
- JDK 21
|
||||
- Maven 3.6+
|
||||
- MySQL 8.0+
|
||||
@@ -193,6 +196,3 @@ Contract-Manager/
|
||||
3. 增强系统安全机制
|
||||
4. 改进用户界面体验
|
||||
5. 扩展更多云端服务集成
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
<parent>
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>Contract-Manager</artifactId>
|
||||
<version>0.0.134-SNAPSHOT</version>
|
||||
<version>0.0.135-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>client</artifactId>
|
||||
<version>0.0.134-SNAPSHOT</version>
|
||||
<version>0.0.135-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>com.ecep.contract</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>0.0.134-SNAPSHOT</version>
|
||||
<version>0.0.135-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -206,6 +206,12 @@ public class WebSocketClientService {
|
||||
send(objectMapper.writeValueAsString(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* WebSocketServerCallbackManage#onMessage 负责接收处理
|
||||
*
|
||||
* @param msg
|
||||
* @return
|
||||
*/
|
||||
public CompletableFuture<JsonNode> send(SimpleMessage msg) {
|
||||
CompletableFuture<JsonNode> future = new CompletableFuture<>();
|
||||
try {
|
||||
@@ -353,14 +359,6 @@ public class WebSocketClientService {
|
||||
return online;
|
||||
}
|
||||
|
||||
public void withSession(Consumer<WebSocketClientSession> sessionConsumer) {
|
||||
WebSocketClientSession session = createSession();
|
||||
try {
|
||||
sessionConsumer.accept(session);
|
||||
} finally {
|
||||
// closeSession(session);vvvv
|
||||
}
|
||||
}
|
||||
|
||||
public void closeSession(WebSocketClientSession session) {
|
||||
if (session != null) {
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
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.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
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
|
||||
private final String sessionId = UUID.randomUUID().toString();
|
||||
@Getter
|
||||
private boolean done = false;
|
||||
|
||||
private WebSocketClientTasker tasker;
|
||||
|
||||
@@ -69,6 +68,8 @@ public class WebSocketClientSession {
|
||||
handleAsStart(args);
|
||||
} else if (type.equals("done")) {
|
||||
handleAsDone(args);
|
||||
done = true;
|
||||
close();
|
||||
} else {
|
||||
tasker.updateMessage(java.util.logging.Level.INFO, "未知的消息类型: " + node.toString());
|
||||
}
|
||||
@@ -83,7 +84,6 @@ public class WebSocketClientSession {
|
||||
|
||||
private void handleAsDone(JsonNode args) {
|
||||
tasker.updateMessage(java.util.logging.Level.INFO, "任务完成");
|
||||
close();
|
||||
}
|
||||
|
||||
private void handleAsProgress(JsonNode args) {
|
||||
|
||||
@@ -5,17 +5,19 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* WebSocket客户端任务接口
|
||||
* 定义了所有通过WebSocket与服务器通信的任务的通用方法
|
||||
* 包括任务名称、更新消息、更新标题、更新进度等操作
|
||||
*
|
||||
* <p>
|
||||
* 所有通过WebSocket与服务器通信的任务类都应实现此接口, 文档参考 .trace/rules/client_task_rules.md
|
||||
*/
|
||||
public interface WebSocketClientTasker {
|
||||
/**s
|
||||
/**
|
||||
* s
|
||||
* 获取任务名称
|
||||
* 任务名称用于唯一标识任务, 服务器端会根据任务名称来调用对应的任务处理函数
|
||||
*
|
||||
@@ -55,6 +57,9 @@ public interface WebSocketClientTasker {
|
||||
*/
|
||||
default void cancelTask() {
|
||||
// 默认实现为空,由具体任务重写
|
||||
// 需要获取到 session
|
||||
// 发送 cancel 指令
|
||||
// 关闭 session.close()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +81,7 @@ public interface WebSocketClientTasker {
|
||||
return null;
|
||||
}
|
||||
|
||||
webSocketService.withSession(session -> {
|
||||
WebSocketClientSession session = webSocketService.createSession();
|
||||
try {
|
||||
session.submitTask(this, locale, args);
|
||||
holder.info("已提交任务到服务器: " + getTaskName());
|
||||
@@ -85,7 +90,16 @@ public interface WebSocketClientTasker {
|
||||
holder.warn(errorMsg);
|
||||
throw new RuntimeException("任务提交失败: " + e.getMessage(), e);
|
||||
}
|
||||
});
|
||||
|
||||
// while (!session.isDone()) {
|
||||
// // 使用TimeUnit
|
||||
// try {
|
||||
// TimeUnit.SECONDS.sleep(1);
|
||||
// } catch (InterruptedException e) {
|
||||
// Thread.currentThread().interrupt();
|
||||
// }
|
||||
// }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,15 +45,33 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
||||
protected CompletableFuture<T> loadedFuture;
|
||||
private final ObservableList<TabSkin> tabSkins = FXCollections.observableArrayList();
|
||||
|
||||
|
||||
@Override
|
||||
public void onShown(WindowEvent 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();
|
||||
|
||||
if (service instanceof QueryService<T, TV> queryService) {
|
||||
setStatus("读取...");
|
||||
loadedFuture = queryService.asyncFindById(viewModel.getId().get());
|
||||
|
||||
} else {
|
||||
loadedFuture = CompletableFuture.supplyAsync(() -> {
|
||||
return getViewModelService().findById(viewModel.getId().get());
|
||||
@@ -72,14 +90,6 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
||||
handleException("载入失败,#" + viewModel.getId().get(), ex);
|
||||
return null;
|
||||
});
|
||||
|
||||
registerTabSkins();
|
||||
if (saveBtn != null) {
|
||||
saveBtn.disableProperty().bind(createTabSkinChangedBindings().not());
|
||||
saveBtn.setOnAction(event -> saveTabSkins());
|
||||
}
|
||||
|
||||
installTabSkins();
|
||||
}
|
||||
|
||||
protected void updateViewModel(T entity) {
|
||||
@@ -105,6 +115,19 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
||||
return saved;
|
||||
}
|
||||
|
||||
public void save() {
|
||||
T entity = getEntity();
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
if (viewModel.copyTo(entity)) {
|
||||
save(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册 skin
|
||||
*/
|
||||
protected void registerTabSkins() {
|
||||
}
|
||||
|
||||
@@ -116,6 +139,9 @@ public abstract class AbstEntityController<T extends IdentityEntity, TV extends
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安装 skin
|
||||
*/
|
||||
protected void installTabSkins() {
|
||||
for (TabSkin tabSkin : tabSkins) {
|
||||
try {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.ecep.contract.controller.AbstEntityManagerSkin;
|
||||
import com.ecep.contract.controller.ManagerSkin;
|
||||
import com.ecep.contract.controller.company.CompanyWindowController;
|
||||
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.service.CompanyService;
|
||||
import com.ecep.contract.service.YongYouU8Service;
|
||||
@@ -15,6 +16,7 @@ import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.cell.CheckBoxTableCell;
|
||||
|
||||
public class YongYouU8ManagerSkin
|
||||
extends
|
||||
@@ -36,10 +38,9 @@ public class YongYouU8ManagerSkin
|
||||
@Override
|
||||
public void initializeTable() {
|
||||
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.setCellFactory(param -> new LocalDateTimeTableCell<>());
|
||||
@@ -47,7 +48,14 @@ public class YongYouU8ManagerSkin
|
||||
controller.cloudLatestColumn.setCellValueFactory(param -> param.getValue().getCloudLatest());
|
||||
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
|
||||
@@ -73,7 +81,7 @@ public class YongYouU8ManagerSkin
|
||||
}
|
||||
for (CloudYuInfoViewModel selectedItem : selectedItems) {
|
||||
CloudYuVo yongYouU8Vo = getU8Service().findById(selectedItem.getId().get());
|
||||
selectedItem.getCustomerCode().set("");
|
||||
selectedItem.getExceptionMessage().set("");
|
||||
if (selectedItem.copyTo(yongYouU8Vo)) {
|
||||
CloudYuVo saved = getU8Service().save(yongYouU8Vo);
|
||||
selectedItem.update(saved);
|
||||
|
||||
@@ -37,8 +37,10 @@ public class YongYouU8ManagerWindowController
|
||||
public TableColumn<CloudYuInfoViewModel, Number> idColumn;
|
||||
public TableColumn<CloudYuInfoViewModel, LocalDateTime> latestUpdateColumn;
|
||||
public TableColumn<CloudYuInfoViewModel, Integer> companyColumn;
|
||||
public TableColumn<CloudYuInfoViewModel, String> cloudIdColumn;
|
||||
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;
|
||||
|
||||
@Override
|
||||
@@ -91,27 +93,32 @@ public class YongYouU8ManagerWindowController
|
||||
|
||||
public void onContractGroupSyncAction(ActionEvent event) {
|
||||
ContractGroupSyncTask task = new ContractGroupSyncTask();
|
||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
UITools.showTaskDialogAndWait("合同组数据同步", task, null);
|
||||
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
}
|
||||
|
||||
public void onContractTypeSyncAction(ActionEvent event) {
|
||||
ContractTypeSyncTask task = new ContractTypeSyncTask();
|
||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
UITools.showTaskDialogAndWait("合同类型数据同步", task, null);
|
||||
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
}
|
||||
|
||||
public void onContractKindSyncAction(ActionEvent event) {
|
||||
ContractKindSyncTask task = new ContractKindSyncTask();
|
||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
UITools.showTaskDialogAndWait("合同类型数据同步", task, null);
|
||||
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
}
|
||||
|
||||
public void onVendorClassSyncAction(ActionEvent event) {
|
||||
VendorClassSyncTask task = new VendorClassSyncTask();
|
||||
Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
UITools.showTaskDialogAndWait("客户分类数据同步", task, null);
|
||||
// Desktop.instance.getTaskMonitorCenter().registerAndStartTask(task);
|
||||
}
|
||||
|
||||
public void onCustomerClassSyncAction(ActionEvent event) {
|
||||
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.cell.ContractFileTypeTableCell;
|
||||
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.ContractFileTypeService;
|
||||
import com.ecep.contract.util.FxmlPath;
|
||||
@@ -22,7 +21,6 @@ import javafx.event.ActionEvent;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.stage.WindowEvent;
|
||||
import javafx.util.StringConverter;
|
||||
import lombok.Setter;
|
||||
import org.apache.pdfbox.Loader;
|
||||
import org.apache.pdfbox.io.IOUtils;
|
||||
@@ -95,21 +93,6 @@ public class ContractTabSkinFiles
|
||||
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
|
||||
public void initializeTab() {
|
||||
TableView<ContractFileViewModel> table = getTableView();
|
||||
@@ -135,6 +118,7 @@ public class ContractTabSkinFiles
|
||||
.setCellFactory(ContractFileTypeTableCell.forTableColumn(getCachedBean(ContractFileTypeService.class)));
|
||||
fileTable_typeColumn.setEditable(false);
|
||||
|
||||
|
||||
/* 文件名编辑器 */
|
||||
fileTable_filePathColumn.setCellValueFactory(param -> param.getValue().getFileName());
|
||||
fileTable_filePathColumn.setCellFactory(TextFieldTableCell.forTableColumn());
|
||||
@@ -194,6 +178,34 @@ public class ContractTabSkinFiles
|
||||
createVendorContractRequestByTemplateUpdateMenuItem(),
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -541,13 +553,13 @@ public class ContractTabSkinFiles
|
||||
//
|
||||
fileTable_menu_change_type.setVisible(true);
|
||||
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());
|
||||
}
|
||||
|
||||
fileTable_menu_change_type_and_name.setVisible(true);
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -560,7 +572,7 @@ public class ContractTabSkinFiles
|
||||
if (selectedItems == null || selectedItems.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ContractFileTypeLocal typeLocal = (ContractFileTypeLocal) item.getProperties().get("typeLocal");
|
||||
ContractFileTypeLocalVo typeLocal = (ContractFileTypeLocalVo) item.getProperties().get("typeLocal");
|
||||
if (typeLocal == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
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.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -50,13 +53,6 @@ import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
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.stage.FileChooser;
|
||||
import javafx.stage.Modality;
|
||||
@@ -79,6 +75,7 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
return super.show(loader, owner, modality);
|
||||
}
|
||||
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public static class MessageExt extends Message {
|
||||
@@ -90,12 +87,16 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Model implements MessageHolder {
|
||||
public static class Model {
|
||||
private SimpleStringProperty code = new SimpleStringProperty();
|
||||
private SimpleStringProperty name = new SimpleStringProperty();
|
||||
private SimpleObjectProperty<Integer> employee = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<LocalDate> setupDate = new SimpleObjectProperty<>();
|
||||
private SimpleListProperty<MessageExt> messages = new SimpleListProperty<>(FXCollections.observableArrayList());
|
||||
}
|
||||
|
||||
static class MessageHolderImpl implements MessageHolder {
|
||||
List<MessageExt> messages = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void addMessage(Level level, String message) {
|
||||
@@ -261,6 +262,8 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
long total = contractService.count(params);
|
||||
setStatus("合同:" + total + " 条");
|
||||
|
||||
MessageHolderImpl messageHolder = new MessageHolderImpl();
|
||||
|
||||
while (true) {
|
||||
if (isCloseRequested()) {
|
||||
break;
|
||||
@@ -268,6 +271,7 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
|
||||
Page<ContractVo> page = contractService.findAll(params, pageRequest);
|
||||
for (ContractVo contract : page) {
|
||||
messageHolder.messages.clear();
|
||||
if (isCloseRequested()) {
|
||||
break;
|
||||
}
|
||||
@@ -285,11 +289,11 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
model.getName().set(contract.getName());
|
||||
model.getSetupDate().set(contract.getSetupDate());
|
||||
|
||||
comm.verify(contract, model);
|
||||
comm.verify(contract, messageHolder);
|
||||
setStatus("合同验证进度:" + counter.get() + " / " + total);
|
||||
// 移除中间消息
|
||||
if (!model.getMessages().isEmpty()) {
|
||||
model.getMessages().removeIf(msg -> msg.getLevel().intValue() <= Level.INFO.intValue());
|
||||
if (!messageHolder.messages.isEmpty()) {
|
||||
model.getMessages().setAll(messageHolder.messages.stream().filter(msg -> msg.getLevel().intValue() > Level.INFO.intValue()).limit(50).toList());
|
||||
}
|
||||
if (model.getMessages().isEmpty()) {
|
||||
if (onlyShowVerifiedChecker.isSelected()) {
|
||||
@@ -325,6 +329,7 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
}
|
||||
runAsync(() -> {
|
||||
ContractVo contract = null;
|
||||
MessageHolderImpl messageHolder = new MessageHolderImpl();
|
||||
try {
|
||||
contract = contractService.findByCode(contractCode);
|
||||
} catch (Exception e) {
|
||||
@@ -336,17 +341,18 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
}
|
||||
model.getMessages().clear();
|
||||
try {
|
||||
comm.verify(contract, model);
|
||||
// 移除中间消息
|
||||
if (!model.getMessages().isEmpty()) {
|
||||
model.getMessages().removeIf(msg -> msg.getLevel().intValue() <= Level.INFO.intValue());
|
||||
}
|
||||
comm.verify(contract, messageHolder);
|
||||
} catch (Exception 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(() -> {
|
||||
viewTableDataSet.remove(model);
|
||||
});
|
||||
@@ -380,6 +386,38 @@ public class ContractVerifyWindowController extends BaseController {
|
||||
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) {
|
||||
FileChooser chooser = new FileChooser();
|
||||
chooser.setTitle("导出核验结果");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.controller.contract;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javafx.scene.control.*;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -26,13 +27,6 @@ import com.ecep.contract.vo.ContractVo;
|
||||
|
||||
import javafx.collections.ObservableList;
|
||||
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.stage.Window;
|
||||
import javafx.stage.WindowEvent;
|
||||
@@ -44,6 +38,8 @@ import javafx.stage.WindowEvent;
|
||||
public class ContractWindowController
|
||||
extends AbstEntityController<ContractVo, ContractViewModel> {
|
||||
|
||||
|
||||
|
||||
public static void show(ContractVo contract, Window owner) {
|
||||
show(ContractViewModel.from(contract), owner);
|
||||
}
|
||||
@@ -69,6 +65,7 @@ public class ContractWindowController
|
||||
public Button openRelativeCompanyVendorBtn;
|
||||
|
||||
public TextField nameField;
|
||||
public CheckBox contractNameLockedCk;
|
||||
public TextField guidField;
|
||||
public TextField codeField;
|
||||
public TextField parentCodeField;
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
package com.ecep.contract.controller.customer;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
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.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.pdmodel.PDDocument;
|
||||
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.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.controller.BaseController;
|
||||
@@ -32,11 +45,9 @@ import com.ecep.contract.vm.CustomerFileViewModel;
|
||||
|
||||
import javafx.application.Platform;
|
||||
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.geometry.Bounds;
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.DatePicker;
|
||||
import javafx.scene.control.Label;
|
||||
@@ -58,8 +69,16 @@ import javafx.stage.WindowEvent;
|
||||
@Scope("prototype")
|
||||
@Component
|
||||
@FxmlPath("/ui/company/customer/customer_evaluation_form.fxml")
|
||||
public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntityController<CompanyCustomerEvaluationFormFileVo, CompanyCustomerEvaluationFormFileViewModel> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CompanyCustomerEvaluationFormFileWindowController.class);
|
||||
public class CompanyCustomerEvaluationFormFileWindowController
|
||||
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) {
|
||||
show(CompanyCustomerEvaluationFormFileViewModel.from(saved), window);
|
||||
@@ -69,7 +88,6 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
show(CompanyCustomerEvaluationFormFileWindowController.class, viewModel, window);
|
||||
}
|
||||
|
||||
|
||||
public Label idField;
|
||||
public TextField filePathField;
|
||||
public CheckBox validField;
|
||||
@@ -88,67 +106,66 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
public ScrollPane leftPane;
|
||||
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 SimpleObjectProperty<Image> imageProperty = new SimpleObjectProperty<>();
|
||||
private CustomerFileViewModel fileViewModel;
|
||||
|
||||
private SimpleStringProperty filePathProperty = new SimpleStringProperty();
|
||||
private SimpleStringProperty editFilePathProperty = new SimpleStringProperty();
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CompanyCustomerFileService companyCustomerFileService;
|
||||
private SimpleBooleanProperty changed = new SimpleBooleanProperty(false);
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CompanyCustomerEvaluationFormFileService evaluationFormFileService;
|
||||
|
||||
|
||||
@Override
|
||||
public void show(Stage stage) {
|
||||
super.show(stage);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShown(WindowEvent windowEvent) {
|
||||
super.onShown(windowEvent);
|
||||
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
|
||||
public ViewModelService<CompanyCustomerEvaluationFormFileVo, CompanyCustomerEvaluationFormFileViewModel> getViewModelService() {
|
||||
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) -> {
|
||||
if (newValue != null) {
|
||||
for (Toggle toggle : group.getToggles()) {
|
||||
@@ -164,6 +181,7 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
return;
|
||||
}
|
||||
}
|
||||
changed.set(true);
|
||||
}
|
||||
Platform.runLater(() -> {
|
||||
group.selectToggle(null);
|
||||
@@ -182,9 +200,11 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
}
|
||||
String data = (String) toggle.getUserData();
|
||||
property.set(data);
|
||||
changed.set(true);
|
||||
};
|
||||
|
||||
BiConsumer<ToggleGroup, Number> numberRadioGroupUpdater = (group, newValue) -> {
|
||||
System.out.println("group = " + group + ", newValue = " + newValue);
|
||||
String value = String.valueOf(newValue);
|
||||
for (Toggle toggle : group.getToggles()) {
|
||||
String data = (String) toggle.getUserData();
|
||||
@@ -201,6 +221,7 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
// RadioButton btn = (RadioButton) first;
|
||||
// btn.setText(String.valueOf(newValue));
|
||||
});
|
||||
changed.set(true);
|
||||
};
|
||||
|
||||
BiConsumer<SimpleIntegerProperty, Toggle> numberPropertyUpdater = (property, toggle) -> {
|
||||
@@ -210,9 +231,9 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
}
|
||||
String data = (String) toggle.getUserData();
|
||||
property.set(Integer.parseInt(data));
|
||||
changed.set(true);
|
||||
};
|
||||
|
||||
|
||||
int totalScoreToLevel(int score) {
|
||||
if (score >= 200) {
|
||||
return 4;
|
||||
@@ -227,63 +248,73 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
}
|
||||
|
||||
boolean calcValid() {
|
||||
if (creditLevelProperty.get() <= 0) {
|
||||
if (viewModel.getCreditLevel().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (!StringUtils.hasText(catalogProperty.get())) {
|
||||
if (!StringUtils.hasText(viewModel.getCatalog().get())) {
|
||||
return false;
|
||||
}
|
||||
if (!StringUtils.hasText(levelProperty.get())) {
|
||||
if (!StringUtils.hasText(viewModel.getLevel().get())) {
|
||||
return false;
|
||||
}
|
||||
if (score1Property.get() <= 0) {
|
||||
|
||||
if (viewModel.getScore1().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (score2Property.get() <= 0) {
|
||||
if (viewModel.getScore2().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (score3Property.get() <= 0) {
|
||||
if (viewModel.getScore3().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (score4Property.get() <= 0) {
|
||||
if (viewModel.getScore4().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (score5Property.get() <= 0) {
|
||||
if (viewModel.getScore5().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
if (creditLevelProperty.get() <= 0) {
|
||||
if (viewModel.getCreditLevel().get() <= 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void initializePane() {
|
||||
setStatus("");
|
||||
idField.textProperty().bind(viewModel.getId().asString());
|
||||
filePathField.textProperty().bind(filePathProperty);
|
||||
editFilePathField.textProperty().bind(editFilePathProperty);
|
||||
// signDateField.valueProperty().bindBidirectional(viewModel.getSignDate());
|
||||
// validField.selectedProperty().bindBidirectional(viewModel.getValid());
|
||||
|
||||
initializeRadioGroup(catalog, catalogProperty);
|
||||
initializeRadioGroup(level, levelProperty);
|
||||
|
||||
initializeRadioGroup(score1, score1Property);
|
||||
initializeRadioGroup(score2, score2Property);
|
||||
initializeRadioGroup(score3, score3Property);
|
||||
initializeRadioGroup(score4, score4Property);
|
||||
initializeRadioGroup(score5, score5Property);
|
||||
|
||||
creditLevelProperty.addListener((observable, oldValue, newValue) -> {
|
||||
numberRadioGroupUpdater.accept(creditLevel, newValue);
|
||||
filePathField.textProperty().bind(fileViewModel.getFilePath());
|
||||
editFilePathField.textProperty().bind(fileViewModel.getEditFilePath());
|
||||
String pattern = "yyyy-MM-dd";
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||
signDateField.setConverter(new LocalDateStringConverter(formatter, null));
|
||||
signDateField.valueProperty().bindBidirectional(fileViewModel.getSignDate());
|
||||
signDateField.valueProperty().addListener((observable, oldValue, newValue) -> {
|
||||
changed.set(true);
|
||||
});
|
||||
|
||||
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(() -> {
|
||||
int total = 0;
|
||||
for (SimpleIntegerProperty score : scores) {
|
||||
total += score.get();
|
||||
}
|
||||
creditLevelProperty.set(totalScoreToLevel(total));
|
||||
viewModel.getCreditLevel().set(totalScoreToLevel(total));
|
||||
return total;
|
||||
}, scores));
|
||||
|
||||
@@ -291,27 +322,191 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
return "合计总分:" + score;
|
||||
}));
|
||||
|
||||
Bindings.createBooleanBinding(() -> {
|
||||
boolean valid = calcValid();
|
||||
// viewModel.getValid().set(valid);
|
||||
return valid;
|
||||
}, catalogProperty, levelProperty, score1Property, score2Property, score3Property, score4Property, score5Property, creditLevelProperty).addListener(((observable, oldValue, newValue) -> {
|
||||
logger.info("valid:{}", newValue);
|
||||
}));
|
||||
Bindings.createBooleanBinding(this::calcValid, viewModel.getCatalog(), viewModel.getLevel(),
|
||||
viewModel.getScore1(), viewModel.getScore2(), viewModel.getScore3(), viewModel.getScore4(),
|
||||
viewModel.getScore5(), viewModel.getCreditLevel())
|
||||
.addListener((observable, oldValue, newValue) -> {
|
||||
fileViewModel.getValid().set(newValue);
|
||||
changed.set(true);
|
||||
});
|
||||
validField.selectedProperty().bindBidirectional(fileViewModel.getValid());
|
||||
validField.setSelected(fileViewModel.getValid().getValue());
|
||||
|
||||
fileViewModel.getFilePath().addListener((observable, oldValue, newValue) -> {
|
||||
File file = new File(newValue);
|
||||
loadFile(file);
|
||||
});
|
||||
if (StringUtils.hasText(fileViewModel.getFilePath().get())) {
|
||||
loadFile(new File(fileViewModel.getFilePath().get()));
|
||||
}
|
||||
|
||||
|
||||
imageView.imageProperty().bind(filePathProperty.map(path -> {
|
||||
if (FileUtils.withExtensions(path, FileUtils.PDF)) {
|
||||
File pdfFile = new File(path);
|
||||
try (PDDocument pdDocument = Loader.loadPDF(pdfFile)) {
|
||||
leftPane.widthProperty().addListener((observable, oldValue, newValue) -> {
|
||||
Platform.runLater(() -> {
|
||||
imageView.setFitWidth(leftPane.getWidth());
|
||||
imageView.setFitHeight(-1);
|
||||
});
|
||||
});
|
||||
|
||||
imageView.setFitWidth(leftPane.getWidth());
|
||||
imageView.setFitHeight(-1);
|
||||
|
||||
imageView.setOnScroll(event -> {
|
||||
Bounds bounds = imageView.getBoundsInLocal();
|
||||
imageView.setFitWidth(bounds.getWidth() + event.getDeltaY());
|
||||
imageView.setFitHeight(-1);
|
||||
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();
|
||||
WritableImage writableImage = new WritableImage(width, height);
|
||||
PixelWriter pixelWriter = writableImage.getPixelWriter();
|
||||
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++) {
|
||||
@@ -319,42 +514,13 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
pixelWriter.setArgb(x, y, argb);
|
||||
}
|
||||
}
|
||||
return writableImage;
|
||||
setStatus();
|
||||
Platform.runLater(() -> {
|
||||
imageView.setImage(writableImage1);
|
||||
});
|
||||
} 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) -> {
|
||||
Platform.runLater(() -> {
|
||||
imageView.setFitWidth(leftPane.getWidth());
|
||||
imageView.setFitHeight(leftPane.getHeight());
|
||||
});
|
||||
});
|
||||
|
||||
imageView.setFitWidth(leftPane.getWidth());
|
||||
imageView.setFitHeight(leftPane.getHeight());
|
||||
|
||||
imageView.setOnScroll(event -> {
|
||||
System.out.println("event = " + event);
|
||||
System.out.println("event.getDeltaY() = " + event.getDeltaY());
|
||||
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());
|
||||
// } else {
|
||||
imageView.setFitHeight(bounds.getHeight() + event.getDeltaY());
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -365,6 +531,7 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
toggleGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
|
||||
stringPropertyUpdater.accept(property, newValue);
|
||||
});
|
||||
stringRadioGroupUpdater.accept(toggleGroup, property.getValue());
|
||||
}
|
||||
|
||||
private void initializeRadioGroup(ToggleGroup toggleGroup, SimpleIntegerProperty property) {
|
||||
@@ -375,21 +542,8 @@ public class CompanyCustomerEvaluationFormFileWindowController extends AbstEntit
|
||||
toggleGroup.selectedToggleProperty().addListener((observable, oldValue, 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
|
||||
if (!FileUtils.withExtensions(item.getFilePath().get(), FileUtils.XLS,
|
||||
FileUtils.XLSX)) {
|
||||
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getEvaluationFormFileService()
|
||||
.findByCustomerFile(item.getId().get());
|
||||
CompanyCustomerEvaluationFormFileWindowController.show(evaluationFormFile,
|
||||
CompanyCustomerEvaluationFormFileWindowController.show(item,
|
||||
controller.root.getScene().getWindow());
|
||||
return;
|
||||
}
|
||||
@@ -211,10 +209,7 @@ public class CustomerTabSkinFile
|
||||
model.update(saved);
|
||||
dataSet.add(model);
|
||||
|
||||
CompanyCustomerEvaluationFormFileVo evaluationFormFile = getCachedBean(
|
||||
CompanyCustomerEvaluationFormFileService.class).findByCustomerFile(saved);
|
||||
|
||||
CompanyCustomerEvaluationFormFileWindowController.show(evaluationFormFile,
|
||||
CompanyCustomerEvaluationFormFileWindowController.show(model,
|
||||
getTableView().getScene().getWindow());
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class EmployeeManagerSkin
|
||||
controller.accountColumn.setCellValueFactory(param -> param.getValue().getAccount());
|
||||
|
||||
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.createdColumn.setCellValueFactory(param -> param.getValue().getCreated());
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.ecep.contract.controller.employee;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import com.ecep.contract.controller.tab.TabSkin;
|
||||
@@ -48,7 +50,7 @@ public class EmployeeTabSkinRole
|
||||
|
||||
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();
|
||||
|
||||
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 onReBuildFilesAction(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public FunctionService getViewModelService() {
|
||||
|
||||
@@ -54,9 +54,6 @@ public class EmployeeRoleManagerWindowController
|
||||
public void onCreateNewAction(ActionEvent event) {
|
||||
}
|
||||
|
||||
public void onReBuildFilesAction(ActionEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmployeeRoleService getViewModelService() {
|
||||
return employeeRoleService;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class EmployeeRoleTabSkinFunctions extends AbstEmployeeRoleBasedTabSkin {
|
||||
}
|
||||
|
||||
private void loadSelectedRoles() {
|
||||
List<FunctionVo> selectedRoles = getRoleService().getFunctionsByRoleId(viewModel.getId().get());
|
||||
List<FunctionVo> selectedRoles = getRoleService().getFunctionsByRole(getEntity());
|
||||
if (selectedRoles != null) {
|
||||
functionsField.getTargetItems().setAll(selectedRoles);
|
||||
}
|
||||
@@ -100,8 +100,7 @@ public class EmployeeRoleTabSkinFunctions extends AbstEmployeeRoleBasedTabSkin {
|
||||
|
||||
private void saveRoles(ActionEvent event) {
|
||||
EmployeeRoleVo entity = getEntity();
|
||||
entity.setFunctions(functionsField.getTargetItems());
|
||||
save(entity);
|
||||
getRoleService().saveRoleFunctions(entity, functionsField.getTargetItems());
|
||||
loadSelectedRoles();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +69,6 @@ public class CompanyTabSkinBankAccount
|
||||
bankAccountTable_openingBankColumn.setCellValueFactory(param -> param.getValue().getOpeningBank());
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,12 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
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.UITools;
|
||||
import com.ecep.contract.vo.CompanyOldNameVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -138,53 +142,20 @@ public class CompanyTabSkinOldName
|
||||
}
|
||||
|
||||
private void onTableMergeAction(ActionEvent event) {
|
||||
CompanyVo updater = getParent();
|
||||
HashSet<String> nameSet = new HashSet<>();
|
||||
nameSet.add(updater.getName());
|
||||
// 收集所有曾用名
|
||||
List<String> nameList = dataSet.stream()
|
||||
.map(viewModel -> viewModel.getName().get())
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
|
||||
List<CompanyOldNameViewModel> removes = new ArrayList<>();
|
||||
for (CompanyOldNameViewModel viewModel : dataSet) {
|
||||
// 创建独立的WebSocket客户端任务器
|
||||
CompanyMergeClientTasker task = new CompanyMergeClientTasker();
|
||||
|
||||
if (!nameSet.add(viewModel.getName().get())) {
|
||||
// fixed 曾用名中有重复时,删除重复的
|
||||
deleteRow(viewModel);
|
||||
removes.add(viewModel);
|
||||
}
|
||||
}
|
||||
if (!removes.isEmpty()) {
|
||||
Platform.runLater(() -> {
|
||||
dataSet.removeAll(removes);
|
||||
});
|
||||
setStatus("移除重复的曾用名" + removes.size());
|
||||
}
|
||||
task.setCompany(getParent());
|
||||
task.setNameList(nameList);
|
||||
UITools.showTaskDialogAndWait("合并曾用名", task, null);
|
||||
|
||||
int size = nameSet.size();
|
||||
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("");
|
||||
loadTableDataSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,7 +172,7 @@ public class CompanyTabSkinOldName
|
||||
return;
|
||||
}
|
||||
String path = viewModel.getPath().get();
|
||||
if (StringUtils.hasText(path)) {
|
||||
if (org.springframework.util.StringUtils.hasText(path)) {
|
||||
if (item.startsWith(path)) {
|
||||
item = "~" + item.substring(path.length());
|
||||
}
|
||||
|
||||
@@ -97,8 +97,10 @@ public class CompanyTabSkinOther
|
||||
// Yu //
|
||||
public TitledPane yuCloudPane;
|
||||
public TextField cloudYuIdField;
|
||||
public TextField cloudYuCloudIdField;
|
||||
public TextField cloudYuLatestField;
|
||||
public TextField cloudYuVendorUpdateDateField;
|
||||
public TextField cloudYuCustomerUpdateDateField;
|
||||
public CheckBox cloudYuActiveField;
|
||||
public Label cloudYuVersionLabel;
|
||||
public Button yuCloudPaneSaveButton;
|
||||
|
||||
@@ -417,8 +419,10 @@ public class CompanyTabSkinOther
|
||||
}
|
||||
|
||||
cloudYuIdField.textProperty().bind(yuCloudInfoViewModel.getId().asString());
|
||||
cloudYuCloudIdField.textProperty().bindBidirectional(yuCloudInfoViewModel.getCloudId());
|
||||
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"));
|
||||
|
||||
Button button = yuCloudPaneSaveButton;
|
||||
@@ -436,6 +440,34 @@ public class CompanyTabSkinOther
|
||||
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) {
|
||||
@@ -516,10 +548,12 @@ public class CompanyTabSkinOther
|
||||
CompanyExtendInfoViewModel viewModel = extendInfoViewModel;
|
||||
CompanyExtendInfoService service = getExtendInfoService();
|
||||
CompanyExtendInfoVo extendInfo = service.findByCompany(company);
|
||||
if (extendInfo != null) {
|
||||
Platform.runLater(() -> {
|
||||
viewModel.update(extendInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
CloudRkService getCloudRkService() {
|
||||
if (cloudRkService == null) {
|
||||
|
||||
@@ -85,7 +85,9 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
||||
|
||||
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.parentCodeField.textProperty().bindBidirectional(viewModel.getParentCode());
|
||||
@@ -351,8 +353,10 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
||||
}
|
||||
if (initialDirectory == null) {
|
||||
if (entity.getPayWay() == ContractPayWay.RECEIVE) {
|
||||
Integer projectId = entity.getProject();
|
||||
if (projectId != null) {
|
||||
// 根据项目设置初始目录
|
||||
ProjectVo project = getProjectService().findById(entity.getProject());
|
||||
ProjectVo project = getProjectService().findById(projectId);
|
||||
if (project != null) {
|
||||
// 根据项目销售方式设置初始目录
|
||||
ProjectSaleTypeVo saleType = getSaleTypeService().findById(project.getSaleTypeId());
|
||||
@@ -364,6 +368,7 @@ public class ContractTabSkinBase extends AbstContractBasedTabSkin {
|
||||
initialDirectory = dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (entity.getPayWay() == ContractPayWay.PAY) {
|
||||
// 根据上级合同设置初始目录
|
||||
String parentCode = entity.getParentCode();
|
||||
|
||||
@@ -4,10 +4,15 @@ import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.service.DepartmentService;
|
||||
import com.ecep.contract.vo.DepartmentVo;
|
||||
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.util.Callback;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
public class DepartmentTableCell<T> extends AsyncUpdateTableCell<T, Integer, DepartmentVo> {
|
||||
|
||||
public DepartmentTableCell(DepartmentService service) {
|
||||
setService(service);
|
||||
}
|
||||
@@ -17,4 +22,20 @@ public class DepartmentTableCell<T> extends AsyncUpdateTableCell<T, Integer, Dep
|
||||
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() {
|
||||
VendorType item = getItem();
|
||||
VendorTypeLocalVo localVo = getServiceBean().findByType(item);
|
||||
System.out.println("item = " + item + ", localVo = " + getServiceBean().getStringConverter().toString(localVo));
|
||||
return localVo;
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,7 @@ public class VendorApprovedListTabSkinVendors
|
||||
task.setEveryYearMinContracts(qualifiedVendorEveryYearMinContractsSpinner.getValue());
|
||||
|
||||
UITools.showTaskDialogAndWait("导入供方", task, null);
|
||||
loadTableDataSet();
|
||||
}
|
||||
|
||||
public void onVendorTableRefreshAction(ActionEvent event) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ecep.contract.constant.CompanyVendorConstant;
|
||||
import com.ecep.contract.service.*;
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
@@ -119,7 +120,8 @@ public class VendorApprovedListVendorExportTask extends Tasker<Object> {
|
||||
}
|
||||
|
||||
private File getVendorApprovedListTemplate() {
|
||||
return getVendorService().getVendorApprovedListTemplate();
|
||||
String path = getConfService().getString(CompanyVendorConstant.KEY_APPROVED_LIST_TEMPLATE);
|
||||
return new File(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -95,6 +95,7 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
}
|
||||
|
||||
service = getBean(VendorApprovedService.class);
|
||||
// 检索供方
|
||||
VendorService vendorService = getBean(VendorService.class);
|
||||
Page<VendorVo> page = vendorService.findAll(
|
||||
ParamUtils.builder()
|
||||
@@ -136,7 +137,17 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
// 明确 company 实例
|
||||
CompanyVo company = initializedVendorCompany(vendor);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -144,15 +155,15 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
|
||||
VendorType vendorType = vendor.getType();
|
||||
if (vendorType == null) {
|
||||
subHolder.error("供方的分类为空");
|
||||
return;
|
||||
subHolder.debug("供方分类未设置");
|
||||
}
|
||||
|
||||
// 确认供方的developDate 是否在供方名录的发布日期之后
|
||||
LocalDate developDate = vendor.getDevelopDate();
|
||||
if (developDate == null) {
|
||||
subHolder.error("供方的开发日期为空");
|
||||
subHolder.error("开发日期未设置");
|
||||
} else if (developDate.isAfter(approvedList.getPublishDate())) {
|
||||
subHolder.info("开发日期在供方名录发布之后, 跳过...");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -160,6 +171,34 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
List<VendorApprovedItemVo> items = getItemService().findAllByListAndVendor(approvedList, vendor);
|
||||
if (items == null || items.isEmpty()) {
|
||||
// 供方不在供方名录中时,新建一个
|
||||
syncWhenNoItem(vendor, company, subHolder);
|
||||
return;
|
||||
}
|
||||
|
||||
VendorApprovedItemVo first = items.getFirst();
|
||||
syncItem(vendor, company, first, subHolder);
|
||||
|
||||
|
||||
for (int i = 1; i < items.size(); i++) {
|
||||
VendorApprovedItemVo item = items.get(i);
|
||||
getItemService().delete(item);
|
||||
subHolder.debug("删除重复的供方名录项:#" + item.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当没有匹配的供方名录项时
|
||||
*
|
||||
* @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());
|
||||
@@ -195,7 +234,7 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
if (logTypicallyVendorNoThreeYearContract) {
|
||||
subHolder.warn("供方近" + vendorContractMinusYear + "年没有合作, 应该转为不合格供应商");
|
||||
}
|
||||
item.setDescription(STR_MEET_UNQUALIFIED);
|
||||
item.setDescription(STR_MEET_UNQUALIFIED + "(缺合同1)");
|
||||
} else {
|
||||
// 检查近3年期间是否都有合同
|
||||
if (checkAllYearHasContract(contracts, approvedList.getPublishDate())) {
|
||||
@@ -226,7 +265,7 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
if (logTypicallyVendorNoThreeYearContract) {
|
||||
subHolder.warn("供方近" + vendorContractMinusYear + "年没有合作, 应该转为不合格供应商");
|
||||
}
|
||||
item.setDescription(STR_MEET_UNQUALIFIED);
|
||||
item.setDescription(STR_MEET_UNQUALIFIED + "(缺合同2)");
|
||||
} else {
|
||||
// 检查近3年期间是否都有合同
|
||||
if (checkAllYearHasContract(contracts, approvedList.getPublishDate())) {
|
||||
@@ -249,32 +288,21 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
}
|
||||
|
||||
// 匹配的历史名称
|
||||
updateVendorNameWithOldName(vendor, item);
|
||||
updateVendorNameWithOldName(company, item);
|
||||
getItemService().save(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配历史名称,当前供方名称为空时
|
||||
* @param company
|
||||
* @param item
|
||||
*/
|
||||
private void updateVendorNameWithOldName(CompanyVo company, VendorApprovedItemVo item) {
|
||||
if (StringUtils.hasText(item.getVendorName())) {
|
||||
// 已经有供方名称时,不更新
|
||||
return;
|
||||
}
|
||||
|
||||
if (items.size() == 1) {
|
||||
VendorApprovedItemVo first = items.getFirst();
|
||||
if (!StringUtils.hasText(first.getVendorName())) {
|
||||
updateVendorNameWithOldName(vendor, first);
|
||||
}
|
||||
updateItem(vendor, first, subHolder);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 1; i < items.size(); i++) {
|
||||
VendorApprovedItemVo item = items.get(i);
|
||||
getItemService().delete(item);
|
||||
subHolder.debug("删除重复的供方名录项:#" + item.getId());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateVendorNameWithOldName(VendorVo vendor, VendorApprovedItemVo item) {
|
||||
CompanyVo company = initializedVendorCompany(vendor);
|
||||
if (company == null) {
|
||||
return;
|
||||
}
|
||||
CompanyOldNameVo companyOldName = getCompanyOldNameService().findMatchByDate(company,
|
||||
approvedList.getPublishDate());
|
||||
if (companyOldName != null) {
|
||||
@@ -288,11 +316,12 @@ public class VendorApprovedListVendorImportTask extends Tasker<Object> {
|
||||
@Setter
|
||||
private boolean logUnqualifiedVendorRemove = true;
|
||||
|
||||
private void updateItem(
|
||||
VendorVo vendor, VendorApprovedItemVo item, MessageHolder holder) {
|
||||
private void syncItem(
|
||||
VendorVo vendor, CompanyVo company, VendorApprovedItemVo item, MessageHolder holder) {
|
||||
VendorType t1 = item.getType();
|
||||
VendorType vendorType = vendor.getType();
|
||||
VendorApprovedItemService itemService = getItemService();
|
||||
updateVendorNameWithOldName(company, item);
|
||||
if (t1 != vendorType) {
|
||||
holder.warn("注意分类不一致, " + t1 + ", " + vendorType + ".");
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.controller.vendor.approved_list;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.ecep.contract.task.VendorApprovedListMakePathTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -104,15 +105,13 @@ public class VendorApprovedListWindowController
|
||||
}
|
||||
|
||||
public void onApprovedListCreatePathAction(ActionEvent event) {
|
||||
VendorApprovedListMakePathTask task = new VendorApprovedListMakePathTask();
|
||||
task.setApprovedList(getEntity());
|
||||
UITools.showTaskDialogAndWait("创建目录", task, null);
|
||||
|
||||
int id = viewModel.getId().get();
|
||||
VendorApprovedVo list = service.findById(id);
|
||||
|
||||
if (service.makePathAbsent(list)) {
|
||||
VendorApprovedVo saved = service.save(list);
|
||||
viewModel.update(saved);
|
||||
} else {
|
||||
setStatus("目录存在或创建失败");
|
||||
}
|
||||
viewModel.update(list);
|
||||
}
|
||||
|
||||
public void onApprovedListChangePathAction(ActionEvent event) {
|
||||
@@ -123,8 +122,4 @@ public class VendorApprovedListWindowController
|
||||
task.setApprovedList(getEntity());
|
||||
UITools.showTaskDialogAndWait("导出供方", task, null);
|
||||
}
|
||||
|
||||
private void save(ActionEvent event) {
|
||||
saveTabSkins();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,37 @@
|
||||
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.vo.DepartmentVo;
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
|
||||
@Lazy
|
||||
@Component
|
||||
public class DepartmentStringConverter extends EntityStringConverter<DepartmentVo> {
|
||||
@Lazy
|
||||
@Autowired
|
||||
/**
|
||||
* 部门字符串转换器
|
||||
*/
|
||||
public class DepartmentStringConverter extends StringConverter<DepartmentVo> {
|
||||
private DepartmentService service;
|
||||
|
||||
public DepartmentStringConverter() {
|
||||
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
setInitialized(department -> service.findById(department.getId()));
|
||||
setSuggestion(service::search);
|
||||
public DepartmentStringConverter(DepartmentService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@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
|
||||
public String toString(VendorCatalogVo object) {
|
||||
if (object == null) {
|
||||
return "-";
|
||||
}
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,26 @@
|
||||
package com.ecep.contract.converter;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
import com.ecep.contract.service.VendorGroupService;
|
||||
import com.ecep.contract.vo.VendorGroupVo;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
|
||||
@Lazy
|
||||
@Component
|
||||
public class VendorGroupStringConverter extends EntityStringConverter<VendorGroupVo> {
|
||||
@Lazy
|
||||
@Autowired
|
||||
public class VendorGroupStringConverter extends StringConverter<VendorGroupVo> {
|
||||
private VendorGroupService service;
|
||||
|
||||
public VendorGroupStringConverter() {
|
||||
|
||||
public VendorGroupStringConverter(VendorGroupService service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
setInitialized(group -> service.findById(group.getId()));
|
||||
setSuggestion(service::search);
|
||||
@Override
|
||||
public String toString(VendorGroupVo object) {
|
||||
return object == null ? "" : object.getCode() + " " + object.getName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public VendorGroupVo fromString(String string) {
|
||||
return service.findByCode(string);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.controlsfx.control.TaskProgressView;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -21,6 +23,8 @@ import lombok.Data;
|
||||
|
||||
@Service
|
||||
public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
||||
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class EntInfo {
|
||||
@@ -69,6 +73,10 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
||||
.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) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'checkBlackListUpdateElapse'");
|
||||
@@ -78,4 +86,12 @@ public class CloudRkService extends QueryService<CloudRkVo, CloudRkViewModel> {
|
||||
// TODO Auto-generated method stub
|
||||
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;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -77,4 +79,16 @@ public class CloudTycService extends QueryService<CloudTycVo, CloudTycInfoViewMo
|
||||
.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;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -32,4 +33,21 @@ public class CompanyContactService extends QueryService<CompanyContactVo, Compan
|
||||
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())
|
||||
.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) {
|
||||
return findByCustomerFile(customerFile.getId());
|
||||
return findOneByProperty("customerFile", customerFile.getId());
|
||||
}
|
||||
|
||||
public CompanyCustomerEvaluationFormFileVo findByCustomerFile(Integer customerFileId) {
|
||||
List<CompanyCustomerEvaluationFormFileVo> page = findAll(ParamUtils.builder()
|
||||
.equals("customerFile", customerFileId)
|
||||
.build(), Pageable.ofSize(1))
|
||||
.getContent();
|
||||
if (page.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return page.getFirst();
|
||||
return findOneByProperty("customerFile", customerFileId);
|
||||
}
|
||||
|
||||
public List<CompanyCustomerEvaluationFormFileVo> searchByCompany(Integer companyId, String searchText) {
|
||||
|
||||
@@ -121,4 +121,12 @@ public class CompanyCustomerFileService extends QueryService<CustomerFileVo, Cus
|
||||
public CustomerFileVo save(CustomerFileVo 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")
|
||||
public class CompanyCustomerFileTypeService
|
||||
extends QueryService<CustomerFileTypeLocalVo, CompanyCustomerFileTypeLocalViewModel> {
|
||||
private final StringConverter<CustomerFileTypeLocalVo> stringConverter = new CustomerFileTypeStringConverter(this);
|
||||
private final CustomerFileTypeStringConverter stringConverter = new CustomerFileTypeStringConverter(this);
|
||||
|
||||
@Cacheable(key = "#p0")
|
||||
@Override
|
||||
@@ -53,8 +53,7 @@ public class CompanyCustomerFileTypeService
|
||||
|
||||
@Cacheable
|
||||
public Map<CustomerFileType, CustomerFileTypeLocalVo> findAll(Locale locale) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("lang", locale.toLanguageTag());
|
||||
Map<String, Object> params = ParamUtils.builder().equals("lang", locale.toLanguageTag()).build();
|
||||
return findAll(params, Pageable.unpaged()).stream()
|
||||
.collect(Collectors.toMap(CustomerFileTypeLocalVo::getType, Function.identity()));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CompanyInvoiceInfoViewModel;
|
||||
import com.ecep.contract.vo.CompanyInvoiceInfoVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
@@ -15,9 +16,8 @@ import java.util.Map;
|
||||
public class CompanyInvoiceInfoService extends QueryService<CompanyInvoiceInfoVo, CompanyInvoiceInfoViewModel> {
|
||||
|
||||
public List<CompanyInvoiceInfoVo> searchByCompany(CompanyVo company, String searchText) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("company", company);
|
||||
params.put("searchText", searchText);
|
||||
Map<String, Object> params = ParamUtils.builder().equals("company", company.getId())
|
||||
.search(searchText).build();
|
||||
return findAll(params, Pageable.unpaged()).getContent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.util.MyStringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -70,24 +71,29 @@ public class CompanyOldNameService extends QueryService<CompanyOldNameVo, Compan
|
||||
}
|
||||
|
||||
public CompanyOldNameVo findMatchByDate(CompanyVo company, LocalDate localDate) {
|
||||
Page<CompanyOldNameVo> page = findAll(ParamUtils.builder()
|
||||
.equals("ambiguity", false)
|
||||
findAll(ParamUtils.builder()
|
||||
.equals("company", company.getId())
|
||||
.and(b -> b.isNotNull("beginDate").greaterThan("beginDate", localDate))
|
||||
.and(b -> b.isNotNull("endDate").lessThan("endDate", localDate))
|
||||
.build(), Pageable.ofSize(1));
|
||||
if (page.isEmpty()) {
|
||||
.equals("ambiguity", true)
|
||||
.isNotNull("beginDate")
|
||||
.build(), Pageable.unpaged()).getContent();
|
||||
return null;
|
||||
}
|
||||
return page.getContent().getFirst();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public List<CompanyOldNameVo> findAllByCompany(IdentityEntity company) {
|
||||
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.Map;
|
||||
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -57,14 +59,26 @@ public class CompanyService extends QueryService<CompanyVo, CompanyViewModel> {
|
||||
}
|
||||
|
||||
public List<CompanyVo> findAllByName(String name) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("name", name);
|
||||
Map<String, Object> params = ParamUtils.builder().equals("name", name).build();
|
||||
return findAll(params, Pageable.unpaged()).getContent();
|
||||
}
|
||||
|
||||
public void merge(CompanyVo company, CompanyVo updater) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'merge'");
|
||||
public void merge(CompanyVo from, CompanyVo to) {
|
||||
|
||||
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) {
|
||||
|
||||
@@ -13,6 +13,12 @@ import com.ecep.contract.vo.ContractVo;
|
||||
|
||||
@Service
|
||||
public class ContractFileService extends QueryService<ContractFileVo, ContractFileViewModel> {
|
||||
|
||||
@Override
|
||||
public ContractFileVo findById(Integer id) {
|
||||
return super.findById(id);
|
||||
}
|
||||
|
||||
public List<ContractFileVo> findAllByContract(ContractVo contract) {
|
||||
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.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
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.Cacheable;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -55,6 +57,10 @@ public class ContractFileTypeService extends QueryService<ContractFileTypeLocalV
|
||||
.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
|
||||
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);
|
||||
|
||||
@@ -5,6 +5,9 @@ import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
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.cache.annotation.CacheConfig;
|
||||
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.ParamUtils;
|
||||
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
|
||||
@CacheConfig(cacheNames = "contract")
|
||||
@@ -158,6 +157,20 @@ public class ContractService extends QueryService<ContractVo, ContractViewModel>
|
||||
.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) {
|
||||
return findAll(ParamUtils.builder()
|
||||
.equals("parentCode", "")
|
||||
@@ -183,4 +196,18 @@ public class ContractService extends QueryService<ContractVo, ContractViewModel>
|
||||
// TODO Auto-generated method stub
|
||||
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.vo.ContractTypeVo;
|
||||
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "contract-type")
|
||||
public class ContractTypeService extends QueryService<ContractTypeVo, ContractTypeViewModel> {
|
||||
|
||||
@@ -30,11 +30,7 @@ public class CustomerService extends QueryService<CustomerVo, CompanyCustomerVie
|
||||
}
|
||||
|
||||
public CustomerVo findByCompany(CompanyVo company) {
|
||||
Page<CustomerVo> page = findAll(ParamUtils.equal("company", company.getId()), Pageable.ofSize(1));
|
||||
if (page.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return page.getContent().getFirst();
|
||||
return findOneByProperty("company", company.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,4 +136,43 @@ public class CustomerService extends QueryService<CustomerVo, CompanyCustomerVie
|
||||
// 替换文件名中的非法字符
|
||||
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;
|
||||
|
||||
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 com.ecep.contract.converter.DepartmentStringConverter;
|
||||
import com.ecep.contract.vm.DepartmentViewModel;
|
||||
import com.ecep.contract.vo.DepartmentVo;
|
||||
|
||||
import javafx.util.StringConverter;
|
||||
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "department")
|
||||
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;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.vo.DepartmentVo;
|
||||
import javafx.collections.ObservableList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.vm.EmployeeRoleViewModel;
|
||||
@@ -11,11 +15,38 @@ import com.ecep.contract.vo.FunctionVo;
|
||||
@Service
|
||||
public class EmployeeRoleService extends QueryService<EmployeeRoleVo, EmployeeRoleViewModel> {
|
||||
|
||||
public List<FunctionVo> getFunctionsByRoleId(int roleId) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'getFunctionsByRoleId'");
|
||||
public List<FunctionVo> getFunctionsByRole(EmployeeRoleVo role) {
|
||||
try {
|
||||
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) {
|
||||
return findAll(ParamUtils.builder().equals("code", code).build(), Pageable.ofSize(1)).getContent().getFirst();
|
||||
return findOneByProperty("code", code);
|
||||
}
|
||||
|
||||
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")})
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ecep.contract.service;
|
||||
import com.ecep.contract.PageArgument;
|
||||
import com.ecep.contract.PageContent;
|
||||
import com.ecep.contract.WebSocketClientService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.model.IdentityEntity;
|
||||
import com.ecep.contract.model.NamedEntity;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
@@ -67,7 +68,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
||||
@Override
|
||||
public T save(T entity) {
|
||||
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) {
|
||||
throw new RuntimeException("保存实体失败", ex);
|
||||
}
|
||||
@@ -88,7 +89,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
||||
@Override
|
||||
public void delete(T entity) {
|
||||
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) {
|
||||
throw new RuntimeException("删除实体失败", ex);
|
||||
}
|
||||
@@ -117,7 +118,7 @@ public class QueryService<T extends IdentityEntity, TV extends IdentityViewModel
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
// 调用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) {
|
||||
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) {
|
||||
return findAll(ParamUtils.builder().equals(propertyName, propertyValue).build(), Pageable.ofSize(1)).stream()
|
||||
.findFirst().orElse(null);
|
||||
ParamUtils.Builder paramBuilder = ParamUtils.builder().equals(propertyName, propertyValue);
|
||||
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) {
|
||||
// 调用async方法执行名为"count"的异步操作,传入参数params
|
||||
// 使用handle方法处理异步操作的结果或异常
|
||||
return async("count", params).handle((response, ex) -> {
|
||||
return async(ServiceConstant.COUNT_METHOD_NAME, params).handle((response, ex) -> {
|
||||
if (ex != null) {
|
||||
throw new RuntimeException("远程方法+count+调用失败", ex);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ public class SysConfService {
|
||||
if (ex != null) {
|
||||
throw new RuntimeException("远程方法+findById+调用失败", ex);
|
||||
}
|
||||
if (response == null || response.isNull()) {
|
||||
return null;
|
||||
}
|
||||
SysConf newEntity = new SysConf();
|
||||
try {
|
||||
objectMapper.updateValue(newEntity, response);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
@@ -12,13 +14,14 @@ public class VendorApprovedFileService
|
||||
extends QueryService<VendorApprovedFileVo, CompanyVendorApprovedFileViewModel> {
|
||||
|
||||
public VendorApprovedFileVo findByName(VendorApprovedVo approvedList, String name) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'findByName'");
|
||||
return findOneByProperty(approvedList, "fileName", name);
|
||||
}
|
||||
|
||||
public boolean reBuildingFiles(VendorApprovedVo list, MessageHolder holder) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'reBuildingFiles'");
|
||||
public VendorApprovedFileVo 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.vo.VendorApprovedFileVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -23,4 +24,12 @@ public class VendorApprovedItemService
|
||||
.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.vo.VendorApprovedVo;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
@Service
|
||||
public class VendorApprovedService
|
||||
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) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'existPath'");
|
||||
try {
|
||||
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";
|
||||
}
|
||||
|
||||
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) {
|
||||
// 查询所有评价表
|
||||
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) {
|
||||
holder.error("未匹配的供应商评价");
|
||||
return;
|
||||
}
|
||||
// 提示评价表已过期
|
||||
holder.error("供应商评价已过期:" + latestFile.getSignDate() + ", 检测日期:" + verifyDate);
|
||||
}
|
||||
public List<VendorFileVo> findAllByVendor(VendorVo vendor) {
|
||||
return findAll(ParamUtils.builder()
|
||||
.equals("vendor", vendor.getId())
|
||||
.build(), Pageable.unpaged()).getContent();
|
||||
}
|
||||
|
||||
public List<VendorFileVo> findAllByVendorAndType(VendorVo vendor, VendorFileType type) {
|
||||
@@ -132,4 +112,12 @@ public class VendorFileService extends QueryService<VendorFileVo, CompanyVendorF
|
||||
.equals("type", type.name())
|
||||
.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;
|
||||
|
||||
import com.ecep.contract.converter.VendorGroupStringConverter;
|
||||
import com.ecep.contract.model.VendorGroup;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.VendorGroupViewModel;
|
||||
import com.ecep.contract.vo.VendorGroupVo;
|
||||
import javafx.util.StringConverter;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -15,6 +17,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "vendor-group")
|
||||
public class VendorGroupService extends QueryService<VendorGroupVo, VendorGroupViewModel> {
|
||||
|
||||
private VendorGroupStringConverter stringConverter = new VendorGroupStringConverter(this);
|
||||
@Cacheable(key = "#id")
|
||||
@Override
|
||||
public VendorGroupVo findById(Integer id) {
|
||||
@@ -53,4 +57,9 @@ public class VendorGroupService extends QueryService<VendorGroupVo, VendorGroupV
|
||||
public void delete(VendorGroupVo entity) {
|
||||
super.delete(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VendorGroupStringConverter getStringConverter() {
|
||||
return stringConverter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
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.SpringApp;
|
||||
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.FileUtils;
|
||||
import com.ecep.contract.util.MyStringUtils;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.CompanyVendorViewModel;
|
||||
import com.ecep.contract.vo.VendorVo;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
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
|
||||
@CacheConfig(cacheNames = "vendor")
|
||||
@@ -47,22 +43,9 @@ public class VendorService extends QueryService<VendorVo, CompanyVendorViewModel
|
||||
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")
|
||||
public VendorVo findByCompany(CompanyVo company) {
|
||||
Page<VendorVo> page = findAll(ParamUtils.equal("company", company.getId()), Pageable.ofSize(1));
|
||||
if (page.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return page.getContent().getFirst();
|
||||
return findOneByProperty("company", company.getId());
|
||||
}
|
||||
|
||||
public void verify(ContractVo contract, MessageHolder holder) {
|
||||
@@ -189,4 +172,32 @@ public class VendorService extends QueryService<VendorVo, CompanyVendorViewModel
|
||||
public void delete(VendorVo 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;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.controlsfx.control.TaskProgressView;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -78,4 +81,15 @@ public class YongYouU8Service extends QueryService<CloudYuVo, CloudYuInfoViewMod
|
||||
.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;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.WebSocketClientTasker;
|
||||
|
||||
public class ContractGroupSyncTask extends Tasker<Object> implements WebSocketClientTasker {
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "ContractGroupSyncTask";
|
||||
}
|
||||
|
||||
public class ContractGroupSyncTask extends Tasker<Object>{
|
||||
@Override
|
||||
public Object execute(MessageHolder holder) {
|
||||
return null;
|
||||
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;
|
||||
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTitle(String title) {
|
||||
// 使用Tasker的updateTitle方法更新标题
|
||||
super.updateTitle(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return "ContractRepairAllTask";
|
||||
@@ -34,6 +28,7 @@ public class ContractRepairAllTasker extends Tasker<Object> implements WebSocket
|
||||
logger.info("开始执行合同修复任务");
|
||||
updateTitle("合同数据修复");
|
||||
Object result = callRemoteTask(holder, getLocale());
|
||||
|
||||
logger.info("合同修复任务执行完成");
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,41 @@
|
||||
package com.ecep.contract.task;
|
||||
|
||||
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";
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return TASK_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(long current, long total) {
|
||||
super.updateProgress(current, total);
|
||||
}
|
||||
|
||||
public class ContractSyncAllTask extends Tasker<Object> {
|
||||
@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 com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.SpringApp;
|
||||
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 {
|
||||
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() {
|
||||
return "ContractSyncTask";
|
||||
}
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
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
|
||||
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());
|
||||
ContractFileVo contractFile = fileService.findById(bidVendor.getQuotationSheetFileId());
|
||||
ContractFileVo contractFile = null;
|
||||
if (bidVendor.getQuotationSheetFileId() != null) {
|
||||
contractFile = fileService.findById(bidVendor.getQuotationSheetFileId());
|
||||
}
|
||||
// 报价表文件不存在
|
||||
if (contractFile == null) {
|
||||
if (requireQuotation && bidVendor.getCompanyId().equals(contract.getCompanyId())) {
|
||||
|
||||
@@ -1,13 +1,32 @@
|
||||
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
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'execute'");
|
||||
updateTitle("用友U8系统-同步客户分类");
|
||||
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;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
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);
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return TASK_NAME;
|
||||
}
|
||||
|
||||
// 显式重写 updateProgress 以解决方法隐藏冲突
|
||||
@Override
|
||||
public void updateProgress(long workDone, long max) {
|
||||
super.updateProgress(workDone, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("用友U8系统-同步客户");
|
||||
return null;
|
||||
return callRemoteTask(holder, Locale.getDefault());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
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
|
||||
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.logging.Level;
|
||||
|
||||
import com.ecep.contract.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
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.EmployeeService;
|
||||
import com.ecep.contract.service.SysConfService;
|
||||
@@ -63,6 +60,22 @@ public abstract class Tasker<T> extends Task<T> {
|
||||
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
|
||||
protected T call() throws Exception {
|
||||
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;
|
||||
|
||||
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
|
||||
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 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 String TASK_NAME = "VendorSyncTask";
|
||||
|
||||
@Override
|
||||
public String getTaskName() {
|
||||
return TASK_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(long current, long total) {
|
||||
super.updateProgress(current, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
updateTitle("用友U8系统-同步供应商");
|
||||
return null;
|
||||
return callRemoteTask(holder, getLocale());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@ package com.ecep.contract.util;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
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 end 结束日期
|
||||
* @return 包含日期范围的查询参数Map
|
||||
*/
|
||||
public static Map<String, Object> between(String key, LocalDate begin, LocalDate end) {
|
||||
return Map.of(key, Map.of(
|
||||
"begin", begin,
|
||||
"end", end));
|
||||
public static Map<String, Object> between(String field, LocalDate begin, LocalDate end) {
|
||||
Builder builder = builder();
|
||||
builder.between(field, begin, end);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建等于条件查询参数
|
||||
*
|
||||
* @param key 查询字段名
|
||||
* @param field 查询字段名
|
||||
* @param value 查询值
|
||||
* @return 包含等于条件的查询参数Map
|
||||
*/
|
||||
public static Map<String, Object> equal(String key, Object value) {
|
||||
return Map.of(key, value);
|
||||
public static Map<String, Object> equal(String field, Object value) {
|
||||
Builder builder = builder();
|
||||
builder.equals(field, value);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建字符串模糊查询参数
|
||||
*
|
||||
* @param key 查询字段名
|
||||
* @param field 查询字段名
|
||||
* @param value 模糊查询的字符串值
|
||||
* @return 包含模糊查询条件的查询参数Map
|
||||
*/
|
||||
public static Map<String, Object> like(String key, String value) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put(key, "%" + value + "%");
|
||||
return params;
|
||||
public static Map<String, Object> contains(String field, String value, boolean caseSensitive) {
|
||||
Builder builder = builder();
|
||||
builder.and().like(field, value, ParamConstant.Mode.CONTAINS, caseSensitive, false);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建日期模糊查询参数
|
||||
*
|
||||
* @param key 查询字段名
|
||||
* @param value 模糊查询的日期值
|
||||
* @return 包含日期模糊查询条件的查询参数Map
|
||||
*/
|
||||
public static Map<String, Object> like(String key, LocalDate value) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put(key, "%" + value + "%");
|
||||
return params;
|
||||
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);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static Map<String, Object> endsWith(String field, String value, boolean caseSensitive) {
|
||||
Builder builder = builder();
|
||||
builder.and().like(field, value, ParamConstant.Mode.ENDS_WITH, caseSensitive, false);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建非空条件查询参数
|
||||
*
|
||||
* @param key 查询字段名
|
||||
* @param field 查询字段名
|
||||
* @return 包含非空条件的查询参数Map
|
||||
*/
|
||||
public static Map<String, Object> isNotNull(String key) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put(key, Map.of("isNotNull", true));
|
||||
return params;
|
||||
public static Map<String, Object> isNotNull(String field) {
|
||||
Builder builder = builder();
|
||||
builder.isNotNull(field);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,9 +86,22 @@ public class ParamUtils {
|
||||
* @return 包含小于条件的查询参数Map
|
||||
*/
|
||||
public static Map<String, Object> lessThan(String key, LocalDate value) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put(key, Map.of("lessThan", value));
|
||||
return params;
|
||||
Builder builder = builder();
|
||||
builder.lessThan(key, value);
|
||||
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 {
|
||||
// 存储构建的查询参数
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
private String searchText;
|
||||
private FilterGroup group;
|
||||
|
||||
/**
|
||||
* 私有构造方法,防止外部直接实例化
|
||||
@@ -119,7 +136,7 @@ public class ParamUtils {
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
*/
|
||||
public Builder isNotNull(String key) {
|
||||
params.put(key, Map.of("isNotNull", true));
|
||||
getDefaultGroup().isNotNull(key);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -131,7 +148,7 @@ public class ParamUtils {
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
*/
|
||||
public Builder lessThan(String key, LocalDate value) {
|
||||
params.put(key, Map.of("lessThan", value));
|
||||
getDefaultGroup().lessThan(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -143,7 +160,7 @@ public class ParamUtils {
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
*/
|
||||
public Builder greaterThan(String key, LocalDate value) {
|
||||
params.put(key, Map.of("greaterThan", value));
|
||||
getDefaultGroup().greaterThan(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -155,7 +172,7 @@ public class ParamUtils {
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
*/
|
||||
public Builder equals(String key, Object value) {
|
||||
params.put(key, value);
|
||||
getDefaultGroup().equals(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -168,13 +185,16 @@ public class ParamUtils {
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
*/
|
||||
public Builder between(String key, LocalDate begin, LocalDate end) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("begin", begin);
|
||||
params.put("end", end);
|
||||
this.params.put(key, params);
|
||||
getDefaultGroup().between(key, begin, end);
|
||||
return this;
|
||||
}
|
||||
|
||||
private FilterGroup getDefaultGroup() {
|
||||
if (group != null) {
|
||||
return group;
|
||||
}
|
||||
return and();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加全文搜索条件到构建器
|
||||
@@ -183,45 +203,343 @@ public class ParamUtils {
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
*/
|
||||
public Builder search(String searchText) {
|
||||
params.put(ServiceConstant.KEY_SEARCH_TEXT, searchText);
|
||||
this.searchText = searchText;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建并返回查询参数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
|
||||
*/
|
||||
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逻辑条件组到构建器
|
||||
*
|
||||
* @param consumer Builder消费者,用于构建子条件
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
* @return 新建的分组实例,支持链式调用添加子条件
|
||||
*/
|
||||
public Builder and(Consumer<Builder> consumer) {
|
||||
Builder builder = new Builder();
|
||||
consumer.accept(builder);
|
||||
params.put("and", builder);
|
||||
return this;
|
||||
public FilterGroup and() {
|
||||
if (group == null) {
|
||||
group = new FilterGroup(ParamConstant.Operator.AND);
|
||||
} else {
|
||||
if (group.operator != ParamConstant.Operator.AND) {
|
||||
throw new IllegalArgumentException(" 当前是 " + group.operator + " 条件组不允许修改为 AND 条件");
|
||||
}
|
||||
}
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加OR逻辑条件组到构建器
|
||||
*
|
||||
* @param consumer Builder消费者,用于构建子条件
|
||||
* @return 当前Builder实例,支持链式调用
|
||||
* @return 新建的分组实例,支持链式调用添加子条件
|
||||
*/
|
||||
public Builder or(Consumer<Builder> consumer) {
|
||||
Builder builder = new Builder();
|
||||
consumer.accept(builder);
|
||||
params.put("or", builder);
|
||||
public FilterGroup or() {
|
||||
if (group == null) {
|
||||
group = new FilterGroup(ParamConstant.Operator.OR);
|
||||
} else {
|
||||
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.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -209,7 +211,6 @@ public class UITools {
|
||||
|
||||
Platform.runLater(() -> {
|
||||
box.getChildren().add(progressBar);
|
||||
System.out.println("add progressBar = " + progressBar);
|
||||
});
|
||||
|
||||
// progressBar.disabledProperty().bind(task.runningProperty());
|
||||
@@ -221,16 +222,18 @@ public class UITools {
|
||||
|
||||
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) {
|
||||
init.accept(consumer::test);
|
||||
}
|
||||
dialog.showAndWait();
|
||||
if (task.isRunning()) {
|
||||
task.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private static String printStackTrace(Throwable e) {
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.vo.CloudYuVo;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
@@ -15,10 +16,6 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
/**
|
||||
* 云端Id
|
||||
*/
|
||||
private SimpleStringProperty cloudId = new SimpleStringProperty();
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
@@ -28,15 +25,16 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
*/
|
||||
private SimpleObjectProperty<LocalDateTime> latestUpdate = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleStringProperty vendorCode = new SimpleStringProperty();
|
||||
private SimpleStringProperty vendorClassCode = new SimpleStringProperty();
|
||||
private SimpleObjectProperty<LocalDate> vendorDevelopDate = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty exceptionMessage = new SimpleStringProperty();
|
||||
|
||||
private SimpleStringProperty customerCode = new SimpleStringProperty();
|
||||
private SimpleStringProperty customerClassCode = new SimpleStringProperty();
|
||||
private SimpleObjectProperty<LocalDate> customerDevelopDate = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<LocalDate> vendorUpdateDate = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<LocalDate> customerUpdateDate = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleObjectProperty<LocalDateTime> cloudLatest = new SimpleObjectProperty<>();
|
||||
/**
|
||||
* 是否激活
|
||||
*/
|
||||
private SimpleBooleanProperty active = new SimpleBooleanProperty();
|
||||
|
||||
/**
|
||||
* Version
|
||||
@@ -46,11 +44,13 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
@Override
|
||||
protected void updateFrom(CloudYuVo info) {
|
||||
super.updateFrom(info);
|
||||
vendorCode.set(info.getExceptionMessage());
|
||||
vendorDevelopDate.set(info.getVendorUpdateDate());
|
||||
customerDevelopDate.set(info.getCustomerUpdateDate());
|
||||
company.set(info.getCompanyId());
|
||||
exceptionMessage.set(info.getExceptionMessage());
|
||||
vendorUpdateDate.set(info.getVendorUpdateDate());
|
||||
customerUpdateDate.set(info.getCustomerUpdateDate());
|
||||
cloudLatest.set(info.getCloudLatest());
|
||||
latestUpdate.set(info.getLatestUpdate());
|
||||
active.set(info.isActive());
|
||||
version.set(info.getVersion());
|
||||
}
|
||||
|
||||
@@ -65,16 +65,20 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
|
||||
private boolean copyTo_(CloudYuVo info) {
|
||||
boolean modified = false;
|
||||
if (!Objects.equals(info.getExceptionMessage(), vendorCode.get())) {
|
||||
info.setExceptionMessage(vendorCode.get());
|
||||
if (!Objects.equals(info.getCompanyId(), company.get())) {
|
||||
info.setCompanyId(company.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getVendorUpdateDate(), vendorDevelopDate.get())) {
|
||||
info.setVendorUpdateDate(vendorDevelopDate.get());
|
||||
if (!Objects.equals(info.getExceptionMessage(), exceptionMessage.get())) {
|
||||
info.setExceptionMessage(exceptionMessage.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getCustomerUpdateDate(), customerDevelopDate.get())) {
|
||||
info.setCustomerUpdateDate(customerDevelopDate.get());
|
||||
if (!Objects.equals(info.getVendorUpdateDate(), vendorUpdateDate.get())) {
|
||||
info.setVendorUpdateDate(vendorUpdateDate.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getCustomerUpdateDate(), customerUpdateDate.get())) {
|
||||
info.setCustomerUpdateDate(customerUpdateDate.get());
|
||||
modified = true;
|
||||
}
|
||||
|
||||
@@ -86,6 +90,10 @@ public class CloudYuInfoViewModel extends IdentityViewModel<CloudYuVo> {
|
||||
info.setLatestUpdate(latestUpdate.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.isActive(), active.get())) {
|
||||
info.setActive(active.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(info.getVersion(), version.get())) {
|
||||
info.setVersion(version.get());
|
||||
modified = true;
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.vo.CompanyBankAccountVo;
|
||||
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
@@ -15,8 +16,6 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAccountVo>
|
||||
implements CompanyBasedViewModel {
|
||||
private SimpleIntegerProperty id = new SimpleIntegerProperty();
|
||||
|
||||
private SimpleObjectProperty<Integer> companyId = new SimpleObjectProperty<>();
|
||||
private SimpleObjectProperty<Integer> bankId = new SimpleObjectProperty<>();
|
||||
|
||||
@@ -24,25 +23,27 @@ public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAc
|
||||
private SimpleStringProperty account = new SimpleStringProperty();
|
||||
|
||||
private SimpleObjectProperty<LocalDate> created = new SimpleObjectProperty<>();
|
||||
|
||||
private SimpleStringProperty description = new SimpleStringProperty();
|
||||
private SimpleBooleanProperty active = new SimpleBooleanProperty();
|
||||
private SimpleIntegerProperty version = new SimpleIntegerProperty();
|
||||
|
||||
|
||||
@Override
|
||||
protected void updateFrom(CompanyBankAccountVo v) {
|
||||
getId().set(v.getId());
|
||||
super.updateFrom(v);
|
||||
companyId.set(v.getCompanyId());
|
||||
bankId.set(v.getBankId());
|
||||
getOpeningBank().set(v.getOpeningBank());
|
||||
getAccount().set(v.getAccount());
|
||||
created.set(v.getCreated());
|
||||
description.set(v.getDescription());
|
||||
active.set(v.isActive());
|
||||
version.set(v.getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean copyTo(CompanyBankAccountVo 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())) {
|
||||
v.setCompanyId(companyId.get());
|
||||
modified = true;
|
||||
@@ -59,6 +60,18 @@ public class CompanyBankAccountViewModel extends IdentityViewModel<CompanyBankAc
|
||||
v.setAccount(account.get());
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Objects;
|
||||
import com.ecep.contract.vo.CompanyCustomerEvaluationFormFileVo;
|
||||
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -13,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CompanyCustomerEvaluationFormFileViewModel extends IdentityViewModel<CompanyCustomerEvaluationFormFileVo> {
|
||||
|
||||
private SimpleIntegerProperty customerFile = new SimpleIntegerProperty();
|
||||
private SimpleObjectProperty<Integer> customerFile = new SimpleObjectProperty<>();
|
||||
private SimpleStringProperty catalog = new SimpleStringProperty();
|
||||
private SimpleStringProperty level = new SimpleStringProperty();
|
||||
private SimpleIntegerProperty creditLevel = new SimpleIntegerProperty(0);
|
||||
@@ -65,6 +66,7 @@ public class CompanyCustomerEvaluationFormFileViewModel extends IdentityViewMode
|
||||
if (vo.getScoreTemplateVersion() != null) {
|
||||
scoreTemplateVersion.set(vo.getScoreTemplateVersion());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,10 @@ public class ContractViewModel extends IdentityViewModel<ContractVo> {
|
||||
|
||||
private SimpleStringProperty code = new SimpleStringProperty();
|
||||
private SimpleStringProperty name = new SimpleStringProperty();
|
||||
/**
|
||||
* 名称是否锁定
|
||||
*/
|
||||
private SimpleBooleanProperty nameLocked = new SimpleBooleanProperty();
|
||||
private SimpleStringProperty state = new SimpleStringProperty();
|
||||
/**
|
||||
* 分组
|
||||
@@ -138,6 +142,7 @@ public class ContractViewModel extends IdentityViewModel<ContractVo> {
|
||||
getPayWay().set(c.getPayWay());
|
||||
getCode().set(c.getCode());
|
||||
getName().set(c.getName());
|
||||
getNameLocked().set(c.isNameLocked());
|
||||
getState().set(c.getState());
|
||||
|
||||
getGroup().set(c.getGroupId());
|
||||
@@ -198,6 +203,10 @@ public class ContractViewModel extends IdentityViewModel<ContractVo> {
|
||||
contract.setName(name.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(nameLocked.get(), contract.isNameLocked())) {
|
||||
contract.setNameLocked(nameLocked.get());
|
||||
modified = true;
|
||||
}
|
||||
if (!Objects.equals(state.get(), contract.getState())) {
|
||||
contract.setState(state.get());
|
||||
modified = true;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<?import javafx.scene.control.*?>
|
||||
<?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"
|
||||
fx:controller="com.ecep.contract.manager.cloud.rk.CloudRkManagerWindowController">
|
||||
fx:controller="com.ecep.contract.controller.cloud.rk.CloudRkManagerWindowController">
|
||||
<children>
|
||||
<MenuBar VBox.vgrow="NEVER">
|
||||
<menus>
|
||||
@@ -39,7 +39,6 @@
|
||||
<Menu mnemonicParsing="false" text="Help">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="数据修复" onAction="#onDataRepairAction"/>
|
||||
<MenuItem mnemonicParsing="false" text="数据迁移" onAction="#onDateTransferAction"/>
|
||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp"/>
|
||||
</items>
|
||||
</Menu>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<?import javafx.scene.control.*?>
|
||||
<?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"
|
||||
fx:controller="com.ecep.contract.manager.cloud.tyc.CloudTycManagerWindowController">
|
||||
fx:controller="com.ecep.contract.controller.cloud.tyc.CloudTycManagerWindowController">
|
||||
<children>
|
||||
<MenuBar VBox.vgrow="NEVER">
|
||||
<menus>
|
||||
@@ -39,7 +39,6 @@
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Help">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#onDateTransferAction" text="数据迁移"/>
|
||||
<MenuItem mnemonicParsing="false" text="About MyHelloApp"/>
|
||||
</items>
|
||||
</Menu>
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?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"
|
||||
fx:controller="com.ecep.contract.controller.cloud.u8.YongYouU8ConfigWindowController">
|
||||
<children>
|
||||
<GridPane>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" minWidth="50.0" prefWidth="250.0"/>
|
||||
<ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" maxWidth="5.0" minWidth="5.0" prefWidth="5.0" />
|
||||
<ColumnConstraints fillWidth="false" halignment="RIGHT" hgrow="NEVER" maxWidth="5.0" minWidth="5.0"
|
||||
prefWidth="5.0"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
@@ -28,7 +30,8 @@
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label text="同步时公司未创建时, 公司开发日期在此之后的自动创建" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||
<Label text="同步时公司未创建时, 公司开发日期在此之后的自动创建" GridPane.columnIndex="2"
|
||||
GridPane.rowIndex="1"/>
|
||||
<DatePicker fx:id="auto_create_company_after" GridPane.columnIndex="2"/>
|
||||
<Label text="cloud.u8.contract.latestDate" GridPane.rowIndex="4"/>
|
||||
<TextField fx:id="contract_latest_date" GridPane.columnIndex="2" GridPane.rowIndex="4"/>
|
||||
@@ -39,7 +42,8 @@
|
||||
<Label text="创建在此之后日期的公司"/>
|
||||
<ToggleSwitch fx:id="use_latest_id" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
|
||||
<Label text="使用latestId同步" GridPane.rowIndex="2"/>
|
||||
<Label text="合同同步时是否使用最后更新的Id来判断更新范围,否则使用最后更新的合同日期来判断更新范围" GridPane.columnIndex="2" GridPane.rowIndex="3" />
|
||||
<Label text="合同同步时是否使用最后更新的Id来判断更新范围,否则使用最后更新的合同日期来判断更新范围"
|
||||
GridPane.columnIndex="2" GridPane.rowIndex="3"/>
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
|
||||
@@ -61,9 +61,10 @@
|
||||
<TableColumn fx:id="idColumn" prefWidth="75.0" text="ID"/>
|
||||
<TableColumn fx:id="companyColumn" prefWidth="200.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" text="平台更新日期"/>
|
||||
<TableColumn fx:id="cloudVendorUpdateDateColumn" prefWidth="160.0" text="供方更新日期"/>
|
||||
<TableColumn fx:id="cloudCustomerUpdateDateColumn" prefWidth="160.0" text="客户更新日期"/>
|
||||
<TableColumn fx:id="activeColumn" text="启用"/>
|
||||
<TableColumn fx:id="descriptionColumn" text="Description"/>
|
||||
</columns>
|
||||
</TableView>
|
||||
|
||||
@@ -22,14 +22,5 @@
|
||||
<TableColumn fx:id="bankAccountTable_openingBankColumn" prefWidth="300" text="开户行"/>
|
||||
<TableColumn fx:id="bankAccountTable_accountColumn" prefWidth="300.0" text="账号"/>
|
||||
</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>
|
||||
</AnchorPane>
|
||||
@@ -1,27 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<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">
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.CheckBox?>
|
||||
<?import javafx.scene.control.Hyperlink?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?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>
|
||||
<VBox spacing="5.0">
|
||||
<children>
|
||||
<TitledPane fx:id="rkCloudPane" animated="false" collapsible="false" text="集团相关方平台"
|
||||
VBox.vgrow="NEVER">
|
||||
<TitledPane fx:id="rkCloudPane" animated="false" collapsible="false" text="集团相关方平台" VBox.vgrow="NEVER">
|
||||
<content>
|
||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||
<columnConstraints>
|
||||
<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 halignment="CENTER" maxWidth="200.0" minWidth="80.0"
|
||||
prefWidth="120.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 halignment="CENTER" maxWidth="200.0" minWidth="80.0" prefWidth="120.0" />
|
||||
<ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" minWidth="100.0" prefWidth="220.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
@@ -38,51 +42,34 @@
|
||||
<Label text="记录编号" />
|
||||
<TextField fx:id="cloudRkIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||
<Label text="平台编号" GridPane.columnIndex="2" />
|
||||
<TextField fx:id="cloudRkCloudIdField" layoutX="255.0" layoutY="14.0" text="-"
|
||||
GridPane.columnIndex="3"/>
|
||||
<TextField fx:id="cloudRkCloudIdField" layoutX="255.0" layoutY="14.0" text="-" GridPane.columnIndex="3" />
|
||||
<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" text="-" GridPane.columnIndex="3" GridPane.rowIndex="7" />
|
||||
<Label text="客户评级" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="cloudRkCustomerGradeField" editable="false" text="-"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="cloudRkCustomerGradeField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<Label text="客户得分" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="cloudRkCustomerScoreField" editable="false" text="-"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="3"/>
|
||||
<TextField fx:id="cloudRkCustomerScoreField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<Label text="企业资信评级" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="cloudRkCreditRankField" editable="false" text="-"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||
<Label layoutX="44.0" layoutY="58.0" text="企业资信评级说明" GridPane.columnIndex="2"
|
||||
GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="cloudRkCreditRankDescriptionField" editable="false" layoutX="140.0"
|
||||
layoutY="54.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="cloudRkCreditRankField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<Label layoutX="44.0" layoutY="58.0" text="企业资信评级说明" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="cloudRkCreditRankDescriptionField" editable="false" layoutX="140.0" layoutY="54.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||
<Label text="平台更新日期" GridPane.rowIndex="5" />
|
||||
<TextField fx:id="cloudRkCloudLatestField" editable="false" text="-"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="5"/>
|
||||
<TextField fx:id="cloudRkCloudLatestField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="5" />
|
||||
<Label text="黑名单更新日期" GridPane.rowIndex="7" />
|
||||
<TextField fx:id="cloudRkBlackListUpdatedField" editable="false" text="-"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="7"/>
|
||||
<TextField fx:id="cloudRkBlackListUpdatedField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
||||
<Label text="供方评级" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="cloudRkVendorGradeField" editable="false" text="-"
|
||||
GridPane.columnIndex="3" GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="cloudRkVendorGradeField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||
<Label text="供方得分" GridPane.columnIndex="2" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="cloudRkVendorScoreField" editable="false" text="-"
|
||||
GridPane.columnIndex="3" GridPane.rowIndex="3"/>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</GridPane>
|
||||
</content>
|
||||
@@ -91,14 +78,10 @@
|
||||
<content>
|
||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||
<columnConstraints>
|
||||
<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 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 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 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>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
@@ -112,18 +95,13 @@
|
||||
<Label text="天眼评分" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="cloudTycIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||
<TextField fx:id="cloudTycCloudIdField" text="-" GridPane.columnIndex="3" />
|
||||
<TextField fx:id="cloudTycLatestField" editable="false" layoutX="255.0" layoutY="44.0"
|
||||
text="-" GridPane.columnIndex="3" GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="cloudTycLatestField" editable="false" layoutX="255.0" layoutY="44.0" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="tycCloudPaneCloudScore" text="-" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="1"/>
|
||||
<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">
|
||||
<TextField fx:id="tycCloudPaneCloudScore" text="-" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<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>
|
||||
<Button mnemonicParsing="false" onAction="#onCloudTycUpdateButtonClickedAction"
|
||||
text="更新"/>
|
||||
<Button mnemonicParsing="false" onAction="#onCloudTycUpdateButtonClickedAction" text="更新" />
|
||||
<Button fx:id="tycCloudPaneSaveButton" mnemonicParsing="false" text="保存" />
|
||||
</children>
|
||||
</HBox>
|
||||
@@ -136,14 +114,10 @@
|
||||
<content>
|
||||
<GridPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
|
||||
<columnConstraints>
|
||||
<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 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 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 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>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
@@ -154,15 +128,16 @@
|
||||
<children>
|
||||
<Label text="记录编号" />
|
||||
<TextField fx:id="cloudYuIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||
<Label text="U8编号" GridPane.columnIndex="2"/>
|
||||
<TextField fx:id="cloudYuCloudIdField" text="-" GridPane.columnIndex="3"/>
|
||||
<Label text="客户编号" GridPane.rowIndex="1"/>
|
||||
<Label text="更新日期" GridPane.columnIndex="2" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="cloudYuLatestField" editable="false" text="-" GridPane.columnIndex="3"
|
||||
GridPane.rowIndex="2"/>
|
||||
<Button fx:id="yuCloudPaneSaveButton" mnemonicParsing="false" text="更新"
|
||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="3"/>
|
||||
<TextField fx:id="cloudYuLatestField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="2" />
|
||||
<Button fx:id="yuCloudPaneSaveButton" mnemonicParsing="false" text="更新" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="3" />
|
||||
<Label fx:id="cloudYuVersionLabel" text="\@Version" GridPane.rowIndex="3" />
|
||||
<Label text="供方更新" GridPane.rowIndex="1" />
|
||||
<Label text="客户更新" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="cloudYuVendorUpdateDateField" editable="false" text="-" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="cloudYuCustomerUpdateDateField" editable="false" text="-" GridPane.columnIndex="3" GridPane.rowIndex="1" />
|
||||
<Label text="启用" GridPane.rowIndex="2" />
|
||||
<CheckBox fx:id="cloudYuActiveField" mnemonicParsing="false" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
</children>
|
||||
</GridPane>
|
||||
</content>
|
||||
@@ -171,14 +146,10 @@
|
||||
<content>
|
||||
<GridPane>
|
||||
<columnConstraints>
|
||||
<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 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 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 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>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
@@ -187,13 +158,10 @@
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Label text="记录编号" />
|
||||
<TextField fx:id="extendInfoIdField" editable="false" text="-"
|
||||
GridPane.columnIndex="1"/>
|
||||
<Button fx:id="extendInfoPaneSaveButton" mnemonicParsing="false" text="更新"
|
||||
GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="extendInfoIdField" editable="false" text="-" GridPane.columnIndex="1" />
|
||||
<Button fx:id="extendInfoPaneSaveButton" mnemonicParsing="false" text="更新" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.rowIndex="2" />
|
||||
<Label fx:id="extendInfoVersionLabel" text="\@Version" GridPane.rowIndex="2" />
|
||||
<CheckBox fx:id="extendInfoDisableVerifyField" mnemonicParsing="false"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||
<CheckBox fx:id="extendInfoDisableVerifyField" mnemonicParsing="false" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<Label text="禁用核验" GridPane.rowIndex="1" />
|
||||
</children>
|
||||
</GridPane>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
<?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"
|
||||
fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFormFileWindowController">
|
||||
<children>
|
||||
@@ -209,7 +210,7 @@ fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFo
|
||||
<Label text="★★★★≤200分,★★★≤150分,★★≤100分,★≤60分" />
|
||||
</children>
|
||||
</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>
|
||||
<padding>
|
||||
<Insets right="5.0" />
|
||||
@@ -217,5 +218,15 @@ fx:controller="com.ecep.contract.controller.customer.CompanyCustomerEvaluationFo
|
||||
</GridPane>
|
||||
</items>
|
||||
</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>
|
||||
</VBox>
|
||||
|
||||
@@ -11,17 +11,24 @@
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?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>
|
||||
<Tab text="通用">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<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 hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0" prefWidth="110.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 hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0"
|
||||
prefWidth="110.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>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
@@ -36,11 +43,14 @@
|
||||
<Label text="Label" GridPane.rowIndex="2"/>
|
||||
<Label text="Label" GridPane.rowIndex="3"/>
|
||||
<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"
|
||||
GridPane.columnSpan="2" GridPane.rowIndex="2"/>
|
||||
<TextField GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3"/>
|
||||
<TextField GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="4"/>
|
||||
<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" />
|
||||
<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>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
@@ -56,7 +66,8 @@
|
||||
<children>
|
||||
<GridPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0" prefWidth="110.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="110.0" minWidth="110.0"
|
||||
prefWidth="110.0"/>
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="150.0" prefWidth="460.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
@@ -73,10 +84,14 @@
|
||||
<Label text="配置用友U8的数据库信息" GridPane.columnIndex="1"/>
|
||||
<Label text="数据库账户" GridPane.rowIndex="3"/>
|
||||
<Label text="数据库账户密码" GridPane.rowIndex="4"/>
|
||||
<TextField fx:id="u8DataBaseServerHostField" promptText="192.168.1.1" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="u8DataBaseCatalogField" promptText="UF_DATA_001_2017" 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" />
|
||||
<TextField fx:id="u8DataBaseServerHostField" promptText="192.168.1.1"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="u8DataBaseCatalogField" promptText="UF_DATA_001_2017"
|
||||
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>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
@@ -92,9 +107,11 @@
|
||||
<children>
|
||||
<GridPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0" prefWidth="130.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0"
|
||||
prefWidth="130.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 halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0"
|
||||
prefWidth="48.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
@@ -108,10 +125,15 @@
|
||||
<Label text="供应商的配置选项" GridPane.columnIndex="1"/>
|
||||
<Label text="供应商文件夹" GridPane.rowIndex="1"/>
|
||||
<Label text="供方调查评价表模板" GridPane.rowIndex="2"/>
|
||||
<Label fx:id="vendorPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<Label fx:id="vendorEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls" 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" />
|
||||
<Label fx:id="vendorPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="1"/>
|
||||
<Label fx:id="vendorEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls"
|
||||
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>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
@@ -125,11 +147,14 @@
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<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 hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0" prefWidth="130.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="130.0" minWidth="130.0"
|
||||
prefWidth="130.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 halignment="CENTER" hgrow="SOMETIMES" maxWidth="48.0" minWidth="48.0"
|
||||
prefWidth="48.0"/>
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
|
||||
@@ -143,12 +168,19 @@
|
||||
<Label text="客户的文件夹" GridPane.rowIndex="1"/>
|
||||
<Label text="客户资信评估表模板" GridPane.rowIndex="2"/>
|
||||
<Label text="销售台账目录" GridPane.rowIndex="3"/>
|
||||
<Label fx:id="customerPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<Label fx:id="customerEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls" textOverrun="CLIP" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<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" />
|
||||
<Label fx:id="customerPathLabel" text="\\\10.84.209.8\" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="1"/>
|
||||
<Label fx:id="customerEvaluationFormTemplateLabel" text="\\\10.84.209.8\template.xls"
|
||||
textOverrun="CLIP" wrapText="true" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="2"/>
|
||||
<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>
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
|
||||
@@ -105,9 +105,9 @@
|
||||
<contextMenu>
|
||||
<ContextMenu>
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" onAction="#onShowContractDetailAction"
|
||||
text="合同详情"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#onShowContractDetailAction" text="合同详情"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#onContractReVerifyAction" text="重新验证"/>
|
||||
<MenuItem mnemonicParsing="false" onAction="#onShowVerifyStatusAction" text="查看状态"/>
|
||||
</items>
|
||||
</ContextMenu>
|
||||
</contextMenu>
|
||||
|
||||
@@ -1,12 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?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?>
|
||||
<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">
|
||||
|
||||
<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">
|
||||
<top>
|
||||
<ToolBar prefHeight="40.0" prefWidth="800.0" BorderPane.alignment="CENTER">
|
||||
<items>
|
||||
@@ -29,8 +44,7 @@
|
||||
</ToolBar>
|
||||
</top>
|
||||
<center>
|
||||
<TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0"
|
||||
tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||
<TabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0" tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||
<tabs>
|
||||
<Tab fx:id="baseInfoTab" text="基本信息">
|
||||
<content>
|
||||
@@ -40,118 +54,83 @@
|
||||
<children>
|
||||
<GridPane VBox.vgrow="NEVER">
|
||||
<columnConstraints>
|
||||
<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 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 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 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>
|
||||
<rowConstraints>
|
||||
<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" 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" 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 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" 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" 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>
|
||||
<children>
|
||||
<Label text="合同名称 *" />
|
||||
<Label text="合同编码 *" GridPane.rowIndex="2" />
|
||||
<Label text="状态 *" GridPane.columnIndex="2" GridPane.rowIndex="4" />
|
||||
<TextField fx:id="codeField" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="2"/>
|
||||
<TextField fx:id="stateField" GridPane.columnIndex="3"
|
||||
GridPane.rowIndex="4"/>
|
||||
<TextField fx:id="codeField" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="stateField" GridPane.columnIndex="3" GridPane.rowIndex="4" />
|
||||
<HBox GridPane.columnIndex="1" GridPane.columnSpan="3">
|
||||
<children>
|
||||
<TextField fx:id="nameField" HBox.hgrow="ALWAYS" />
|
||||
<Button fx:id="contractRenameBtn" mnemonicParsing="false"
|
||||
text="合同更名"/>
|
||||
<CheckBox fx:id="contractNameLockedCk" mnemonicParsing="false">
|
||||
<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>
|
||||
</HBox>
|
||||
<Label layoutX="20.0" layoutY="28.0" text="GUID *"
|
||||
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="28.0" text="备注"
|
||||
GridPane.rowIndex="18"/>
|
||||
<TextField fx:id="groupField" layoutX="202.0" layoutY="114.0"
|
||||
GridPane.columnIndex="3" GridPane.rowIndex="3"/>
|
||||
<TextField fx:id="guidField" GridPane.columnIndex="3"
|
||||
GridPane.rowIndex="17"/>
|
||||
<Label layoutX="56.0" layoutY="118.0" text="类型 *"
|
||||
GridPane.columnIndex="2" GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="typeField" GridPane.columnIndex="3"
|
||||
GridPane.rowIndex="1"/>
|
||||
<TextField fx:id="kindField" GridPane.columnIndex="3"
|
||||
GridPane.rowIndex="2"/>
|
||||
<Label layoutX="20.0" layoutY="28.0" text="GUID *" 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="28.0" text="备注" GridPane.rowIndex="18" />
|
||||
<TextField fx:id="groupField" layoutX="202.0" layoutY="114.0" GridPane.columnIndex="3" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="guidField" GridPane.columnIndex="3" GridPane.rowIndex="17" />
|
||||
<Label layoutX="56.0" layoutY="118.0" text="类型 *" GridPane.columnIndex="2" GridPane.rowIndex="1" />
|
||||
<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">
|
||||
<TextField fx:id="pathField" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="15">
|
||||
<GridPane.margin>
|
||||
<Insets />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<Label text="创建日期" GridPane.rowIndex="17" />
|
||||
<TextField fx:id="createdField" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="17"/>
|
||||
<TextField fx:id="createdField" GridPane.columnIndex="1" GridPane.rowIndex="17" />
|
||||
<HBox GridPane.columnIndex="1" GridPane.rowIndex="8">
|
||||
<children>
|
||||
<DatePicker fx:id="startDateField"
|
||||
maxWidth="1.7976931348623157E308"
|
||||
promptText="启时日期" HBox.hgrow="ALWAYS">
|
||||
<DatePicker fx:id="startDateField" maxWidth="1.7976931348623157E308" promptText="启时日期" HBox.hgrow="ALWAYS">
|
||||
<HBox.margin>
|
||||
<Insets right="6.0" />
|
||||
</HBox.margin>
|
||||
</DatePicker>
|
||||
<DatePicker fx:id="endDateField"
|
||||
maxWidth="1.7976931348623157E308"
|
||||
promptText="截止日期" HBox.hgrow="ALWAYS"/>
|
||||
<DatePicker fx:id="endDateField" maxWidth="1.7976931348623157E308" promptText="截止日期" HBox.hgrow="ALWAYS" />
|
||||
</children>
|
||||
</HBox>
|
||||
<TextArea fx:id="descriptionField" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="3" GridPane.rowIndex="18"/>
|
||||
<TextArea fx:id="descriptionField" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="18" />
|
||||
<Label text="提交人 *" GridPane.columnIndex="2" GridPane.rowIndex="8" />
|
||||
<HBox GridPane.columnIndex="3" GridPane.rowIndex="8">
|
||||
<children>
|
||||
@@ -160,8 +139,7 @@
|
||||
</children>
|
||||
</HBox>
|
||||
<Label text="签订日期 *" GridPane.rowIndex="9" />
|
||||
<DatePicker fx:id="orderDateField" maxWidth="1.7976931348623157E308"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="9"/>
|
||||
<DatePicker fx:id="orderDateField" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="9" />
|
||||
<Label text="生效人 *" GridPane.columnIndex="2" GridPane.rowIndex="9" />
|
||||
<Label text="修改人 *" GridPane.columnIndex="2" GridPane.rowIndex="10" />
|
||||
<HBox GridPane.columnIndex="3" GridPane.rowIndex="9">
|
||||
@@ -176,52 +154,38 @@
|
||||
<DatePicker fx:id="varyDateField" HBox.hgrow="SOMETIMES" />
|
||||
</children>
|
||||
</HBox>
|
||||
<TextField fx:id="parentCodeField" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="3"/>
|
||||
<TextField fx:id="parentCodeField" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<Label text="主合同编码" GridPane.rowIndex="3" />
|
||||
<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>
|
||||
<Button fx:id="contractPathCreateBtn" mnemonicParsing="false"
|
||||
text="创建目录"/>
|
||||
<Button fx:id="contractPathChangeBtn" mnemonicParsing="false"
|
||||
text="变更目录"/>
|
||||
<Button fx:id="contractPathAsNameBtn" mnemonicParsing="false"
|
||||
text="与合同名称同名"/>
|
||||
<Button fx:id="contractPathAsCodeBtn" mnemonicParsing="false"
|
||||
text="与合同号同名"/>
|
||||
<Button fx:id="contractPathCreateBtn" mnemonicParsing="false" text="创建目录" />
|
||||
<Button fx:id="contractPathChangeBtn" mnemonicParsing="false" text="变更目录" />
|
||||
<Button fx:id="contractPathAsNameBtn" mnemonicParsing="false" text="与合同名称同名" />
|
||||
<Button fx:id="contractPathAsCodeBtn" mnemonicParsing="false" text="与合同号同名" />
|
||||
</children>
|
||||
</HBox>
|
||||
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1"
|
||||
GridPane.rowIndex="4">
|
||||
<HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="4">
|
||||
<children>
|
||||
<Button fx:id="openMainContractBtn" mnemonicParsing="false"
|
||||
text="打开主合同"/>
|
||||
<Button fx:id="calcMainContractNoBtn" mnemonicParsing="false"
|
||||
text="计算主合同编号"/>
|
||||
<Button fx:id="openMainContractBtn" mnemonicParsing="false" text="打开主合同" />
|
||||
<Button fx:id="calcMainContractNoBtn" mnemonicParsing="false" text="计算主合同编号" />
|
||||
</children>
|
||||
</HBox>
|
||||
<Label text="对方单位 *" GridPane.rowIndex="5" />
|
||||
<HBox spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3"
|
||||
GridPane.rowIndex="5">
|
||||
<HBox spacing="5.0" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="5">
|
||||
<children>
|
||||
<TextField fx:id="companyField" HBox.hgrow="SOMETIMES" />
|
||||
<Button mnemonicParsing="false"
|
||||
onAction="#onContractOpenRelativeCompanyAction"
|
||||
text="详情">
|
||||
<Button mnemonicParsing="false" onAction="#onContractOpenRelativeCompanyAction" text="详情">
|
||||
<HBox.margin>
|
||||
<Insets />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="openRelativeCompanyCustomerBtn"
|
||||
mnemonicParsing="false" text="客户">
|
||||
<Button fx:id="openRelativeCompanyCustomerBtn" mnemonicParsing="false" text="客户">
|
||||
<HBox.margin>
|
||||
<Insets />
|
||||
</HBox.margin>
|
||||
</Button>
|
||||
<Button fx:id="openRelativeCompanyVendorBtn"
|
||||
mnemonicParsing="false" text="供应商"/>
|
||||
<Button fx:id="openRelativeCompanyVendorBtn" mnemonicParsing="false" text="供应商" />
|
||||
</children>
|
||||
</HBox>
|
||||
<Label text="业务员 *" GridPane.rowIndex="11" />
|
||||
@@ -246,50 +210,28 @@
|
||||
<Label text="归属项目" GridPane.rowIndex="1" />
|
||||
<HBox GridPane.columnIndex="1" GridPane.rowIndex="1">
|
||||
<children>
|
||||
<TextField fx:id="projectField" prefWidth="190.0"
|
||||
HBox.hgrow="ALWAYS"/>
|
||||
<Button fx:id="linkContractProjectBtn" mnemonicParsing="false"
|
||||
text="关联" textOverrun="CLIP">
|
||||
<TextField fx:id="projectField" prefWidth="190.0" HBox.hgrow="ALWAYS" />
|
||||
<Button fx:id="linkContractProjectBtn" mnemonicParsing="false" text="关联" textOverrun="CLIP">
|
||||
</Button>
|
||||
</children>
|
||||
</HBox>
|
||||
<Label text="1. (*) 字段数据同步自用友U8系统,同步时将被覆盖"
|
||||
textFill="#888888" wrapText="true" GridPane.columnIndex="1"
|
||||
GridPane.columnSpan="3" GridPane.rowIndex="20"/>
|
||||
<Label text="1. (*) 字段数据同步自用友U8系统,同步时将被覆盖" textFill="#888888" wrapText="true" GridPane.columnIndex="1" GridPane.columnSpan="3" GridPane.rowIndex="20" />
|
||||
<Label text="合同金额" GridPane.rowIndex="6" />
|
||||
<TextField fx:id="amountField" alignment="CENTER_RIGHT"
|
||||
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
|
||||
<TextField fx:id="amountField" alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.rowIndex="6" />
|
||||
<Label text="合同总数量 *" GridPane.rowIndex="12" />
|
||||
<Label text="合同总金额 *" GridPane.rowIndex="13" />
|
||||
<Label text="不含税总金额 *" GridPane.rowIndex="14" />
|
||||
<Label text="执行总数量 *" GridPane.columnIndex="2"
|
||||
GridPane.rowIndex="12"/>
|
||||
<Label text="执行总金额 *" GridPane.columnIndex="2"
|
||||
GridPane.rowIndex="13"/>
|
||||
<Label text="不含税总金额 *" GridPane.columnIndex="2"
|
||||
GridPane.rowIndex="14"/>
|
||||
<TextField fx:id="totalQuantityField" alignment="CENTER_RIGHT"
|
||||
GridPane.columnIndex="1" GridPane.halignment="RIGHT"
|
||||
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"/>
|
||||
<Label text="执行总数量 *" GridPane.columnIndex="2" GridPane.rowIndex="12" />
|
||||
<Label text="执行总金额 *" GridPane.columnIndex="2" GridPane.rowIndex="13" />
|
||||
<Label text="不含税总金额 *" GridPane.columnIndex="2" GridPane.rowIndex="14" />
|
||||
<TextField fx:id="totalQuantityField" alignment="CENTER_RIGHT" GridPane.columnIndex="1" GridPane.halignment="RIGHT" 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>
|
||||
<VBox.margin>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
@@ -320,8 +262,7 @@
|
||||
<bottom>
|
||||
<HBox id="HBox" alignment="CENTER_LEFT" prefWidth="800.0" spacing="5.0">
|
||||
<children>
|
||||
<Label fx:id="leftStatusLabel" maxHeight="1.7976931348623157E308" text="Left status"
|
||||
HBox.hgrow="ALWAYS">
|
||||
<Label fx:id="leftStatusLabel" maxHeight="1.7976931348623157E308" text="Left status" HBox.hgrow="ALWAYS">
|
||||
</Label>
|
||||
<Pane HBox.hgrow="ALWAYS" />
|
||||
<Label fx:id="rightStatusLabel" text="Right status" HBox.hgrow="NEVER" />
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<?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.EmployeeFunctionsManagerWindowController">
|
||||
fx:controller="com.ecep.contract.controller.permission.EmployeeFunctionWindowController">
|
||||
<center>
|
||||
<TabPane fx:id="tabPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0"
|
||||
tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<Menu text="文件(_F)">
|
||||
<items>
|
||||
<MenuItem onAction="#onCreateNewAction" text="新建…(_N)"/>
|
||||
<MenuItem onAction="#onReBuildFilesAction" text="同步…(_R)"/>
|
||||
<SeparatorMenuItem mnemonicParsing="false"/>
|
||||
<MenuItem mnemonicParsing="false" text="Preferences…"/>
|
||||
</items>
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?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>
|
||||
<TabPane fx:id="tabPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="150.0" tabClosingPolicy="UNAVAILABLE" tabMaxWidth="100.0" tabMinWidth="40.0">
|
||||
<tabs>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<Menu text="文件(_F)">
|
||||
<items>
|
||||
<MenuItem onAction="#onCreateNewAction" text="新建…(_N)" />
|
||||
<MenuItem onAction="#onReBuildFilesAction" text="同步…(_R)" />
|
||||
<SeparatorMenuItem mnemonicParsing="false" />
|
||||
<MenuItem mnemonicParsing="false" text="Preferences…" />
|
||||
</items>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user