6 changed files with 136 additions and 3 deletions
@ -1,18 +1,32 @@ |
|||||
using BBWYB.Common.Log; |
using BBWYB.Common.Log; |
||||
using BBWYB.Common.Models; |
using BBWYB.Common.Models; |
||||
|
using BBWYB.Server.Model.Dto; |
||||
|
using SDKAdapter; |
||||
|
using SDKAdapter.PurchasePlatform.Client; |
||||
|
using SDKAdapter.PurchasePlatform.Models; |
||||
using Yitter.IdGenerator; |
using Yitter.IdGenerator; |
||||
|
|
||||
namespace BBWYB.Server.Business |
namespace BBWYB.Server.Business |
||||
{ |
{ |
||||
public class PurchaseOrderBusiness : BaseBusiness, IDenpendency |
public class PurchaseOrderBusiness : BaseBusiness, IDenpendency |
||||
{ |
{ |
||||
public PurchaseOrderBusiness(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator) : base(fsql, nLogManager, idGenerator) |
private PP_PlatformClientFactory ppPlatformClientFactory; |
||||
|
public PurchaseOrderBusiness(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator, PP_PlatformClientFactory ppPlatformClientFactory) : base(fsql, nLogManager, idGenerator) |
||||
{ |
{ |
||||
|
this.ppPlatformClientFactory = ppPlatformClientFactory; |
||||
} |
} |
||||
|
|
||||
public PreviewOrderResponse PreviewPurchaseOrder(PreviewOrderReuqest previewOrderReuqest) |
public PreviewOrderResponse PreviewPurchaseOrder(PreviewOrderRequest previewOrderReuqest) |
||||
{ |
{ |
||||
|
var response = ppPlatformClientFactory.GetClient((AdapterEnums.PlatformType)previewOrderReuqest.Platform) |
||||
|
.PreviewOrder(new PP_PreviewOrderRequest() |
||||
|
{ |
||||
|
|
||||
|
}); |
||||
|
return new PreviewOrderResponse() |
||||
|
{ |
||||
|
|
||||
|
}; |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
@ -0,0 +1,15 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class PlatformRequest |
||||
|
{ |
||||
|
public Enums.Platform Platform { get; set; } |
||||
|
|
||||
|
public string AppKey { get; set; } |
||||
|
|
||||
|
public string AppSecret { get; set; } |
||||
|
|
||||
|
public string AppToken { get; set; } |
||||
|
|
||||
|
public bool SaveResponseLog { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class CargoParamRequest |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 采购商品Id
|
||||
|
/// </summary>
|
||||
|
public string ProductId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 采购SkuId
|
||||
|
/// </summary>
|
||||
|
public string SkuId { get; set; } |
||||
|
public string SpecId { get; set; } |
||||
|
public int Quantity { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单SkuId
|
||||
|
/// </summary>
|
||||
|
public string BelongSkuId { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class ConsigneeRequest |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 联系人名称
|
||||
|
/// </summary>
|
||||
|
public string ContactName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 座机
|
||||
|
/// </summary>
|
||||
|
public string TelePhone { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 手机
|
||||
|
/// </summary>
|
||||
|
public string Mobile { get; set; } |
||||
|
|
||||
|
public string Address { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 省
|
||||
|
/// </summary>
|
||||
|
public string Province { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 市
|
||||
|
/// </summary>
|
||||
|
public string City { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 县
|
||||
|
/// </summary>
|
||||
|
public string County { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 镇
|
||||
|
/// </summary>
|
||||
|
public string Town { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class PreviewOrderRequest : PlatformRequest |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 订单模式
|
||||
|
/// <para>1688 general大市场订单 saleproxy分销订单</para>
|
||||
|
/// </summary>
|
||||
|
public Enums.PurchaseOrderMode PurchaseOrderMode { get; set; } |
||||
|
|
||||
|
public ConsigneeRequest Consignee { get; set; } |
||||
|
|
||||
|
public IList<CargoParamRequest> CargoParamList { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class PreviewOrderResponse |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 总额
|
||||
|
/// </summary>
|
||||
|
public decimal TotalAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 货款总额
|
||||
|
/// </summary>
|
||||
|
public decimal ProductAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 运费
|
||||
|
/// </summary>
|
||||
|
public decimal FreightAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 扩展数据
|
||||
|
/// </summary>
|
||||
|
public string Extensions { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue