From efd31af347e10fe4a41adb064ac247a32e301c17 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 24 Jan 2024 18:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EBookingAmendment=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Enum/TaskBaseTypeEnum.cs | 6 +++ .../Enum/TaskFileCategoryEnum.cs | 10 +++++ .../Service/BookingSlot/BookingSlotService.cs | 41 +++++++++++++++++++ .../TaskManagePlat/TaskManageService.cs | 9 +++- 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Enum/TaskBaseTypeEnum.cs b/Myshipping.Application/Enum/TaskBaseTypeEnum.cs index d349062e..43df6fa0 100644 --- a/Myshipping.Application/Enum/TaskBaseTypeEnum.cs +++ b/Myshipping.Application/Enum/TaskBaseTypeEnum.cs @@ -125,5 +125,11 @@ namespace Myshipping.Application /// [Description("派车")] TRUCK_DISPATCH, + + /// + /// Booking Amendment + /// + [Description("BC变更")] + BC_MODIFY } } diff --git a/Myshipping.Application/Enum/TaskFileCategoryEnum.cs b/Myshipping.Application/Enum/TaskFileCategoryEnum.cs index 65d285f3..52468c1b 100644 --- a/Myshipping.Application/Enum/TaskFileCategoryEnum.cs +++ b/Myshipping.Application/Enum/TaskFileCategoryEnum.cs @@ -23,6 +23,16 @@ namespace Myshipping.Application [Description("Booking Confirmation Notice")] BC_NOTICE, /// + /// Booking Confirmation + /// + [Description("Booking Amendment")] + BC_MODIFY, + /// + /// Booking Confirmation通知 + /// + [Description("Booking Amendment Notice")] + BC_MODIFY_NOTICE, + /// /// 空 /// [Description("NONE")] diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 73a14f24..4b1fcf9f 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -58,6 +58,12 @@ namespace Myshipping.Application const string CONST_BC_NOTICE_FILE_CODE = "bc_notice"; const string CONST_BC_NOTICE_FILE_NAME = "Booking Confirmation Notice"; + const string CONST_BC_MODIFY_FILE_CODE = "bc_modify"; + const string CONST_BC_MODIFY_FILE_NAME = "Booking Amendment"; + + const string CONST_BC_MODIFY_NOTICE_FILE_CODE = "bc_moidfynotice"; + const string CONST_BC_MODIFY_NOTICE_FILE_NAME = "Booking Amendment Notice"; + public BookingSlotService(SqlSugarRepository repBase, SqlSugarRepository repCtn, SqlSugarRepository repStock, @@ -368,6 +374,41 @@ namespace Myshipping.Application } await InsLog("Update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, "CtnList"); + + string batchNo = IDGen.NextID().ToString(); + + //处理附件 + if (file != null) + { + _logger.LogInformation($"请求文件名:{file.FileName}"); + + var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), file.FileBytes, batchNo, file.FileName, "bcmoidfyfiles"); + + _logger.LogInformation($"保存文件路径:{fileFullPath}"); + + if (!string.IsNullOrWhiteSpace(fileFullPath)) + { + //将格式单附件写入订舱的附件 + SaveEDIFile(id, fileFullPath, file.FileName, UserManager.TENANT_ID, + CONST_BC_MODIFY_FILE_CODE, CONST_BC_MODIFY_FILE_NAME).GetAwaiter(); + } + } + + if (modifyFile != null) + { + _logger.LogInformation($"请求文件名(变更文件):{modifyFile.FileName}"); + + var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), modifyFile.FileBytes, batchNo, modifyFile.FileName, "bcmoidfynoticefiles"); + + _logger.LogInformation($"保存文件路径(变更文件):{fileFullPath}"); + + if (!string.IsNullOrWhiteSpace(fileFullPath)) + { + //将格式单附件写入订舱的附件 + SaveEDIFile(id, fileFullPath, modifyFile.FileName, UserManager.TENANT_ID, + CONST_BC_MODIFY_NOTICE_FILE_CODE, CONST_BC_MODIFY_NOTICE_FILE_NAME).GetAwaiter(); + } + } } else if (dto.OpType == "del") { diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 74e4d6cd..9ed677e7 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -433,6 +433,11 @@ namespace Myshipping.Application fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC.ToString(); fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC.GetDescription(); } + else if (TaskBaseTypeEnum.BC_MODIFY.ToString() == taskInfo.TASK_BASE_TYPE) + { + fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC_MODIFY.ToString(); + fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC_MODIFY.GetDescription(); + } } else { @@ -660,7 +665,7 @@ namespace Myshipping.Application #endregion #region BC 任务 - if (info.Main.TaskType == TaskBaseTypeEnum.BC) + if (info.Main.TaskType == TaskBaseTypeEnum.BC || info.Main.TaskType == TaskBaseTypeEnum.BC_MODIFY) { //异步写入 var bcInfo = info.Main.BCInfo.Adapt(); @@ -680,7 +685,7 @@ namespace Myshipping.Application bcInfo.BOOKING_SLOT_ID = info.Main.BCInfo.BookingSlotId.Value; await _taskBCInfoRepository.InsertAsync(bcInfo); - + //异步写入集装箱 info.Main.BCInfo.CtnList.ForEach(async ctn => {