From 54532cd49960dc8ae77992c055a0a0d9690a8e77 Mon Sep 17 00:00:00 2001 From: "qianhao.xu" Date: Mon, 8 Jul 2024 14:01:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=AE=8C=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOAN.Model/MES/base/Dto/BaseSupplierDto.cs | 4 ++++ DOAN.Service/MES/base/BaseSupplierService.cs | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/DOAN.Model/MES/base/Dto/BaseSupplierDto.cs b/DOAN.Model/MES/base/Dto/BaseSupplierDto.cs index 29f650b..8d04ae3 100644 --- a/DOAN.Model/MES/base/Dto/BaseSupplierDto.cs +++ b/DOAN.Model/MES/base/Dto/BaseSupplierDto.cs @@ -7,6 +7,10 @@ namespace DOAN.Model.MES.base_.Dto /// public class BaseSupplierQueryDto : PagerInfo { + public string SupplierNo { get; set; } + + public string SupplierName { get; set; } + public int? Type { get; set; } } /// diff --git a/DOAN.Service/MES/base/BaseSupplierService.cs b/DOAN.Service/MES/base/BaseSupplierService.cs index f6533eb..437079c 100644 --- a/DOAN.Service/MES/base/BaseSupplierService.cs +++ b/DOAN.Service/MES/base/BaseSupplierService.cs @@ -24,7 +24,10 @@ namespace DOAN.Service.MES.base_ /// public PagedInfo GetList(BaseSupplierQueryDto parm) { - var predicate = Expressionable.Create(); + var predicate = Expressionable.Create() + .AndIF(!string.IsNullOrEmpty(parm.SupplierNo), it => it.SupplierNo.Contains(parm.SupplierNo)) + .AndIF(!string.IsNullOrEmpty(parm.SupplierName), it => it.SupplierName.Contains(parm.SupplierName)) + .AndIF(parm.Type > -1, it => it.Type == parm.Type); var response = Queryable() .Where(predicate.ToExpression())