diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs
index 0a3dbd50..a253e7ed 100644
--- a/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs
+++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Interface/ITaskManageBCService.cs
@@ -112,5 +112,6 @@ namespace DS.WMS.Core.TaskPlat.Interface
/// BC变更任务主键
/// 返回回执
Task> ManualSendEmailToCustomer(long taskPKId);
+ Task TestDelete(long id);
}
}
diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
index 85b029a0..122127d8 100644
--- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
+++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageBCService.cs
@@ -3386,5 +3386,29 @@ namespace DS.WMS.Core.TaskPlat.Method
return await InnerSendEmailToCustomer(taskPKId, businessTaskMailId);
}
#endregion
+
+ public async Task TestDelete(long id)
+ {
+ var tenantDb2 = saasDbService.GetBizDbScopeById(user.TenantId);
+
+ try
+ {
+ await tenantDb2.Ado.BeginTranAsync();
+ var a = tenantDb2.ContextID;
+ var b = await tenantDb2.Deleteable().Where(x => x.ModuleName == id.ToString()).ExecuteCommandAsync();
+ //throw new Exception("fdsfsdfdsf");
+ await tenantDb2.Ado.CommitTranAsync();
+ }
+ catch (Exception)
+ {
+ await tenantDb2.Ado.RollbackTranAsync();
+ //await tenantDb2.Ado.RollbackTranAsync();
+ throw;
+ }
+
+
+
+ return DataResult.Successed("");
+ }
}
}
diff --git a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs
index 496bce5a..537724e4 100644
--- a/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs
+++ b/ds-wms-service/DS.WMS.Core/TaskPlat/Method/TaskManageService.cs
@@ -2750,9 +2750,35 @@ namespace DS.WMS.Core.TaskPlat.Method
public async Task TestTaskFlow(string taskType, long taskId, int testType)
{
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
-
+ var t11 = tenantDb.ContextID;
switch (testType)
{
+ // 事务测试
+ case 5:
+ {
+ try
+ {
+ await tenantDb.Ado.BeginTranAsync();
+ var t1 = tenantDb.ContextID;
+ var t2 = await tenantDb.Queryable().Where(x => x.Id == taskId).ToListAsync();
+ var m = new TaskFlowLogDetail()
+ {
+ ModuleName = taskId.ToString()
+ };
+ var t3 = await tenantDb.Insertable(m).ExecuteCommandAsync();
+
+ var service = serviceProvider.GetRequiredService();
+ await service.TestDelete(taskId);
+
+ await tenantDb.Ado.CommitTranAsync();
+ }
+ catch (Exception)
+ {
+ await tenantDb.Ado.RollbackTranAsync();
+ throw;
+ }
+ break;
+ }
// 任务编排执行测试
case 1:
{
@@ -2810,7 +2836,6 @@ namespace DS.WMS.Core.TaskPlat.Method
// 判断条件测试
case 4:
{
- logger.LogInformation("fdfdfd");
var condition = await tenantDb.Queryable().FirstAsync(x => x.Id == 4001);
if (condition != null)
{