From 65f10726272c46f75645531bd6329a42405753e9 Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Thu, 14 Mar 2024 16:49:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrderService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index d76c8f19..019b3f56 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -720,7 +720,7 @@ namespace Myshipping.Application throw Oops.Bah("大简云接收订舱用户key和秘钥未配置,请联系管理员"); } - var orderList = _rep.AsQueryable().Where(x => ids.Contains(x.Id)).ToList(); + var orderList = _rep.AsQueryable().Filter(null, true).Where(x => ids.Contains(x.Id)).ToList(); var noSubmitList = orderList.Where(x => x.BSSTATUS != "已提交").Select(x => x.BOOKINGNO).ToList(); if (noSubmitList.Count > 0) { @@ -771,7 +771,7 @@ namespace Myshipping.Application var succ = item.GetBooleanValue("success"); if (succ) { - var model = _rep.AsQueryable().First(x => x.Id == id); + var model = _rep.AsQueryable().Filter(null, true).First(x => x.Id == id); model.BSSTATUS = "已录入"; await _rep.UpdateAsync(model); @@ -1822,7 +1822,11 @@ namespace Myshipping.Application throw Oops.Bah("当前状态不能修改"); } - await CancelSubmit(new List() { custOrder.Id }); + if (custOrder.BSSTATUS == "已提交") + { + await CancelSubmit(new List() { custOrder.Id }); + custOrder = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == custOrder.Id); //取消后重新拉取一遍数据 + } input.Id = custOrder.Id; From 21414bd6a18d740f4769974cae8924e0de53304c Mon Sep 17 00:00:00 2001 From: wanghaomei <86whm@163.com> Date: Thu, 14 Mar 2024 17:53:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=94=BE=E8=88=B1=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index c33aa712..ff1a308d 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -3761,7 +3761,7 @@ namespace Myshipping.Application var bs = await GenPrintFile(bookingId, printTemplate); var opt = App.GetOptions(); - var fileSaveName = $"放舱_{order.MBLNO}_{DateTime.Now.Ticks}.pdf"; // 文件原始名称 + var fileSaveName = $"放舱通知_{order.MBLNO}_{DateTime.Now.Ticks}.pdf"; // 文件原始名称 var dirAbs = string.Empty; if (string.IsNullOrEmpty(opt.basePath)) { @@ -3848,7 +3848,7 @@ namespace Myshipping.Application 邮箱:{user.Email}
"; - var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.AttnMail, new KeyValuePair(fileSaveName, bs)); + var sendResult = await MailSendHelper.SendMail(mailAcc, mailSubject, mailContent, letterYard.AttnMail, new KeyValuePair($"放舱通知_{order.MBLNO}.pdf", bs)); if (!sendResult.Key) { _logger.LogError($"放舱邮件发送失败:从{mailAcc.MailAccount}到{letterYard.AttnMail},主题 {mailSubject}"); From f2742abfd5f67a02ebb4835588eb0823008ddba9 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng Date: Thu, 14 Mar 2024 18:10:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8E=A5=E6=94=B6=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=9C=80=E6=B1=82=E5=90=8E=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrderService.cs | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 7314a381..96ff9550 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -916,6 +916,8 @@ namespace Myshipping.Application //日志动态 SaveAuditLog($"{model.BSSTATUS},审核意见:{recModel.Comment}", id, model.CreatedUserId.Value, model.TenantId.Value, "系统"); + long bookingId = 0; + //进入客户订舱系统的订舱台账 if (recModel.Accept) { @@ -926,6 +928,7 @@ namespace Myshipping.Application await _repOrder.InsertAsync(bkOrder); model.BookingId = bkOrder.Id; //客户订舱数据与订舱台账数据关联 + bookingId = bkOrder.Id; await _rep.UpdateAsync(model); var bkEdiExt = new BookingEDIExt(); @@ -960,9 +963,6 @@ namespace Myshipping.Application await _repFile.InsertAsync(file); } - - - return bkOrder.Id; } @@ -971,18 +971,35 @@ namespace Myshipping.Application { try { - var body = new + string json = null; + if (recModel.Accept) { - Type = recModel.Accept ? "CustOrderStatusAccept" : "CustOrderStatusReject", - Data = new + var body = new { - model.BSNO, - BSSTATUS = recModel.Accept ? "已审核" : "已驳回", - BookingOrderId = recModel.Accept ? (long?)model.BookingId : null, - COMMENT = recModel.Accept ? null: recModel.Comment - } - }; - var json = body.ToJsonString(); + Type = "CustOrderStatusAccept", + Data = new + { + model.BSNO, + BSSTATUS = "已审核", + BookingOrderId = bookingId + } + }; + json = body.ToJsonString(); + } + else + { + var body = new + { + Type = "CustOrderStatusReject", + Data = new + { + model.BSNO, + BSSTATUS = "已驳回", + COMMENT = recModel.Comment + } + }; + json = body.ToJsonString(); + } var mqUrl = _cache.GetAllSysConfig().Result.FirstOrDefault(x => x.Code == "AuditBookingMqUrl")?.Value ?? throw new Exception("需配置接收订舱需求审核后推送东胜MQ连接串:[AuditBookingMqUrl]"); @@ -1020,7 +1037,14 @@ namespace Myshipping.Application } }); - return 0; + if (recModel.Accept) + { + return bookingId; + } + else + { + return 0; + } } #endregion