|
@@ -23,6 +23,7 @@ import com.yohoufo.order.service.stats.impl.SellerOrderStatsConfiguration; |
|
@@ -23,6 +23,7 @@ import com.yohoufo.order.service.stats.impl.SellerOrderStatsConfiguration; |
23
|
import com.yohoufo.order.service.stats.impl.SellerOrderStatsEntry;
|
23
|
import com.yohoufo.order.service.stats.impl.SellerOrderStatsEntry;
|
24
|
import com.yohoufo.order.service.support.BuyerOrderMetaMapperSupport;
|
24
|
import com.yohoufo.order.service.support.BuyerOrderMetaMapperSupport;
|
25
|
import com.yohoufo.order.utils.LoggerUtils;
|
25
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
26
|
+import com.yohoufo.order.utils.RetryerUtils;
|
26
|
import org.slf4j.Logger;
|
27
|
import org.slf4j.Logger;
|
27
|
import org.springframework.beans.factory.annotation.Autowired;
|
28
|
import org.springframework.beans.factory.annotation.Autowired;
|
28
|
import org.springframework.stereotype.Component;
|
29
|
import org.springframework.stereotype.Component;
|
|
@@ -281,20 +282,30 @@ public class BuyerOrderChangeBusinessPostProcessor { |
|
@@ -281,20 +282,30 @@ public class BuyerOrderChangeBusinessPostProcessor { |
281
|
private class SellerOrderQuantityStatsBusinessProcessor extends BusinessProcessorAdapter {
|
282
|
private class SellerOrderQuantityStatsBusinessProcessor extends BusinessProcessorAdapter {
|
282
|
@Override
|
283
|
@Override
|
283
|
public void appraiseSuccess(BusinessProcessorContext context) {
|
284
|
public void appraiseSuccess(BusinessProcessorContext context) {
|
284
|
- doProcess(context.buyerOrder);
|
285
|
+ try {
|
|
|
286
|
+ RetryerUtils.getRetryer().call(() -> doProcess(context.buyerOrder));
|
|
|
287
|
+ } catch (Exception e) {
|
|
|
288
|
+ logger.error("appraiseSuccess happened exception:{}", e);
|
|
|
289
|
+ //便于异常告警
|
|
|
290
|
+ throw new RuntimeException(e);
|
|
|
291
|
+ }
|
|
|
292
|
+
|
285
|
}
|
293
|
}
|
286
|
|
294
|
|
287
|
@Override
|
295
|
@Override
|
288
|
public void acceptFault(BusinessProcessorContext context) {
|
296
|
public void acceptFault(BusinessProcessorContext context) {
|
289
|
- doProcess(context.buyerOrder);
|
297
|
+ try {
|
|
|
298
|
+ RetryerUtils.getRetryer().call(() -> doProcess(context.buyerOrder));
|
|
|
299
|
+ } catch (Exception e) {
|
|
|
300
|
+ logger.error("acceptFault happened exception:{}", e);
|
|
|
301
|
+ //便于异常告警
|
|
|
302
|
+ throw new RuntimeException(e);
|
|
|
303
|
+ }
|
290
|
}
|
304
|
}
|
291
|
|
305
|
|
292
|
- private void doProcess(BuyerOrder buyerOrder) {
|
|
|
293
|
-
|
306
|
+ private boolean doProcess(BuyerOrder buyerOrder) {
|
294
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
|
307
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
|
295
|
-
|
|
|
296
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
|
308
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
|
297
|
-
|
|
|
298
|
SellerOrderStatsEntry statsEntry = SellerOrderStatsEntry.builder()
|
309
|
SellerOrderStatsEntry statsEntry = SellerOrderStatsEntry.builder()
|
299
|
.buyerUid(buyerOrder.getUid())
|
310
|
.buyerUid(buyerOrder.getUid())
|
300
|
.buyerOrderCode(buyerOrder.getOrderCode())
|
311
|
.buyerOrderCode(buyerOrder.getOrderCode())
|
|
@@ -303,8 +314,8 @@ public class BuyerOrderChangeBusinessPostProcessor { |
|
@@ -303,8 +314,8 @@ public class BuyerOrderChangeBusinessPostProcessor { |
303
|
.build();
|
314
|
.build();
|
304
|
|
315
|
|
305
|
SellerOrderStatsConfiguration statsConfig = statsConfigurationManager.getStatsConfig(statsEntry);
|
316
|
SellerOrderStatsConfiguration statsConfig = statsConfigurationManager.getStatsConfig(statsEntry);
|
306
|
-
|
|
|
307
|
statsConfigurationManager.getStatsProcessor(statsConfig.getStatsProcessorName()).accept(statsEntry, statsConfig);
|
317
|
statsConfigurationManager.getStatsProcessor(statsConfig.getStatsProcessorName()).accept(statsEntry, statsConfig);
|
|
|
318
|
+ return true;
|
308
|
}
|
319
|
}
|
309
|
}
|
320
|
}
|
310
|
|
321
|
|