wuxw7
2018-05-09 1254c7d457b742e16ffc8c7820a445e1985fa55c
java110-bean/src/main/java/com/java110/entity/center/DataFlow.java
@@ -3,7 +3,6 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
@@ -11,6 +10,9 @@
 * Created by wuxw on 2018/4/13.
 */
public class DataFlow {
    private String dataFlowId;
    private String oId;
@@ -53,19 +55,21 @@
    //请求完成时间
    private Date endDate;
    private String reqJson;
    private JSONObject reqJson;
    private String resJson;
    private JSONObject resJson;
    private List<Business> businesses;
    private String requestURL;
    private List<DataFlowLinksCost> linksCostDatas = new ArrayList<DataFlowLinksCost>();
    private List<DataFlowLinksCost> linksCostDates = new ArrayList<DataFlowLinksCost>();
    private Map<String,String> headers = new HashMap<String,String>();
    private AppRoute appRoute;
    /*private AppRoute appRoute;*/
    private List<AppRoute> appRoutes = new ArrayList<AppRoute>();
    //请求业务系统报文
    private JSONObject requestBusinessJson;
@@ -84,7 +88,13 @@
        return businesses;
    }
    public String getDataFlowId() {
        return dataFlowId;
    }
    public void setDataFlowId(String dataFlowId) {
        this.dataFlowId = dataFlowId;
    }
    public void setBusinesses(List<Business> businesses) {
        this.businesses = businesses;
@@ -236,21 +246,7 @@
        this.endDate = endDate;
    }
    public String getReqJson() {
        return reqJson;
    }
    public void setReqJson(String reqJson) {
        this.reqJson = reqJson;
    }
    public String getResJson() {
        return resJson;
    }
    public void setResJson(String resJson) {
        this.resJson = resJson;
    }
    public String getRequestURL() {
        return requestURL;
@@ -264,12 +260,20 @@
        return headers;
    }
    public AppRoute getAppRoute() {
    /*public AppRoute getAppRoute() {
        return appRoute;
    }
    public void setAppRoute(AppRoute appRoute) {
        this.appRoute = appRoute;
    }*/
    public List<AppRoute> getAppRoutes() {
        return appRoutes;
    }
    public void addAppRoutes(AppRoute appRoute) {
        this.appRoutes.add(appRoute);
    }
    public String getIp() {
@@ -297,12 +301,32 @@
        this.responseBusinessJson = responseBusinessJson;
    }
    public JSONObject getReqJson() {
        return reqJson;
    }
    public void setReqJson(JSONObject reqJson) {
        this.reqJson = reqJson;
    }
    public JSONObject getResJson() {
        return resJson;
    }
    public void setResJson(JSONObject resJson) {
        this.resJson = resJson;
    }
    public List<DataFlowLinksCost> getLinksCostDates() {
        return linksCostDates;
    }
    /**
     * 添加各个环节的耗时
     * @param dataFlowLinksCost
     */
    public void addLinksCostDatas(DataFlowLinksCost dataFlowLinksCost){
        this.linksCostDatas.add(dataFlowLinksCost);
    public void addLinksCostDates(DataFlowLinksCost dataFlowLinksCost){
        this.linksCostDates.add(dataFlowLinksCost);
    }
    public DataFlow builder(String reqInfo, Map<String,String> headerAll) throws Exception{
@@ -312,8 +336,10 @@
            JSONObject reqInfoObj = JSONObject.parseObject(reqInfo);
            JSONObject orderObj = reqInfoObj.getJSONObject("orders");
            JSONArray businessArray = reqInfoObj.getJSONArray("business");
            this.setReqJson(reqInfoObj);
            this.setDataFlowId(orderObj.containsKey("dataFlowId")?orderObj.getString("dataFlowId"):"-1");
            this.setAppId(orderObj.getString("appId"));
            this.setAppId(orderObj.getString("transactionId"));
            this.setTransactionId(orderObj.getString("transactionId"));
            this.setUserId(orderObj.getString("userId"));
            this.setOrderTypeCd(orderObj.getString("orderTypeCd"));
            this.setRemark(orderObj.getString("remark"));
@@ -337,6 +363,7 @@
        }catch (Exception e){
            throw e;
        }
        return this;