|
|
|
@ -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<PlatformPurchaseOrderSku> platformPurchaseOrderSkus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId()));
|
|
|
|
|
Map<Long, PlatformPurchaseOrderSku> 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<PurchaseOrderItem> purchaseOrderItems = purchaseOrderItemMapper.getListByPurchaseOrderId(purchaseOrder.getPurchaseOrderId());
|
|
|
|
|
List<PlatformPurchaseOrderSku> platformPurchaseOrderSkus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId()));
|
|
|
|
|
Map<Long, PlatformPurchaseOrderSku> 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());
|
|
|
|
|