From f15e692a2d612adf0a50c1a36ce1d0f4502fc1e3 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 29 Mar 2024 16:40:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 39 ++++++++++++++++++- .../BookingSlot/IBookingSlotService.cs | 18 ++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index 142bb62b..3039d3c9 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -1491,7 +1491,7 @@ namespace Myshipping.Application return dto; } - var list =_repAllocation.AsQueryable().Where(a => a.BOOKING_SLOT_ID == id).ToList(); + var list = _repAllocation.AsQueryable().Where(a => a.BOOKING_SLOT_ID == id).ToList(); dto = new BookingSlotWithOrderDto { @@ -1544,6 +1544,43 @@ namespace Myshipping.Application return dto; } #endregion + + /// + /// 校验是否可以生成订舱订单 + /// + /// 舱位主键 + /// + [HttpGet("/BookingSlot/ValidateCreateBookingOrder")] + public async Task ValidateCreateBookingOrder(long id) + { + TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + + var slotInfo = await _repBase.AsQueryable().FirstAsync(a => a.Id == id); + + if (slotInfo == null) + { + throw Oops.Oh($"获取舱位失败,舱位不存在或已作废"); + } + + //if(so) + + return result; + } + + /// + /// 批量发送邮件提醒(发送客户) + /// + /// 舱位主键组 + /// + [HttpPost("/BookingSlot/SendEmail")] + public async Task SendEmail([FromBody]long[] ids) + { + TaskManageOrderResultDto result = new TaskManageOrderResultDto(); + + result.succ = true; + + return result; + } } diff --git a/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs index 7ae52bb3..ac2b9bb8 100644 --- a/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/IBookingSlotService.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Http; +using Furion.FriendlyException; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Myshipping.Application.Entity; using Myshipping.Application.Event; @@ -112,5 +113,20 @@ namespace Myshipping.Application /// 返回回执 Task SearchBookingSlotWithOrderByNo(string slotBookingNo); + + /// + /// 校验是否可以生成订舱订单 + /// + /// 舱位主键 + /// + Task ValidateCreateBookingOrder(long id); + + /// + /// 批量发送邮件提醒(发送客户) + /// + /// 舱位主键组 + /// + Task SendEmail(long[] ids); + } } \ No newline at end of file