...
|
...
|
@@ -13,6 +13,7 @@ import com.yohobuy.ufo.model.promotion.request.CouponSendMqBean; |
|
|
import com.yohobuy.ufo.model.promotion.request.CouponSendType;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.alarm.EventBusPublisher;
|
|
|
import com.yohoufo.common.constant.EnumPlatformDeliveryStatus;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.model.*;
|
...
|
...
|
@@ -68,7 +69,7 @@ public class AppraiseService { |
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(AppraiseService.class);
|
|
|
|
|
|
private ExecutorService executorService = new ThreadPoolExecutor(3, 5, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(100), new PubThreadFactory("appraise-processor"));
|
|
|
private ExecutorService executorService = new ThreadPoolExecutor(3, 5, 60, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1000), new PubThreadFactory("appraise-processor"));
|
|
|
|
|
|
@Autowired
|
|
|
private IExpressInfoService expressInfoService;
|
...
|
...
|
@@ -214,10 +215,15 @@ public class AppraiseService { |
|
|
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
|
|
|
EventBusPublisher.publishEvent(buyerConfirmEvent);
|
|
|
|
|
|
//记录物流信息
|
|
|
//发物流
|
|
|
expressInfoService.deliverGoods(buyerUid, appraiseExpressInfoBo.getExpressCompanyId(), orderCode, appraiseExpressInfoBo.getWayBillCode(), appraiseExpressInfoBo.getDepotNum(), appraiseExpressInfoBo.getMobile());
|
|
|
executorService.execute(() -> {
|
|
|
//记录物流信息
|
|
|
//发物流
|
|
|
expressInfoService.deliverGoods(buyerUid, appraiseExpressInfoBo.getExpressCompanyId(), orderCode, appraiseExpressInfoBo.getWayBillCode(), appraiseExpressInfoBo.getDepotNum(), appraiseExpressInfoBo.getMobile());
|
|
|
|
|
|
//更新平台物流状态为已发货
|
|
|
buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
EnumPlatformDeliveryStatus.delivery_to_buyer.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
});
|
|
|
//记录订单的状态变更信息
|
|
|
orderStatusFlowService.addAsy(buyerOrder.getOrderCode(), targetOrderStatus.getCode());
|
|
|
|
...
|
...
|
@@ -291,11 +297,16 @@ public class AppraiseService { |
|
|
LOGGER.info("returnBackOrderCauseOfJudgeFailure check status ok expectStatus {}, actual status {}, orderCode {}", expectStatus,
|
|
|
buyerOrder.getStatus(), orderCode);
|
|
|
|
|
|
executorService.execute(() -> {
|
|
|
//更新物流信息
|
|
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
|
|
|
|
|
//更新物流信息
|
|
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
|
|
//更新平台物流状态为已发货
|
|
|
buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
|
|
|
});
|
|
|
//清缓存
|
|
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
|
|
|
...
|
...
|
@@ -342,10 +353,15 @@ public class AppraiseService { |
|
|
throw new ServiceException(ServiceError.ORDER_STATUS_INVALIDATE);
|
|
|
}
|
|
|
|
|
|
//记录物流信息
|
|
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, false);
|
|
|
executorService.execute(() -> {
|
|
|
//记录物流信息
|
|
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, false);
|
|
|
|
|
|
//更新平台物流状态为已发货
|
|
|
buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
});
|
|
|
//发送消息
|
|
|
inBoxFacade.sendCancelledProductToSellerByCenter(sellerUid, wayBillCode);
|
|
|
|
...
|
...
|
@@ -384,8 +400,14 @@ public class AppraiseService { |
|
|
|
|
|
//记录物流信息
|
|
|
int sellerUid = buyerOrder.getSellerUid();
|
|
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, true);
|
|
|
executorService.execute(() -> {
|
|
|
expressInfoService.returnBackCauseOfBuyerCancelAfterSellerSendOut(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile, true);
|
|
|
|
|
|
//更新平台物流状态为已发货
|
|
|
buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
});
|
|
|
|
|
|
//发送消息
|
|
|
//清缓存
|
|
|
SellerOrderGoods sellerOrderGoods = cleanCacheAfterUpdateStatus(buyerOrder.getOrderCode(), buyerOrder.getUid(), buyerOrder.getSellerUid());
|
...
|
...
|
@@ -747,6 +769,10 @@ public class AppraiseService { |
|
|
EnumExpressDataOperateTransferCode operateTransferCode = EnumExpressDataOperateTransferCode.judge_reject;
|
|
|
expressInfoService.saveOperateTransferExpressInfo(sellerUid, orderCode, expressType.getCode(), expressDataType, operateTransferCode);
|
|
|
|
|
|
//更新平台物流状态为已发货
|
|
|
buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
EnumPlatformDeliveryStatus.delivery_to_seller.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
|
|
|
//发货物流(平台已发货)
|
|
|
expressInfoService.returnBackOrderCauseOfJudgeFailure(sellerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
|
|
|
...
|
...
|
@@ -1250,6 +1276,11 @@ public class AppraiseService { |
|
|
//鉴定通过后自动发货,这个时候产生:买家确认收货的mq
|
|
|
BuyerConfirmEvent buyerConfirmEvent = BuyerConfirmEvent.builder().uid(buyerUid).orderCode(orderCode).build();
|
|
|
EventBusPublisher.publishEvent(buyerConfirmEvent);
|
|
|
|
|
|
//更新平台物流状态为已发货
|
|
|
buyerOrderMapper.updatePlatformDeliveryStatusByOrderCode(orderCode, buyerOrder.getUid(),
|
|
|
EnumPlatformDeliveryStatus.delivery_to_buyer.getCode(), DateUtil.getCurrentTimeSecond());
|
|
|
|
|
|
//记录物流信息
|
|
|
//发物流
|
|
|
expressInfoService.deliverGoods(buyerUid, expressCompanyId, orderCode, wayBillCode, depotNum, mobile);
|
...
|
...
|
|