diff --git a/BBWY.Server.API/Controllers/OrderSyncController.cs b/BBWY.Server.API/Controllers/OrderSyncController.cs index 3655d8a3..9598fd0f 100644 --- a/BBWY.Server.API/Controllers/OrderSyncController.cs +++ b/BBWY.Server.API/Controllers/OrderSyncController.cs @@ -47,6 +47,16 @@ namespace BBWY.Server.API.Controllers orderSyncBusiness.ManualSyncOrder(shopId, orderIds, null, null); } + /// + /// 订单批量删除 + /// + /// + /// + [HttpPost("{shopId}")] + public void OrderDelete([FromRoute]long shopId, [FromBody]IList orderIds) + { + orderSyncBusiness.OrderDelete(shopId, orderIds); + } /// /// 根据日期同步 @@ -94,5 +104,6 @@ namespace BBWY.Server.API.Controllers { orderSyncBusiness.DeleteTimeOutWaitPayOrder(); } + } } diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs index 6e7cad25..1a15c5c5 100644 --- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs @@ -16,6 +16,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Net.Http; +using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; using Yitter.IdGenerator; @@ -752,6 +753,20 @@ namespace BBWY.Server.Business return orderState; } + public void OrderDelete(long ShopId, IList orderIds) + { + fsql.Transaction(() => + { + fsql.Delete().Where(o => o.ShopId == ShopId && orderIds.Contains(o.Id)).ExecuteAffrows(); + fsql.Delete().Where(osku => orderIds.Contains(osku.OrderId)).ExecuteAffrows(); + fsql.Delete().Where(ocd => orderIds.Contains(ocd.OrderId)).ExecuteAffrows(); + fsql.Delete().Where(oc => orderIds.Contains(oc.OrderId)).ExecuteAffrows(); + fsql.Delete().Where(ods => orderIds.Contains(ods.OrderId)).ExecuteAffrows(); + fsql.Delete().Where(ocs => orderIds.Contains(ocs.OrderId)).ExecuteAffrows(); + fsql.Delete().Where(oc => orderIds.Contains(oc.OrderId)).ExecuteAffrows(); + }); + } + /// /// 接收订单推送 ///