物料优化

This commit is contained in:
lihao 2025-09-24 17:56:07 +08:00
parent 38438e7742
commit 197432459e
1 changed files with 9 additions and 7 deletions

View File

@ -187,14 +187,16 @@ public class MaterialToGyMesListener implements IBusinessListener {
*/ */
} }
if (!dataArr.isEmpty()) { if (!dataArr.isEmpty()) {
pushData(dataArr); JSONObject jsonObj = new JSONObject();
jsonObj.put("list", dataArr);
pushData(jsonObj);
} }
} }
/** /**
* 推送同步数据 * 推送同步数据
*/ */
private void pushData(JSONArray param) throws BusinessException { private void pushData(JSONObject param) throws BusinessException {
// String jsonString = param.toJSONString(); // String jsonString = param.toJSONString();
// 转json字符串的时候保留null值 // 转json字符串的时候保留null值
String jsonStr = JSON.toJSONString(param, String jsonStr = JSON.toJSONString(param,
@ -203,7 +205,7 @@ public class MaterialToGyMesListener implements IBusinessListener {
); );
logger.error("gymes-Material-param = " + jsonStr); logger.error("gymes-Material-param = " + jsonStr);
// NCCForUAPLogger.debug("gymes-Material-param = " + jsonStr); // NCCForUAPLogger.debug("gymes-Material-param = " + jsonStr);
String baseUrl = configParams.get("gymesBaseUrl"); String baseUrl = configParams.get("mesBaseUrl");
String requestUrl = baseUrl + addUrl; String requestUrl = baseUrl + addUrl;
logger.error("gymes-Material-url = " + requestUrl); logger.error("gymes-Material-url = " + requestUrl);
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr); String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);