|
@@ -1,8 +1,12 @@
|
|
|
package com.persagy.ibms.data.sdk.util;
|
|
|
|
|
|
import java.io.File;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.persagy.ibms.core.data.SceneObject;
|
|
|
import com.persagy.ibms.core.data.SceneProperty;
|
|
@@ -44,8 +48,24 @@ public class RWDRepositoryUtil {
|
|
|
|
|
|
log.warn("LoadConfig");
|
|
|
SceneObject sceneObject = new SceneObject();
|
|
|
- JSONObject sceneJSON = FastJsonReaderUtil.Instance().ReadJSONObject(new File(Constant.getLatestPath(Constant.config, false)));
|
|
|
- FastJsonUtil.Set_JavaObject(sceneJSON, sceneObject);
|
|
|
+ {
|
|
|
+ JSONObject sceneJSON_ori = FastJsonReaderUtil.Instance().ReadJSONObject(new File(Constant.getLatestPath(Constant.config, false)));
|
|
|
+ JSONArray PropertyList_ori = sceneJSON_ori.getJSONArray("PropertyList");
|
|
|
+ JSONObject sceneJSON = new JSONObject();
|
|
|
+ JSONArray PropertyList = new JSONArray();
|
|
|
+ for (int i = 0; i < PropertyList_ori.size(); i++) {
|
|
|
+ JSONObject Property = PropertyList_ori.getJSONObject(i);
|
|
|
+ String PropertyName = Property.getString("PropertyName");
|
|
|
+ if (PropertyName.equals("general_query")) {
|
|
|
+ JSONObject custom_object = Property.getJSONObject("custom_object");
|
|
|
+ parse_general_query(Repository, custom_object);
|
|
|
+ } else {
|
|
|
+ PropertyList.add(Property);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sceneJSON.put("PropertyList", PropertyList);
|
|
|
+ FastJsonUtil.Set_JavaObject(sceneJSON, sceneObject);
|
|
|
+ }
|
|
|
Repository.sceneObject = sceneObject;
|
|
|
|
|
|
Repository.property2SDV_enable = true;
|
|
@@ -63,4 +83,16 @@ public class RWDRepositoryUtil {
|
|
|
Repository.property2SDV.clear();
|
|
|
}
|
|
|
|
|
|
+ private static void parse_general_query(RepositoryImpl Repository, JSONObject custom_object) {
|
|
|
+ Map<String, JSONObject> general_queryMap = new HashMap<String, JSONObject>();
|
|
|
+ JSONArray PropertyList = custom_object.getJSONArray("PropertyList");
|
|
|
+ for (int i = 0; i < PropertyList.size(); i++) {
|
|
|
+ JSONObject Property = PropertyList.getJSONObject(i);
|
|
|
+ String PropertyName = Property.getString("PropertyName");
|
|
|
+ String query_sql = Property.getString("query_sql");
|
|
|
+ JSONObject query_sql_json = JSON.parseObject(query_sql);
|
|
|
+ general_queryMap.put(PropertyName, query_sql_json);
|
|
|
+ }
|
|
|
+ Repository.general_queryMap = general_queryMap;
|
|
|
+ }
|
|
|
}
|