using WcsMain.DataBase.TableEntity; namespace WcsMain.ExtendMethod; /// /// 库位的扩展方法 /// public static class AppLocationExtendMethod { /// /// 检验是否存在Wmslocation /// /// /// /// public static bool ExistWmsLocation(this List? value, params string?[] wmsLocations) { if(value == default || wmsLocations == default || wmsLocations.Length < 1) return false; foreach (var wmsLocation in wmsLocations) { if(!value.Exists(e => e.WmsLocation == wmsLocation)) return false; } return true; } /// /// 根据 wmsLocation 获取库位的详细信息 /// /// /// /// public static AppLocation? DetailWithWmsLocation(this List? value, string? wmsLocation) { if(value == default || wmsLocation == default) return default; return value.Find(f => f.WmsLocation == wmsLocation); } /// /// 根据 wcsLocation 获取库位的详细信息 /// /// /// /// public static AppLocation? DetailWithWcsLocation(this List? value, string? wcsLocation) { if (value == default || wcsLocation == default) return default; return value.Find(f => f.WcsLocation == wcsLocation); } }