Parcourir la source

如果查询语句错误,查询以后再抛出

menglu il y a 4 ans
Parent
commit
81fbf74db1

+ 12 - 7
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/ComputeUtil.java

@@ -113,14 +113,19 @@ public class ComputeUtil {
 		// 处理expression
 		for (SceneProperty spInner : spList) {
 			if (spInner.propertyValueType.equals("query")) {
-				JSONObject sql_json = JSON.parseObject(spInner.query_sql);
-				if (sql_json.containsKey("QueryType")) {
-					String QueryType = (String) sql_json.get("QueryType");
-					if (QueryType.equals("expression")) {
-						String expression = (String) sql_json.get("expression");
-						JSONObject CriteriaObject = (JSONObject) sql_json.get("Criteria");
-						ExpressionUtil.buildAndPut(Repository, spInner, expression, CriteriaObject);
+				try {
+					JSONObject sql_json = JSON.parseObject(spInner.query_sql);
+					if (sql_json.containsKey("QueryType")) {
+						String QueryType = (String) sql_json.get("QueryType");
+						if (QueryType.equals("expression")) {
+							String expression = (String) sql_json.get("expression");
+							JSONObject CriteriaObject = (JSONObject) sql_json.get("Criteria");
+							ExpressionUtil.buildAndPut(Repository, spInner, expression, CriteriaObject);
+						}
 					}
+				} catch (Exception e) {
+					log.error(spInner.query_sql);
+					throw e;
 				}
 			}
 		}

+ 1 - 1
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/FileUtil.java

@@ -70,7 +70,7 @@ public class FileUtil {
 
 			return true;
 		} else if (file1.isFile() && file2.isFile()) {
-			log.info(LogUtil.refreshLoggerName, "Compare " + file1.getPath() + " " + file2.getPath());
+			log.info(LogUtil.refreshLoggerName + "\t" + "Compare " + file1.getPath() + " " + file2.getPath());
 			Object json1 = FastJsonReaderUtil.Instance().Read(file1);
 			Object json2 = FastJsonReaderUtil.Instance().Read(file2);
 			return FastJsonCompareUtil.Instance().CompareObject(json1, json2);