From 457b75b642a1fdaa7158e5b047cabc5d7ae16333 Mon Sep 17 00:00:00 2001 From: xxyy <cathay_xy@163.com> Date: 星期一, 10 三月 2025 10:10:13 +0800 Subject: [PATCH] 修复和优化 Dt_TaskService.cs 中的任务请求逻辑 --- Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs index 140c9fc..aa0da5e 100644 --- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs +++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs @@ -31,7 +31,7 @@ public ISqlSugarClient Db => BaseDal.Db; private PropertyInfo[] _propertyInfo { get; set; } = null; - private PropertyInfo[] TProperties + public PropertyInfo[] TProperties { get { @@ -132,7 +132,15 @@ if (string.IsNullOrEmpty(where)) { // 閽堝瀛楃涓茬被鍨嬬殑瀛楁浣跨敤妯$硦鏌ヨ - where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + //where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false") + { + where += $" {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'"; + } + else + { + where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; + } } else { @@ -164,7 +172,7 @@ /// <param name="pageData"></param> /// <param name="propertyInfo"></param> /// <returns></returns> - private Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo) + public Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo) { if (!string.IsNullOrEmpty(pageData.Sort)) { -- Gitblit v1.9.3