wuxw
2022-07-19 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54
java110-core/src/main/java/com/java110/core/context/OrderDataFlow.java
old mode 100644 new mode 100755
@@ -2,13 +2,14 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.common.constant.CommonConstant;
import com.java110.common.util.Assert;
import com.java110.common.util.DateUtil;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.DateUtil;
import com.java110.entity.order.Business;
import com.java110.entity.order.BusinessAttrs;
import com.java110.entity.order.Orders;
import com.java110.entity.order.OrdersAttrs;
import com.java110.utils.util.StringUtil;
import java.util.*;
@@ -81,6 +82,9 @@
        //构建返回头
        builderResHeaders();
        //构建返回json 为{"msg":[]}
        builderResJson();
        //构建 订单信息
        builderOrders();
@@ -126,12 +130,26 @@
        this.orders.setRequestTime(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME));
        this.orders.setoId("-1");
        String oId = this.getReqHeaders().get(CommonConstant.O_ID);
        if(StringUtil.isEmpty(oId)){
            oId = "-1";
        }
        this.orders.setoId(oId);
        JSONObject tmpOrderJson = this.getReqJson().getJSONObject("orders");
        Assert.jsonObjectHaveKey(tmpOrderJson,"orderTypeCd","请求报文错误,未找到orderTypeCd节点");
        this.orders.setOrderTypeCd(tmpOrderJson.getString("orderTypeCd"));
        if(tmpOrderJson.containsKey("orderProcess") && !StringUtil.isEmpty(tmpOrderJson.getString("orderProcess"))){
            this.orders.setOrderProcess(tmpOrderJson.getString("orderProcess"));
        }
        if(tmpOrderJson.containsKey("oId") && !StringUtil.isEmpty(tmpOrderJson.getString("oId"))){
            this.orders.setoId(tmpOrderJson.getString("oId"));
        }
        if(!tmpOrderJson.containsKey("attrs")){
            return ;
@@ -160,6 +178,9 @@
    private void builderBusiness() {
        this.businessList = new ArrayList<Business>();
        if(!this.getReqJson().containsKey("business")){
            return;
        }
        JSONArray tmpBusiness = this.getReqJson().getJSONArray("business");
@@ -214,6 +235,15 @@
        }
    }
    /**
     * 初始化构建返回报文
     */
    private void builderResJson(){
        JSONObject resJson = new JSONObject();
        resJson.put("msg",new JSONArray());
        this.setResJson(resJson);
    }
    public Orders getOrders() {
        return orders;