5 changed files with 51 additions and 19 deletions
@ -0,0 +1,48 @@ |
|||
using BBWY.Common.Models; |
|||
using BBWY.Server.Model.Db; |
|||
using BBWY.Server.Model.Dto; |
|||
using BBWY.Server.Model.Dto.Response.PurchaseOrderV2; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Yitter.IdGenerator; |
|||
|
|||
namespace BBWY.Server.Business |
|||
{ |
|||
public class BatchPurchaseBusiness : BaseBusiness, IDenpendency |
|||
{ |
|||
private ProductBusiness productBusiness; |
|||
public BatchPurchaseBusiness(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator, ProductBusiness productBusiness) : base(fsql, nLogManager, idGenerator) |
|||
{ |
|||
this.productBusiness = productBusiness; |
|||
} |
|||
|
|||
public IList<ProductSkuWithSchemeResponse> GetProductSkuAndSchemeList(SearchProductSkuAndSchemeRequest request) |
|||
{ |
|||
if (string.IsNullOrEmpty(request.Spu) || string.IsNullOrEmpty(request.Sku)) |
|||
throw new BusinessException("至少具备一个Sku或Spu条件"); |
|||
|
|||
var productSkuList = productBusiness.GetProductSkuList(new SearchProductSkuRequest() |
|||
{ |
|||
AppKey = request.AppKey, |
|||
AppSecret = request.AppSecret, |
|||
AppToken = request.AppToken, |
|||
Platform = request.Platform, |
|||
Sku = request.Sku, |
|||
Spu = request.Spu |
|||
}); |
|||
if (productSkuList == null || productSkuList.Count() == 0) |
|||
return null; |
|||
|
|||
var skuIdList = productSkuList.Select(s => s.Id).ToList(); |
|||
var schemeList = fsql.Select<PurchaseScheme, Purchaser>().InnerJoin((ps, p) => ps.PurchaserId == p.Id) |
|||
.Where((ps, p) => ps.ShopId == request.ShopId) |
|||
.Where((ps, p) => ps.PurchasePlatform == request.PurchasePlatform) |
|||
.Where((ps, p) => skuIdList.Contains(ps.SkuId)).ToList(); |
|||
foreach (var productSku in productSkuList) |
|||
{ |
|||
|
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
} |
@ -1,19 +0,0 @@ |
|||
using BBWY.Common.Models; |
|||
using BBWY.Server.Model.Dto; |
|||
using BBWY.Server.Model.Dto.Response.PurchaseOrderV2; |
|||
using Yitter.IdGenerator; |
|||
|
|||
namespace BBWY.Server.Business |
|||
{ |
|||
public class PurchaseOrderV2Business : BaseBusiness, IDenpendency |
|||
{ |
|||
public PurchaseOrderV2Business(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator) : base(fsql, nLogManager, idGenerator) |
|||
{ |
|||
} |
|||
|
|||
public ProductSkuWithSchemeResponse GetProductSkuAndSchemeList(SearchProductSkuAndSchemeRequest request) |
|||
{ |
|||
return null; |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue