推送修复
This commit is contained in:
+2
@@ -187,6 +187,8 @@ public class BusinessDocumentOrderApplicationService {
|
||||
billList.add(billMap);
|
||||
}
|
||||
body.put("billList",billList);
|
||||
List<Map<String, Object>> bodyList = new ArrayList<>();
|
||||
bodyList.add(body);
|
||||
|
||||
if (pushData.getId() != null) {
|
||||
updatePushStatus(pushData.getId(), 2, null, String.valueOf(pushBy), pushByName);
|
||||
|
||||
+9
-5
@@ -96,14 +96,18 @@ public class ExchangeRateApplicationService {
|
||||
StringBuilder failMsg = new StringBuilder();
|
||||
|
||||
for (ExchangeRateDTO dto : exchangeRateDTOList) {
|
||||
Map<String, String> body = new HashMap<>();
|
||||
body.put("erpCurrCode", dto.getErpCurrCode());
|
||||
body.put("erpCurrName", dto.getErpCurrName());
|
||||
|
||||
Map<String, String> item = new HashMap<>();
|
||||
item.put("erpCurrCode", dto.getErpCurrCode());
|
||||
item.put("erpCurrName", dto.getErpCurrName());
|
||||
List<Map<String, String>> 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);
|
||||
|
||||
+9
-11
@@ -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<String, String> body = new HashMap<>();
|
||||
body.put("goodsCode", dto.getMaterialCode());
|
||||
Map<String, String> 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<Map<String, String>> 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);
|
||||
|
||||
Reference in New Issue
Block a user