| | |
| | | /// <summary> |
| | | /// 获取所有 |
| | | /// </summary> |
| | | public async Task<List<PipeLineRoughnessCoefficientDto>> GetAll() |
| | | public async Task<List<PipeRoughnessCoefficientDto>> GetAll() |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var list = _service.GetAll(); |
| | | var vm_list = list?.Select(x => new PipeLineRoughnessCoefficientDto(x)).ToList(); |
| | | var vm_list = list?.Select(x => new PipeRoughnessCoefficientDto(x)).ToList(); |
| | | return vm_list; |
| | | }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 通过 ID 获取 |
| | | /// </summary> |
| | | public async Task<PipeLineRoughnessCoefficientDto> GetByID(long ID) |
| | | public async Task<PipeRoughnessCoefficientDto> GetByID(long ID) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var model = _service.GetByID(ID); |
| | | return model == null ? null : new PipeLineRoughnessCoefficientDto(model); |
| | | return model == null ? null : new PipeRoughnessCoefficientDto(model); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 通过 管道ID 获取 |
| | | /// </summary> |
| | | public async Task<List<PipeLineRoughnessCoefficientDto>> GetByPipeID(long ID) |
| | | public async Task<List<PipeRoughnessCoefficientDto>> GetByPipeID(long ID) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var list = _service.GetByPipeID(ID); |
| | | var vm_list = list?.Select(x => new PipeLineRoughnessCoefficientDto(x)).ToList(); |
| | | var vm_list = list?.Select(x => new PipeRoughnessCoefficientDto(x)).ToList(); |
| | | return vm_list; |
| | | }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 通过 Ids 获取 |
| | | /// </summary> |
| | | public async Task<List<PipeLineRoughnessCoefficientDto>> GetByIds(List<long> Ids) |
| | | public async Task<List<PipeRoughnessCoefficientDto>> GetByIds(List<long> Ids) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var list = _service.GetByIds(Ids); |
| | | var vm_list = list?.Select(x => new PipeLineRoughnessCoefficientDto(x)).ToList(); |
| | | var vm_list = list?.Select(x => new PipeRoughnessCoefficientDto(x)).ToList(); |
| | | return vm_list; |
| | | }); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 插入一条 |
| | | /// </summary> |
| | | public async Task<long> Insert(AddPipeLineRoughnessCoefficientInput input) |
| | | public async Task<long> Insert(AddPipeRoughnessCoefficientInput input) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var model = input.Adapt<AddPipeLineRoughnessCoefficientInput, Model.PipeLineRoughnessCoefficient>(); |
| | | var model = input.Adapt<AddPipeRoughnessCoefficientInput, Model.PipeRoughnessCoefficient>(); |
| | | var id = _service.Insert(model); |
| | | return id; |
| | | }); |
| | |
| | | /// <summary> |
| | | /// 批量插入 |
| | | /// </summary> |
| | | public async Task<bool> Inserts(List<AddPipeLineRoughnessCoefficientInput> inputList) |
| | | public async Task<bool> Inserts(List<AddPipeRoughnessCoefficientInput> inputList) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var list = inputList.Select(x => x.Adapt<AddPipeLineRoughnessCoefficientInput, Model.PipeLineRoughnessCoefficient>()).ToList(); |
| | | var list = inputList.Select(x => x.Adapt<AddPipeRoughnessCoefficientInput, Model.PipeRoughnessCoefficient>()).ToList(); |
| | | var bol = _service.Inserts(list); |
| | | return bol; |
| | | }); |
| | |
| | | /// <summary> |
| | | /// 大批量插入 |
| | | /// </summary> |
| | | public async Task<bool> BulkInserts(List<AddPipeLineRoughnessCoefficientInput> list) |
| | | public async Task<bool> BulkInserts(List<AddPipeRoughnessCoefficientInput> list) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | |
| | | /// <summary> |
| | | /// 更新一条 |
| | | /// </summary> |
| | | public async Task<bool> Update(UpdatePipeLineRoughnessCoefficientInput input) |
| | | public async Task<bool> Update(UpdatePipeRoughnessCoefficientInput input) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | } |
| | | |
| | | var rhs = new Model.PipeLineRoughnessCoefficient(model); |
| | | var rhs = new Model.PipeRoughnessCoefficient(model); |
| | | input.Adapt(rhs); |
| | | var bol = _service.Update(rhs); |
| | | return bol; |
| | |
| | | /// <summary> |
| | | /// 批量更新 |
| | | /// </summary> |
| | | public async Task<bool> Updates(List<UpdatePipeLineRoughnessCoefficientInput> inputList) |
| | | public async Task<bool> Updates(List<UpdatePipeRoughnessCoefficientInput> inputList) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | |
| | | { |
| | | return false; |
| | | } |
| | | var list = inputList.Select(x => x.Adapt<UpdatePipeLineRoughnessCoefficientInput, Model.PipeLineRoughnessCoefficient>()).ToList(); |
| | | var list = inputList.Select(x => x.Adapt<UpdatePipeRoughnessCoefficientInput, Model.PipeRoughnessCoefficient>()).ToList(); |
| | | var bol = _service.Updates(list); |
| | | return bol; |
| | | }); |
| | |
| | | /// <summary> |
| | | /// 大批量更新 |
| | | /// </summary> |
| | | public async Task<bool> BulkUpdates(List<UpdatePipeLineRoughnessCoefficientInput> list) |
| | | public async Task<bool> BulkUpdates(List<UpdatePipeRoughnessCoefficientInput> list) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |