diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java index f935b43..4b7d531 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java @@ -12,6 +12,7 @@ import com.doudian.open.api.supplyCenter_order_syncSupplierInfo.param.SupplyCent import com.doudian.open.api.supplyCenter_refund_operate.param.Address; import com.doudian.open.api.supplyCenter_refund_operate.param.SkuRefundInfosItem; import com.doudian.open.api.supplyCenter_refund_operate.param.SupplyCenterRefundOperateParam; +import com.jinritemai.cloud.base.core.util.AuthThreadLocalUtil; import com.ms.biz.consts.DsMessageConst; import com.ms.biz.consts.PurchaseOrderConst; import com.ms.biz.consts.Refund1688Const; @@ -140,7 +141,7 @@ public class DsMessageServiceImpl implements DsMessageService { public void addDsMessage(Long shopId, Long platformPushMsgId, String bizId, String bizType, String data) { TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); try { - log.error("addDsMessagePlatformPushMsgId" + platformPushMsgId); + log.info("addDsMessagePlatformPushMsgId" + platformPushMsgId); DsMessage dsMessage = add(shopId, platformPushMsgId, bizId, bizType, data); dsMessageConsumerBufferService.addBuffer(shopId, dsMessage.getDsMessageId(), null); dataSourceTransactionManager.commit(transactionStatus); @@ -222,6 +223,9 @@ public class DsMessageServiceImpl implements DsMessageService { PurchaseOrderDTO purchaseOrderDTO = messageDTO.getPurchaseOrderInfo(); PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurchaseOrderSn(purchaseOrderDTO.getPurchaseOrderSn()); PlatformPurchaseOrder platformPurchaseOrder = platformPurchaseOrderMapper.selectByPrimaryKey(purchaseOrder.getPurOrderId()); + + AuthThreadLocalUtil.set(platformPurchaseOrder.getShopId().toString()); + List platformPurchaseOrderSkus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId())); Map skuIdAndPlatformPurchaseOrderSkuMap = platformPurchaseOrderSkus.stream().collect(Collectors.toMap(PlatformPurchaseOrderSku::getSkuId, x->x)); @@ -404,11 +408,14 @@ public class DsMessageServiceImpl implements DsMessageService { private void handlePurchaseOrderRelate(PurchaseOrderRelateMessageDTO messageDTO) { PurchaseOrderDTO purchaseOrderDTO = messageDTO.getPurchaseOrderInfo(); PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurchaseOrderSn(purchaseOrderDTO.getPurchaseOrderSn()); + PlatformPurchaseOrder platformPurchaseOrder = platformPurchaseOrderMapper.selectByPrimaryKey(purchaseOrder.getPurOrderId()); + + AuthThreadLocalUtil.set(platformPurchaseOrder.getShopId().toString()); + List purchaseOrderItems = purchaseOrderItemMapper.getListByPurchaseOrderId(purchaseOrder.getPurchaseOrderId()); List platformPurchaseOrderSkus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId())); Map skuIdAndPlatformPurchaseOrderSkuMap = platformPurchaseOrderSkus.stream().collect(Collectors.toMap(PlatformPurchaseOrderSku::getSkuId, x->x)); - PlatformPurchaseOrder platformPurchaseOrder = platformPurchaseOrderMapper.selectByPrimaryKey(purchaseOrder.getPurOrderId()); SupplyCenterOrderSyncSupplierInfoParam param = new SupplyCenterOrderSyncSupplierInfoParam(); param.setPurOrderId(platformPurchaseOrder.getPurOrderId()); param.setSupplierOrderId(purchaseOrderDTO.getPurchaseOrderSn());