Commit f9346295 by 徐康

修复问题

parent 971b07d1
...@@ -21,6 +21,7 @@ import cn.freemud.service.thirdparty.DeliveryFeiginClient; ...@@ -21,6 +21,7 @@ import cn.freemud.service.thirdparty.DeliveryFeiginClient;
import cn.freemud.service.thirdparty.EcologyAdminApplicationClient; import cn.freemud.service.thirdparty.EcologyAdminApplicationClient;
import cn.freemud.service.thirdparty.PosClient; import cn.freemud.service.thirdparty.PosClient;
import cn.freemud.utils.DateTimeUtil; import cn.freemud.utils.DateTimeUtil;
import cn.freemud.utils.ExceptionUtils;
import cn.freemud.utils.LogUtil; import cn.freemud.utils.LogUtil;
import cn.freemud.utils.ResponseUtil; import cn.freemud.utils.ResponseUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -462,19 +463,10 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService { ...@@ -462,19 +463,10 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
} }
ecologyAdminApplicationClient.subscribeMessage(request); ecologyAdminApplicationClient.subscribeMessage(request);
} catch (Exception e) { } catch (Exception e) {
ApiLog.info("麦咖啡订阅消息推送失败" + orderId + getExceptionInfo(e)); ApiLog.info("麦咖啡订阅消息推送失败" + orderId + ExceptionUtils.getExceptionInfo(e));
} }
} }
private String getExceptionInfo(Exception e) {
StringBuilder sb = new StringBuilder();
StackTraceElement[] trace = e.getStackTrace();
for (StackTraceElement traceElement : trace) {
sb.append("\tat " + traceElement);
}
return sb.toString();
}
/** /**
* 配送消息推送 * 配送消息推送
*/ */
......
...@@ -134,6 +134,7 @@ import java.util.function.Function; ...@@ -134,6 +134,7 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@Slf4j
public class MCCafeOrderServiceImpl implements MCCafeOrderService { public class MCCafeOrderServiceImpl implements MCCafeOrderService {
private final Integer RESPONSE_SUCCESS_CODE = 100; private final Integer RESPONSE_SUCCESS_CODE = 100;
...@@ -2380,22 +2381,22 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService { ...@@ -2380,22 +2381,22 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
BeanUtils.copyProperties(queryOrderVo,vo); BeanUtils.copyProperties(queryOrderVo,vo);
String channelType = this.getQueryOrderChannelType(vo, userLoginInfoDto); String channelType = this.getQueryOrderChannelType(vo, userLoginInfoDto);
QueryOrdersDto queryOrdersDto = orderAdapter.convent2QueryOrdersDtoMcCafe(queryOrderVo, userId, channelType); QueryOrdersDto queryOrdersDto = orderAdapter.convent2QueryOrdersDtoMcCafe(queryOrderVo, userId, channelType);
QueryOrdersResponse queryOrderResponse; QueryOrdersResponse queryOrderResponse = null;
try { try {
QueryOrdersRequest queryOrdersRequest2 = new QueryOrdersRequest(); QueryOrdersRequest queryOrdersRequest2 = new QueryOrdersRequest();
BeanUtil.convertBean(queryOrdersDto, queryOrdersRequest2); BeanUtil.convertBean(queryOrdersDto, queryOrdersRequest2);
queryOrdersRequest2.setTrackingNo(LogTreadLocal.getTrackingNo()); queryOrdersRequest2.setTrackingNo(LogTreadLocal.getTrackingNo());
queryOrderResponse = orderCenterSdkService.queryMCCafeOrders(queryOrdersRequest2); queryOrderResponse = orderCenterSdkService.queryMCCafeOrders(queryOrdersRequest2);
} catch (Exception e) { } catch (Exception e) {
LogUtil.error("queryOrders_error", gson.toJson(queryOrdersDto), e); log.error("queryRecentOrders_error : " + ExceptionUtils.getExceptionInfo(e));
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR); return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode(), "查询订单异常");
} }
if (queryOrderResponse == null || !RESPONSE_SUCCESS_CODE.equals(queryOrderResponse.getErrcode())) { if (queryOrderResponse == null || !RESPONSE_SUCCESS_CODE.equals(queryOrderResponse.getErrcode())) {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode()); return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode(), "查询订单失败");
} }
//用户无订单数据 //用户无订单数据
if (queryOrderResponse.getData() == null || queryOrderResponse.getData().getCount() == 0) { if (queryOrderResponse.getData() == null || queryOrderResponse.getData().getCount() == 0) {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR); return ResponseUtil.error(ResponseResult.SUCCESS.getCode(), "查询订单数量为0");
} }
List<RecentGoodsInfoVo> recentGoodsInfoVoList = new ArrayList<>(); List<RecentGoodsInfoVo> recentGoodsInfoVoList = new ArrayList<>();
......
package cn.freemud.utils;
public class ExceptionUtils {
public static String getExceptionInfo(Exception e) {
StringBuilder sb = new StringBuilder();
StackTraceElement[] trace = e.getStackTrace();
for (StackTraceElement traceElement : trace) {
sb.append("\tat " + traceElement);
}
return sb.toString();
}
}
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