lixiaojun
2024-12-09 25f7d54d23dd47d6f2bfd91e7edfd218a4b9ec3e
BLL/HStation.BLL.Assets.Core/03-localclient/04-PipeLineRoughnessCoefficient/PipeLineRoughnessCoefficient.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using HStation.Dto;
using System.Collections.Generic;
using Yw.Dto;
namespace HStation.CAL.LocalClient
@@ -6,7 +7,7 @@
    /// <summary>
    /// 报警等级
    /// </summary>
    public class PipeLineRoughnessCoefficient : IPipeLineRoughnessCoefficient
    public class PipeLineRoughnessCoefficient : IAssetsPipeCoefficient
    {
        private readonly HStation.Service.PipeLineRoughnessCoefficient _service = new();
@@ -15,12 +16,12 @@
        /// <summary>
        /// 获取所有
        /// </summary>
        public async Task<List<PipeRoughnessCoefficientDto>> GetAll()
        public async Task<List<AssetsPipeCoefficientDto>> GetAll()
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = _service.GetAll();
                var vm_list = list?.Select(x => new PipeRoughnessCoefficientDto(x)).ToList();
                var vm_list = list?.Select(x => new AssetsPipeCoefficientDto(x)).ToList();
                return vm_list;
            });
        }
@@ -28,24 +29,24 @@
        /// <summary>
        /// 通过 ID 获取
        /// </summary>
        public async Task<PipeRoughnessCoefficientDto> GetByID(long ID)
        public async Task<AssetsPipeCoefficientDto> GetByID(long ID)
        {
            return await Task.Factory.StartNew(() =>
            {
                var model = _service.GetByID(ID);
                return model == null ? null : new PipeRoughnessCoefficientDto(model);
                return model == null ? null : new AssetsPipeCoefficientDto(model);
            });
        }
        /// <summary>
        /// 通过 管道ID 获取
        /// </summary>
        public async Task<List<PipeRoughnessCoefficientDto>> GetByPipeID(long ID)
        public async Task<List<AssetsPipeCoefficientDto>> GetByPipeID(long ID)
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = _service.GetByPipeID(ID);
                var vm_list = list?.Select(x => new PipeRoughnessCoefficientDto(x)).ToList();
                var vm_list = list?.Select(x => new AssetsPipeCoefficientDto(x)).ToList();
                return vm_list;
            });
        }
@@ -53,12 +54,12 @@
        /// <summary>
        /// 通过 Ids 获取
        /// </summary>
        public async Task<List<PipeRoughnessCoefficientDto>> GetByIds(List<long> Ids)
        public async Task<List<AssetsPipeCoefficientDto>> GetByIds(List<long> Ids)
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = _service.GetByIds(Ids);
                var vm_list = list?.Select(x => new PipeRoughnessCoefficientDto(x)).ToList();
                var vm_list = list?.Select(x => new AssetsPipeCoefficientDto(x)).ToList();
                return vm_list;
            });
        }
@@ -70,11 +71,11 @@
        /// <summary>
        /// 插入一条
        /// </summary>
        public async Task<long> Insert(AddPipeRoughnessCoefficientInput input)
        public async Task<long> Insert(AddAssetsPipeCoefficientInput input)
        {
            return await Task.Factory.StartNew(() =>
            {
                var model = input.Adapt<AddPipeRoughnessCoefficientInput, Model.PipeRoughnessCoefficient>();
                var model = input.Adapt<AddAssetsPipeCoefficientInput, Model.AssetsPipeLineCoefficient>();
                var id = _service.Insert(model);
                return id;
            });
@@ -83,11 +84,11 @@
        /// <summary>
        /// 批量插入
        /// </summary>
        public async Task<bool> Inserts(List<AddPipeRoughnessCoefficientInput> inputList)
        public async Task<bool> Inserts(List<AddAssetsPipeCoefficientInput> inputList)
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = inputList.Select(x => x.Adapt<AddPipeRoughnessCoefficientInput, Model.PipeRoughnessCoefficient>()).ToList();
                var list = inputList.Select(x => x.Adapt<AddAssetsPipeCoefficientInput, Model.AssetsPipeLineCoefficient>()).ToList();
                var bol = _service.Inserts(list);
                return bol;
            });
@@ -96,7 +97,7 @@
        /// <summary>
        /// 大批量插入
        /// </summary>
        public async Task<bool> BulkInserts(List<AddPipeRoughnessCoefficientInput> list)
        public async Task<bool> BulkInserts(List<AddAssetsPipeCoefficientInput> list)
        {
            return await Task.Factory.StartNew(() =>
            {
@@ -111,7 +112,7 @@
        /// <summary>
        /// 更新一条
        /// </summary>
        public async Task<bool> Update(UpdatePipeRoughnessCoefficientInput input)
        public async Task<bool> Update(UpdateAssetsPipeCoefficientInput input)
        {
            return await Task.Factory.StartNew(() =>
            {
@@ -121,7 +122,7 @@
                    throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在");
                }
                var rhs = new Model.PipeRoughnessCoefficient(model);
                var rhs = new Model.AssetsPipeLineCoefficient(model);
                input.Adapt(rhs);
                var bol = _service.Update(rhs);
                return bol;
@@ -131,7 +132,7 @@
        /// <summary>
        /// 批量更新
        /// </summary>
        public async Task<bool> Updates(List<UpdatePipeRoughnessCoefficientInput> inputList)
        public async Task<bool> Updates(List<UpdateAssetsPipeCoefficientInput> inputList)
        {
            return await Task.Factory.StartNew(() =>
            {
@@ -139,7 +140,7 @@
                {
                    return false;
                }
                var list = inputList.Select(x => x.Adapt<UpdatePipeRoughnessCoefficientInput, Model.PipeRoughnessCoefficient>()).ToList();
                var list = inputList.Select(x => x.Adapt<UpdateAssetsPipeCoefficientInput, Model.AssetsPipeLineCoefficient>()).ToList();
                var bol = _service.Updates(list);
                return bol;
            });
@@ -148,7 +149,7 @@
        /// <summary>
        /// 大批量更新
        /// </summary>
        public async Task<bool> BulkUpdates(List<UpdatePipeRoughnessCoefficientInput> list)
        public async Task<bool> BulkUpdates(List<UpdateAssetsPipeCoefficientInput> list)
        {
            return await Task.Factory.StartNew(() =>
            {