From 5243d038b082cb00019906952d4d9199c29c55d4 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 10 May 2023 17:18:28 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=B8=8B=E8=B4=A7=E7=BA=B8=E6=AF=94=E5=AF=B9=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/TaskShippingOrderCompareService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs index aa992296..aa51c8b7 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs @@ -328,7 +328,7 @@ namespace Myshipping.Application try { - var res = await url.SetClientTimeout(180).SetHttpMethod(HttpMethod.Post) + var res = await url.SetClientTimeout(900).SetHttpMethod(HttpMethod.Post) .SetBody(JSON.Serialize(info), "application/json") .SetContentEncoding(Encoding.UTF8) .PostAsync(); From e124a3c023c8621d19db332e748b987c35f9d3d4 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 10 May 2023 17:24:52 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=8B=E8=B4=A7?= =?UTF-8?q?=E7=BA=B8=E6=AF=94=E5=AF=B9=E7=9A=84=E8=AF=B7=E6=B1=82=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/TaskShippingOrderCompareService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs index aa51c8b7..906777ab 100644 --- a/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs +++ b/Myshipping.Application/Service/TaskManagePlat/TaskShippingOrderCompareService.cs @@ -328,7 +328,10 @@ namespace Myshipping.Application try { - var res = await url.SetClientTimeout(900).SetHttpMethod(HttpMethod.Post) + var res = await url.OnClientCreating(client => { + // client 为 HttpClient 对象 + client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟 + }).SetHttpMethod(HttpMethod.Post) .SetBody(JSON.Serialize(info), "application/json") .SetContentEncoding(Encoding.UTF8) .PostAsync(); From d96365699c5e0aa09e1f310524663de9718f5052 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Wed, 10 May 2023 17:51:48 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=94=BE=E8=88=B1=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index d2140832..c3ae9e40 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2194,10 +2194,11 @@ namespace Myshipping.Application /// /// 放舱发送 /// - /// + /// 订舱ID + /// 打印模板ID /// [HttpPost("/BookingLetteryard/SendLetterYard")] - public async Task SendLetterYard(long bookingId) + public async Task SendLetterYard(long bookingId,long templateId) { var order = _rep.FirstOrDefault(x => x.Id == bookingId); var user = await _repUser.FirstOrDefaultAsync(u => u.Id == order.CreatedUserId); @@ -2227,7 +2228,14 @@ namespace Myshipping.Application //} #region 保存放舱文件,并挂载到订舱附件 - var fileBytes = await GetReportFile(bookingId, "fangcang"); + var printTemplate = await _repPrintTemplate.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == templateId); + if (printTemplate == null) + { + throw Oops.Bah(BookingErrorCode.BOOK115); + } + + var bs = await GenPrintFile(bookingId, printTemplate); + var opt = App.GetOptions(); var fileSaveName = $"放舱_{order.MBLNO}_{DateTime.Now.Ticks}.pdf"; // 文件原始名称 var dirAbs = string.Empty; @@ -2246,7 +2254,7 @@ namespace Myshipping.Application var fileRelaPath = Path.Combine(opt.relativePath, fileSaveName).ToLower(); var fileAbsPath = Path.Combine(dirAbs, fileSaveName).ToLower(); - File.WriteAllBytes(fileAbsPath, fileBytes); + File.WriteAllBytes(fileAbsPath, bs); var newFile = new BookingFile { @@ -2316,7 +2324,7 @@ namespace Myshipping.Application 邮箱:{user.Email}
"; - var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.AttnMail, new KeyValuePair(fileSaveName, fileBytes)); + var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.AttnMail, new KeyValuePair(fileSaveName, bs)); if (!sendResult.Key) { _logger.LogError($"放舱邮件发送失败:从{mailAcc.MailAccount}到{letterYard.AttnMail},主题 {mailSubject}"); From 0bb7ea534442a4abda9cf273d72af67513fcbd18 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Thu, 11 May 2023 10:08:20 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=94=BE=E8=88=B1=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index c3ae9e40..fece7518 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2198,7 +2198,7 @@ namespace Myshipping.Application /// 打印模板ID /// [HttpPost("/BookingLetteryard/SendLetterYard")] - public async Task SendLetterYard(long bookingId,long templateId) + public async Task SendLetterYard(long bookingId, long templateId) { var order = _rep.FirstOrDefault(x => x.Id == bookingId); var user = await _repUser.FirstOrDefaultAsync(u => u.Id == order.CreatedUserId); From dd498a5770789d9ccdada2af43ea822b9ad88629 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Thu, 11 May 2023 13:57:56 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=94=BE=E8=88=B1=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index fece7518..776d2fcf 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2215,7 +2215,12 @@ namespace Myshipping.Application throw Oops.Bah("ATTN MAIL未正确填写"); } - var mailAcc = await _repUserMail.FirstOrDefaultAsync(x => x.CreatedUserId == user.Id && x.MailAccount == letterYard.AttnMail && x.SmtpPort > 0 && x.SmtpServer != null && x.SmtpServer != ""); + if (string.IsNullOrEmpty(letterYard.FromMail)) + { + throw Oops.Bah("FROM MAIL未正确填写"); + } + + var mailAcc = await _repUserMail.FirstOrDefaultAsync(x => x.CreatedUserId == user.Id && x.MailAccount == letterYard.FromMail && x.SmtpPort > 0 && x.SmtpServer != null && x.SmtpServer != ""); if (mailAcc == null) { throw Oops.Bah("用户邮箱未设置或smtp未正确配置"); From f4dff3e5ead63d82162fc3d22e347a97d51cd802 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 12 May 2023 09:15:14 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E8=BD=A6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0FROM=E6=89=8B=E6=9C=BA=E5=8F=B7=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=94=B9FROM=E7=94=B5=E8=AF=9D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=BA=E5=BA=A7=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/Entity/BookingTruck.cs | 9 +++++++-- .../Entity/TaskManagePlat/TaskTruckInfo.cs | 9 +++++++-- .../Service/BookingTruck/Dtos/BookingTruckDto.cs | 6 +++++- .../Service/BookingTruck/Dtos/BookingTruckPrintDto.cs | 6 +++++- .../Service/BookingTruck/Dtos/BookingTruckShowBaseDto.cs | 6 +++++- .../TaskManagePlat/Dtos/TaskManageOrderTruckInfo.cs | 6 +++++- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Myshipping.Application/Entity/BookingTruck.cs b/Myshipping.Application/Entity/BookingTruck.cs index f3bb4c8a..37a4745a 100644 --- a/Myshipping.Application/Entity/BookingTruck.cs +++ b/Myshipping.Application/Entity/BookingTruck.cs @@ -62,9 +62,9 @@ namespace Myshipping.Application.Entity [Description("FROM")] public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// - [Description("FROM电话")] + [Description("FROM座机")] public string FromTel { get; set; } /// /// FROM邮箱 @@ -72,6 +72,11 @@ namespace Myshipping.Application.Entity [Description("FROM邮箱")] public string FromMail { get; set; } /// + /// FROM手机号 + /// + [Description("FROM手机号")] + public string FromMobile { get; set; } + /// /// FROM传真 /// [Description("FROM传真")] diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskTruckInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskTruckInfo.cs index 600b11f1..a6e44ac9 100644 --- a/Myshipping.Application/Entity/TaskManagePlat/TaskTruckInfo.cs +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskTruckInfo.cs @@ -73,9 +73,9 @@ namespace Myshipping.Application.Entity [Description("FROM")] public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// - [Description("FROM电话")] + [Description("FROM座机")] public string FromTel { get; set; } /// /// FROM邮箱 @@ -83,6 +83,11 @@ namespace Myshipping.Application.Entity [Description("FROM邮箱")] public string FromMail { get; set; } /// + /// FROM手机号 + /// + [Description("FROM手机号")] + public string FromMobile { get; set; } + /// /// FROM传真 /// [Description("FROM传真")] diff --git a/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckDto.cs b/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckDto.cs index cdc6d8a5..7193efd6 100644 --- a/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckDto.cs +++ b/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckDto.cs @@ -57,10 +57,14 @@ namespace Myshipping.Application /// public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// public string FromTel { get; set; } /// + /// FROM手机号 + /// + public string FromMobile { get; set; } + /// /// FROM邮箱 /// public string FromMail { get; set; } diff --git a/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckPrintDto.cs b/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckPrintDto.cs index d6df4a03..7a3214ce 100644 --- a/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckPrintDto.cs +++ b/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckPrintDto.cs @@ -38,7 +38,7 @@ namespace Myshipping.Application /// public string Attn { get; set; } /// - /// ATTN电话 + /// ATTN座机 /// public string AttnTel { get; set; } /// @@ -50,6 +50,10 @@ namespace Myshipping.Application /// public string AttnFax { get; set; } /// + /// FROM手机号 + /// + public string FromMobile { get; set; } + /// /// FROM /// public string FromName { get; set; } diff --git a/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckShowBaseDto.cs b/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckShowBaseDto.cs index 8d1f9879..5c06f83f 100644 --- a/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckShowBaseDto.cs +++ b/Myshipping.Application/Service/BookingTruck/Dtos/BookingTruckShowBaseDto.cs @@ -53,10 +53,14 @@ namespace Myshipping.Application /// public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// public string FromTel { get; set; } /// + /// FROM手机号 + /// + public string FromMobile { get; set; } + /// /// FROM邮箱 /// public string FromMail { get; set; } diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderTruckInfo.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderTruckInfo.cs index f3ea2e7f..5341def2 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderTruckInfo.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskManageOrderTruckInfo.cs @@ -52,10 +52,14 @@ namespace Myshipping.Application /// public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// public string FromTel { get; set; } /// + /// FROM手机号 + /// + public string FromMobile { get; set; } + /// /// FROM邮箱 /// public string FromMail { get; set; } From ba82e78c2f0729980fc3fd0dadf32c6fc408dc16 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 12 May 2023 10:26:35 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E8=BD=A6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=85=E6=96=B9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0FROM=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=A1=AB?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingTruck/BookingTruckService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs b/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs index 3a3b7125..476b9f99 100644 --- a/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs +++ b/Myshipping.Application/Service/BookingTruck/BookingTruckService.cs @@ -517,6 +517,7 @@ namespace Myshipping.Application model.FromName = UserManager.Name; model.FromTel = UserManager.TEl; model.FromMail = UserManager.Email; + model.FromMobile = UserManager.Phone; //这里岗位是调度的信息,如果默认只有一条记录,取第一条,其他情况不返回默认值 var userPosInfo = await _sysUserService.QueryUserByPos("", "PCDD"); From 7462e798023a9e5d13708ae5788249e22b7e7107 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 12 May 2023 10:37:16 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E8=BD=A6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0FROM?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaskManagePlat/Dtos/Truck/TaskTruckShowBaseDto.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckShowBaseDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckShowBaseDto.cs index 2d9c09da..ffb70c5c 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckShowBaseDto.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckShowBaseDto.cs @@ -49,10 +49,14 @@ namespace Myshipping.Application /// public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// public string FromTel { get; set; } /// + /// FROM手机号 + /// + public string FromMobile { get; set; } + /// /// FROM邮箱 /// public string FromMail { get; set; } From 667d075852205d37fe71fd37cdeafa38e28792b9 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 12 May 2023 10:49:55 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E8=BD=A6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9A=84=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TaskManagePlat/Dtos/Truck/TaskTruckDto.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckDto.cs index 79b1eac8..c2f9bd7a 100644 --- a/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckDto.cs +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/Truck/TaskTruckDto.cs @@ -56,10 +56,14 @@ namespace Myshipping.Application /// public string FromName { get; set; } /// - /// FROM电话 + /// FROM座机 /// public string FromTel { get; set; } /// + /// FROM手机号 + /// + public string FromMobile { get; set; } + /// /// FROM邮箱 /// public string FromMail { get; set; }