From 488c2447debe339fa1b9263aac992fc269fba476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 2 Aug 2024 08:58:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA=E5=A7=94=E6=89=98=E7=BC=96?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Method/TaskInteraction/SeaExportTaskService.cs | 3 ++- .../DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs index ba537848..fe11731f 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs @@ -46,6 +46,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction var biz = await TenantDb.Queryable().Select(x => new { x.Id, + x.CustomerNo, x.MBLNO, x.Vessel, x.Voyno, @@ -81,7 +82,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction IsCheckExistsByTaskType = true } }; - info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】 {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")} BLNo:{biz?.MBLNO}"; + info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}"; var result = await ManagerService.InitTaskJob(info); if (!result.Succeeded) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs index 9f9a07ae..ddc534e0 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/TaskService.cs @@ -254,13 +254,14 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction var biz = await TenantDb.Queryable().Select(x => new { x.Id, + x.CustomerNo, x.MBLNO, x.Vessel, x.Voyno, x.ETD, }).FirstAsync(x => x.Id == request.BusinessId); - info.Main.TaskDesp = info.Main.TaskTitle = $"【{request.TaskType.GetDescription()}】 {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")} BLNo:{biz?.MBLNO}"; + info.Main.TaskDesp = info.Main.TaskTitle = $"【{request.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}"; } if (useTransaction) From 7cd5557a21d26b874c3ac7b441c75d507aaf84f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B5=87=E6=96=87=E9=BE=99?= Date: Fri, 2 Aug 2024 10:04:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A04=E7=A7=8D=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Enums/TaskPlat/TaskBaseTypeEnum.cs | 20 ++++++++++++++ .../Op/Dtos/TaskInteraction/TaskRequest.cs | 7 +++-- .../TaskInteraction/ISeaExportTaskService.cs | 5 ++-- .../TaskInteraction/SeaExportTaskService.cs | 26 +++++++++++++------ 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs b/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs index 27f393ce..b2cfeda8 100644 --- a/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs +++ b/ds-wms-service/DS.Module.Core/Enums/TaskPlat/TaskBaseTypeEnum.cs @@ -299,6 +299,26 @@ namespace DS.Module.Core /// [Description("待办保险")] WAIT_Insurance = 312, + /// + /// 待出号 + /// + [Description("待出号")] + WAIT_CHUHAO = 313, + /// + /// 待内点入货 + /// + [Description("待内点入货")] + WAIT_NDRH = 314, + /// + /// 待发快递 + /// + [Description("待发快递")] + WAIT_DELIVERY = 315, + /// + /// 待箱使 + /// + [Description("待箱使")] + WAIT_XIANGSHI = 316, #endregion } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs index 138686af..83aba1bf 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/TaskInteraction/TaskRequest.cs @@ -20,13 +20,12 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction /// public BusinessType BusinessType { get; set; } - TaskBaseTypeEnum _taskType; + TaskBaseTypeEnum _defaultTaskType = TaskBaseTypeEnum.NOT_SPECIFIED; /// /// 任务类型 /// [IgnoreDataMember] - public TaskBaseTypeEnum TaskType => _taskType == default ? - string.IsNullOrEmpty(TaskTypeName) ? TaskBaseTypeEnum.NOT_SPECIFIED : Enum.Parse(TaskTypeName) : _taskType; + public TaskBaseTypeEnum TaskType => string.IsNullOrEmpty(TaskTypeName) ? _defaultTaskType : Enum.Parse(TaskTypeName); /// /// 任务类型名称 @@ -38,7 +37,7 @@ namespace DS.WMS.Core.Op.Dtos.TaskInteraction /// /// 验证上下文 /// - public IEnumerable Validate(ValidationContext validationContext) + public virtual IEnumerable Validate(ValidationContext validationContext) { if (BusinessId == 0) { diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/ISeaExportTaskService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/ISeaExportTaskService.cs index 70878c62..7e167e4b 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/ISeaExportTaskService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/TaskInteraction/ISeaExportTaskService.cs @@ -1,5 +1,4 @@ -using DS.Module.Core; -using DS.WMS.Core.Op.Dtos.TaskInteraction; +using DS.WMS.Core.Op.Dtos.TaskInteraction; namespace DS.WMS.Core.Op.Interface.TaskInteraction { @@ -13,6 +12,6 @@ namespace DS.WMS.Core.Op.Interface.TaskInteraction /// /// /// - Task CreateSubTaskAsync(IEnumerable request); + Task CreateSubTaskAsync(IEnumerable request); } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs index fe11731f..c76a3029 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/TaskInteraction/SeaExportTaskService.cs @@ -34,8 +34,11 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction /// /// /// - public async Task CreateSubTaskAsync(IEnumerable request) + public async Task CreateSubTaskAsync(IEnumerable request) { + if (request == null || !request.Any()) + return; + long userId = long.Parse(User.UserId); long tenatId = long.Parse(User.TenantId); string tenatName = Db.Queryable().Where(x => x.Id == tenatId).Select(x => x.Name).First(); @@ -102,7 +105,6 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction } await TenantDb.Insertable(taskList).ExecuteCommandAsync(); - return DataResult.Success; } /// @@ -118,16 +120,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction var task = await GetQuery(request.BusinessId, request.BusinessType, request.TaskType).FirstAsync(); if (task != null) { - var list = Array.FindAll(await GetSubRequestAsync(request.BusinessId, request.BusinessType, task.RecvUserIdArray), x => !string.IsNullOrEmpty(x.TaskTypeName)); - await CreateSubTaskAsync(list); + var list = await GetSubRequestAsync(request.BusinessId, request.BusinessType, task.RecvUserIdArray); + await CreateSubTaskAsync(list.FindAll(x => x.TaskType != TaskBaseTypeEnum.NOT_SPECIFIED).OrderBy(x => x.TaskType)); } } } - internal async Task GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers) + internal async Task> GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers) { var svcList = await GetServicesAsync(id); - var list = new TaskCreationRequest[svcList.Length]; + var list = new List(svcList.Length); for (int i = 0; i < svcList.Length; i++) { var dto = new TaskCreationRequest { BusinessId = id, BusinessType = businessType, RecvUserIdList = recvUsers }; @@ -157,8 +159,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction dto.TaskTypeName = TaskBaseTypeEnum.WAIT_TUOCHE.ToString(); else if (svcName == "保险") dto.TaskTypeName = TaskBaseTypeEnum.WAIT_Insurance.ToString(); - - list[i] = dto; + else if (svcName == "出号") + dto.TaskTypeName = TaskBaseTypeEnum.WAIT_CHUHAO.ToString(); + else if (svcName == "内点入货") + dto.TaskTypeName = TaskBaseTypeEnum.WAIT_NDRH.ToString(); + else if (svcName == "快递") + dto.TaskTypeName = TaskBaseTypeEnum.WAIT_DELIVERY.ToString(); + else if (svcName == "箱使") + dto.TaskTypeName = TaskBaseTypeEnum.WAIT_XIANGSHI.ToString(); + + list.Add(dto); } return list;