From b826e3716742abba49ab2a851b943ea8328db66e Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期二, 24 十二月 2024 11:19:45 +0800
Subject: [PATCH] 水池匹配修改

---
 Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowMain.cs                                                      |    6 
 Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/ElbowMainDto.cs                                                             |    4 
 Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/AddElbowSeriesInput.cs                                                    |    5 
 Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowFactorDto.cs                                        |   18 +
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/04-pipe/01-pipesinglematching/PipeSingleMatchingCtrl.Designer.cs |   29 -
 Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/UpdateElbowSeriesInput.cs                                                 |    5 
 Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowSeries.cs                                       |    2 
 Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowFactor.cs                                       |   11 
 BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs                               |    2 
 Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowFactorInput.cs                                   |   22 
 Service/HStation.Service.Assets.Core/04-dal/01-interface/20-exchanger/IAssetsExchangerMain.cs                                  |    2 
 Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowFactor.cs                                                    |    4 
 Service/HStation.Service.Assets.Core/05-service/03-Elbow/02-ElbowMain/ElbowManage_Instance.cs                                  |   10 
 Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowSeries.cs                                            |    2 
 Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowFactor.cs                                            |    2 
 Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowFactorInput.cs                                |   12 
 Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/Cache/AssetsElbowFactorCacheHelper.cs                  |    4 
 BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowCoefficient.cs                                                 |  111 +++----
 BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowMain_Instance.cs                             |   36 +-
 Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowSeries.cs                                        |    2 
 BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowSeries.cs                                                      |  154 +++++++++--
 Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowFactor.cs                                        |    2 
 /dev/null                                                                                                                      |   11 
 Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/ElbowSeriesDto.cs                                                         |    6 
 Service/HStation.Service.Assets.Core/05-service/03-Elbow/01-ElbowSeries/ElbowSeries.cs                                         |  148 ++++++++++-
 Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor_Instance.cs                          |    2 
 BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowSeries.cs                                                |    2 
 Service/HStation.Service.Assets.Core/01-entity/03-Elbow/AssetsElbowFactor.cs                                                   |    5 
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs                                  |   16 
 BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowFactor.cs                                                |   12 
 Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/AddElbowMianInput.cs                                                        |    2 
 Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor.cs                                   |   98 +++++--
 32 files changed, 515 insertions(+), 232 deletions(-)

diff --git a/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowCoefficient.cs b/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowCoefficient.cs
deleted file mode 100644
index 469b935..0000000
--- a/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowCoefficient.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-锘縰sing HStation.Dto;
-using Yw.CAL;
-
-namespace HStation.CAL
-{
-    /// <summary>
-    /// 鎶ヨ绛夌骇
-    /// </summary>
-    public interface IAssetsElbowCoefficient : IBaseCAL<AddAssetsElbowCoefficientInput, UpdateAssetsElbowCoefficientInput, AssetsElbowCoefficientDto>
-    {
-    }
-}
\ No newline at end of file
diff --git a/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowFactor.cs b/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowFactor.cs
new file mode 100644
index 0000000..d4effea
--- /dev/null
+++ b/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowFactor.cs
@@ -0,0 +1,12 @@
+锘縰sing HStation.Dto;
+using Yw.CAL;
+
+namespace HStation.CAL
+{
+    /// <summary>
+    /// 鎶ヨ绛夌骇
+    /// </summary>
+    public interface IAssetsElbowFactor : IBaseCAL<AddAssetsElbowFactorInput, UpdateAssetsElbowFactorInput, AssetsElbowFactorDto>, IUpdateSorter
+    {
+    }
+}
\ No newline at end of file
diff --git a/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowSeries.cs b/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowSeries.cs
index a3a0c1f..b28cc96 100644
--- a/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowSeries.cs
+++ b/BLL/HStation.BLL.Assets.Core/01-interface/06-IElbowManage/IAssetsElbowSeries.cs
@@ -5,7 +5,7 @@
     /// <summary>
     /// 鎶ヨ绛夌骇
     /// </summary>
-    public interface IAssetsElbowSeries : IBaseCAL<AddAssetsElbowSeriesInput, UpdateAssetsElbowSeriesInput, AssetsElbowSeriesDto>, IUpdateParas, IUpdateFlags, IUpdateTagName, IUpdateSorter
+    public interface IAssetsElbowSeries : IBaseCAL<AddAssetsElbowSeriesInput, UpdateAssetsElbowSeriesInput, AssetsElbowSeriesDto>, IUpdateParas, IUpdateFlags, IUpdateTagName, IUpdateTreeSorter
     {
     }
 }
\ No newline at end of file
diff --git a/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowCoefficient.cs b/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowCoefficient.cs
index 6eef8bc..648886d 100644
--- a/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowCoefficient.cs
+++ b/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowCoefficient.cs
@@ -1,27 +1,23 @@
-锘縰sing HStation.Dto;
-using System.Collections.Generic;
-using Yw.Dto;
-
-namespace HStation.CAL.LocalClient
+锘縩amespace HStation.CAL.LocalClient
 {
     /// <summary>
-    /// 鎶ヨ绛夌骇
+    /// 鎹㈢儹鍣ㄧ郴鏁�
     /// </summary>
-    public class AssetsElbowCoefficient : IAssetsElbowCoefficient
+    public class AssetsElbowFactor : IAssetsElbowFactor
     {
-        private readonly HStation.Service.AssetsElbowCoefficient _service = new();
+        private readonly HStation.Service.AssetsElbowFactor _service = new();
 
         #region Query
 
         /// <summary>
         /// 鑾峰彇鎵�鏈�
         /// </summary>
-        public async Task<List<AssetsElbowCoefficientDto>> GetAll()
+        public async Task<List<AssetsElbowFactorDto>> GetAll()
         {
             return await Task.Factory.StartNew(() =>
             {
                 var list = _service.GetAll();
-                var vm_list = list?.Select(x => new AssetsElbowCoefficientDto(x)).ToList();
+                var vm_list = list?.Select(x => new AssetsElbowFactorDto(x)).ToList();
                 return vm_list;
             });
         }
@@ -29,40 +25,43 @@
         /// <summary>
         /// 閫氳繃 ID 鑾峰彇
         /// </summary>
-        public async Task<AssetsElbowCoefficientDto> GetByID(long ID)
+        public async Task<AssetsElbowFactorDto> GetByID(long ID)
         {
             return await Task.Factory.StartNew(() =>
             {
                 var model = _service.GetByID(ID);
-                return model == null ? null : new AssetsElbowCoefficientDto(model);
+                return model == null ? null : new AssetsElbowFactorDto(model);
             });
         }
 
         /// <summary>
         /// 閫氳繃 Ids 鑾峰彇
         /// </summary>
-        public async Task<List<AssetsElbowCoefficientDto>> GetByIds(List<long> Ids)
+        public async Task<List<AssetsElbowFactorDto>> GetByIds(List<long> Ids)
         {
             return await Task.Factory.StartNew(() =>
             {
                 var list = _service.GetByIds(Ids);
-                var vm_list = list?.Select(x => new AssetsElbowCoefficientDto(x)).ToList();
+                var vm_list = list?.Select(x => new AssetsElbowFactorDto(x)).ToList();
                 return vm_list;
             });
         }
 
         #endregion Query
 
+
+
         #region Insert
 
         /// <summary>
         /// 鎻掑叆涓�鏉�
         /// </summary>
-        public async Task<long> Insert(AddAssetsElbowCoefficientInput input)
+        public async Task<long> Insert(AddAssetsElbowFactorInput input)
         {
             return await Task.Factory.StartNew(() =>
             {
-                var model = input.Adapt<AddAssetsElbowCoefficientInput, Model.AssetsElbowFactor>();
+                var model = input.Adapt<AddAssetsElbowFactorInput, Model.AssetsElbowFactor>();
+                model.SortCode = _service.GetMaxSortCode() + 1;
                 var id = _service.Insert(model);
                 return id;
             });
@@ -71,20 +70,7 @@
         /// <summary>
         /// 鎵归噺鎻掑叆
         /// </summary>
-        public async Task<bool> Inserts(List<AddAssetsElbowCoefficientInput> inputList)
-        {
-            return await Task.Factory.StartNew(() =>
-            {
-                var list = inputList.Select(x => x.Adapt<AddAssetsElbowCoefficientInput, Model.AssetsElbowFactor>()).ToList();
-                var bol = _service.Inserts(list);
-                return bol;
-            });
-        }
-
-        /// <summary>
-        /// 澶ф壒閲忔彃鍏�
-        /// </summary>
-        public async Task<bool> BulkInserts(List<AddAssetsElbowCoefficientInput> list)
+        public async Task<bool> Inserts(List<AddAssetsElbowFactorInput> inputList)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -92,22 +78,16 @@
             });
         }
 
-        /*       /// <summary>
-               /// 鏇存柊榛樿鍊肩姸鎬�
-               /// </summary>
-               public async Task<bool> UpdateDefaultStatus(long ID, bool status)
-               {
-                   return await Task.Factory.StartNew(() =>
-                   {
-                       var model = _service.GetByID(ID);
-                       if (model == null)
-                       {
-                           throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{ID} 鏁版嵁涓嶅瓨鍦�");
-                       }
-                       var bol = _service.UpdateDefaultStatus(ID, status);
-                       return bol;
-                   });
-               }*/
+        /// <summary>
+        /// 澶ф壒閲忔彃鍏�
+        /// </summary>
+        public async Task<bool> BulkInserts(List<AddAssetsElbowFactorInput> list)
+        {
+            return await Task.Factory.StartNew(() =>
+            {
+                return false;
+            });
+        }
 
         #endregion Insert
 
@@ -116,7 +96,7 @@
         /// <summary>
         /// 鏇存柊涓�鏉�
         /// </summary>
-        public async Task<bool> Update(UpdateAssetsElbowCoefficientInput input)
+        public async Task<bool> Update(UpdateAssetsElbowFactorInput input)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -125,7 +105,6 @@
                 {
                     throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 鏁版嵁涓嶅瓨鍦�");
                 }
-
                 var rhs = new Model.AssetsElbowFactor(model);
                 input.Adapt(rhs);
                 var bol = _service.Update(rhs);
@@ -136,24 +115,18 @@
         /// <summary>
         /// 鎵归噺鏇存柊
         /// </summary>
-        public async Task<bool> Updates(List<UpdateAssetsElbowCoefficientInput> inputList)
+        public async Task<bool> Updates(List<UpdateAssetsElbowFactorInput> inputList)
         {
             return await Task.Factory.StartNew(() =>
             {
-                if (inputList == null || inputList.Count < 1)
-                {
-                    return false;
-                }
-                var list = inputList.Select(x => x.Adapt<UpdateAssetsElbowCoefficientInput, Model.AssetsElbowFactor>()).ToList();
-                var bol = _service.Updates(list);
-                return bol;
+                return false;
             });
         }
 
         /// <summary>
         /// 澶ф壒閲忔洿鏂�
         /// </summary>
-        public async Task<bool> BulkUpdates(List<UpdateAssetsElbowCoefficientInput> list)
+        public async Task<bool> BulkUpdates(List<UpdateAssetsElbowFactorInput> list)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -162,13 +135,27 @@
         }
 
         /// <summary>
-        /// 鏇存柊缂栫爜
+        /// 鏇存柊鎺掑簭鐮�
         /// </summary>
-        public async Task<bool> UpdateCode(long ID, string Code)
+        public async Task<bool> UpdateSortCode(long ID, int SortCode)
         {
             return await Task.Factory.StartNew(() =>
             {
-                return false;
+                var bol = _service.UpdateSortCode(ID, SortCode);
+                return bol;
+            });
+        }
+
+        /// <summary>
+        /// 鏇存柊鎺掑簭
+        /// </summary>
+        public async Task<bool> UpdateSorter(List<UpdateSortCodeInput> inputList)
+        {
+            return await Task.Factory.StartNew(() =>
+            {
+                var list = inputList.Select(x => x.Adapt<Yw.Model.Sorter>()).ToList();
+                var bol = _service.UpdateSorter(list);
+                return bol;
             });
         }
 
@@ -211,11 +198,11 @@
         {
             return await Task.Factory.StartNew(() =>
             {
-                var bol = _service.DeleteAll();
-                return bol;
+                return false;
             });
         }
 
         #endregion Delete
+
     }
 }
\ No newline at end of file
diff --git a/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowSeries.cs b/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowSeries.cs
index dca9ee7..5142b5c 100644
--- a/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowSeries.cs
+++ b/BLL/HStation.BLL.Assets.Core/03-localclient/06-Elbow/AssetsElbowSeries.cs
@@ -1,9 +1,7 @@
-锘縰sing Yw.Dto;
-
-namespace HStation.CAL.LocalClient
+锘縩amespace HStation.CAL.LocalClient
 {
     /// <summary>
-    /// 鎶ヨ绛夌骇
+    /// 鎹㈢儹鍣ㄧ郴鍒�
     /// </summary>
     public class AssetsElbowSeries : IAssetsElbowSeries
     {
@@ -51,6 +49,8 @@
 
         #endregion Query
 
+
+
         #region Insert
 
         /// <summary>
@@ -60,8 +60,26 @@
         {
             return await Task.Factory.StartNew(() =>
             {
+                var parentIds = new List<long>();
+                if (input.ParentID > 0)
+                {
+                    var parent = _service.GetByID(input.ParentID);
+                    if (parent == null)
+                    {
+                        throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ParentID:{input.ParentID} 鏁版嵁涓嶅瓨鍦�");
+                    }
+                    parentIds = TreeParentIdsHelper.GetChildParentIds(parent.ID, parent.ParentIds);
+                }
+                if (!string.IsNullOrEmpty(input.TagName))
+                {
+                    if (_service.IsExistTagName(input.TagName))
+                    {
+                        throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"TagName:{input.TagName} 鏍囪宸插瓨鍦�");
+                    }
+                }
                 var model = input.Adapt<AddAssetsElbowSeriesInput, Model.AssetsElbowSeries>();
-                model.SortCode = _service.GetMaxSortCode() + 1;
+                model.ParentIds = parentIds;
+                model.SortCode = _service.GetMaxSortCode(input.ParentID) + 1;
                 var id = _service.Insert(model);
                 return id;
             });
@@ -74,13 +92,7 @@
         {
             return await Task.Factory.StartNew(() =>
             {
-                var list = inputList.Select(x => x.Adapt<AddAssetsElbowSeriesInput, Model.AssetsElbowSeries>()).ToList();
-                list.ForEach(x =>
-                {
-                    x.SortCode = _service.GetMaxSortCode() + 1 + list.IndexOf(x);
-                });
-                var bol = _service.Inserts(list);
-                return bol;
+                return false;
             });
         }
 
@@ -111,7 +123,13 @@
                 {
                     throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 鏁版嵁涓嶅瓨鍦�");
                 }
-
+                if (!string.IsNullOrEmpty(input.TagName))
+                {
+                    if (_service.IsExistTagNameExceptID(input.TagName, input.ID))
+                    {
+                        throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"TagName:{input.TagName} 鏍囪宸插瓨鍦�");
+                    }
+                }
                 var rhs = new Model.AssetsElbowSeries(model);
                 input.Adapt(rhs);
                 var bol = _service.Update(rhs);
@@ -126,13 +144,7 @@
         {
             return await Task.Factory.StartNew(() =>
             {
-                if (inputList == null || inputList.Count < 1)
-                {
-                    return false;
-                }
-                var list = inputList.Select(x => x.Adapt<UpdateAssetsElbowSeriesInput, Model.AssetsElbowSeries>()).ToList();
-                var bol = _service.Updates(list);
-                return bol;
+                return false;
             });
         }
 
@@ -140,17 +152,6 @@
         /// 澶ф壒閲忔洿鏂�
         /// </summary>
         public async Task<bool> BulkUpdates(List<UpdateAssetsElbowSeriesInput> list)
-        {
-            return await Task.Factory.StartNew(() =>
-            {
-                return false;
-            });
-        }
-
-        /// <summary>
-        /// 鏇存柊缂栫爜
-        /// </summary>
-        public async Task<bool> UpdateCode(long ID, string Code)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -179,6 +180,61 @@
             {
                 var list = inputList.Select(x => x.Adapt<Yw.Model.Sorter>()).ToList();
                 var bol = _service.UpdateSorter(list);
+                return bol;
+            });
+        }
+
+        /// <summary>
+        /// 鏇存柊鏍戞帓搴忕爜
+        /// </summary>
+        public async Task<bool> UpdateTreeSortCode(long ID, long ParentID, int SortCode)
+        {
+            return await Task.Factory.StartNew(() =>
+            {
+                var model = _service.GetByID(ID);
+                if (model == null)
+                {
+                    throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{ID} 鏁版嵁涓嶅瓨鍦�");
+                }
+                var parentIds = new List<long>();
+                if (ParentID > 0)
+                {
+                    var parent = _service.GetByID(ParentID);
+                    if (parent == null)
+                    {
+                        throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ParentID:{ParentID} 鏁版嵁涓嶅瓨鍦�");
+                    }
+                    parentIds = TreeParentIdsHelper.GetChildParentIds(parent.ID, parent.ParentIds);
+                }
+                var sorterList = new List<Yw.Model.TreeSorter>()
+                {
+                    new Yw.Model.TreeSorter()
+                    {
+                        ID=ID,
+                        ParentIds=parentIds,
+                        SortCode=SortCode
+                    }
+                };
+                if (TreeParentIdsHelper.ToString(parentIds) != TreeParentIdsHelper.ToString(model.ParentIds))
+                {
+                    var children = _service.GetChildrenByID(ID);
+                    if (children != null && children.Count > 0)
+                    {
+                        foreach (var item in children)
+                        {
+                            var itemParent = sorterList.Find(x => x.ID == item.ParentIds.Last());
+                            var itemParentIds = TreeParentIdsHelper.GetChildParentIds(itemParent.ID, itemParent.ParentIds);
+                            var sorter = new Yw.Model.TreeSorter()
+                            {
+                                ID = item.ID,
+                                ParentIds = itemParentIds,
+                                SortCode = item.SortCode
+                            };
+                            sorterList.Add(sorter);
+                        }
+                    }
+                }
+                var bol = _service.UpdateTreeSorter(sorterList);
                 return bol;
             });
         }
@@ -214,12 +270,47 @@
         {
             return await Task.Factory.StartNew(() =>
             {
+                if (!string.IsNullOrEmpty(TagName))
+                {
+                    if (_service.IsExistTagNameExceptID(TagName, ID))
+                    {
+                        throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"TagName:{TagName}", "鏍囪鍚嶇О宸插瓨鍦�");
+                    }
+                }
                 var bol = _service.UpdateTagName(ID, TagName);
                 return bol;
             });
         }
 
         #endregion Update
+
+        #region Exist
+
+        /// <summary>
+        ///
+        /// </summary>
+        public async Task<bool> IsExistTagName(string TagName)
+        {
+            return await Task.Factory.StartNew(() =>
+            {
+                var bol = _service.IsExistTagName(TagName);
+                return bol;
+            });
+        }
+
+        /// <summary>
+        ///
+        /// </summary>
+        public async Task<bool> IsExistTagNameExceptID(string TagName, long ExceptID)
+        {
+            return await Task.Factory.StartNew(() =>
+            {
+                var bol = _service.IsExistTagNameExceptID(TagName, ExceptID);
+                return bol;
+            });
+        }
+
+        #endregion Exist
 
         #region Delete
 
@@ -263,5 +354,6 @@
         }
 
         #endregion Delete
+
     }
 }
\ No newline at end of file
diff --git a/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs b/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs
index cb5edb3..d53d84a 100644
--- a/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs
+++ b/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs
@@ -11,7 +11,7 @@
     /// </summary>
     public partial class AssetsElbowCoefficient
     {
-        private readonly HStation.CAL.IAssetsElbowCoefficient _cal = CALCreateHelper.CreateCAL<HStation.CAL.IAssetsElbowCoefficient>();
+        private readonly HStation.CAL.IAssetsElbowFactor _cal = CALCreateHelper.CreateCAL<HStation.CAL.IAssetsElbowFactor>();
 
         #region Query
 
diff --git a/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowMain_Instance.cs b/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowMain_Instance.cs
index 3d88a1c..66001f5 100644
--- a/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowMain_Instance.cs
+++ b/BLL/HStation.BLL.Assets.Core/04-bll/06-Elbow/03-AssetsElbowCoefficient/AssetsElbowMain_Instance.cs
@@ -6,80 +6,80 @@
     public partial class AssetsElbowCoefficient
     {
         //dto to vmo
-        internal static HStation.Vmo.AssetsElbowCoefficientVmo Dto2Vmo(AssetsElbowCoefficientDto dto)
+        internal static HStation.Vmo.AssetsElbowCoefficientVmo Dto2Vmo(AssetsElbowFactorDto dto)
         {
             if (dto == null)
             {
                 return default;
             }
-            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsElbowCoefficientDto, HStation.Vmo.AssetsElbowCoefficientVmo>()
+            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Dto.Assets.AssetsElbowFactorDto, HStation.Vmo.AssetsElbowCoefficientVmo>()
             ).CreateMapper();
-            var vmo = mapper.Map<AssetsElbowCoefficientDto, HStation.Vmo.AssetsElbowCoefficientVmo>(dto);
+            var vmo = mapper.Map<AssetsElbowFactorDto, HStation.Vmo.AssetsElbowCoefficientVmo>(dto);
             return vmo;
         }
 
         //dto to vmos
-        internal static List<HStation.Vmo.AssetsElbowCoefficientVmo> Dto2Vmos(List<AssetsElbowCoefficientDto> dtos)
+        internal static List<HStation.Vmo.AssetsElbowCoefficientVmo> Dto2Vmos(List<AssetsElbowFactorDto> dtos)
         {
             if (dtos == null || dtos.Count < 1)
             {
                 return default;
             }
-            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsElbowCoefficientDto, HStation.Vmo.AssetsElbowCoefficientVmo>()
+            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsElbowFactorDto, HStation.Vmo.AssetsElbowCoefficientVmo>()
             ).CreateMapper();
-            var vmos = mapper.Map<List<AssetsElbowCoefficientDto>, List<HStation.Vmo.AssetsElbowCoefficientVmo>>(dtos);
+            var vmos = mapper.Map<List<AssetsElbowFactorDto>, List<HStation.Vmo.AssetsElbowCoefficientVmo>>(dtos);
             return vmos;
         }
 
         //vmo to add dto
-        internal static HStation.Dto.Assets.AddAssetsElbowCoefficientInput Vmo2AddDto(HStation.Vmo.AssetsElbowCoefficientVmo vmo)
+        internal static HStation.Dto.Assets.AddAssetsElbowFactorInput Vmo2AddDto(HStation.Vmo.AssetsElbowCoefficientVmo vmo)
         {
             if (vmo == null)
             {
                 return default;
             }
-            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.AddAssetsElbowCoefficientInput>()
+            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.AddAssetsElbowFactorInput>()
             ).CreateMapper();
-            var dto = mapper.Map<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.AddAssetsElbowCoefficientInput>(vmo);
+            var dto = mapper.Map<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.AddAssetsElbowFactorInput>(vmo);
             return dto;
         }
 
         //vmo to add dtos
-        internal static List<HStation.Dto.Assets.AddAssetsElbowCoefficientInput> Vmo2AddDtos(List<HStation.Vmo.AssetsElbowCoefficientVmo> vmoList)
+        internal static List<HStation.Dto.Assets.AddAssetsElbowFactorInput> Vmo2AddDtos(List<HStation.Vmo.AssetsElbowCoefficientVmo> vmoList)
         {
             if (vmoList == null || vmoList.Count < 1)
             {
                 return default;
             }
-            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.AddAssetsElbowCoefficientInput>()
+            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.AddAssetsElbowFactorInput>()
             ).CreateMapper();
-            var dtoList = mapper.Map<List<HStation.Vmo.AssetsElbowCoefficientVmo>, List<HStation.Dto.Assets.AddAssetsElbowCoefficientInput>>(vmoList);
+            var dtoList = mapper.Map<List<HStation.Vmo.AssetsElbowCoefficientVmo>, List<HStation.Dto.Assets.AddAssetsElbowFactorInput>>(vmoList);
             return dtoList;
         }
 
         //vmo to update dto
-        internal static HStation.Dto.Assets.UpdateAssetsElbowCoefficientInput Vmo2UpdateDto(HStation.Vmo.AssetsElbowCoefficientVmo vmo)
+        internal static HStation.Dto.Assets.UpdateAssetsElbowFactorInput Vmo2UpdateDto(HStation.Vmo.AssetsElbowCoefficientVmo vmo)
         {
             if (vmo == null)
             {
                 return default;
             }
-            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.UpdateAssetsElbowCoefficientInput>()
+            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.UpdateAssetsElbowFactorInput>()
             ).CreateMapper();
-            var dto = mapper.Map<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.UpdateAssetsElbowCoefficientInput>(vmo);
+            var dto = mapper.Map<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.UpdateAssetsElbowFactorInput>(vmo);
             return dto;
         }
 
         //vmo to update dtos
-        internal static List<HStation.Dto.Assets.UpdateAssetsElbowCoefficientInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsElbowCoefficientVmo> vmoList)
+        internal static List<HStation.Dto.Assets.UpdateAssetsElbowFactorInput> Vmo2UpdateDtos(List<HStation.Vmo.AssetsElbowCoefficientVmo> vmoList)
         {
             if (vmoList == null || vmoList.Count < 1)
             {
                 return default;
             }
-            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.UpdateAssetsElbowCoefficientInput>()
+            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<HStation.Vmo.AssetsElbowCoefficientVmo, HStation.Dto.Assets.UpdateAssetsElbowFactorInput>()
             ).CreateMapper();
-            var dtoList = mapper.Map<List<HStation.Vmo.AssetsElbowCoefficientVmo>, List<HStation.Dto.Assets.UpdateAssetsElbowCoefficientInput>>(vmoList);
+            var dtoList = mapper.Map<List<HStation.Vmo.AssetsElbowCoefficientVmo>, List<HStation.Dto.Assets.UpdateAssetsElbowFactorInput>>(vmoList);
             return dtoList;
         }
     }
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/AddElbowSeriesInput.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/AddElbowSeriesInput.cs
index 3bc4e85..f0a55e9 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/AddElbowSeriesInput.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/AddElbowSeriesInput.cs
@@ -8,9 +8,10 @@
         public string Name { get; set; }
 
         /// <summary>
-        /// 鐖剁骇ID
+        /// 鐖剁骇id
         /// </summary>
-        public List<long> ParentIds { get; set; }
+        [Required]
+        public long ParentID { get; set; }
 
         /// <summary>
         /// 鎵�灞炵被鍒獻D
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/ElbowSeriesDto.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/ElbowSeriesDto.cs
index d564469..0af5705 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/ElbowSeriesDto.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/ElbowSeriesDto.cs
@@ -9,7 +9,7 @@
         public AssetsElbowSeriesDto(Model.AssetsElbowSeries rhs)
         {
             this.ID = rhs.ID;
-            this.ParentIds = rhs.ParentIds;
+            this.ParentID = rhs.ParentIds.LastOrDefault();
             this.CatalogID = rhs.CatalogID;
             this.Name = rhs.Name;
             this.Paras = rhs.Paras;
@@ -30,9 +30,9 @@
         public string Name { get; set; }
 
         /// <summary>
-        /// 鐖剁骇ID
+        /// 鐖剁骇id
         /// </summary>
-        public List<long> ParentIds { get; set; }
+        public long ParentID { get; set; }
 
         /// <summary>
         /// 鎵�灞炵被鍒獻D
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/UpdateElbowSeriesInput.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/UpdateElbowSeriesInput.cs
index bfb1bb1..514c500 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/UpdateElbowSeriesInput.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/01-ElbowSeries/UpdateElbowSeriesInput.cs
@@ -16,9 +16,10 @@
         public string Name { get; set; }
 
         /// <summary>
-        /// 鐖剁骇ID
+        /// 鐖剁骇id
         /// </summary>
-        public List<long> ParentIds { get; set; }
+        [Required]
+        public long ParentID { get; set; }
 
         /// <summary>
         /// 鎵�灞炵被鍒獻D
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/AddElbowMianInput.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/AddElbowMianInput.cs
index eeef769..85cd83c 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/AddElbowMianInput.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/AddElbowMianInput.cs
@@ -45,7 +45,7 @@
         /// <summary>
         /// 璇嗗埆鍏抽敭瀛�
         /// </summary>
-        public List<string> KeyWord { get; set; }
+        public List<string> KeyWords { get; set; }
 
         /// <summary>
         /// 鍙傛暟
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/ElbowMainDto.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/ElbowMainDto.cs
index 63241d4..e35455e 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/ElbowMainDto.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/02-ElbowMain/ElbowMainDto.cs
@@ -15,7 +15,7 @@
             this.Caliber = rhs.Caliber;
             this.Name = rhs.Name;
             this.MinorLoss = rhs.MinorLoss;
-            this.KeyWord = rhs.KeyWord;
+            this.KeyWords = rhs.KeyWords;
             this.Angle = rhs.Angle;
             this.Flags = rhs.Flags;
             this.Paras = rhs.Paras;
@@ -65,7 +65,7 @@
         /// <summary>
         /// 璇嗗埆鍏抽敭瀛�
         /// </summary>
-        public List<string> KeyWord { get; set; }
+        public List<string> KeyWords { get; set; }
 
         /// <summary>
         /// 鍙傛暟
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowCoefficientInput.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowCoefficientInput.cs
deleted file mode 100644
index 52453a8..0000000
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowCoefficientInput.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-锘縩amespace HStation.Dto.Assets
-{
-    public class AddAssetsElbowCoefficientInput
-    {
-        /// <summary>
-        /// 鍚嶇О
-        /// </summary>
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 鍙e緞
-        /// </summary>
-        public double? Caliber { get; set; }
-
-        /// <summary>
-        /// 鏉愭枡
-        /// </summary>
-        public string Material { get; set; }
-
-        /// <summary>
-        /// 灞�闃荤郴鏁�
-        /// </summary>
-        public double MinorLoss { get; set; }
-    }
-}
\ No newline at end of file
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowCoefficientInput.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowFactorInput.cs
similarity index 65%
copy from Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowCoefficientInput.cs
copy to Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowFactorInput.cs
index 0fa73e5..0eeaf6b 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowCoefficientInput.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AddAssetsElbowFactorInput.cs
@@ -1,15 +1,7 @@
-锘縰sing System.ComponentModel.DataAnnotations;
-
-namespace HStation.Dto.Assets
+锘縩amespace HStation.Dto.Assets
 {
-    public class UpdateAssetsElbowCoefficientInput
+    public class AddAssetsElbowFactorInput
     {
-        /// <summary>
-        /// id
-        /// </summary>
-        [Required, Range(1, long.MaxValue, ErrorMessage = "ID 蹇呴』澶т簬0")]
-        public long ID { get; set; }
-
         /// <summary>
         /// 鍚嶇О
         /// </summary>
@@ -29,5 +21,15 @@
         /// 灞�闃荤郴鏁�
         /// </summary>
         public double MinorLoss { get; set; }
+
+        /// <summary>
+        /// 鎺掑簭鐮�
+        /// </summary>
+        public int SortCode { get; set; }
+
+        /// <summary>
+        /// 璇存槑
+        /// </summary>
+        public string Description { get; set; }
     }
 }
\ No newline at end of file
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficientDto.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowFactorDto.cs
similarity index 64%
rename from Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficientDto.cs
rename to Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowFactorDto.cs
index c9abc78..22c1694 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficientDto.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/AssetsElbowFactorDto.cs
@@ -1,18 +1,20 @@
 锘縩amespace HStation.Dto.Assets
 {
-    public class AssetsElbowCoefficientDto
+    public class AssetsElbowFactorDto
     {
-        public AssetsElbowCoefficientDto()
+        public AssetsElbowFactorDto()
         {
         }
 
-        public AssetsElbowCoefficientDto(Model.AssetsElbowFactor rhs)
+        public AssetsElbowFactorDto(Model.AssetsElbowFactor rhs)
         {
             this.ID = rhs.ID;
             this.Name = rhs.Name;
             this.Material = rhs.Material;
             this.Caliber = rhs.Caliber;
             this.MinorLoss = rhs.MinorLoss;
+            this.SortCode = rhs.SortCode;
+            this.Description = rhs.Description;
         }
 
         /// <summary>
@@ -39,5 +41,15 @@
         /// 灞�闃荤郴鏁�
         /// </summary>
         public double MinorLoss { get; set; }
+
+        /// <summary>
+        /// 鎺掑簭鐮�
+        /// </summary>
+        public int SortCode { get; set; }
+
+        /// <summary>
+        /// 璇存槑
+        /// </summary>
+        public string Description { get; set; }
     }
 }
\ No newline at end of file
diff --git a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowCoefficientInput.cs b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowFactorInput.cs
similarity index 72%
rename from Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowCoefficientInput.cs
rename to Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowFactorInput.cs
index 0fa73e5..c55e15d 100644
--- a/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowCoefficientInput.cs
+++ b/Dto/HStation.Dto.Assets.Core/05-Elbow/03-AssetsElbowCoefficient/UpdateAssetsElbowFactorInput.cs
@@ -2,7 +2,7 @@
 
 namespace HStation.Dto.Assets
 {
-    public class UpdateAssetsElbowCoefficientInput
+    public class UpdateAssetsElbowFactorInput
     {
         /// <summary>
         /// id
@@ -29,5 +29,15 @@
         /// 灞�闃荤郴鏁�
         /// </summary>
         public double MinorLoss { get; set; }
+
+        /// <summary>
+        /// 鎺掑簭鐮�
+        /// </summary>
+        public int SortCode { get; set; }
+
+        /// <summary>
+        /// 璇存槑
+        /// </summary>
+        public string Description { get; set; }
     }
 }
\ No newline at end of file
diff --git a/Service/HStation.Service.Assets.Core/01-entity/03-Elbow/AssetsElbowFactor.cs b/Service/HStation.Service.Assets.Core/01-entity/03-Elbow/AssetsElbowFactor.cs
index 94ab9b0..b7e4850 100644
--- a/Service/HStation.Service.Assets.Core/01-entity/03-Elbow/AssetsElbowFactor.cs
+++ b/Service/HStation.Service.Assets.Core/01-entity/03-Elbow/AssetsElbowFactor.cs
@@ -22,11 +22,14 @@
             this.Caliber = rhs.Caliber;
             this.Material = rhs.Material;
             this.MinorLoss = rhs.MinorLoss;
+            this.SortCode = rhs.SortCode;
+            this.Description = rhs.Description;
         }
 
         /// <summary>
         /// 鍚嶇О
         /// </summary>
+        [SugarColumn(Length = 50, IsNullable = true)]
         public string Name { get; set; }
 
         /// <summary>
@@ -37,6 +40,8 @@
         /// <summary>
         /// 鏉愭枡
         /// </summary>
+
+        [SugarColumn(Length = 100, IsNullable = true)]
         public string Material { get; set; }
 
         /// <summary>
diff --git a/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowFactor.cs b/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowFactor.cs
index 97bc07d..50f8773 100644
--- a/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowFactor.cs
+++ b/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowFactor.cs
@@ -22,6 +22,8 @@
             this.Caliber = rhs.Caliber;
             this.Material = rhs.Material;
             this.MinorLoss = rhs.MinorLoss;
+            this.SortCode = rhs.SortCode;
+            this.Description = rhs.Description;
         }
 
         public void Reset(AssetsElbowFactor rhs)
@@ -31,6 +33,8 @@
             this.Caliber = rhs.Caliber;
             this.Material = rhs.Material;
             this.MinorLoss = rhs.MinorLoss;
+            this.SortCode = rhs.SortCode;
+            this.Description = rhs.Description;
         }
 
         /// <summary>
diff --git a/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowMain.cs b/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowMain.cs
index 3400050..899b8fa 100644
--- a/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowMain.cs
+++ b/Service/HStation.Service.Assets.Core/02-model/03-Elbow/AssetsElbowMain.cs
@@ -24,7 +24,7 @@
             this.Angle = rhs.Angle;
             this.MinorLoss = rhs.MinorLoss;
             this.ElbowType = rhs.ElbowType;
-            this.KeyWord = rhs.KeyWord;
+            this.KeyWords = rhs.KeyWords;
             this.Paras = rhs.Paras == null ? null : new Dictionary<string, string>(rhs.Paras);
             this.Flags = rhs.Flags?.ToList();
             this.TagName = rhs.TagName;
@@ -42,7 +42,7 @@
             this.Angle = rhs.Angle;
             this.MinorLoss = rhs.MinorLoss;
             this.ElbowType = rhs.ElbowType;
-            this.KeyWord = rhs.KeyWord;
+            this.KeyWords = rhs.KeyWords;
             this.Paras = rhs.Paras == null ? null : new Dictionary<string, string>(rhs.Paras);
             this.Flags = rhs.Flags?.ToList();
             this.TagName = rhs.TagName;
@@ -103,7 +103,7 @@
         /// <summary>
         /// 璇嗗埆鍏抽敭瀛�
         /// </summary>
-        public List<string> KeyWord { get; set; }
+        public List<string> KeyWords { get; set; }
 
         /// <summary>
         /// 鎺掑簭鐮�
diff --git a/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowCoefficient.cs b/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowCoefficient.cs
deleted file mode 100644
index 7abdf6e..0000000
--- a/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowCoefficient.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-锘縰sing Yw.DAL;
-
-namespace HStation.DAL
-{
-    /// <summary>
-    ///
-    /// </summary>
-    public interface IAssetsElbowCoefficient : IBaseDAL<Entity.AssetsElbowFactor>
-    {
-    }
-}
\ No newline at end of file
diff --git a/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowFactor.cs b/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowFactor.cs
new file mode 100644
index 0000000..e0cd81f
--- /dev/null
+++ b/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowFactor.cs
@@ -0,0 +1,11 @@
+锘縰sing Yw.DAL;
+
+namespace HStation.DAL
+{
+    /// <summary>
+    ///
+    /// </summary>
+    public interface IAssetsElbowFactor : IBaseDAL<Entity.AssetsElbowFactor>, IUpdateSorter
+    {
+    }
+}
\ No newline at end of file
diff --git a/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowSeries.cs b/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowSeries.cs
index 7e3476b..bf7eea5 100644
--- a/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowSeries.cs
+++ b/Service/HStation.Service.Assets.Core/04-dal/01-interface/03-IElbow/IAssetsElbowSeries.cs
@@ -5,7 +5,7 @@
     /// <summary>
     ///
     /// </summary>
-    public interface IAssetsElbowSeries : IBaseDAL<Entity.AssetsElbowSeries>, IUpdateParas, IUpdateFlags, IUpdateTagName, IUpdateSorter
+    public interface IAssetsElbowSeries : IBaseDAL<Entity.AssetsElbowSeries>, IUpdateParas, IUpdateFlags, IUpdateTagName, IUpdateTreeSorter
     {
     }
 }
\ No newline at end of file
diff --git a/Service/HStation.Service.Assets.Core/04-dal/01-interface/20-exchanger/IAssetsExchangerMain.cs b/Service/HStation.Service.Assets.Core/04-dal/01-interface/20-exchanger/IAssetsExchangerMain.cs
index dd71fa0..e2dd8f0 100644
--- a/Service/HStation.Service.Assets.Core/04-dal/01-interface/20-exchanger/IAssetsExchangerMain.cs
+++ b/Service/HStation.Service.Assets.Core/04-dal/01-interface/20-exchanger/IAssetsExchangerMain.cs
@@ -8,7 +8,7 @@
     public interface IAssetsExchangerMain : IBaseDAL<Entity.AssetsExchangerMain>, IUpdateParas, IUpdateFlags, IUpdateTagName, IUpdateSorter
     {
         /// <summary>
-        /// 
+        ///
         /// </summary>
         List<Entity.AssetsExchangerMain> GetBySeriesID(long SeriesID);
     }
diff --git a/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsFourlinkCoefficient.cs b/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowFactor.cs
similarity index 75%
rename from Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsFourlinkCoefficient.cs
rename to Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowFactor.cs
index 6cda980..c91c730 100644
--- a/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsFourlinkCoefficient.cs
+++ b/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowFactor.cs
@@ -5,7 +5,7 @@
     /// <summary>
     ///
     /// </summary>
-    public partial class AssetsElbowCoefficient : BaseDAL<Entity.AssetsElbowFactor>, IAssetsElbowCoefficient
+    public partial class AssetsElbowFactor : BaseDAL_Sorter<Entity.AssetsElbowFactor>, IAssetsElbowFactor
     {
         /// <summary>
         ///
diff --git a/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowSeries.cs b/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowSeries.cs
index b92b124..487be56 100644
--- a/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowSeries.cs
+++ b/Service/HStation.Service.Assets.Core/04-dal/02-postgresql/06-Elbow/AssetsElbowSeries.cs
@@ -5,7 +5,7 @@
     /// <summary>
     ///
     /// </summary>
-    public partial class AssetsElbowSeries : BaseDAL_Paras_Flags_TagName_Sorter<Entity.AssetsElbowSeries>, IAssetsElbowSeries
+    public partial class AssetsElbowSeries : BaseDAL_Paras_Flags_TagName_TreeSorter<Entity.AssetsElbowSeries>, IAssetsElbowSeries
     {
         /// <summary>
         ///
diff --git a/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowCoefficient.cs b/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowFactor.cs
similarity index 74%
rename from Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowCoefficient.cs
rename to Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowFactor.cs
index dc13ee1..b0fe468 100644
--- a/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowCoefficient.cs
+++ b/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowFactor.cs
@@ -5,7 +5,7 @@
     /// <summary>
     ///
     /// </summary>
-    public partial class AssetsElbowCoefficient : BaseDAL<Entity.AssetsElbowFactor>, IAssetsElbowCoefficient
+    public partial class AssetsElbowFactor : BaseDAL_Sorter<Entity.AssetsElbowFactor>, IAssetsElbowFactor
     {
         /// <summary>
         ///
diff --git a/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowSeries.cs b/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowSeries.cs
index 01d6e90..814d52f 100644
--- a/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowSeries.cs
+++ b/Service/HStation.Service.Assets.Core/04-dal/03-sqlite/06-Elbow/AssetsElbowSeries.cs
@@ -5,7 +5,7 @@
     /// <summary>
     ///
     /// </summary>
-    public partial class AssetsElbowSeries : BaseDAL_Paras_Flags_TagName_Sorter<Entity.AssetsElbowSeries>, IAssetsElbowSeries
+    public partial class AssetsElbowSeries : BaseDAL_Paras_Flags_TagName_TreeSorter<Entity.AssetsElbowSeries>, IAssetsElbowSeries
     {
         /// <summary>
         ///
diff --git a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/01-ElbowSeries/ElbowSeries.cs b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/01-ElbowSeries/ElbowSeries.cs
index cf68340..52d0368 100644
--- a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/01-ElbowSeries/ElbowSeries.cs
+++ b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/01-ElbowSeries/ElbowSeries.cs
@@ -80,6 +80,8 @@
 
         #endregion Cache
 
+
+
         #region Query
 
         /// <summary>
@@ -88,7 +90,7 @@
         public List<Model.AssetsElbowSeries> GetAll()
         {
             var all = GetCache();
-            return all.OrderBy(x => x.SortCode).ToList();
+            return all.OrderBy(x => x.ParentIds.Count).ThenBy(x => x.SortCode).ToList();
         }
 
         /// <summary>
@@ -110,23 +112,100 @@
                 return default;
             }
             var all = GetAll();
-            return all.Where(x => Ids.Contains(x.ID)).OrderBy(x => x.SortCode).ToList();
+            return all.Where(x => Ids.Contains(x.ID)).OrderBy(x => x.ParentIds.Count).ThenBy(x => x.SortCode).ToList();
+        }
+
+        /// <summary>
+        /// 閫氳繃 ID 鑾峰彇瀛愮骇鍙婅嚜韬�
+        /// </summary>
+        public List<Model.AssetsElbowSeries> GetChildAndSelfByID(long ID)
+        {
+            var all = GetAll();
+            var list = all.Where(x => x.ID == ID || x.ParentIds.Contains(ID)).OrderBy(x => x.ParentIds.Count).ThenBy(x => x.SortCode).ToList();
+            return list;
+        }
+
+        /// <summary>
+        /// 閫氳繃 ID 鑾峰彇瀛愮骇
+        /// </summary>
+        public List<Model.AssetsElbowSeries> GetChildrenByID(long ID)
+        {
+            var all = GetAll();
+            var list = all.Where(x => x.ParentIds.Contains(ID)).OrderBy(x => x.ParentIds.Count).ThenBy(x => x.SortCode).ToList();
+            return list;
+        }
+
+        /// <summary>
+        /// 閫氳繃 ID 鑾峰彇鐖剁骇
+        /// </summary>
+        public List<Model.AssetsElbowSeries> GetParentByID(long ID)
+        {
+            var all = GetAll();
+            var model = all.Find(x => x.ID == ID);
+            if (model == null)
+            {
+                return default;
+            }
+            return all.Where(x => model.ParentIds.Contains(x.ID)).OrderBy(x => x.ParentIds.Count).ThenBy(x => x.SortCode).ToList();
+        }
+
+        /// <summary>
+        /// 閫氳繃 ID 鑾峰彇鐖剁骇鍙婅嚜韬�
+        /// </summary>
+        public List<Model.AssetsElbowSeries> GetParentAndSelfByID(long ID)
+        {
+            var all = GetAll();
+            var model = all.Find(x => x.ID == ID);
+            if (model == null)
+            {
+                return default;
+            }
+            return all.Where(x => model.ParentIds.Contains(x.ID) || x.ID == ID).OrderBy(x => x.ParentIds.Count).ThenBy(x => x.SortCode).ToList();
+        }
+
+        /// <summary>
+        /// 閫氳繃 ParentID 鑾峰彇
+        /// </summary>
+        public List<Model.AssetsElbowSeries> GetByParentID(long ParentID)
+        {
+            var all = GetAll();
+            return all.Where(x => x.ParentIds.LastOrDefault() == ParentID).OrderBy(x => x.SortCode).ToList();
+        }
+
+        /// <summary>
+        /// 鏄惁鍖呭惈瀛愰」
+        /// </summary>
+        public bool HasChildren(long ID)
+        {
+            var all = GetAll();
+            return all.Exists(x => x.ParentIds.Contains(ID));
         }
 
         /// <summary>
         /// 鑾峰彇鏈�澶ф帓搴忕爜
         /// </summary>
-        public int GetMaxSortCode()
+        public int GetMaxSortCode(long ParentID)
         {
-            var all = GetAll();
-            if (all == null || all.Count < 1)
+            List<Model.AssetsElbowSeries> list = null;
+            if (ParentID < 1)
+            {
+                list = GetAll();
+                list = list?.Where(x => x.ParentIds.Count < 1).ToList();
+            }
+            else
+            {
+                list = GetByParentID(ParentID);
+            }
+            if (list == null || list.Count < 1)
             {
                 return 0;
             }
-            return all.Max(x => x.SortCode);
+            return list.Max(x => x.SortCode);
         }
 
         #endregion Query
+
+
 
         #region Insert
 
@@ -170,6 +249,8 @@
         }
 
         #endregion Insert
+
+
 
         #region Update
 
@@ -256,6 +337,46 @@
         }
 
         /// <summary>
+        /// 鏇存柊鏍戞帓搴忕爜
+        /// </summary>
+        public bool UpdateTreeSortCode(long ID, List<long> ParentIds, int SortCode)
+        {
+            if (ID < 1)
+            {
+                return false;
+            }
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowSeries>();
+            var bol = dal.UpdateTreeSortCode(ID, TreeParentIdsHelper.ToString(ParentIds), SortCode);
+            if (bol)
+            {
+                UpdateCache(ID);
+            }
+            return bol;
+        }
+
+        /// <summary>
+        /// 鏇存柊鏍戞帓搴�
+        /// </summary>
+        public bool UpdateTreeSorter(List<Yw.Model.TreeSorter> sorters)
+        {
+            if (sorters == null || sorters.Count < 1)
+            {
+                return false;
+            }
+            if (sorters.Exists(x => x.ID < 1))
+            {
+                return false;
+            }
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowSeries>();
+            var bol = dal.UpdateTreeSorter(sorters.ToEntityList());
+            if (bol)
+            {
+                UpdateCache(sorters.Select(x => x.ID).ToList());
+            }
+            return bol;
+        }
+
+        /// <summary>
         /// 鏇存柊 Paras
         /// </summary>
         public bool UpdateParas(long ID, Dictionary<string, string> Paras)
@@ -311,6 +432,8 @@
 
         #endregion Update
 
+
+
         #region Exist
 
         /// <summary>
@@ -339,16 +462,9 @@
             return all.Exists(x => x.TagName == TagName && x.ID != ExceptID);
         }
 
-        /// <summary>
-        /// 鏄惁鍖呭惈瀛愰」
-        /// </summary>
-        public bool HasChildren(long ID)
-        {
-            var all = GetAll();
-            return all.Exists(x => x.ParentIds.Contains(ID));
-        }
-
         #endregion Exist
+
+
 
         #region Delete
 
@@ -369,7 +485,7 @@
                 Msg = "瀛樺湪鍨嬪彿淇℃伅锛岃鍒犻櫎鍚庨噸璇曪紒";
                 return false;
             }
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsCoolingSeries>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowSeries>();
             var bol = dal.DeleteByID(ID);
             if (bol)
             {
diff --git a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/02-ElbowMain/ElbowManage_Instance.cs b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/02-ElbowMain/ElbowManage_Instance.cs
index d0ce4d3..ec15220 100644
--- a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/02-ElbowMain/ElbowManage_Instance.cs
+++ b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/02-ElbowMain/ElbowManage_Instance.cs
@@ -10,7 +10,7 @@
             var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsElbowMain, Model.AssetsElbowMain>()
             .ForMember(d => d.Paras, opt => opt.MapFrom(src => ParasHelper.ToDictionary(src.Paras)))
             .ForMember(d => d.Flags, opt => opt.MapFrom(src => FlagsHelper.ToList(src.Flags)))
-            .ForMember(d => d.KeyWord, opt => opt.MapFrom(src => KeyWordHelper.ToList(src.KeyWords)))
+            .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToList(src.KeyWords)))
             ).CreateMapper();
             var model = mapper.Map<Entity.AssetsElbowMain, Model.AssetsElbowMain>(entity);
             return model;
@@ -24,7 +24,7 @@
             var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Entity.AssetsElbowMain, Model.AssetsElbowMain>()
             .ForMember(d => d.Paras, opt => opt.MapFrom(src => ParasHelper.ToDictionary(src.Paras)))
             .ForMember(d => d.Flags, opt => opt.MapFrom(src => FlagsHelper.ToList(src.Flags)))
-            .ForMember(d => d.KeyWord, opt => opt.MapFrom(src => KeyWordHelper.ToList(src.KeyWords)))
+            .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToList(src.KeyWords)))
              ).CreateMapper();
             var models = mapper.Map<List<Entity.AssetsElbowMain>, List<Model.AssetsElbowMain>>(entities);
             return models;
@@ -38,7 +38,7 @@
             var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsElbowMain, Entity.AssetsElbowMain>()
             .ForMember(d => d.Paras, opt => opt.MapFrom(src => ParasHelper.ToString(src.Paras)))
             .ForMember(d => d.Flags, opt => opt.MapFrom(src => FlagsHelper.ToString(src.Flags)))
-             .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToString(src.KeyWord)))
+             .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToString(src.KeyWords)))
             ).CreateMapper();
             var entity = mapper.Map<Model.AssetsElbowMain, Entity.AssetsElbowMain>(model);
             return entity;
@@ -52,7 +52,7 @@
             var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsElbowMain, Entity.AssetsElbowMain>()
             .ForMember(d => d.Paras, opt => opt.MapFrom(src => ParasHelper.ToString(src.Paras)))
             .ForMember(d => d.Flags, opt => opt.MapFrom(src => FlagsHelper.ToString(src.Flags)))
-             .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToString(src.KeyWord)))
+             .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToString(src.KeyWords)))
             ).CreateMapper();
             var entities = mapper.Map<List<Model.AssetsElbowMain>, List<Entity.AssetsElbowMain>>(models);
             return entities;
@@ -66,7 +66,7 @@
             var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Model.AssetsElbowMain, Entity.AssetsElbowMain>()
             .ForMember(d => d.Paras, opt => opt.MapFrom(src => ParasHelper.ToString(src.Paras)))
             .ForMember(d => d.Flags, opt => opt.MapFrom(src => FlagsHelper.ToString(src.Flags)))
-             .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToString(src.KeyWord)))
+             .ForMember(d => d.KeyWords, opt => opt.MapFrom(src => KeyWordHelper.ToString(src.KeyWords)))
             ).CreateMapper();
             mapper.Map(model, entity);
         }
diff --git a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor.cs
similarity index 74%
rename from Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs
rename to Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor.cs
index 4d1d515..29e4278 100644
--- a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient.cs
+++ b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor.cs
@@ -3,16 +3,16 @@
     /// <summary>
     ///
     /// </summary>
-    public partial class AssetsElbowCoefficient
+    public partial class AssetsElbowFactor
     {
         #region Cache
 
         //鑾峰彇缂撳瓨
         private static List<Model.AssetsElbowFactor> GetCache()
         {
-            var all = AssetsElbowCoefficientCacheHelper.GetSet(() =>
+            var all = AssetsElbowFactorCacheHelper.GetSet(() =>
             {
-                var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+                var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
                 var entity_list = dal.GetAll();
                 var model_list = Entity2Models(entity_list);
                 if (model_list == null)
@@ -27,7 +27,7 @@
         //閫氳繃 ID 鏇存柊缂撳瓨
         private static void UpdateCache(long ID)
         {
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var entity_ds = dal.GetByID(ID);
             var model_ds = Entity2Model(entity_ds);
             var all = GetCache();
@@ -40,7 +40,7 @@
             {
                 model.Reset(model_ds);
             }
-            AssetsElbowSeriesCacheHelper.Trigger();
+            AssetsElbowFactorCacheHelper.Trigger();
         }
 
         //閫氳繃 Ids 鏇存柊缂撳瓨
@@ -50,7 +50,7 @@
             {
                 return;
             }
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var entity_list = dal.GetByIds(Ids);
             var model_list = Entity2Models(entity_list);
             var all = GetCache();
@@ -59,7 +59,7 @@
             {
                 all.AddRange(model_list);
             }
-            AssetsElbowSeriesCacheHelper.Trigger();
+            AssetsElbowFactorCacheHelper.Trigger();
         }
 
         //绉婚櫎缂撳瓨
@@ -67,7 +67,7 @@
         {
             var all = GetCache();
             all.RemoveAll(x => x.ID == ID);
-            AssetsElbowSeriesCacheHelper.Trigger();
+            AssetsElbowFactorCacheHelper.Trigger();
         }
 
         //绉婚櫎鎵�鏈夌紦瀛�
@@ -75,7 +75,7 @@
         {
             var all = GetCache();
             all.Clear();
-            AssetsElbowSeriesCacheHelper.Trigger();
+            AssetsElbowFactorCacheHelper.Trigger();
         }
 
         /// <summary>
@@ -83,7 +83,7 @@
         /// </summary>
         public static void PublishCache(string key)
         {
-            AssetsElbowSeriesCacheHelper.Publish(key);
+            AssetsElbowFactorCacheHelper.Publish(key);
         }
 
         #endregion Cache
@@ -96,7 +96,7 @@
         public List<Model.AssetsElbowFactor> GetAll()
         {
             var all = GetCache();
-            return all;
+            return all?.OrderBy(x => x.SortCode).ToList();
         }
 
         /// <summary>
@@ -118,7 +118,20 @@
                 return default;
             }
             var all = GetAll();
-            return all.Where(x => Ids.Contains(x.ID)).ToList();
+            return all.Where(x => Ids.Contains(x.ID))?.OrderBy(x => x.SortCode).ToList();
+        }
+
+        /// <summary>
+        /// 鑾峰彇鏈�澶ф帓搴忕爜
+        /// </summary>
+        public int GetMaxSortCode()
+        {
+            var all = GetAll();
+            if (all == null || all.Count < 1)
+            {
+                return 0;
+            }
+            return all.Max(x => x.SortCode);
         }
 
         #endregion Query
@@ -134,7 +147,7 @@
             {
                 return default;
             }
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var entity = Model2Entity(model);
             var id = dal.Insert(entity);
             if (id > 0)
@@ -153,7 +166,7 @@
             {
                 return false;
             }
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var entity_list = Model2Entities(list);
             var ids = dal.InsertsR(entity_list);
             if (ids != null && ids.Count > 0)
@@ -178,7 +191,7 @@
                 return false;
             }
             var entity = Model2Entity(model);
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var bol = dal.Update(entity);
             if (bol)
             {
@@ -201,11 +214,51 @@
                 return false;
             }
             var entity_list = Model2Entities(list);
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var bol = dal.Updates(entity_list);
             if (bol)
             {
                 UpdateCache(list.Select(x => x.ID).ToList());
+            }
+            return bol;
+        }
+
+        /// <summary>
+        /// 鏇存柊鎺掑簭鐮�
+        /// </summary>
+        public bool UpdateSortCode(long ID, int SortCode)
+        {
+            if (ID < 1)
+            {
+                return false;
+            }
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
+            var bol = dal.UpdateSortCode(ID, SortCode);
+            if (bol)
+            {
+                UpdateCache(ID);
+            }
+            return bol;
+        }
+
+        /// <summary>
+        /// 鏇存柊鎺掑簭
+        /// </summary>
+        public bool UpdateSorter(List<Yw.Model.Sorter> sorters)
+        {
+            if (sorters == null || sorters.Count < 1)
+            {
+                return false;
+            }
+            if (sorters.Exists(x => x.ID < 1))
+            {
+                return false;
+            }
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
+            var bol = dal.UpdateSorter(sorters.ToEntityList());
+            if (bol)
+            {
+                UpdateCache(sorters.Select(x => x.ID).ToList());
             }
             return bol;
         }
@@ -220,22 +273,11 @@
         public bool DeleteByID(long ID, out string Msg)
         {
             Msg = string.Empty;
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
+            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowFactor>();
             var bol = dal.DeleteByID(ID);
             if (bol)
             {
                 RemoveCache(ID);
-            }
-            return bol;
-        }
-
-        public bool DeleteAll()
-        {
-            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsElbowCoefficient>();
-            var bol = dal.DeleteAll();
-            if (bol)
-            {
-                RemoveAllCache();
             }
             return bol;
         }
diff --git a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient_Instance.cs b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor_Instance.cs
similarity index 97%
rename from Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient_Instance.cs
rename to Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor_Instance.cs
index 77fab27..37da1ce 100644
--- a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/AssetsElbowCoefficient_Instance.cs
+++ b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/AssetsElbowFactor_Instance.cs
@@ -1,6 +1,6 @@
 锘縩amespace HStation.Service
 {
-    public partial class AssetsElbowCoefficient
+    public partial class AssetsElbowFactor
     {
         //Entity to GetModel
         internal static Model.AssetsElbowFactor Entity2Model(Entity.AssetsElbowFactor entity)
diff --git a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/Cache/AssetsElbowCoefficientCacheHelper.cs b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/Cache/AssetsElbowFactorCacheHelper.cs
similarity index 93%
rename from Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/Cache/AssetsElbowCoefficientCacheHelper.cs
rename to Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/Cache/AssetsElbowFactorCacheHelper.cs
index cdb0d5e..1a03868 100644
--- a/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-AssetsElbowCoefficient/Cache/AssetsElbowCoefficientCacheHelper.cs
+++ b/Service/HStation.Service.Assets.Core/05-service/03-Elbow/03-ElbowFactor/Cache/AssetsElbowFactorCacheHelper.cs
@@ -4,9 +4,9 @@
     /// AssetsElbowFactor
     /// 缂撳瓨杈呭姪绫�
     /// </summary>
-    internal class AssetsElbowCoefficientCacheHelper
+    internal class AssetsElbowFactorCacheHelper
     {
-        private const string _contentKey = "AssetsElbowCoefficientList";
+        private const string _contentKey = "AssetsElbowFactorList";
 
         internal static string GetCacheKey()
         {
diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs
index eb1a67e..d0161dd 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/00-core/AssetsMatchingHelper.cs
@@ -1470,15 +1470,20 @@
                 {
                     if (input.DbId == null)
                         input.MatchingDbId = vmo.ID.ToString();
-                    if (input.ModelType == null)
+                    if (input.ModelType == null && input.ModelType == string.Empty)
                         input.MatchingModelType = vmo.Name;
-                    if (input.DN < 0)
+                    if (input.DN <= 0)
                         input.MatchingDN = vmo.DN;
-                    if (input.MinLevel < 0)
+                    if (input.MinLevel <= 0)
                         input.MatchingMinLevel = vmo.MinLevel;
+                    input.MatchingOverFlow = vmo.OverFlow;
+                    if (input.MinVol <= 0)
+                        input.MatchingMinVol = vmo.MinVol;
+                    if (input.MaxLevel <= 0)
+                        input.MatchingMaxLevel = vmo.MaxLevel;
                     if (input.CurveDbId == null)
                     {
-                        var list = Task.Run(async () => await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(HStation.Assets.DataType.ValveMain, vmo.ID)).Result;
+                        var list = Task.Run(async () => await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(HStation.Assets.DataType.TankMain, vmo.ID)).Result;
                         if (list != null && list.Count > 0)
                         {
                             var def = list.OrderByDescending(x => x.Importance).First();
@@ -1499,6 +1504,9 @@
                     input.MatchingDN = vmo.DN;
                     input.MatchingMinLevel = vmo.MinLevel;
                     input.MatchingOverFlow = vmo.OverFlow;
+                    input.MatchingMinVol = vmo.MinVol;
+                    input.MatchingMaxLevel = vmo.MaxLevel;
+
                     var list = Task.Run(async () => await new BLL.PhartDiagramRelation().GetExByObjectTypeAndObjectID(HStation.Assets.DataType.ValveMain, vmo.ID)).Result;
                     if (list != null && list.Count > 0)
                     {
diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/04-pipe/01-pipesinglematching/PipeSingleMatchingCtrl.Designer.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/04-pipe/01-pipesinglematching/PipeSingleMatchingCtrl.Designer.cs
index bf81d15..99f5f5a 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/04-pipe/01-pipesinglematching/PipeSingleMatchingCtrl.Designer.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/07-matching/04-pipe/01-pipesinglematching/PipeSingleMatchingCtrl.Designer.cs
@@ -33,7 +33,6 @@
             gridControl3 = new DevExpress.XtraGrid.GridControl();
             pipeLineSingleMatchingViewModelBindingSource = new BindingSource(components);
             gridView3 = new DevExpress.XtraGrid.Views.Grid.GridView();
-            colName = new DevExpress.XtraGrid.Columns.GridColumn();
             colModelType = new DevExpress.XtraGrid.Columns.GridColumn();
             colMaterial = new DevExpress.XtraGrid.Columns.GridColumn();
             colCaliber = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -89,67 +88,60 @@
             // 
             gridView3.Appearance.HeaderPanel.Options.UseTextOptions = true;
             gridView3.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
-            gridView3.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colName, colModelType, colMaterial, colCaliber, colMinorLoss, colHazen, colDarcy, colManning });
+            gridView3.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { colModelType, colMaterial, colCaliber, colMinorLoss, colHazen, colDarcy, colManning });
             gridView3.GridControl = gridControl3;
             gridView3.Name = "gridView3";
             gridView3.OptionsView.ShowGroupPanel = false;
             gridView3.FocusedRowChanged += gridView3_FocusedRowChanged;
-            // 
-            // colName
-            // 
-            colName.FieldName = "Name";
-            colName.Name = "colName";
-            colName.Visible = true;
-            colName.VisibleIndex = 0;
             // 
             // colModelType
             // 
             colModelType.FieldName = "ModelType";
             colModelType.Name = "colModelType";
             colModelType.Visible = true;
-            colModelType.VisibleIndex = 1;
+            colModelType.VisibleIndex = 0;
             // 
             // colMaterial
             // 
             colMaterial.FieldName = "Material";
             colMaterial.Name = "colMaterial";
             colMaterial.Visible = true;
-            colMaterial.VisibleIndex = 2;
+            colMaterial.VisibleIndex = 1;
             // 
             // colCaliber
             // 
             colCaliber.FieldName = "Caliber";
             colCaliber.Name = "colCaliber";
             colCaliber.Visible = true;
-            colCaliber.VisibleIndex = 3;
+            colCaliber.VisibleIndex = 2;
             // 
             // colMinorLoss
             // 
             colMinorLoss.FieldName = "MinorLoss";
             colMinorLoss.Name = "colMinorLoss";
             colMinorLoss.Visible = true;
-            colMinorLoss.VisibleIndex = 4;
+            colMinorLoss.VisibleIndex = 3;
             // 
             // colHazen
             // 
             colHazen.FieldName = "Hazen";
             colHazen.Name = "colHazen";
             colHazen.Visible = true;
-            colHazen.VisibleIndex = 5;
+            colHazen.VisibleIndex = 4;
             // 
             // colDarcy
             // 
             colDarcy.FieldName = "Darcy";
             colDarcy.Name = "colDarcy";
             colDarcy.Visible = true;
-            colDarcy.VisibleIndex = 6;
+            colDarcy.VisibleIndex = 5;
             // 
             // colManning
             // 
             colManning.FieldName = "Manning";
             colManning.Name = "colManning";
             colManning.Visible = true;
-            colManning.VisibleIndex = 7;
+            colManning.VisibleIndex = 6;
             // 
             // searchControl1
             // 
@@ -199,12 +191,12 @@
             layoutControlItem5.TextSize = new Size(0, 0);
             layoutControlItem5.TextVisible = false;
             // 
-            // PipeSingleMatchingForm
+            // PipeSingleMatchingCtrl
             // 
             AutoScaleDimensions = new SizeF(7F, 14F);
             AutoScaleMode = AutoScaleMode.Font;
             Controls.Add(layoutControl1);
-            Name = "PipeLineSingleMatchingForm";
+            Name = "PipeSingleMatchingCtrl";
             Size = new Size(1343, 607);
             ((ISupportInitialize)layoutControl1).EndInit();
             layoutControl1.ResumeLayout(false);
@@ -230,7 +222,6 @@
         private DevExpress.XtraGrid.Views.Grid.GridView gridView3;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
         private BindingSource pipeLineSingleMatchingViewModelBindingSource;
-        private DevExpress.XtraGrid.Columns.GridColumn colName;
         private DevExpress.XtraGrid.Columns.GridColumn colModelType;
         private DevExpress.XtraGrid.Columns.GridColumn colMaterial;
         private DevExpress.XtraGrid.Columns.GridColumn colCaliber;

--
Gitblit v1.9.3