From 9e3799824abebb51575d735faedc9ac8c4a15ee5 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 29 Mar 2024 15:24:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingSlot/BookingSlotService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs index aa36db82..7098319a 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -395,8 +395,8 @@ namespace Myshipping.Application TaskBCInfoDto bcTargetDto = dto.DataObj.Adapt(); //提取箱信息 - var ctnList = _repCtn.AsQueryable() - .Where(x => x.IsDeleted == false && x.TenantId == UserManager.TENANT_ID + var ctnList = _repCtn.AsQueryable().Filter(null, true) + .Where(x => x.IsDeleted == false && x.TenantId.Value == UserManager.TENANT_ID && x.SLOT_ID == model.Id).ToList(); if (ctnList != null) @@ -1210,6 +1210,7 @@ namespace Myshipping.Application /// /// 生成订舱订单请求 /// 返回回执 + [HttpGet("/BookingSlot/CreateBookingOrder")] public async Task CreateBookingOrder(BookingGenerateDto model) { TaskManageOrderResultDto result = new TaskManageOrderResultDto(); @@ -1476,7 +1477,7 @@ namespace Myshipping.Application /// /// /// 返回回执 - + [HttpGet("/BookingSlot/SearchBookingSlotWithOrderById")] public async Task SearchBookingSlotWithOrderById(long id) { BookingSlotWithOrderDto dto = null; @@ -1513,7 +1514,7 @@ namespace Myshipping.Application /// /// 订舱编号 /// 返回回执 - + [HttpGet("/BookingSlot/SearchBookingSlotWithOrderByNo")] public async Task SearchBookingSlotWithOrderByNo(string slotBookingNo) { BookingSlotWithOrderDto dto = null; From 530ed5f2b7f34e73b02893eeec5ffb2e5d9d15d6 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 29 Mar 2024 15:35:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=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 7098319a..142bb62b 100644 --- a/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs +++ b/Myshipping.Application/Service/BookingSlot/BookingSlotService.cs @@ -1210,7 +1210,7 @@ namespace Myshipping.Application /// /// 生成订舱订单请求 /// 返回回执 - [HttpGet("/BookingSlot/CreateBookingOrder")] + [HttpPost("/BookingSlot/CreateBookingOrder")] public async Task CreateBookingOrder(BookingGenerateDto model) { TaskManageOrderResultDto result = new TaskManageOrderResultDto(); From f15e692a2d612adf0a50c1a36ce1d0f4502fc1e3 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 29 Mar 2024 16:40:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B1=E4=BD=8D?= =?UTF-8?q?=E7=AE=A1=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