...
|
...
|
@@ -23,6 +23,7 @@ import com.yohoufo.order.service.stats.impl.SellerOrderStatsConfiguration; |
|
|
import com.yohoufo.order.service.stats.impl.SellerOrderStatsEntry;
|
|
|
import com.yohoufo.order.service.support.BuyerOrderMetaMapperSupport;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import com.yohoufo.order.utils.RetryerUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
...
|
...
|
@@ -281,20 +282,30 @@ public class BuyerOrderChangeBusinessPostProcessor { |
|
|
private class SellerOrderQuantityStatsBusinessProcessor extends BusinessProcessorAdapter {
|
|
|
@Override
|
|
|
public void appraiseSuccess(BusinessProcessorContext context) {
|
|
|
doProcess(context.buyerOrder);
|
|
|
try {
|
|
|
RetryerUtils.getRetryer().call(() -> doProcess(context.buyerOrder));
|
|
|
} catch (Exception e) {
|
|
|
logger.error("appraiseSuccess happened exception:{}", e);
|
|
|
//便于异常告警
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void acceptFault(BusinessProcessorContext context) {
|
|
|
doProcess(context.buyerOrder);
|
|
|
try {
|
|
|
RetryerUtils.getRetryer().call(() -> doProcess(context.buyerOrder));
|
|
|
} catch (Exception e) {
|
|
|
logger.error("acceptFault happened exception:{}", e);
|
|
|
//便于异常告警
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void doProcess(BuyerOrder buyerOrder) {
|
|
|
|
|
|
private boolean doProcess(BuyerOrder buyerOrder) {
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectByOrderCode(buyerOrder.getUid(), buyerOrder.getOrderCode());
|
|
|
|
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(buyerOrderGoods.getSkup());
|
|
|
|
|
|
SellerOrderStatsEntry statsEntry = SellerOrderStatsEntry.builder()
|
|
|
.buyerUid(buyerOrder.getUid())
|
|
|
.buyerOrderCode(buyerOrder.getOrderCode())
|
...
|
...
|
@@ -303,8 +314,8 @@ public class BuyerOrderChangeBusinessPostProcessor { |
|
|
.build();
|
|
|
|
|
|
SellerOrderStatsConfiguration statsConfig = statsConfigurationManager.getStatsConfig(statsEntry);
|
|
|
|
|
|
statsConfigurationManager.getStatsProcessor(statsConfig.getStatsProcessorName()).accept(statsEntry, statsConfig);
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|