From 146ca8c7eefe74d3b73c00a73e99e94e903be401 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期四, 06 二月 2025 15:04:21 +0800 Subject: [PATCH] 增加工况管理功能和计算结果自由压力与绝对压力切换 --- BLL/HStation.BLL.Assets.Core/03-localclient/18-Hydrant/AssetsHydrantCoefficient.cs | 73 +++++++++++++++++++++++++----------- 1 files changed, 50 insertions(+), 23 deletions(-) diff --git a/BLL/HStation.BLL.Assets.Core/03-localclient/18-Hydrant/AssetsHydrantCoefficient.cs b/BLL/HStation.BLL.Assets.Core/03-localclient/18-Hydrant/AssetsHydrantCoefficient.cs index cb4d7a6..6f0c931 100644 --- a/BLL/HStation.BLL.Assets.Core/03-localclient/18-Hydrant/AssetsHydrantCoefficient.cs +++ b/BLL/HStation.BLL.Assets.Core/03-localclient/18-Hydrant/AssetsHydrantCoefficient.cs @@ -1,26 +1,23 @@ -锘縰sing HStation.Dto; -using Yw.Dto; - -namespace HStation.CAL.LocalClient +锘縩amespace HStation.CAL.LocalClient { /// <summary> - /// 娑堢伀鏍撶郴鏁� - ///</summary> - public class AssetsHydrantCoefficient : IAssetsHydrantCoefficient + /// 鎹㈢儹鍣ㄧ郴鏁� + /// </summary> + public class AssetsHydrantFactor : IAssetsHydrantFactor { - private readonly Service.AssetsHydrantCoefficient _service = new(); + private readonly HStation.Service.AssetsHydrantFactor _service = new(); #region Query /// <summary> /// 鑾峰彇鎵�鏈� /// </summary> - public async Task<List<AssetsHydrantCoefficientDto>> GetAll() + public async Task<List<AssetsHydrantFactorDto>> GetAll() { return await Task.Factory.StartNew(() => { var list = _service.GetAll(); - var vm_list = list?.Select(x => new AssetsHydrantCoefficientDto(x)).ToList(); + var vm_list = list?.Select(x => new AssetsHydrantFactorDto(x)).ToList(); return vm_list; }); } @@ -28,40 +25,43 @@ /// <summary> /// 閫氳繃 ID 鑾峰彇 /// </summary> - public async Task<AssetsHydrantCoefficientDto> GetByID(long ID) + public async Task<AssetsHydrantFactorDto> GetByID(long ID) { return await Task.Factory.StartNew(() => { var model = _service.GetByID(ID); - return model == null ? null : new AssetsHydrantCoefficientDto(model); + return model == null ? null : new AssetsHydrantFactorDto(model); }); } /// <summary> /// 閫氳繃 Ids 鑾峰彇 /// </summary> - public async Task<List<AssetsHydrantCoefficientDto>> GetByIds(List<long> Ids) + public async Task<List<AssetsHydrantFactorDto>> GetByIds(List<long> Ids) { return await Task.Factory.StartNew(() => { var list = _service.GetByIds(Ids); - var vm_list = list?.Select(x => new AssetsHydrantCoefficientDto(x)).ToList(); + var vm_list = list?.Select(x => new AssetsHydrantFactorDto(x)).ToList(); return vm_list; }); } #endregion Query + + #region Insert /// <summary> /// 鎻掑叆涓�鏉� /// </summary> - public async Task<long> Insert(AddAssetsHydrantCoefficientInput input) + public async Task<long> Insert(AddAssetsHydrantFactorInput input) { return await Task.Factory.StartNew(() => { - var model = input.Adapt<AddAssetsHydrantCoefficientInput, Model.AssetsHydrantCoefficient>(); + var model = input.Adapt<AddAssetsHydrantFactorInput, Model.AssetsHydrantFactor>(); + model.SortCode = _service.GetMaxSortCode() + 1; var id = _service.Insert(model); return id; }); @@ -70,7 +70,7 @@ /// <summary> /// 鎵归噺鎻掑叆 /// </summary> - public async Task<bool> Inserts(List<AddAssetsHydrantCoefficientInput> inputList) + public async Task<bool> Inserts(List<AddAssetsHydrantFactorInput> inputList) { return await Task.Factory.StartNew(() => { @@ -81,7 +81,7 @@ /// <summary> /// 澶ф壒閲忔彃鍏� /// </summary> - public async Task<bool> BulkInserts(List<AddAssetsHydrantCoefficientInput> list) + public async Task<bool> BulkInserts(List<AddAssetsHydrantFactorInput> list) { return await Task.Factory.StartNew(() => { @@ -96,7 +96,7 @@ /// <summary> /// 鏇存柊涓�鏉� /// </summary> - public async Task<bool> Update(UpdateAssetsHydrantCoefficientInput input) + public async Task<bool> Update(UpdateAssetsHydrantFactorInput input) { return await Task.Factory.StartNew(() => { @@ -105,7 +105,7 @@ { throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 鏁版嵁涓嶅瓨鍦�"); } - var rhs = new Model.AssetsHydrantCoefficient(model); + var rhs = new Model.AssetsHydrantFactor(model); input.Adapt(rhs); var bol = _service.Update(rhs); return bol; @@ -115,7 +115,7 @@ /// <summary> /// 鎵归噺鏇存柊 /// </summary> - public async Task<bool> Updates(List<UpdateAssetsHydrantCoefficientInput> inputList) + public async Task<bool> Updates(List<UpdateAssetsHydrantFactorInput> inputList) { return await Task.Factory.StartNew(() => { @@ -126,11 +126,36 @@ /// <summary> /// 澶ф壒閲忔洿鏂� /// </summary> - public async Task<bool> BulkUpdates(List<UpdateAssetsHydrantCoefficientInput> list) + public async Task<bool> BulkUpdates(List<UpdateAssetsHydrantFactorInput> list) { return await Task.Factory.StartNew(() => { return false; + }); + } + + /// <summary> + /// 鏇存柊鎺掑簭鐮� + /// </summary> + public async Task<bool> UpdateSortCode(long ID, int SortCode) + { + return await Task.Factory.StartNew(() => + { + 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; }); } @@ -166,8 +191,9 @@ } /// <summary> - /// 鍏ㄩ儴鍒犻櫎 + /// 鍒犻櫎鍏ㄩ儴 /// </summary> + /// <returns></returns> public async Task<bool> DeleteAll() { return await Task.Factory.StartNew(() => @@ -177,5 +203,6 @@ } #endregion Delete + } } \ No newline at end of file -- Gitblit v1.9.3