ソースを参照

项目信息改成post,部分返回json放出null

menglu 3 年 前
コミット
2d9b93a2da

+ 4 - 4
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/RestApi.java

@@ -122,8 +122,8 @@ public class RestApi {
 		return result;
 	}
 
-	@GetMapping(path = "/get_projectInfo")
-	String get_projectInfo() {
+	@PostMapping(path = { "/get_projectInfo", "/zkt-sdk/get_projectInfo" }, produces = "application/json;charset=UTF-8")
+	public String get_projectInfo() {
 		JSONObject result = new JSONObject();
 		result.put("projectId", RepositoryContainer.RepositoryBase.projectId);
 		result.put("groupCode", RepositoryContainer.RepositoryBase.groupCode);
@@ -182,14 +182,14 @@ public class RestApi {
 	public String post_filter_and_page(@RequestBody String param, HttpServletRequest request) {
 		JSONObject paramObject = JSON.parseObject(param);
 		JSONObject result = RestUtil.post_filter_and_page(paramObject);
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	@PostMapping(path = { "/get_alarm_detail", "/zkt-sdk/get_alarm_detail" }, produces = "application/json;charset=UTF-8")
 	public String get_alarm_detail(@RequestBody String param, HttpServletRequest request) {
 		JSONObject paramObject = JSON.parseObject(param);
 		JSONObject result = RWDAlarmUtil.get_alarm_detail(paramObject);
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	@PostMapping(path = { "/alarm_export_post", "/zkt-sdk/alarm_export_post" }, produces = "application/json;charset=UTF-8")

+ 5 - 5
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/service/rest/RestUtil.java

@@ -331,7 +331,7 @@ public class RestUtil {
 			log.error(message);
 			result.put("result", "failure");
 		}
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	public static String get_control_value(String param) {
@@ -355,7 +355,7 @@ public class RestUtil {
 			result.put("ResultMsg", message);
 			result.put("ResultCode", 250);
 		}
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	public static String getIp(HttpServletRequest request) {
@@ -433,7 +433,7 @@ public class RestUtil {
 			result.put("ResultMsg", message);
 			result.put("ResultCode", 250);
 		}
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	public static ResponseEntity<FileSystemResource> fjd_query_history_batch_export(String param) throws Exception {
@@ -485,7 +485,7 @@ public class RestUtil {
 			result.put("ResultMsg", message);
 			result.put("ResultCode", 250);
 		}
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	public static String path_array_history_fjd_query(String param) {
@@ -556,7 +556,7 @@ public class RestUtil {
 		} catch (ParseException e) {
 			// log.error(e.getMessage(),e);
 		}
-		return result.toJSONString();
+		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
 	}
 
 	private static void fjd_query_result_process(JSONArray points, Map<String, JSONArray> Point2datas, Map<String, IntWrapper> Point2index) {