From 5b77ee33a23a3fd8a8ae9358af9ebb27eca19aed Mon Sep 17 00:00:00 2001
From: zhangxiaofeng <1939543722@qq.com>
Date: Fri, 17 May 2024 17:00:31 +0800
Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=9B=B8=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Service/BookingLabel/BookingLabelService.cs | 14 ++++++++++++++
.../BookingLabel/Dto/BookingLabelBaseDto.cs | 16 +++++++++++++++-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/Myshipping.Application/Service/BookingLabel/BookingLabelService.cs b/Myshipping.Application/Service/BookingLabel/BookingLabelService.cs
index 011c24de..3f35b6cd 100644
--- a/Myshipping.Application/Service/BookingLabel/BookingLabelService.cs
+++ b/Myshipping.Application/Service/BookingLabel/BookingLabelService.cs
@@ -94,6 +94,20 @@ namespace Myshipping.Application
: cacheList.Where(x => x.Scope == scope).ToList();
return result;
}
+ ///
+ /// 分页获取全部或指定范围类型的标签列表
+ ///
+ [HttpPost("/BookingLabel/PageList")]
+ public async Task> PageList(BookingLabelPageListInput input)
+ {
+ var list = await _rep.AsQueryable()
+ .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name))
+ .WhereIF(input.Scope != null, x => x.Scope == input.Scope)
+ .ToPagedListAsync(input.PageNo, input.PageSize);
+
+ var result = list.Adapt>();
+ return result;
+ }
///
/// 新增或修改标签信息
diff --git a/Myshipping.Application/Service/BookingLabel/Dto/BookingLabelBaseDto.cs b/Myshipping.Application/Service/BookingLabel/Dto/BookingLabelBaseDto.cs
index 88af57a9..875c0291 100644
--- a/Myshipping.Application/Service/BookingLabel/Dto/BookingLabelBaseDto.cs
+++ b/Myshipping.Application/Service/BookingLabel/Dto/BookingLabelBaseDto.cs
@@ -1,4 +1,5 @@
-namespace Myshipping.Application.Service.BookingLabel.Dto
+using Myshipping.Core;
+namespace Myshipping.Application.Service.BookingLabel.Dto
{
public class BookingLabelBaseDto
{
@@ -28,4 +29,17 @@
///
public long[] BusinessIdArray { get; set; }
}
+ public class BookingLabelPageListInput : PageInputBase
+ {
+ ///
+ /// 标签名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 标签使用范围 1-舱位
+ ///
+ public int? Scope { get; set; }
+
+ }
}