From 4af0c8934497837da21c7284f7d9f58fa7b6de86 Mon Sep 17 00:00:00 2001
From: shanji <18996038927@163.com>
Date: Mon, 3 Apr 2023 17:21:12 +0800
Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/OrderSyncController.cs | 11 +++++++++++
BBWY.Server.Business/Sync/OrderSyncBusiness.cs | 15 +++++++++++++++
2 files changed, 26 insertions(+)
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();
+ });
+ }
+
///
/// 接收订单推送
///