升级自定义交易组件常用商品接口,spu接口,品牌接口,订单接口,物流接口。

This commit is contained in:
大灰灰
2022-06-30 22:42:19 +08:00
parent 43a691d1be
commit dc408b8596
27 changed files with 1070 additions and 667 deletions

View File

@@ -57,7 +57,7 @@ namespace CoreCms.Net.RedisMQ.Subscribe
}
/// <summary>
/// 自定义交易组件-同步订单状态
/// 自定义交易组件-同步订单确认收货
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
@@ -95,7 +95,7 @@ namespace CoreCms.Net.RedisMQ.Subscribe
request.OutOrderId = orderModel.orderId;
var response = await client.ExecuteShopDeliveryReceiveAsync(request);
NLogUtil.WriteAll(response.IsSuccessful() ? LogLevel.Info : LogLevel.Error,
LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货", JsonConvert.SerializeObject(request));
LogType.RedisMessageQueue, "自定义交易组件-同步订单确认收货", JsonConvert.SerializeObject(response));
}
else
{

View File

@@ -33,25 +33,23 @@ namespace CoreCms.Net.RedisMQ.Subscribe
private readonly string _wxOpenAppId = AppSettingsConstVars.WxOpenAppId;
private readonly string _wxOpenAppSecret = AppSettingsConstVars.WxOpenAppSecret;
private readonly ICoreCmsUserWeChatInfoServices _userWeChatInfoServices;
private readonly ICoreCmsBillDeliveryServices _billDeliveryServices;
private readonly ICoreCmsBillDeliveryItemServices _billDeliveryItemServices;
private readonly ICoreCmsOrderServices _orderServices;
private readonly ICoreCmsOrderItemServices _orderItemServices;
private readonly ICoreCmsUserWeChatInfoServices _weChatInfoServices;
private readonly IWeChatTransactionComponentOrderServices _tcOrderServices;
private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory;
public TCOrderShipSyncSubscribe(ICoreCmsUserWeChatInfoServices userWeChatInfoServices, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsOrderServices orderServices, ICoreCmsUserWeChatInfoServices weChatInfoServices, IWeChatTransactionComponentOrderServices tcOrderServices, ICoreCmsOrderItemServices orderItemServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory)
public TCOrderShipSyncSubscribe(ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsOrderServices orderServices, IWeChatTransactionComponentOrderServices tcOrderServices, ICoreCmsOrderItemServices orderItemServices, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsBillDeliveryItemServices billDeliveryItemServices)
{
_userWeChatInfoServices = userWeChatInfoServices;
_billDeliveryServices = billDeliveryServices;
_orderServices = orderServices;
_weChatInfoServices = weChatInfoServices;
_tcOrderServices = tcOrderServices;
_orderItemServices = orderItemServices;
_weChatApiHttpClientFactory = weChatApiHttpClientFactory;
_billDeliveryItemServices = billDeliveryItemServices;
}
/// <summary>
@@ -88,6 +86,9 @@ namespace CoreCms.Net.RedisMQ.Subscribe
return;
}
var items = await _billDeliveryItemServices.QueryListByClauseAsync(p => p.deliveryId == billDelivery.deliveryId);
//判断是否发货发完
var finishAllDelivery = false;
@@ -109,13 +110,30 @@ namespace CoreCms.Net.RedisMQ.Subscribe
request.OutOrderId = orderInfo.orderId;
request.OpenId = tcOrderModel.openid;
request.IsFinishAll = finishAllDelivery;
request.DeliveryList = new List<ShopDeliverySendRequest.Types.Delivery>
var delivery = new ShopDeliverySendRequest.Types.Delivery
{
new ShopDeliverySendRequest.Types.Delivery()
{
DeliveryId = billDelivery.thirdPartylogiCode, WaybillId = billDelivery.logiNo
}
DeliveryId = billDelivery.thirdPartylogiCode,
WaybillId = billDelivery.logiNo,
ProductList = new List<ShopDeliverySendRequest.Types.Delivery.Types.Product>()
};
items.ForEach(p =>
{
delivery.ProductList.Add(new ShopDeliverySendRequest.Types.Delivery.Types.Product()
{
OutProductId = p.goodsId.ToString(),
OutSKUId = p.productId.ToString(),
Count = p.nums
});
});
request.DeliveryList = new List<ShopDeliverySendRequest.Types.Delivery>()
{
delivery
};
request.ShipDoneTime = new DateTimeOffset(billDelivery.createTime);
}
else
{

View File

@@ -1,12 +1,12 @@
/***********************************************************************
* Project: CoreCms
* ProjectName: 核心内容管理系统
* Web: https://www.corecms.net
* Author: 大灰灰
* Email: jianweie@163.com
* CreateTime: 2021/7/10 22:41:46
* Description: 暂无
***********************************************************************/
* Project: CoreCms
* ProjectName: 核心内容管理系统
* Web: https://www.corecms.net
* Author: 大灰灰
* Email: jianweie@163.com
* CreateTime: 2021/7/10 22:41:46
* Description: 暂无
***********************************************************************/
using System;
@@ -26,7 +26,7 @@ using SKIT.FlurlHttpClient.Wechat.Api.Models;
namespace CoreCms.Net.RedisMQ.Subscribe
{
/// <summary>
/// 自定义交易组件-同步订单状态
/// 自定义交易组件-同步订单状态(弃用,新版已经取消了同步)
/// </summary>
public class TCPayOrderSyncSubscribe : IRedisSubscribe
{