Authored by chenchao

Merge branch 'hotfix_20190515skup状态同步告警' into test6.9.3

@@ -2,6 +2,7 @@ package com.yohoufo.order.convert.builder; @@ -2,6 +2,7 @@ package com.yohoufo.order.convert.builder;
2 2
3 import com.yohobuy.ufo.model.order.common.OrderStatus; 3 import com.yohobuy.ufo.model.order.common.OrderStatus;
4 import com.yohobuy.ufo.model.order.common.SellerOrderStatus; 4 import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
  5 +import com.yohobuy.ufo.model.order.common.SkupStatus;
5 import com.yohoufo.common.alarm.SmsAlarmEvent; 6 import com.yohoufo.common.alarm.SmsAlarmEvent;
6 import com.yohoufo.order.constants.AlarmConfig; 7 import com.yohoufo.order.constants.AlarmConfig;
7 8
@@ -77,5 +78,14 @@ public class AlarmEventBuilder { @@ -77,5 +78,14 @@ public class AlarmEventBuilder {
77 } 78 }
78 79
79 80
  81 + public static SmsAlarmEvent buildSkupStatusAlarmEvent(int skup, SkupStatus skupStatus, int statusInPrd){
  82 +
  83 + SmsAlarmEvent smsAlarmEvent ;
  84 + String content ;
  85 + content = "同步skup状态到商品库失败,skup:"+ skup +",SkupStatus:" + skupStatus + ",statusInPrd:"+ statusInPrd;
  86 + smsAlarmEvent = new SmsAlarmEvent("ufoOrder.syncSkup", "syncSkup", content);
  87 + return smsAlarmEvent;
  88 + }
  89 +
80 90
81 } 91 }
@@ -13,8 +13,11 @@ import com.yohobuy.ufo.model.response.ProductDetailResp; @@ -13,8 +13,11 @@ import com.yohobuy.ufo.model.response.ProductDetailResp;
13 import com.yohobuy.ufo.model.response.StorageDataResp; 13 import com.yohobuy.ufo.model.response.StorageDataResp;
14 import com.yohobuy.ufo.model.response.StorageInfoResp; 14 import com.yohobuy.ufo.model.response.StorageInfoResp;
15 import com.yohoufo.common.ApiResponse; 15 import com.yohoufo.common.ApiResponse;
  16 +import com.yohoufo.common.alarm.EventBusPublisher;
  17 +import com.yohoufo.common.alarm.SmsAlarmEvent;
16 import com.yohoufo.common.exception.UfoServiceException; 18 import com.yohoufo.common.exception.UfoServiceException;
17 import com.yohoufo.dal.order.model.SellerOrderGoods; 19 import com.yohoufo.dal.order.model.SellerOrderGoods;
  20 +import com.yohoufo.order.convert.builder.AlarmEventBuilder;
18 import lombok.Data; 21 import lombok.Data;
19 import org.apache.commons.collections.CollectionUtils; 22 import org.apache.commons.collections.CollectionUtils;
20 import org.apache.commons.collections.MapUtils; 23 import org.apache.commons.collections.MapUtils;
@@ -275,6 +278,8 @@ public class ProductProxyService extends AbsProxyService{ @@ -275,6 +278,8 @@ public class ProductProxyService extends AbsProxyService{
275 String errorStack = Throwables.getStackTraceAsString(ex); 278 String errorStack = Throwables.getStackTraceAsString(ex);
276 logger.warn("call {} fail,req {}, error {}", SYNC_SKUP_STATUS, req, errorStack); 279 logger.warn("call {} fail,req {}, error {}", SYNC_SKUP_STATUS, req, errorStack);
277 result = false; 280 result = false;
  281 + SmsAlarmEvent smsAlarmEvent = AlarmEventBuilder.buildSkupStatusAlarmEvent(goods.getId(), skupStatus, status);
  282 + EventBusPublisher.publishEvent(smsAlarmEvent);
278 } 283 }
279 284
280 return result; 285 return result;