From e5d9808da51f1455e26b7432d45cb4f758212076 Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Fri, 16 Aug 2024 12:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=A9=BA=E6=88=96=E8=80=85=E9=9D=9E=E7=A9=BA=EF=BC=9B?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9B=B8=E7=AD=89=E4=B8=8E=E5=90=A6=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DS.Module.Core/Condition/ConditionHelper.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ds-wms-service/DS.Module.Core/Condition/ConditionHelper.cs b/ds-wms-service/DS.Module.Core/Condition/ConditionHelper.cs index b88e9b40..37f2c3a0 100644 --- a/ds-wms-service/DS.Module.Core/Condition/ConditionHelper.cs +++ b/ds-wms-service/DS.Module.Core/Condition/ConditionHelper.cs @@ -56,13 +56,17 @@ namespace DS.Module.Core.Condition switch (item.Operator) { case "equal": - itemResult = valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) == true; break; + itemResult = (valStr == null && item.Value == null) || valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) == true; break; case "not_equal": - itemResult = valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) != true; break; + itemResult = (valStr != null || item.Value != null) && valStr?.Equals(item.Value, StringComparison.OrdinalIgnoreCase) != true; break; case "contains": itemResult = valStr?.Contains(item.Value, StringComparison.OrdinalIgnoreCase) == true; break; case "not_contain": itemResult = valStr?.Contains(item.Value, StringComparison.OrdinalIgnoreCase) != true; break; + case "empty": + itemResult = string.IsNullOrWhiteSpace(valStr) == true; break; + case "not_empty": + itemResult = string.IsNullOrWhiteSpace(valStr) != true; break; case "start_with": itemResult = valStr?.StartsWith(item.Value, StringComparison.OrdinalIgnoreCase) == true; break; case "end_with":