diff --git a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs index 8b70b7e3..1515efb6 100644 --- a/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs @@ -215,14 +215,27 @@ namespace BBWY.Server.Business if (request.CargoParamGroupList == null || request.CargoParamGroupList.Count() == 0 || request.CargoParamGroupList.Any(g => g.CargoParamList == null || g.CargoParamList.Count() == 0 || string.IsNullOrEmpty(g.PurchaserId))) throw new BusinessException("缺少商品参数"); - if (request.Consignee == null || - string.IsNullOrEmpty(request.Consignee.Address) || - string.IsNullOrEmpty(request.Consignee.Mobile) || - string.IsNullOrEmpty(request.Consignee.ContactName)) - throw new BusinessException("缺少收货人信息"); if (request.PurchaseAccountList == null || request.PurchaseAccountList.Count() == 0) throw new BusinessException("缺少采购账号"); + if (request.Consignee == null || + string.IsNullOrEmpty(request.Consignee.Address) || + string.IsNullOrEmpty(request.Consignee.Mobile) || + string.IsNullOrEmpty(request.Consignee.ContactName)) + { + request.Consignee = new ConsigneeRequest() + { + ContactName = "默认收货人", + Address = "齐越众创投资有限公司", + Province = "福建省", + City = "泉州市", + County = "鲤城区", + Town = "鲤城区", + Mobile = "15000000000", + TelePhone = "15000000000" + }; + } + var extJArray = new List(); var errorBuilder = new StringBuilder(); var freightAmount = 0M; diff --git a/BBWY.Server.Business/Sync/ProductSyncBusiness.cs b/BBWY.Server.Business/Sync/ProductSyncBusiness.cs index d81c81b4..560af131 100644 --- a/BBWY.Server.Business/Sync/ProductSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/ProductSyncBusiness.cs @@ -366,11 +366,11 @@ namespace BBWY.Server.Business.Sync public void SyncAllShopAllProduct() { var shopList = venderBusiness.GetShopList(platform: Enums.Platform.京东); - //SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "布莱特玩具专营店"), true); - foreach (var shop in shopList) - { - Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); - } + SyncProduct(shopList.FirstOrDefault(s => s.ShopName == "熊猴玩具专营店"), true); + //foreach (var shop in shopList) + //{ + // Task.Factory.StartNew(() => SyncProduct(shop, true), CancellationToken.None, TaskCreationOptions.LongRunning, taskSchedulerManager.ProductSyncTaskScheduler); + //} } } } diff --git a/BBWY.Server.Business/TestBusiness.cs b/BBWY.Server.Business/TestBusiness.cs index 2646837f..23a9a1b3 100644 --- a/BBWY.Server.Business/TestBusiness.cs +++ b/BBWY.Server.Business/TestBusiness.cs @@ -62,13 +62,13 @@ namespace BBWY.Server.Business var productSkuCount = fsql.Select().Where(p => p.ShopId == shopId) .Where(p => p.State == 1) .Count(); - var jpspu_sql = $"select count(1) as Count,t.ShopId from (select max(osku1.Id) as oskuId,max(osku1.CreateTime) as maxTime,osku1.ProductId,o.ShopId from OrderSku osku1 inner join `Order` o on osku1.OrderId=o.Id where o.OrderState !=6 and o.IsGift=0 and o.StartTime>='2022-05-01' and o.ShopId='{shopId}' Group By osku1.ProductId,o.ShopId order by maxTime desc,osku1.ProductId desc,o.ShopId desc) as t inner join orderSku osku on t.oskuId=osku.Id inner join `order` o on osku.OrderId=o.Id inner join product p on t.ProductId = p.Id where o.StorageType=0 and p.state=8 group by t.ShopId"; + var jpspu_sql = $"select count(1) as Count,t.ShopId from (select max(osku1.Id) as oskuId,max(osku1.CreateTime) as maxTime,osku1.ProductId,o.ShopId from OrderSku osku1 inner join `Order` o on osku1.OrderId=o.Id where o.OrderState !=6 and o.IsGift=0 and o.StartTime>='2022-05-01' and o.ShopId='{shopId}' Group By osku1.ProductId,o.ShopId order by maxTime desc,osku1.ProductId desc,o.ShopId desc) as t inner join orderSku osku on t.oskuId=osku.Id inner join `order` o on osku.OrderId=o.Id inner join product p on t.ProductId = p.Id where o.StorageType in (0,1) and p.state=8 group by t.ShopId"; //京配spu数 var jpspu = fsql.Ado.QuerySingle(jpspu_sql); - var jpsku_sql = $"select count(1) as Count,t.ShopId from (select max(osku1.Id) as oskuId,max(osku1.CreateTime) as maxTime,osku1.SkuId,o.ShopId from OrderSku osku1 inner join `Order` o on osku1.OrderId=o.Id where o.OrderState !=6 and o.IsGift=0 and o.StartTime>='2022-05-01' and o.ShopId='{shopId}' Group By osku1.SkuId,o.ShopId order by maxTime desc,osku1.SkuId desc,o.ShopId desc) as t inner join orderSku osku on t.oskuId=osku.Id inner join `order` o on osku.OrderId=o.Id inner join productsku psku on t.SkuId = psku.Id where o.StorageType=0 and psku.State=1 group by t.ShopId"; + var jpsku_sql = $"select count(1) as Count,t.ShopId from (select max(osku1.Id) as oskuId,max(osku1.CreateTime) as maxTime,osku1.SkuId,o.ShopId from OrderSku osku1 inner join `Order` o on osku1.OrderId=o.Id where o.OrderState !=6 and o.IsGift=0 and o.StartTime>='2022-05-01' and o.ShopId='{shopId}' Group By osku1.SkuId,o.ShopId order by maxTime desc,osku1.SkuId desc,o.ShopId desc) as t inner join orderSku osku on t.oskuId=osku.Id inner join `order` o on osku.OrderId=o.Id inner join productsku psku on t.SkuId = psku.Id where o.StorageType in (0,1) and psku.State=1 group by t.ShopId"; var jpsku = fsql.Ado.QuerySingle(jpsku_sql);