From e7df5d1ece7ecabaa7a3943f24a6621649fdc455 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期一, 13 一月 2025 16:08:11 +0800 Subject: [PATCH] 增加批量添加,修改阀门界面 --- Service/HStation.Service.Assets.Core/05-service/03-Valve/02-ValveMain/ValveMain.cs | 78 ++++++++++++++++++++++++++++++++++----- 1 files changed, 68 insertions(+), 10 deletions(-) diff --git a/Service/HStation.Service.Assets.Core/05-service/03-Valve/02-ValveMain/ValveMain.cs b/Service/HStation.Service.Assets.Core/05-service/03-Valve/02-ValveMain/ValveMain.cs index cad6f50..f3315a5 100644 --- a/Service/HStation.Service.Assets.Core/05-service/03-Valve/02-ValveMain/ValveMain.cs +++ b/Service/HStation.Service.Assets.Core/05-service/03-Valve/02-ValveMain/ValveMain.cs @@ -40,7 +40,7 @@ { model.Reset(model_ds); } - AssetsValveSeriesCacheHelper.Trigger(); + AssetsValveMainCacheHelper.Trigger(); } //閫氳繃 Ids 鏇存柊缂撳瓨 @@ -59,7 +59,7 @@ { all.AddRange(model_list); } - AssetsValveSeriesCacheHelper.Trigger(); + AssetsValveMainCacheHelper.Trigger(); } //绉婚櫎缂撳瓨 @@ -67,7 +67,7 @@ { var all = GetCache(); all.RemoveAll(x => x.ID == ID); - AssetsValveSeriesCacheHelper.Trigger(); + AssetsValveMainCacheHelper.Trigger(); } /// <summary> @@ -75,10 +75,12 @@ /// </summary> public static void PublishCache(string key) { - AssetsValveSeriesCacheHelper.Publish(key); + AssetsValveMainCacheHelper.Publish(key); } #endregion Cache + + #region Query @@ -123,24 +125,33 @@ } /// <summary> - /// 閫氳繃 绯诲垪ID 鑾峰彇 + /// 閫氳繃 SeriesID 鑾峰彇 /// </summary> - public List<Model.AssetsValveMain> GetBySeriesID(long id) + public List<Model.AssetsValveMain> GetBySeriesID(long SeriesID) { - if (id < 1) + var all = GetAll(); + return all.Where(x => x.SeriesID == SeriesID).OrderBy(x => x.SortCode).ToList(); + } + + /// <summary> + /// 閫氳繃 SeriesIds 鑾峰彇 + /// </summary> + public List<Model.AssetsValveMain> GetBySeriesIds(List<long> SeriesIds) + { + if (SeriesIds == null || SeriesIds.Count < 1) { return default; } var all = GetAll(); - return all.Where(x => x.SeriesID == id).ToList(); + return all.Where(x => SeriesIds.Contains(x.SeriesID)).OrderBy(x => x.SortCode).ToList(); } /// <summary> /// 鑾峰彇鏈�澶ф帓搴忕爜 /// </summary> - public int GetMaxSortCode() + public int GetMaxSortCode(long SeriesID) { - var all = GetAll(); + var all = GetBySeriesID(SeriesID); if (all == null || all.Count < 1) { return 0; @@ -149,6 +160,8 @@ } #endregion Query + + #region Insert @@ -192,6 +205,8 @@ } #endregion Insert + + #region Update @@ -333,6 +348,49 @@ #endregion Update + + + #region Exist + + /// <summary> + /// 鍒ゆ柇 TagName 鏄惁瀛樺湪 + /// </summary> + public bool IsExistTagName(string TagName) + { + if (string.IsNullOrEmpty(TagName)) + { + return false; + } + var all = GetAll(); + return all.Exists(x => x.TagName == TagName); + } + + /// <summary> + /// 鍒ゆ柇 TagName 鏄惁瀛樺湪 ExceptID + /// </summary> + public bool IsExistTagNameExceptID(string TagName, long ExceptID) + { + if (string.IsNullOrEmpty(TagName)) + { + return false; + } + var all = GetAll(); + return all.Exists(x => x.TagName == TagName && x.ID != ExceptID); + } + + /// <summary> + /// 閫氳繃 SeriesID 鍒ゆ柇鏄惁瀛樺湪 + /// </summary> + public bool IsExistBySeriesID(long SeriesID) + { + var all = GetAll(); + return all.Exists(x => x.SeriesID == SeriesID); + } + + #endregion Exist + + + #region Delete /// <summary> -- Gitblit v1.9.3