From 3b2bde2f6bc89e6edbcf2d85bcb1250bfc80fdd3 Mon Sep 17 00:00:00 2001 From: ljl Date: Wed, 15 Nov 2023 14:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ms/biz/service/impl/DsMessageServiceImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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());