From f846a0458343bab40fadda95182f66c5a26839f1 Mon Sep 17 00:00:00 2001 From: cjy Date: Fri, 1 Nov 2024 10:23:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E8=BF=90=E5=87=BA=E5=8F=A3=E6=92=A4?= =?UTF-8?q?=E9=94=80=E5=AE=A1=E5=8D=95=20=E6=9B=B4=E6=96=B0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=AD=89=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskInteraction/Method/TaskService.cs | 62 +++++++++++++++++-- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/TaskService.cs b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/TaskService.cs index 00757b52..23f5aa62 100644 --- a/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/TaskService.cs +++ b/ds-wms-service/DS.WMS.Core/TaskInteraction/Method/TaskService.cs @@ -3,12 +3,16 @@ using DS.Module.Core; using DS.Module.Core.Data; using DS.Module.Core.Helpers; using DS.Module.DjyRulesEngine; +using DS.Module.DjyServiceStatus; using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Entity; using DS.WMS.Core.Flow.Interface; using DS.WMS.Core.Flow.Method; using DS.WMS.Core.Info.Interface; +using DS.WMS.Core.Invoice.Dtos; +using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Entity; +using DS.WMS.Core.Op.Interface; using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.TaskInteraction.Dtos; using DS.WMS.Core.TaskInteraction.Entity; @@ -114,7 +118,15 @@ namespace DS.WMS.Core.TaskInteraction.Method /// 规则库服务 /// protected Lazy RuleEngineService { get; private set; } - + /// + /// 海运出口公共服务 + /// + protected Lazy seaComService { get; private set; } + /// + /// 大简云服务状态服务 + /// + protected Lazy djyStatusService { get; private set; } + /// /// 初始化 /// @@ -129,7 +141,8 @@ namespace DS.WMS.Core.TaskInteraction.Method ClientParamService = new Lazy(provider.GetRequiredService()); FlowService = new Lazy(provider.GetRequiredService()); RuleEngineService = new Lazy(provider.GetRequiredService()); - + seaComService = new Lazy(provider.GetRequiredService()); + djyStatusService = new Lazy(provider.GetRequiredService()); TenantDb.QueryFilter.Clear(); } @@ -823,11 +836,50 @@ namespace DS.WMS.Core.TaskInteraction.Method TaskStatus = TaskStatusEnum.Cancel, TaskType = request.TaskType }); - + //海运出口撤销审单 更新状态等操作 if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT) { - await TenantDb.Updateable().SetColumns(x => x.BusinessStatusName == null) - .Where(x => x.Id == request.BusinessId).ExecuteCommandAsync(); + //await TenantDb.Updateable().SetColumns(x => x.BusinessStatusName == null) + //.Where(x => x.Id == request.BusinessId).ExecuteCommandAsync(); + + //删除提交货物状态 + var goodsStatus = TenantDb.Queryable().First(x => x.StatusCode == "TIJIAO" && x.BusinessId == request.BusinessId); + if (goodsStatus != null) + await TenantDb.Updateable(goodsStatus).ExecuteCommandAsync(); + + var order = TenantDb.Queryable().Filter(null, true).First(x => x.Id == request.BusinessId); + var oldOrder = order.Adapt(); + order.BusinessStatusName = string.Empty; + order.BusinessStatus = string.Empty; + await TenantDb.Updateable(order).UpdateColumns(x => new + { + x.BusinessStatusName, + x.BusinessStatus + }).EnableDiffLogEvent().ExecuteCommandAsync(); + // 记录日志 + await seaComService.Value.SaveSeaExportLogAsync(new SeaExportSaveLog() + { + OperateType = "Update", + OldOrder = oldOrder, + NewOrder = order, + SourceCode = "WithdrawAsync", + SourceName = "撤销审单更新", + }, TenantDb); + + //更新大简云货物状态 + var pushModel = new EmbedServiceProjectStatusDto + { + businessId = request.BusinessId.ToString(), + SourceType = 1, + StatusCodes = new List { + new EmbedServiceProjectStatusDetailDto{ + StatusCode = "TIJIAO" + } + } + }; + + await djyStatusService.Value.CancelServiceStatus(pushModel); + } if (useTransaction)