| | |
| | | /// <summary> |
| | | /// 报警等级 |
| | | /// </summary> |
| | | public class PipeLineRoughnessCoefficient : IAssetsPipeLineCoefficient |
| | | public class PipeLineRoughnessCoefficient : IAssetsPipeCoefficient |
| | | { |
| | | private readonly HStation.Service.PipeLineRoughnessCoefficient _service = new(); |
| | | |
| | |
| | | /// <summary> |
| | | /// 获取所有 |
| | | /// </summary> |
| | | public async Task<List<AssetsPipeLineCoefficientDto>> GetAll() |
| | | public async Task<List<AssetsPipeCoefficientDto>> GetAll() |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var list = _service.GetAll(); |
| | | var vm_list = list?.Select(x => new AssetsPipeLineCoefficientDto(x)).ToList(); |
| | | var vm_list = list?.Select(x => new AssetsPipeCoefficientDto(x)).ToList(); |
| | | return vm_list; |
| | | }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 通过 ID 获取 |
| | | /// </summary> |
| | | public async Task<AssetsPipeLineCoefficientDto> 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 AssetsPipeLineCoefficientDto(model); |
| | | return model == null ? null : new AssetsPipeCoefficientDto(model); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 通过 管道ID 获取 |
| | | /// </summary> |
| | | public async Task<List<AssetsPipeLineCoefficientDto>> 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 AssetsPipeLineCoefficientDto(x)).ToList(); |
| | | var vm_list = list?.Select(x => new AssetsPipeCoefficientDto(x)).ToList(); |
| | | return vm_list; |
| | | }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 通过 Ids 获取 |
| | | /// </summary> |
| | | public async Task<List<AssetsPipeLineCoefficientDto>> 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 AssetsPipeLineCoefficientDto(x)).ToList(); |
| | | var vm_list = list?.Select(x => new AssetsPipeCoefficientDto(x)).ToList(); |
| | | return vm_list; |
| | | }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 插入一条 |
| | | /// </summary> |
| | | public async Task<long> Insert(AddAssetsPipeLineCoefficientInput input) |
| | | public async Task<long> Insert(AddAssetsPipeCoefficientInput input) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var model = input.Adapt<AddAssetsPipeLineCoefficientInput, Model.AssetsPipeLineCoefficient>(); |
| | | var model = input.Adapt<AddAssetsPipeCoefficientInput, Model.AssetsPipeLineCoefficient>(); |
| | | var id = _service.Insert(model); |
| | | return id; |
| | | }); |
| | |
| | | /// <summary> |
| | | /// 批量插入 |
| | | /// </summary> |
| | | public async Task<bool> Inserts(List<AddAssetsPipeLineCoefficientInput> inputList) |
| | | public async Task<bool> Inserts(List<AddAssetsPipeCoefficientInput> inputList) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var list = inputList.Select(x => x.Adapt<AddAssetsPipeLineCoefficientInput, Model.AssetsPipeLineCoefficient>()).ToList(); |
| | | var list = inputList.Select(x => x.Adapt<AddAssetsPipeCoefficientInput, Model.AssetsPipeLineCoefficient>()).ToList(); |
| | | var bol = _service.Inserts(list); |
| | | return bol; |
| | | }); |
| | |
| | | /// <summary> |
| | | /// 大批量插入 |
| | | /// </summary> |
| | | public async Task<bool> BulkInserts(List<AddAssetsPipeLineCoefficientInput> list) |
| | | public async Task<bool> BulkInserts(List<AddAssetsPipeCoefficientInput> list) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | |
| | | /// <summary> |
| | | /// 更新一条 |
| | | /// </summary> |
| | | public async Task<bool> Update(UpdateAssetsPipeLineCoefficientInput input) |
| | | public async Task<bool> Update(UpdateAssetsPipeCoefficientInput input) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | |
| | | /// <summary> |
| | | /// 批量更新 |
| | | /// </summary> |
| | | public async Task<bool> Updates(List<UpdateAssetsPipeLineCoefficientInput> inputList) |
| | | public async Task<bool> Updates(List<UpdateAssetsPipeCoefficientInput> inputList) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | |
| | | { |
| | | return false; |
| | | } |
| | | var list = inputList.Select(x => x.Adapt<UpdateAssetsPipeLineCoefficientInput, Model.AssetsPipeLineCoefficient>()).ToList(); |
| | | var list = inputList.Select(x => x.Adapt<UpdateAssetsPipeCoefficientInput, Model.AssetsPipeLineCoefficient>()).ToList(); |
| | | var bol = _service.Updates(list); |
| | | return bol; |
| | | }); |
| | |
| | | /// <summary> |
| | | /// 大批量更新 |
| | | /// </summary> |
| | | public async Task<bool> BulkUpdates(List<UpdateAssetsPipeLineCoefficientInput> list) |
| | | public async Task<bool> BulkUpdates(List<UpdateAssetsPipeCoefficientInput> list) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |