From fb68073088c6ab7150ae58cb24095b0ed0cd83df Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期一, 18 七月 2022 13:53:16 +0800
Subject: [PATCH] 优化bId 为空问题
---
java110-core/src/main/java/com/java110/core/factory/Java110TransactionalFactory.java | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/java110-core/src/main/java/com/java110/core/factory/Java110TransactionalFactory.java b/java110-core/src/main/java/com/java110/core/factory/Java110TransactionalFactory.java
old mode 100644
new mode 100755
index 25fa152..efb31e6
--- a/java110-core/src/main/java/com/java110/core/factory/Java110TransactionalFactory.java
+++ b/java110-core/src/main/java/com/java110/core/factory/Java110TransactionalFactory.java
@@ -7,8 +7,12 @@
import com.java110.utils.util.StringUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.*;
+import com.java110.core.log.LoggerFactory;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
@@ -84,6 +88,7 @@
}
public static String getOrCreateOId(OrderDto orderDto) {
+
//鍏ㄥ眬浜嬪姟寮�鍚��
if (StringUtils.isEmpty(orderDto.getoId())) {
createOId(orderDto);
@@ -94,6 +99,21 @@
//灏嗕簨鍔D 瀛樻斁璧锋潵
put(O_ID, orderDto.getoId());
return orderDto.getoId();
+ }
+
+ /**
+ * 娓呯悊浜嬪姟
+ */
+ public static void clearOId() {
+ //娓呯悊浜嬪姟
+ if(!StringUtil.isEmpty(getOId())) {
+ remove(O_ID);
+ }
+ //娓呯悊瑙掕壊
+ if(!StringUtil.isEmpty(getServiceRole())) {
+ remove(SERVICE_ROLE);
+ }
+
}
/**
@@ -153,6 +173,7 @@
* 澶勭悊澶辫触锛屽洖閫�浜嬪姟
*/
public static void fallbackOId() {
+
String oId = getOId();
if (StringUtil.isEmpty(oId) || ROLE_OBSERVER.equals(getServiceRole())) {
//褰撳墠娌℃湁寮�鍚簨鍔℃棤闇�鍥為��
--
Gitblit v1.8.0