From 145b0358d6dee8e589ad545f635c511823d3c3a3 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 13:56:16 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/FileAttachHelper.cs | 78 ++++++++ .../Service/BookingSlot/BookingSlotService.cs | 186 +++++++++++++++++- .../BookingSlot/IBookingSlotService.cs | 23 ++- .../TaskManagePlat/Dtos/TaskBCInfoDto.cs | 1 + .../TaskManagePlat/TaskManageBCService.cs | 140 ++++++------- .../TaskManagePlat/TaskManageService.cs | 2 +- 6 files changed, 357 insertions(+), 73 deletions(-) diff --git a/Myshipping.Application/Helper/FileAttachHelper.cs b/Myshipping.Application/Helper/FileAttachHelper.cs index d37f1a68..a59d711c 100644 --- a/Myshipping.Application/Helper/FileAttachHelper.cs +++ b/Myshipping.Application/Helper/FileAttachHelper.cs @@ -306,5 +306,83 @@ namespace Myshipping.Application return bookFilePath; } #endregion + + + #region 保存文件并返回文件完整路径 + /// + /// 保存文件并返回文件完整路径 + /// + /// 文件目录KEY + /// 文件二进制流 + /// 批次号 + /// 文件名称 + /// 附件类型 bcfiles-BC文件 sofile-订舱附件 + /// 返回文件完整路径 + public static async Task SaveFileDirect(string fileDictKey, byte[] fileBytes, string batchNo, + string fileName,string attachFileType = "sofiles") + { + var logger = Log.CreateLogger(nameof(FileAttachHelper)); + + var fileCfg = App.GetOptions(); + + string fileRoot = string.Empty; + + if (fileCfg != null) + { + if (!string.IsNullOrWhiteSpace(fileCfg.basePath)) + { + fileRoot = fileCfg.basePath; + } + } + + if (string.IsNullOrWhiteSpace(fileRoot)) + fileRoot = App.WebHostEnvironment.WebRootPath; + + string relativePath = fileCfg.relativePath; + + if (!string.IsNullOrWhiteSpace(attachFileType)) + relativePath += $"\\{attachFileType}"; + + if (!string.IsNullOrWhiteSpace(fileDictKey)) + relativePath += $"\\{fileDictKey}"; + + relativePath += $"\\{DateTime.Now.ToString("yyyyMMddHHmmssfff")}"; + + string filePath = $"{fileRoot}\\{relativePath}"; + + string fileFullName = $"{filePath}\\{fileName}"; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + relativePath = relativePath.Replace("\\", "/"); + filePath = filePath.Replace("\\", "/"); + fileFullName = fileFullName.Replace("\\", "/"); + } + + logger.LogInformation("批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, filePath, + RuntimeInformation.OSDescription); + + //预先创建目录 + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + + await File.WriteAllBytesAsync(fileFullName, fileBytes); + + string bookFilePath = string.Empty; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("/", "\\/") + ".*").Value; + } + else + { + bookFilePath = System.Text.RegularExpressions.Regex.Match(fileFullName, relativePath.Replace("\\", "\\\\") + ".*").Value; + } + + return bookFilePath; + } + #endregion } } diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 8fd355a1..2b41d2ca 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -1,9 +1,13 @@ using Furion.DependencyInjection; +using Furion.DistributedIDGenerator; using Furion.DynamicApiController; using Furion.EventBus; +using Furion.Extensions; using Furion.FriendlyException; +using Furion.JsonSerialization; using Mapster; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Myshipping.Application.Entity; @@ -12,14 +16,17 @@ using Myshipping.Application.Service.BookingOrder.Dto; using Myshipping.Application.Service.BookingSlot.Dto; using Myshipping.Core; using Myshipping.Core.Service; +using Org.BouncyCastle.Asn1.Tsp; using SqlSugar; using System; using System.Collections.Generic; using System.ComponentModel; +using System.Drawing.Imaging; +using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; - +using Yitter.IdGenerator; namespace Myshipping.Application { @@ -34,6 +41,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _repStock; private readonly SqlSugarRepository _repAllocation; private readonly SqlSugarRepository _repAllocationCtn; + private readonly SqlSugarRepository _bookingFileRepository; private readonly SqlSugarRepository _repBookingLog; private readonly SqlSugarRepository _repBookingLogDetail; @@ -44,6 +52,12 @@ namespace Myshipping.Application private readonly IEventPublisher _publisher; + const string CONST_BC_FILE_CODE = "bc"; + const string CONST_BC_FILE_NAME = "Booking Confirmation"; + + const string CONST_BC_NOTICE_FILE_CODE = "bc_notice"; + const string CONST_BC_NOTICE_FILE_NAME = "Booking Confirmation Notice"; + public BookingSlotService(SqlSugarRepository repBase, SqlSugarRepository repCtn, SqlSugarRepository repStock, @@ -54,7 +68,8 @@ namespace Myshipping.Application ISysCacheService cache, IEventPublisher publisher, SqlSugarRepository repAllocation, - SqlSugarRepository repAllocationCtn) + SqlSugarRepository repAllocationCtn, + SqlSugarRepository bookingFileRepository) { _repBase = repBase; _repCtn = repCtn; @@ -70,6 +85,7 @@ namespace Myshipping.Application _publisher = publisher; _bookingfile = bookingfile; + _bookingFileRepository = bookingFileRepository; } #region 舱位 @@ -180,12 +196,99 @@ namespace Myshipping.Application /// /// [HttpPost("/BookingSlot/ApiReceive"), AllowAnonymous, ApiUser] - public async Task ApiReceive(BookingSlotBaseApiDto dto) + public async Task ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null) + { + TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + + try + { + BookingSlotBaseApiDto dto = JSON.Deserialize(jsonData); + + DynameFileInfo bcFile = null; + DynameFileInfo bcNoticeFile = null; + + if (file != null) + { + bcFile = new DynameFileInfo + { + FileBytes = file.ToByteArray(), + FileName = file.FileName + }; + } + + if (modifyFile != null) + { + bcNoticeFile = new DynameFileInfo + { + FileBytes = file.ToByteArray(), + FileName = file.FileName + }; + } + + var id = InnerApiReceive(dto, bcFile, bcNoticeFile).GetAwaiter().GetResult(); + + result.succ = true; + result.msg = "成功"; + result.ext = id; + } + catch(Exception ex) + { + result.succ = false; + result.msg = $"失败,原因:{ex.Message}"; + } + + return result; + } + #endregion + + /// + /// 舱位接收保存、取消接口 + /// + /// + /// + /// + /// + [HttpPost("/BookingSlot/InnerApiReceive")] + public async Task InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null) { long id = 0; + //接口方法直接调用save、delete等方法会报错,可能因为非token授权登录导致,故重写一遍保存、删除代码 if (dto.OpType == "add" || dto.OpType == "update" || dto.OpType == "del") { + //翻译船公司 + if (!string.IsNullOrWhiteSpace(dto.DataObj.CARRIERID) && string.IsNullOrWhiteSpace(dto.DataObj.CARRIER)) + { + var carrierInfo = _cache.GetAllCodeCarrier().GetAwaiter().GetResult() + .Where(t => t.Code.Equals(dto.DataObj.CARRIERID, StringComparison.OrdinalIgnoreCase) + || t.EnName.Equals(dto.DataObj.CARRIERID, StringComparison.OrdinalIgnoreCase) + || t.CnName.Equals(dto.DataObj.CARRIERID, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); + + if(carrierInfo != null) + { + dto.DataObj.CARRIER = carrierInfo.CnName?.Trim(); + } + } + + //翻译箱型代码 + if (dto.DataObj.CtnList != null && dto.DataObj.CtnList.Count > 0 && + dto.DataObj.CtnList.Any(t => string.IsNullOrWhiteSpace(t.CTNCODE))) + { + var ctnCodeList = _cache.GetAllCodeCtn().GetAwaiter().GetResult().ToList(); + + dto.DataObj.CtnList.ForEach(t => + { + if(!string.IsNullOrWhiteSpace(t.CTNALL) && string.IsNullOrWhiteSpace(t.CTNCODE)) + { + var ctnCode = ctnCodeList.FirstOrDefault(a => !string.IsNullOrWhiteSpace(a.Name) && + a.Name.Equals(t.CTNALL, StringComparison.OrdinalIgnoreCase)); + + if (ctnCode != null) + t.CTNCODE = ctnCode?.Code; + } + }); + } + BookingSlotBase model = null; if (dto.OpType == "add") { @@ -208,6 +311,33 @@ namespace Myshipping.Application } await InsLog("Add", model.Id, "新增舱位"); + + string batchNo = IDGen.NextID().ToString(); + + //处理附件 + if (file != null) + { + var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), file.FileBytes, batchNo, file.FileName, "bcfiles"); + + if (!string.IsNullOrWhiteSpace(fileFullPath)) + { + //将格式单附件写入订舱的附件 + SaveEDIFile(id, fileFullPath, file.FileName, UserManager.TENANT_ID, + CONST_BC_FILE_CODE, CONST_BC_FILE_NAME).GetAwaiter(); + } + } + + if (modifyFile != null) + { + var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), modifyFile.FileBytes, batchNo, modifyFile.FileName, "bcnoticefiles"); + + if (!string.IsNullOrWhiteSpace(fileFullPath)) + { + //将格式单附件写入订舱的附件 + SaveEDIFile(id, fileFullPath, file.FileName, UserManager.TENANT_ID, + CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter(); + } + } } else if (dto.OpType == "update") { @@ -269,7 +399,6 @@ namespace Myshipping.Application return id; } - #endregion /// /// 插入日志(仅显示一条文本信息) @@ -704,5 +833,54 @@ namespace Myshipping.Application return result.XnPagedResult(); } #endregion + + #region 异步写入附件表 + /// + /// 异步写入附件表 + /// + /// 订舱ID + /// 文件路径 + /// 文件名 + /// 租户ID + /// 附件类型代码 + /// 附件类型名称 + /// 附件模块代码 + /// + [NonAction] + private async Task SaveEDIFile(long boookId, string FilePath, string fileName, long tenantId, + string fileTypeCode = "bc", string fileTypeName = "Booking Confirmation", string moudle = "BookingSlot") + { + /* + 直接将附件信息写入附件表 + */ + //EDI文件 + var bookFile = new BookingFile + { + Id = YitIdHelper.NextId(), + FileName = fileName, + FilePath = FilePath, + TypeCode = fileTypeCode, + TypeName = fileTypeName, + BookingId = boookId, + TenantId = tenantId, + Moudle = moudle + }; + + await _bookingFileRepository.InsertAsync(bookFile); + } + #endregion + } + + public class DynameFileInfo + { + /// + /// 文件名称 + /// + public string FileName { get; set; } + + /// + /// 文件二进制流 + /// + public byte[] FileBytes { get; set; } } } diff --git a/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs index 02447b42..7d24dba0 100644 --- a/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Myshipping.Application.Entity; using Myshipping.Application.Event; using Myshipping.Application.Service.BookingSlot.Dto; @@ -9,7 +10,15 @@ namespace Myshipping.Application { public interface IBookingSlotService { - Task ApiReceive(BookingSlotBaseApiDto dto); + /// + /// 舱位接收保存、取消接口 + /// + /// 请求详情 + /// BC附件 + /// BC变更附件 + /// + Task ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null); + Task Detail(long id); Task> GetAvailableSlots(BookingSlotBaseDto input); @@ -55,5 +64,15 @@ namespace Myshipping.Application /// /// Task Page(BookingSlotBasePageInput input); + + + /// + /// 舱位接收保存、取消接口 + /// + /// + /// + /// + /// + Task InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null); } } \ No newline at end of file diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBCInfoDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBCInfoDto.cs index 63e5a08c..b8e8d242 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBCInfoDto.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskBCInfoDto.cs @@ -361,5 +361,6 @@ namespace Myshipping.Application /// 订舱确认时间 /// public Nullable BookingConfirmDate { get; set; } + } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index a7d7c22e..0e1e9c07 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -957,52 +957,42 @@ namespace Myshipping.Application }); } - id = await _bookingSlotService.ApiReceive(slotModel); + var opt = App.GetOptions(); + var dirAbs = opt.basePath; + if (string.IsNullOrEmpty(dirAbs)) + { + dirAbs = App.WebHostEnvironment.WebRootPath; + } - string batchNo = IDGen.NextID().ToString(); + DynameFileInfo dynameFile = null; + DynameFileInfo dynameNoticeFile = null; - //成功后写入附件 - if (id > 0) + if (taskFileList.Any(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString())) { - var opt = App.GetOptions(); - var dirAbs = opt.basePath; - if (string.IsNullOrEmpty(dirAbs)) - { - dirAbs = App.WebHostEnvironment.WebRootPath; - } + var fileInfo = taskFileList.FirstOrDefault(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString()); + var fileFullPath = Path.Combine(dirAbs, fileInfo.FILE_PATH); - taskFileList.ForEach(file => + dynameFile = new DynameFileInfo { - if (file.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString()) - { - var fileFullPath = Path.Combine(dirAbs, file.FILE_PATH); + FileBytes = File.ReadAllBytes(fileFullPath), + FileName = Path.GetFileName(fileFullPath) + }; + } - if (File.Exists(fileFullPath)) - { - //如果确认文件读取成功 - var bookFilePath = FileAttachHelper.MoveFile(id.ToString(), fileFullPath, batchNo, false, "bcfiles", true).GetAwaiter().GetResult(); + if (taskFileList.Any(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC_NOTICE.ToString())) + { + var fileInfo = taskFileList.FirstOrDefault(t => t.FILE_CATEGORY == TaskFileCategoryEnum.BC.ToString()); + var fileFullPath = Path.Combine(dirAbs, fileInfo.FILE_PATH); - //将格式单附件写入订舱的附件 - SaveEDIFile(id, bookFilePath, new System.IO.FileInfo(bookFilePath).Name, taskBCInfo.TenantId.Value, - CONST_BC_FILE_CODE, CONST_BC_FILE_NAME).GetAwaiter(); - } - } - else if (file.FILE_CATEGORY == TaskFileCategoryEnum.BC_NOTICE.ToString()) - { - var fileFullPath = Path.Combine(dirAbs, file.FILE_PATH); + dynameNoticeFile = new DynameFileInfo + { + FileBytes = File.ReadAllBytes(fileFullPath), + FileName = Path.GetFileName(fileFullPath) + }; + } - if (File.Exists(fileFullPath)) - { - //如果确认文件读取成功 - var bookFilePath = FileAttachHelper.MoveFile(id.ToString(), fileFullPath, batchNo,false,"bcnoticefile",true).GetAwaiter().GetResult(); + id = await _bookingSlotService.InnerApiReceive(slotModel, dynameFile, dynameNoticeFile); - //将格式单附件写入订舱的附件 - SaveEDIFile(id, bookFilePath, new System.IO.FileInfo(bookFilePath).Name, taskBCInfo.TenantId.Value, - CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter(); - } - } - }); - } } catch (Exception ex) { @@ -1368,7 +1358,7 @@ namespace Myshipping.Application string filePath = string.Empty; //读取邮件模板并填充数据 - string emailHtml = GenerateSendEmailHtml(taskBCInfo).GetAwaiter().GetResult(); + string emailHtml = GenerateSendEmailHtml(taskBCInfo, UserManager.TENANT_NAME).GetAwaiter().GetResult(); _logger.LogInformation($"生成邮件BODY,结果:{emailHtml}"); @@ -1406,6 +1396,7 @@ namespace Myshipping.Application _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); + //推送邮件 var emailRlt = await PushEmail(emailApiUserDefinedDto, filePath); @@ -1431,8 +1422,9 @@ namespace Myshipping.Application /// 通过邮件模板生成HTML /// /// BC任务详情 + /// 当前租户全称 /// 返回生成的HTML - public async Task GenerateSendEmailHtml(TaskBCInfo taskBCInfo) + public async Task GenerateSendEmailHtml(TaskBCInfo taskBCInfo,string tenantName) { string result = string.Empty; @@ -1465,43 +1457,59 @@ namespace Myshipping.Application { var tdList = baseTr.SelectNodes(".//td"); - foreach (var baseTd in tdList) + if (baseTr.Attributes["class"].Value == "email-noreply") { - if (baseTd.Attributes["class"].Value == "billno-val") - { - baseTd.InnerHtml = taskBCInfo.MBL_NO; - } - else if (baseTd.Attributes["class"].Value == "takebillno-val") + foreach (var baseTd in tdList) { - baseTd.InnerHtml = taskBCInfo.MBL_NO; - } - else if (baseTd.Attributes["class"].Value == "pol-val") - { - baseTd.InnerHtml = taskBCInfo.PLACERECEIPT; - } - else if (baseTd.Attributes["class"].Value == "pod-val") - { - baseTd.InnerHtml = taskBCInfo.PLACEDELIVERY; - } - else if (baseTd.Attributes["class"].Value == "ctn-val") - { - baseTd.InnerHtml = taskBCInfo.CTN_STAT; - } - else if (baseTd.Attributes["class"].Value == "etd-val") - { - if (taskBCInfo.ETD.HasValue) + if (baseTd.Attributes["class"].Value == "notice-comp-val") { - baseTd.InnerHtml = taskBCInfo.ETD.Value.ToString("yyyy-MM-dd"); + baseTd.InnerHtml = tenantName; } } - else if (baseTd.Attributes["class"].Value == "eta-val") + } + else + { + foreach (var baseTd in tdList) { - if (taskBCInfo.ETA.HasValue) + if (baseTd.Attributes["class"].Value == "billno-val") + { + baseTd.InnerHtml = taskBCInfo.MBL_NO; + } + else if (baseTd.Attributes["class"].Value == "takebillno-val") + { + baseTd.InnerHtml = taskBCInfo.MBL_NO; + } + else if (baseTd.Attributes["class"].Value == "pol-val") + { + baseTd.InnerHtml = taskBCInfo.PLACERECEIPT; + } + else if (baseTd.Attributes["class"].Value == "pod-val") + { + baseTd.InnerHtml = taskBCInfo.PLACEDELIVERY; + } + else if (baseTd.Attributes["class"].Value == "ctn-val") { - baseTd.InnerHtml = taskBCInfo.ETA.Value.ToString("yyyy-MM-dd"); + baseTd.InnerHtml = taskBCInfo.CTN_STAT; + } + else if (baseTd.Attributes["class"].Value == "etd-val") + { + if (taskBCInfo.ETD.HasValue) + { + baseTd.InnerHtml = taskBCInfo.ETD.Value.ToString("yyyy-MM-dd"); + } + } + else if (baseTd.Attributes["class"].Value == "eta-val") + { + if (taskBCInfo.ETA.HasValue) + { + baseTd.InnerHtml = taskBCInfo.ETA.Value.ToString("yyyy-MM-dd"); + } } } } + + + } result = html.DocumentNode.OuterHtml; diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 15b6e031..238454eb 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -1184,7 +1184,7 @@ namespace Myshipping.Application _logger.LogInformation("任务台账权限范围 {list}", userlist); var entities = await _taskBaseInfoRepository.AsQueryable() - .Where(t=> userlist.Contains(t.CreatedUserId)) + .Where(t=> userlist.Contains(t.CreatedUserId) || t.IS_PUBLIC == 1) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.MBlNo), t => mblList.Contains(t.MBL_NO)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.TaskRecvName), t => t.CreatedUserName.Contains(QuerySearch.TaskRecvName.Trim())) .WhereIF(etdBegin != DateTime.MinValue, t => t.ETD.HasValue && t.ETD.Value >= etdBegin) From e7c78af66efa7211eafda295283b769b2d182645 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 14:08:43 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=96=B0=E5=A2=9EBC=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageBCService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 0e1e9c07..7aff35cc 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -1618,6 +1618,7 @@ namespace Myshipping.Application /// /// BC任务主键 /// 返回回执 + [HttpGet("/TaskManageBC/SendEmail")] public async Task SendEmail(string taskPKId) { if (string.IsNullOrWhiteSpace(taskPKId)) From 6a598c621d9b32e7adaf82ad314ed72831c152bb Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 15:22:35 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 238454eb..5ea6c083 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -302,7 +302,7 @@ namespace Myshipping.Application if (userTendInfo != null) { - taskInfo.IS_PUBLIC = 0; + taskInfo.IS_PUBLIC = 1; } } else From b4458d30bb1a2f9360cd9fb75c7feda182908692 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 15:53:52 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 4 ++-- .../TaskManagePlat/TaskManageBCService.cs | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 2b41d2ca..84e30e0c 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -220,8 +220,8 @@ namespace Myshipping.Application { bcNoticeFile = new DynameFileInfo { - FileBytes = file.ToByteArray(), - FileName = file.FileName + FileBytes = modifyFile.ToByteArray(), + FileName = modifyFile.FileName }; } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 7aff35cc..2eede93c 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -687,7 +687,16 @@ namespace Myshipping.Application { #region 推送舱位、推送订舱 //推送舱位 - var bookingSlotId = await GenerateBookingSlot(bcOrder, bcCtnList, fileList); + long bookingSlotId = 0; + + if(bcOrder.BOOKING_SLOT_ID.HasValue && bcOrder.BOOKING_SLOT_ID.Value > 0) + { + bookingSlotId = bcOrder.BOOKING_SLOT_ID.Value; + } + else + { + bookingSlotId = await GenerateBookingSlot(bcOrder, bcCtnList, fileList); + } if (bookingSlotId > 0) { @@ -696,6 +705,7 @@ namespace Myshipping.Application if (bookingOrderId > 0) { + //更新库存 //_bookingSlotService. var bcEntity = _taskBCInfoRepository.AsQueryable().First(a => a.PK_ID == bcOrder.PK_ID); @@ -722,6 +732,10 @@ namespace Myshipping.Application }).ExecuteCommand(); + var currBCOrder = _taskBCInfoRepository.AsQueryable().First(a => a.PK_ID == bcEntity.PK_ID); + + if (currBCOrder != null) + await GenerateSendEmail(currBCOrder); var taskEntity = _taskBaseRepository.AsQueryable().First(u => u.PK_ID == bcEntity.TASK_ID); From e0096b091e0ad846a71229dcd57bcc65ab080e63 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 16:10:05 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E7=9A=84=E8=88=B1?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 84e30e0c..c6c86f24 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -334,7 +334,7 @@ namespace Myshipping.Application if (!string.IsNullOrWhiteSpace(fileFullPath)) { //将格式单附件写入订舱的附件 - SaveEDIFile(id, fileFullPath, file.FileName, UserManager.TENANT_ID, + SaveEDIFile(id, fileFullPath, modifyFile.FileName, UserManager.TENANT_ID, CONST_BC_NOTICE_FILE_CODE, CONST_BC_NOTICE_FILE_NAME).GetAwaiter(); } } From 301472cf3de649f1ac7be7abb2380cfa1c5f4b6c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 16:59:30 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=AE=A2=E6=88=B7=E9=82=AE=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E5=A2=9E=E5=8A=A0=E9=82=AE=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EmailTemplate/BCEmailTemplate.html | 2 +- .../TaskManagePlat/TaskManageBCService.cs | 96 +++++++++++-------- Myshipping.Web.Core/applicationconfig.json | 5 +- 3 files changed, 58 insertions(+), 45 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/EmailTemplate/BCEmailTemplate.html b/Myshipping.Application/Service/TaskManagePlat/EmailTemplate/BCEmailTemplate.html index cd495343..9575f220 100644 --- a/Myshipping.Application/Service/TaskManagePlat/EmailTemplate/BCEmailTemplate.html +++ b/Myshipping.Application/Service/TaskManagePlat/EmailTemplate/BCEmailTemplate.html @@ -48,7 +48,7 @@ 2023-12-01 - ETD: + ETA: 2023-12-01 diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 2eede93c..138033e2 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -677,8 +677,7 @@ namespace Myshipping.Application var fileList = _taskFileRepository.AsQueryable().Where(a => a.TASK_PKID == bcTaskInfo.PK_ID).ToList(); - if ((bcOrder.BOOKING_ORDER_ID.HasValue && bcOrder.BOOKING_ORDER_ID.Value>0) - || (bcOrder.BOOKING_SLOT_ID.HasValue && bcOrder.BOOKING_SLOT_ID.Value > 0)) + if (bcOrder.BOOKING_ORDER_ID.HasValue && bcOrder.BOOKING_ORDER_ID.Value > 0) { throw Oops.Oh($"当前BC任务已生成订舱或舱位,不能重复生成"); } @@ -1451,6 +1450,14 @@ namespace Myshipping.Application { string templatePath = App.Configuration["EmailTemplateFilePath"]; + var opt = App.GetOptions(); + var dirAbs = opt.basePath; + if (string.IsNullOrEmpty(dirAbs)) + { + dirAbs = App.WebHostEnvironment.WebRootPath; + } + templatePath = $"{dirAbs}{templatePath}\\BCEmailTemplate.html"; + string baseHtml = File.ReadAllText(templatePath); if (string.IsNullOrWhiteSpace(baseHtml)) @@ -1471,59 +1478,64 @@ namespace Myshipping.Application { var tdList = baseTr.SelectNodes(".//td"); - if (baseTr.Attributes["class"].Value == "email-noreply") + foreach (var baseTd in tdList) { - foreach (var baseTd in tdList) + if (baseTd.Attributes["class"].Value == "billno-val") { - if (baseTd.Attributes["class"].Value == "notice-comp-val") - { - baseTd.InnerHtml = tenantName; - } + baseTd.InnerHtml = taskBCInfo.MBL_NO; } - } - else - { - foreach (var baseTd in tdList) + else if (baseTd.Attributes["class"].Value == "takebillno-val") { - if (baseTd.Attributes["class"].Value == "billno-val") - { - baseTd.InnerHtml = taskBCInfo.MBL_NO; - } - else if (baseTd.Attributes["class"].Value == "takebillno-val") - { - baseTd.InnerHtml = taskBCInfo.MBL_NO; - } - else if (baseTd.Attributes["class"].Value == "pol-val") - { - baseTd.InnerHtml = taskBCInfo.PLACERECEIPT; - } - else if (baseTd.Attributes["class"].Value == "pod-val") - { - baseTd.InnerHtml = taskBCInfo.PLACEDELIVERY; - } - else if (baseTd.Attributes["class"].Value == "ctn-val") + baseTd.InnerHtml = taskBCInfo.MBL_NO; + } + else if (baseTd.Attributes["class"].Value == "pol-val") + { + baseTd.InnerHtml = taskBCInfo.PLACERECEIPT; + } + else if (baseTd.Attributes["class"].Value == "pod-val") + { + baseTd.InnerHtml = taskBCInfo.PLACEDELIVERY; + } + else if (baseTd.Attributes["class"].Value == "ctn-val") + { + baseTd.InnerHtml = taskBCInfo.CTN_STAT; + } + else if (baseTd.Attributes["class"].Value == "etd-val") + { + if (taskBCInfo.ETD.HasValue) { - baseTd.InnerHtml = taskBCInfo.CTN_STAT; + baseTd.InnerHtml = taskBCInfo.ETD.Value.ToString("yyyy-MM-dd"); } - else if (baseTd.Attributes["class"].Value == "etd-val") + } + else if (baseTd.Attributes["class"].Value == "eta-val") + { + if (taskBCInfo.ETA.HasValue) { - if (taskBCInfo.ETD.HasValue) - { - baseTd.InnerHtml = taskBCInfo.ETD.Value.ToString("yyyy-MM-dd"); - } + baseTd.InnerHtml = taskBCInfo.ETA.Value.ToString("yyyy-MM-dd"); } - else if (baseTd.Attributes["class"].Value == "eta-val") + } + } + } + + var noreplyTr = html.DocumentNode.SelectNodes("//tr[@class='email-noreply']").FirstOrDefault(); + + if (noreplyTr != null) + { + var currTd = noreplyTr.SelectNodes(".//td").FirstOrDefault(); + + if(currTd != null) + { + var currPList = currTd.SelectNodes(".//p"); + + foreach (var baseP in currPList) + { + if (baseP.Attributes["class"].Value == "notice-comp-val") { - if (taskBCInfo.ETA.HasValue) - { - baseTd.InnerHtml = taskBCInfo.ETA.Value.ToString("yyyy-MM-dd"); - } + baseP.InnerHtml = tenantName; } } } - - } result = html.DocumentNode.OuterHtml; diff --git a/Myshipping.Web.Core/applicationconfig.json b/Myshipping.Web.Core/applicationconfig.json index f709c330..e3a4959e 100644 --- a/Myshipping.Web.Core/applicationconfig.json +++ b/Myshipping.Web.Core/applicationconfig.json @@ -56,7 +56,7 @@ }, "Cache": { "CacheType": "RedisCache", // RedisCache - "RedisConnectionString": "192.168.0.80:6379,password=,defaultDatabase=11" + "RedisConnectionString": "192.168.0.180:6379,password=,defaultDatabase=11" }, "SnowId": { "WorkerId": "1" // 取值范围0~63,默认1 @@ -130,5 +130,6 @@ "ServiceStatusOpenAuto": "0", "DraftCompareUrl": "http://localhost:5110/api/TaskDraftCompare/ExcuteDraftCompare", "GetDraftCompareUrl": "http://localhost:5110/api/TaskDraftCompare/DraftCompareResult", - "DraftReadUrl": "http://localhost:5110/api/TaskDraftCompare/ExcuteDraftFileRead" + "DraftReadUrl": "http://localhost:5110/api/TaskDraftCompare/ExcuteDraftFileRead", + "EmailTemplateFilePath": "\\EmailTemplate" } \ No newline at end of file From fdac13dfd10e00fcfe1c029d62b782d7bdd4ec35 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 19 Jan 2024 18:06:06 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageBCService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 138033e2..4b1c0b23 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -1367,7 +1367,7 @@ namespace Myshipping.Application _logger.LogInformation($"提取当前公共邮箱的配置完成,id={publicMailAccount.Id}"); - string emailTitle = string.Empty; + string emailTitle = $"Booking Confirmation : {taskBCInfo.MBL_NO}"; string filePath = string.Empty; //读取邮件模板并填充数据 @@ -1404,7 +1404,8 @@ namespace Myshipping.Application Password = publicMailAccount.Password?.Trim(), Server = publicMailAccount.SmtpServer?.Trim(), Port = publicMailAccount.SmtpPort.HasValue ? publicMailAccount.SmtpPort.Value : 465, - UseSSL = publicMailAccount.SmtpSSL.HasValue ? publicMailAccount.SmtpSSL.Value : true + UseSSL = publicMailAccount.SmtpSSL.HasValue ? publicMailAccount.SmtpSSL.Value : true, + Attaches = new List() }; _logger.LogInformation($"生成请求邮件参数,结果:{JSON.Serialize(emailApiUserDefinedDto)}"); From db62e27545ddd99d05b6e3c134787a2f4c978e2e Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jan 2024 09:37:20 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index c6c86f24..2c1c23d6 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -317,8 +317,12 @@ namespace Myshipping.Application //处理附件 if (file != null) { + _logger.LogInformation($"请求文件名:{file.FileName}"); + var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), file.FileBytes, batchNo, file.FileName, "bcfiles"); + _logger.LogInformation($"保存文件路径:{fileFullPath}"); + if (!string.IsNullOrWhiteSpace(fileFullPath)) { //将格式单附件写入订舱的附件 @@ -329,8 +333,12 @@ namespace Myshipping.Application if (modifyFile != null) { + _logger.LogInformation($"请求文件名(变更文件):{file.FileName}"); + var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), modifyFile.FileBytes, batchNo, modifyFile.FileName, "bcnoticefiles"); + _logger.LogInformation($"保存文件路径(变更文件):{fileFullPath}"); + if (!string.IsNullOrWhiteSpace(fileFullPath)) { //将格式单附件写入订舱的附件 From 6ac5d1390b269080a19e0e2e2096a73710e5248d Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jan 2024 09:55:34 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 2 +- .../Service/TaskManagePlat/TaskManageService.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 2c1c23d6..73a14f24 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -333,7 +333,7 @@ namespace Myshipping.Application if (modifyFile != null) { - _logger.LogInformation($"请求文件名(变更文件):{file.FileName}"); + _logger.LogInformation($"请求文件名(变更文件):{modifyFile.FileName}"); var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), modifyFile.FileBytes, batchNo, modifyFile.FileName, "bcnoticefiles"); diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 5ea6c083..20369805 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -350,7 +350,8 @@ namespace Myshipping.Application if (TaskBaseTypeEnum.BC.ToString() == taskInfo.TASK_BASE_TYPE) attachFileType = "bcfiles"; - var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, file.FileName, + var noExtensionFileName = Path.GetFileNameWithoutExtension(file.FileName); + var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, noExtensionFileName, GetFileType(file.FileName), attachFileType); if (!string.IsNullOrWhiteSpace(fileFullName)) @@ -380,7 +381,8 @@ namespace Myshipping.Application if (TaskBaseTypeEnum.BC.ToString() == taskInfo.TASK_BASE_TYPE) attachFileType = "bcnoticefiles"; - var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, modifyFile.FileName, + var noExtensionFileName = Path.GetFileNameWithoutExtension(modifyFile.FileName); + var fileFullName = await FileAttachHelper.SaveFile(taskInfo.PK_ID, bytes, batchNo, noExtensionFileName, GetFileType(modifyFile.FileName), attachFileType); if (!string.IsNullOrWhiteSpace(fileFullName)) From c1b6d8671e331132a2d5dba88cf7d7f31cb678ff Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jan 2024 10:56:48 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=88=B1=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs | 5 +++++ .../Service/TaskManagePlat/TaskManageBCService.cs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs index b5a1d4b6..bf1a40cf 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderBCInfo.cs @@ -331,5 +331,10 @@ namespace Myshipping.Application /// 订舱确认时间 /// public Nullable BookingConfirmDate { get; set; } + + /// + /// 舱位主键 + /// + public Nullable BookingSlotId { get; set; } } } diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs index 4b1c0b23..a62f02f0 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageBCService.cs @@ -761,6 +761,10 @@ namespace Myshipping.Application } } } + else + { + throw Oops.Oh($"生成舱位失败,舱位已存在"); + } #endregion } else if (model.GenerateMethod == "GEN_BOOKING") From 6b1e5b04a92de55d9f0732d3e3e6f61e2a42e8f0 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 22 Jan 2024 14:10:01 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9BC=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskManageService.cs | 3 +++ Myshipping.Web.Entry/appsettings.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs index 20369805..74e4d6cd 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskManageService.cs @@ -676,6 +676,9 @@ namespace Myshipping.Application bcInfo.TenantId = taskInfo.TenantId; bcInfo.TenantName = taskInfo.TenantName; + if (info.Main.BCInfo.BookingSlotId.HasValue && info.Main.BCInfo.BookingSlotId.Value > 0) + bcInfo.BOOKING_SLOT_ID = info.Main.BCInfo.BookingSlotId.Value; + await _taskBCInfoRepository.InsertAsync(bcInfo); //异步写入集装箱 diff --git a/Myshipping.Web.Entry/appsettings.json b/Myshipping.Web.Entry/appsettings.json index 3cc8579c..c88c7a3c 100644 --- a/Myshipping.Web.Entry/appsettings.json +++ b/Myshipping.Web.Entry/appsettings.json @@ -37,5 +37,5 @@ } }, "AllowedHosts": "*", - "Urls": "http://localhost:5000" + "Urls": "http://localhost:5120" } \ No newline at end of file