namespace HStation.CAL.LocalClient
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class XhsPumpPhartMappingStd : IXhsPumpPhartMappingStd
|
{
|
private readonly HStation.Service.XhsPumpPhartMapping _service = new();
|
|
|
/// <summary>
|
/// 通过 PumpID 获取
|
/// </summary>
|
public async Task<List<XhsPumpPhartMappingStdDto>> GetByPumpID(long PumpID)
|
{
|
return await Task.Factory.StartNew(() =>
|
{
|
var list = _service.GetByPumpID(PumpID);
|
var vm_list = list?.Select(x => new XhsPumpPhartMappingStdDto(x)).ToList();
|
return vm_list;
|
});
|
}
|
|
/// <summary>
|
/// 通过 PumpIds 获取
|
/// </summary>
|
public async Task<List<XhsPumpPhartMappingStdDto>> GetByPumpIds(List<long> PumpIds)
|
{
|
return await Task.Factory.StartNew(() =>
|
{
|
var list = _service.GetByPumpIds(PumpIds);
|
var vm_list = list?.Select(x => new XhsPumpPhartMappingStdDto(x)).ToList();
|
return vm_list;
|
});
|
}
|
|
|
/// <summary>
|
/// 通过 PumpID 获取默认
|
/// </summary>
|
public async Task<XhsPumpPhartMappingStdDto> GetDefaultByPumpID(long PumpID)
|
{
|
return await Task.Factory.StartNew(() =>
|
{
|
var model = _service.GetDefaultByPumpID(PumpID);
|
return model == null ? null : new XhsPumpPhartMappingStdDto(model);
|
});
|
}
|
|
}
|
}
|