refactor: 移除Hibernate依赖并重构代理对象初始化检查逻辑
feat(controller): 新增多个任务类用于合同和客户相关操作 feat(service): 新增ProxyUtils工具类替代Hibernate.isInitialized检查 refactor(controller): 重构多个控制器和皮肤类,使用ProxyUtils替代Hibernate refactor(service): 重构服务类,移除Hibernate依赖并优化方法实现 fix(controller): 修复表格单元格初始化逻辑,确保代理对象正确加载 chore: 更新项目版本号至0.0.58-SNAPSHOT docs: 添加MyProperties类用于管理下载路径配置
This commit is contained in:
13
client/src/main/java/com/ecep/contract/util/ProxyUtils.java
Normal file
13
client/src/main/java/com/ecep/contract/util/ProxyUtils.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.ecep.contract.util;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class ProxyUtils {
|
||||
/**
|
||||
* 判断对象是否已初始化
|
||||
* 在客户端环境中,如果对象不为null,则认为已初始化
|
||||
*/
|
||||
public static boolean isInitialized(Object proxy) {
|
||||
return proxy != null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ecep.contract.util;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Text;
|
||||
|
||||
public class TextMessageHolder implements MessageHolder {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void addMessage(Level level, String message) {
|
||||
Text text = new Text(message);
|
||||
if (Level.WARNING == level) { // warning
|
||||
text.setFill(Color.YELLOW);
|
||||
} else if (Level.SEVERE == level) {// error
|
||||
text.setFill(Color.RED);
|
||||
} else if (Level.FINE == level) { // debug
|
||||
text.setFill(Color.GRAY);
|
||||
} else {
|
||||
text.setFill(Color.WHITE);
|
||||
}
|
||||
addTextMessage(text);
|
||||
}
|
||||
|
||||
public void addTextMessage(Text text) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'addTextMessage'");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -58,13 +58,7 @@ public class UITools {
|
||||
expContent.add(label, 0, 0);
|
||||
expContent.add(textArea, 0, 1);
|
||||
|
||||
String message = null;
|
||||
if (e instanceof org.springframework.orm.ObjectOptimisticLockingFailureException) {
|
||||
message = "锁冲突, 数据可能已经被修改, 请重新加载, 再次重试.";
|
||||
} else {
|
||||
message = e.getMessage();
|
||||
}
|
||||
|
||||
String message = e.getMessage();
|
||||
showAndWait(Alert.AlertType.ERROR, "程序异常", title, message, expContent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user