From 0e33247236d4ac46f1a75802f53dd6c612301cff Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期二, 24 十二月 2024 14:52:06 +0800
Subject: [PATCH] 注册泵曲线事件

---
 BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkFactor.cs |  112 +++++++++++++++++++++++++-------------------------------
 1 files changed, 50 insertions(+), 62 deletions(-)

diff --git a/BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkCoefficient.cs b/BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkFactor.cs
similarity index 62%
rename from BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkCoefficient.cs
rename to BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkFactor.cs
index dae913e..fe38b88 100644
--- a/BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkCoefficient.cs
+++ b/BLL/HStation.BLL.Assets.Core/03-localclient/08-FourLink/AssetsFourlinkFactor.cs
@@ -1,26 +1,23 @@
-锘縰sing HStation.Dto;
-using Yw.Dto;
-
-namespace HStation.CAL.LocalClient
+锘縩amespace HStation.CAL.LocalClient
 {
     /// <summary>
-    /// 鎶ヨ绛夌骇
+    /// 鎹㈢儹鍣ㄧ郴鏁�
     /// </summary>
-    public class AssetsFourlinkCoefficient : IAssetsFourlinkCoefficient
+    public class AssetsFourlinkFactor : IAssetsFourlinkFactor
     {
-        private readonly HStation.Service.AssetsFourlinkCoefficient _service = new();
+        private readonly HStation.Service.AssetsFourlinkFactor _service = new();
 
         #region Query
 
         /// <summary>
         /// 鑾峰彇鎵�鏈�
         /// </summary>
-        public async Task<List<AssetsFourlinkCoefficientDto>> GetAll()
+        public async Task<List<AssetsFourlinkFactorDto>> GetAll()
         {
             return await Task.Factory.StartNew(() =>
             {
                 var list = _service.GetAll();
-                var vm_list = list?.Select(x => new AssetsFourlinkCoefficientDto(x)).ToList();
+                var vm_list = list?.Select(x => new AssetsFourlinkFactorDto(x)).ToList();
                 return vm_list;
             });
         }
@@ -28,40 +25,43 @@
         /// <summary>
         /// 閫氳繃 ID 鑾峰彇
         /// </summary>
-        public async Task<AssetsFourlinkCoefficientDto> GetByID(long ID)
+        public async Task<AssetsFourlinkFactorDto> GetByID(long ID)
         {
             return await Task.Factory.StartNew(() =>
             {
                 var model = _service.GetByID(ID);
-                return model == null ? null : new AssetsFourlinkCoefficientDto(model);
+                return model == null ? null : new AssetsFourlinkFactorDto(model);
             });
         }
 
         /// <summary>
         /// 閫氳繃 Ids 鑾峰彇
         /// </summary>
-        public async Task<List<AssetsFourlinkCoefficientDto>> GetByIds(List<long> Ids)
+        public async Task<List<AssetsFourlinkFactorDto>> GetByIds(List<long> Ids)
         {
             return await Task.Factory.StartNew(() =>
             {
                 var list = _service.GetByIds(Ids);
-                var vm_list = list?.Select(x => new AssetsFourlinkCoefficientDto(x)).ToList();
+                var vm_list = list?.Select(x => new AssetsFourlinkFactorDto(x)).ToList();
                 return vm_list;
             });
         }
 
         #endregion Query
 
+
+
         #region Insert
 
         /// <summary>
         /// 鎻掑叆涓�鏉�
         /// </summary>
-        public async Task<long> Insert(AddAssetsFourlinkCoefficientInput input)
+        public async Task<long> Insert(AddAssetsFourlinkFactorInput input)
         {
             return await Task.Factory.StartNew(() =>
             {
-                var model = input.Adapt<AddAssetsFourlinkCoefficientInput, Model.AssetsFourlinkCoefficient>();
+                var model = input.Adapt<AddAssetsFourlinkFactorInput, Model.AssetsFourlinkFactor>();
+                model.SortCode = _service.GetMaxSortCode() + 1;
                 var id = _service.Insert(model);
                 return id;
             });
@@ -70,20 +70,7 @@
         /// <summary>
         /// 鎵归噺鎻掑叆
         /// </summary>
-        public async Task<bool> Inserts(List<AddAssetsFourlinkCoefficientInput> inputList)
-        {
-            return await Task.Factory.StartNew(() =>
-            {
-                var list = inputList.Select(x => x.Adapt<AddAssetsFourlinkCoefficientInput, Model.AssetsFourlinkCoefficient>()).ToList();
-                var bol = _service.Inserts(list);
-                return bol;
-            });
-        }
-
-        /// <summary>
-        /// 澶ф壒閲忔彃鍏�
-        /// </summary>
-        public async Task<bool> BulkInserts(List<AddAssetsFourlinkCoefficientInput> list)
+        public async Task<bool> Inserts(List<AddAssetsFourlinkFactorInput> inputList)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -91,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<AddAssetsFourlinkFactorInput> list)
+        {
+            return await Task.Factory.StartNew(() =>
+            {
+                return false;
+            });
+        }
 
         #endregion Insert
 
@@ -115,7 +96,7 @@
         /// <summary>
         /// 鏇存柊涓�鏉�
         /// </summary>
-        public async Task<bool> Update(UpdateAssetsFourlinkCoefficientInput input)
+        public async Task<bool> Update(UpdateAssetsFourlinkFactorInput input)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -124,8 +105,7 @@
                 {
                     throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 鏁版嵁涓嶅瓨鍦�");
                 }
-
-                var rhs = new Model.AssetsFourlinkCoefficient(model);
+                var rhs = new Model.AssetsFourlinkFactor(model);
                 input.Adapt(rhs);
                 var bol = _service.Update(rhs);
                 return bol;
@@ -135,24 +115,18 @@
         /// <summary>
         /// 鎵归噺鏇存柊
         /// </summary>
-        public async Task<bool> Updates(List<UpdateAssetsFourlinkCoefficientInput> inputList)
+        public async Task<bool> Updates(List<UpdateAssetsFourlinkFactorInput> inputList)
         {
             return await Task.Factory.StartNew(() =>
             {
-                if (inputList == null || inputList.Count < 1)
-                {
-                    return false;
-                }
-                var list = inputList.Select(x => x.Adapt<UpdateAssetsFourlinkCoefficientInput, Model.AssetsFourlinkCoefficient>()).ToList();
-                var bol = _service.Updates(list);
-                return bol;
+                return false;
             });
         }
 
         /// <summary>
         /// 澶ф壒閲忔洿鏂�
         /// </summary>
-        public async Task<bool> BulkUpdates(List<UpdateAssetsFourlinkCoefficientInput> list)
+        public async Task<bool> BulkUpdates(List<UpdateAssetsFourlinkFactorInput> list)
         {
             return await Task.Factory.StartNew(() =>
             {
@@ -161,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;
             });
         }
 
@@ -210,11 +198,11 @@
         {
             return await Task.Factory.StartNew(() =>
             {
-                var bol = _service.DeleteAll();
-                return bol;
+                return false;
             });
         }
 
         #endregion Delete
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3