namespace HStation.CAL.LocalClient
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class XhsPumpPhartMappingExtensionsStd : IXhsPumpPhartMappingExtensionsStd
|
{
|
private readonly HStation.Service.XhsPumpPhartMapping _service = new();
|
|
/// <summary>
|
/// 通过 PumpID 获取
|
/// </summary>
|
public async Task<List<XhsPumpPhartMappingExtensionsStdDto>> GetByPumpID(long PumpID)
|
{
|
return await Task.Factory.StartNew(() =>
|
{
|
var list = _service.GetTupleByPumpID(PumpID);
|
var vm_list = list?.Select(x => new XhsPumpPhartMappingExtensionsStdDto(x.Item1, x.Item2, x.Item3)).ToList();
|
return vm_list;
|
});
|
|
}
|
|
/// <summary>
|
/// 通过 PumpID 获取默认
|
/// </summary>
|
public async Task<XhsPumpPhartMappingExtensionsStdDto> GetDefaultByPumpID(long PumpID)
|
{
|
return await Task.Factory.StartNew(() =>
|
{
|
var model = _service.GetTupleDefaultByPumpID(PumpID);
|
return model == null ? null : new XhsPumpPhartMappingExtensionsStdDto(model.Item1, model.Item2, model.Item3);
|
});
|
|
}
|
|
|
|
}
|
}
|