From 7afa32638bd4c1eec05a19a6586af3f4b1ce8ccb Mon Sep 17 00:00:00 2001
From: wuxw7 <wuxw7@asiainfo.com>
Date: 星期六, 16 六月 2018 01:25:43 +0800
Subject: [PATCH] 日志服务实现
---
java110-core/src/main/java/com/java110/core/context/DataFlow.java | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/java110-core/src/main/java/com/java110/core/context/DataFlow.java b/java110-core/src/main/java/com/java110/core/context/DataFlow.java
index d6b28e1..2ce6d05 100644
--- a/java110-core/src/main/java/com/java110/core/context/DataFlow.java
+++ b/java110-core/src/main/java/com/java110/core/context/DataFlow.java
@@ -3,7 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.common.util.DateUtil;
-import com.java110.common.util.SequenceUtil;
+import com.java110.core.factory.GenerateCodeFactory;
import com.java110.common.util.StringUtil;
import com.java110.entity.center.AppRoute;
import com.java110.entity.center.Business;
@@ -219,7 +219,17 @@
Business business = null;
JSONObject reqInfoObj = JSONObject.parseObject(reqInfo);
JSONObject orderObj = reqInfoObj.getJSONObject("orders");
- JSONArray businessArray = reqInfoObj.getJSONArray("business");
+ Object businessObj = reqInfoObj.get("business");
+ JSONArray businessArray = null;
+ if(businessObj instanceof JSONObject){
+ businessArray = new JSONArray();
+ businessArray.add(reqInfoObj.getJSONObject("business"));
+ }else if(businessObj instanceof JSONArray){
+ businessArray = reqInfoObj.getJSONArray("business");
+ }else{
+ // 涓嶅仛澶勭悊
+ }
+
this.setReqData(reqInfo);
this.setReqJson(reqInfoObj);
this.setDataFlowId(orderObj.containsKey("dataFlowId")?orderObj.getString("dataFlowId"):"-1");
@@ -269,7 +279,7 @@
this.setReqData(reqInfo);
this.setDataFlowId("-1");
this.setAppId(headerAll.get("appId"));
- this.setTransactionId(StringUtil.isNullOrNone(headerAll.get("transactionId"))? SequenceUtil.getTransactionId():headerAll.get("transactionId"));
+ this.setTransactionId(StringUtil.isNullOrNone(headerAll.get("transactionId"))? GenerateCodeFactory.getTransactionId():headerAll.get("transactionId"));
this.setUserId(StringUtil.isNullOrNone(headerAll.get("userId"))? "-1":headerAll.get("userId"));
this.setOrderTypeCd("T");
this.setRemark(StringUtil.isNullOrNone(headerAll.get("remark"))? "":headerAll.get("remark"));
--
Gitblit v1.8.0