Commit 4177b1c0 by 徐康

Merge remote-tracking branch 'origin/master'

parents 8f2c44a9 4677d095
......@@ -2587,7 +2587,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
headers.set("Timestamp", timestamp);
headers.set("Sign", sign);
headers.add("Accept", MediaType.APPLICATION_JSON_VALUE);
Gson gson = new Gson();
AppLogUtil.infoLog("订单推送header: "+JSON.toJSONString(headers),null,null);
String json = JSON.toJSONString(mcCafePushOrderDto);
HttpEntity<String> requestEntity = new HttpEntity<>(json, headers);
ResponseEntity<String> responseEntity = client.exchange(mccafePushOrderGatewayUrl+"/mp/order", HttpMethod.POST, requestEntity, String.class);
......@@ -2601,7 +2601,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
pushMccafeOrder.setStoreId(orderInfoReqs.getStoreId());
if(!"SUCCESS".equals(responseDto.getCode())) {
pushMccafeOrder.setStatus(0);
pushMccafeOrder.setFailReason(JSON.toJSONString(responseDto));
pushMccafeOrder.setFailReason(subLongString(JSON.toJSONString(responseDto)));
} else {
pushMccafeOrder.setStatus(1);
}
......@@ -2627,7 +2627,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
pushMccafeOrder.setPartnerId(orderInfoReqs.getPartnerId());
pushMccafeOrder.setStoreId(orderInfoReqs.getStoreId());
pushMccafeOrder.setStatus(0);
pushMccafeOrder.setFailReason(ExceptionUtils.getExceptionInfo(e));
pushMccafeOrder.setFailReason(subLongString(ExceptionUtils.getExceptionInfo(e)));
pushMccafeOrderManager.insertOrder(pushMccafeOrder);
}
......@@ -2641,6 +2641,18 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
return baseResponse;
}
public String subLongString(String s) {
if(StringUtils.isNotBlank(s)) {
if(s.length() > 15000) {
return s.substring(0,15000);
} else {
return s;
}
} else {
return "";
}
}
public BaseResponse mcCafePushOrderMakeUp(McCafeQueryOrderVo queryOrderVo) {
executor.submit(() -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment