diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java index 3216a2028..e720f506a 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java @@ -187,6 +187,8 @@ public class BusinessDocumentOrderApplicationService { billList.add(billMap); } body.put("billList",billList); + List> bodyList = new ArrayList<>(); + bodyList.add(body); if (pushData.getId() != null) { updatePushStatus(pushData.getId(), 2, null, String.valueOf(pushBy), pushByName); diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java index e04ba6238..7649e424d 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/exchangeRate/ExchangeRateApplicationService.java @@ -96,14 +96,18 @@ public class ExchangeRateApplicationService { StringBuilder failMsg = new StringBuilder(); for (ExchangeRateDTO dto : exchangeRateDTOList) { - Map body = new HashMap<>(); - body.put("erpCurrCode", dto.getErpCurrCode()); - body.put("erpCurrName", dto.getErpCurrName()); + + Map item = new HashMap<>(); + item.put("erpCurrCode", dto.getErpCurrCode()); + item.put("erpCurrName", dto.getErpCurrName()); + List> bodyList = new ArrayList<>(); + bodyList.add(item); + GwLog gwLog = new GwLog(); gwLog.setType("汇率管理"); gwLog.setBusinessId(Long.valueOf(dto.getId())); - gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setRequestBody(JSONObject.toJSONString(bodyList)); gwLog.setResponseBody(""); gwLog.setStatus(1); gwLog.setSendTime(new Date()); @@ -120,7 +124,7 @@ public class ExchangeRateApplicationService { CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(PUSH_API_URL); - StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); httpPost.setHeader("apiName", API_NAME); diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java index 64277b4a4..46bb9f600 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java @@ -23,10 +23,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.io.IOException; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Service @Slf4j @@ -80,8 +77,8 @@ public class MaterialInfoApplicationService { StringBuilder failMsg = new StringBuilder(); for (MaterialInfoDTO dto : dtoList) { - Map body = new HashMap<>(); - body.put("goodsCode", dto.getMaterialCode()); + Map item = new HashMap<>(); + item.put("goodsCode", dto.getMaterialCode()); String goodsTypeString; if(dto.getGoodsType() == 0){ @@ -93,14 +90,15 @@ public class MaterialInfoApplicationService { }else{ throw new ServiceException("货物类型不存在"); } - body.put("goodsType", goodsTypeString); - body.put("erpName", dto.getMaterialName()); - + item.put("goodsType", goodsTypeString); + item.put("erpName", dto.getMaterialName()); + List> bodyList = new ArrayList<>(); + bodyList.add(item); GwLog gwLog = new GwLog(); gwLog.setType("物料管理"); gwLog.setBusinessId(dto.getMaterialBaseInfoId()); - gwLog.setRequestBody(JSONObject.toJSONString(body)); + gwLog.setRequestBody(JSONObject.toJSONString(bodyList)); gwLog.setResponseBody(""); gwLog.setStatus(1); gwLog.setSendTime(new Date()); @@ -116,7 +114,7 @@ public class MaterialInfoApplicationService { CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(PUSH_API_URL); - StringEntity postingString = new StringEntity(JSONObject.toJSONString(body), "UTF-8"); + StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8"); httpPost.setEntity(postingString); httpPost.setHeader("Content-type", "application/json"); httpPost.setHeader("apiName", API_NAME);