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":