shiyj
2019-07-07 348c483d9e8cf81c485289a44c717fe1c23f4065
java110-bean/src/main/java/com/java110/entity/service/DataQuery.java
@@ -2,6 +2,9 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.springframework.http.ResponseEntity;
import java.util.Map;
/**
 * 数据查询对象
@@ -21,6 +24,9 @@
    private JSONObject responseInfo;
    private ServiceSql serviceSql;
    //rest 返回对象
    private ResponseEntity responseEntity;
@@ -65,6 +71,13 @@
        this.serviceSql = serviceSql;
    }
    public ResponseEntity getResponseEntity() {
        return responseEntity;
    }
    public void setResponseEntity(ResponseEntity responseEntity) {
        this.responseEntity = responseEntity;
    }
    /**
     * {
@@ -89,9 +102,9 @@
        if(businessInfoObj.containsKey("business")){
            if(businessInfoObj.get("business") instanceof JSONObject){
                currentBusinessInfo = (JSONObject) businessInfoObj.get("business");
            }else if(businessInfoObj.get("business") instanceof JSONArray){
            }/*else if(businessInfoObj.get("business") instanceof JSONArray){
                currentBusinessInfo =  ((JSONArray) businessInfoObj.get("business")).getJSONObject(0);
            }else {
            }*/else {
                return null;
            }
        }else{
@@ -101,4 +114,10 @@
        this.setRequestParams(currentBusinessInfo.getJSONObject("datas").getJSONObject("params"));
        return this;
    }
    public DataQuery builder(Map<String, Object> headers){
        this.setServiceCode(headers.get("service").toString());
        this.setRequestParams(JSONObject.parseObject(JSONObject.toJSONString(headers.get("params"))));
        return this;
    }
}