From 11ca3c341e90702d3e2c3a57103cd253b84ecbc3 Mon Sep 17 00:00:00 2001 From: cjy Date: Wed, 6 Nov 2024 20:00:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E9=85=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/SeaExportRefundService.cs | 83 +++++++++++++++++-- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs index f7775dac..51072a7d 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportRefundService.cs @@ -307,7 +307,7 @@ namespace DS.WMS.Core.Op.Method { item.BusinessId = newKey; } - await tenantDb.Updateable(bookingGoods).ExecuteCommandAsync(); + await tenantDb.Updateable(bookingGoods).UpdateColumns(x => new { x.BusinessId }).ExecuteCommandAsync(); } //任务交互表 var taskList = await tenantDb.Queryable().Where(x => x.BusinessId == req.Id).ToListAsync(); @@ -319,7 +319,7 @@ namespace DS.WMS.Core.Op.Method item.TaskStatus = TaskStatusEnum.Cancel; } if (taskList.Count > 0) - await tenantDb.Updateable(taskList).ExecuteCommandAsync(); + await tenantDb.Updateable(taskList).UpdateColumns(x=>new { x.BusinessId,x.TaskStatus }).ExecuteCommandAsync(); } //任务台主表 var taskbaseList = await tenantDb.Queryable().Where(x => x.OUT_BS_NO == req.Id).ToListAsync(); @@ -331,10 +331,11 @@ namespace DS.WMS.Core.Op.Method item.STATUS = TaskStatusEnum.Cancel.ToString(); } if (taskbaseList.Count > 0) - await tenantDb.Updateable(taskbaseList).ExecuteCommandAsync(); + await tenantDb.Updateable(taskbaseList).UpdateColumns(x => new { x.OUT_BS_NO, x.STATUS }).ExecuteCommandAsync(); } + var ids = taskbaseList.Select(x => x.Id); //任务台任务分配表 - var taskAllocationList = await tenantDb.Queryable().Where(x => x.BusinessId == req.Id).ToListAsync(); + var taskAllocationList = await tenantDb.Queryable().Where(x => x.BusinessId == req.Id && ids.Contains(x.TaskId)).ToListAsync(); if (taskAllocationList.IsNotNull() && taskAllocationList.Count > 0) { foreach (var item in taskAllocationList) @@ -343,7 +344,7 @@ namespace DS.WMS.Core.Op.Method item.Status = TaskStatusEnum.Cancel.ToString(); } if (taskAllocationList.Count > 0) - await tenantDb.Updateable(taskAllocationList).ExecuteCommandAsync(); + await tenantDb.Updateable(taskAllocationList).UpdateColumns(x => new { x.BusinessId, x.Status }).ExecuteCommandAsync(); } #endregion //更新原单信息 @@ -491,6 +492,29 @@ namespace DS.WMS.Core.Op.Method } await tenantDb.Updateable(taskList).ExecuteCommandAsync(); } + //任务台主表 + var taskbaseList = await tenantDb.Queryable().Where(x => x.OUT_BS_NO == req.Id && x.STATUS == TaskStatusEnum.Create.ToString()).ToListAsync(); + if (taskbaseList.IsNotNull() && taskbaseList.Count > 0) + { + foreach (var item in taskbaseList) + { + item.STATUS = TaskStatusEnum.Pending.ToString(); + } + if (taskbaseList.Count > 0) + await tenantDb.Updateable(taskbaseList).UpdateColumns(x => new { x.STATUS }).ExecuteCommandAsync(); + } + var ids = taskbaseList.Select(x => x.Id); + //任务台任务分配表 + var taskAllocationList = await tenantDb.Queryable().Where(x => x.BusinessId == req.Id && ids.Contains(x.TaskId)).ToListAsync(); + if (taskAllocationList.IsNotNull() && taskAllocationList.Count > 0) + { + foreach (var item in taskAllocationList) + { + item.Status = TaskStatusEnum.Pending.ToString(); + } + if (taskAllocationList.Count > 0) + await tenantDb.Updateable(taskAllocationList).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); + } await seaComService.SetGoodsStatus("YFTC", req.Id, tenantDb); await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog() @@ -569,8 +593,7 @@ namespace DS.WMS.Core.Op.Method x.IsRefund, }).ExecuteCommandAsync(); //任务交互表 提交退舱任务待处理流程变更为取消 - var taskList = await tenantDb.Queryable().Where(x => x.BusinessId == callback.BusinessId - && (x.TaskStatus == TaskStatusEnum.Create || x.TaskStatus == TaskStatusEnum.Pending)).ToListAsync(); + var taskList = await tenantDb.Queryable().Where(x => x.BusinessId == callback.BusinessId).ToListAsync(); if (taskList.IsNotNull() && taskList.Count > 0) { foreach (var item in taskList) @@ -579,6 +602,29 @@ namespace DS.WMS.Core.Op.Method } await tenantDb.Updateable(taskList).ExecuteCommandAsync(); } + //任务台主表 + var taskbaseList = await tenantDb.Queryable().Where(x => x.OUT_BS_NO == callback.BusinessId).ToListAsync(); + if (taskbaseList.IsNotNull() && taskbaseList.Count > 0) + { + foreach (var item in taskbaseList) + { + item.STATUS = TaskStatusEnum.Cancel.ToString(); + } + if (taskbaseList.Count > 0) + await tenantDb.Updateable(taskbaseList).UpdateColumns(x => new { x.STATUS }).ExecuteCommandAsync(); + } + var ids = taskbaseList.Select(x => x.Id); + //任务台任务分配表 + var taskAllocationList = await tenantDb.Queryable().Where(x => x.BusinessId == callback.BusinessId && ids.Contains(x.TaskId)).ToListAsync(); + if (taskAllocationList.IsNotNull() && taskAllocationList.Count > 0) + { + foreach (var item in taskAllocationList) + { + item.Status = TaskStatusEnum.Cancel.ToString(); + } + if (taskAllocationList.Count > 0) + await tenantDb.Updateable(taskAllocationList).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); + } await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog() { OperateType = "Update", @@ -603,6 +649,29 @@ namespace DS.WMS.Core.Op.Method } await tenantDb.Updateable(taskList).ExecuteCommandAsync(); } + //任务台主表 + var taskbaseList = await tenantDb.Queryable().Where(x => x.OUT_BS_NO == callback.BusinessId && x.STATUS == TaskStatusEnum.Pending.ToString() ).ToListAsync(); + if (taskbaseList.IsNotNull() && taskbaseList.Count > 0) + { + foreach (var item in taskbaseList) + { + item.STATUS = TaskStatusEnum.Create.ToString(); + } + if (taskbaseList.Count > 0) + await tenantDb.Updateable(taskbaseList).UpdateColumns(x => new { x.STATUS }).ExecuteCommandAsync(); + } + var ids = taskbaseList.Select(x=>x.Id); + //任务台任务分配表 + var taskAllocationList = await tenantDb.Queryable().Where(x => x.BusinessId == callback.BusinessId && x.Status == TaskStatusEnum.Pending.ToString() && ids.Contains(x.TaskId)).ToListAsync(); + if (taskAllocationList.IsNotNull() && taskAllocationList.Count > 0) + { + foreach (var item in taskAllocationList) + { + item.Status = TaskStatusEnum.Create.ToString(); + } + if (taskAllocationList.Count > 0) + await tenantDb.Updateable(taskAllocationList).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync(); + } await seaComService.SetGoodsStatus("TCBH", callback.BusinessId, tenantDb); }