duheng
2024-07-23 3fec42c6383aa3b8d65f744a93b8a918d7cc6e02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
            });
 
        }
 
 
 
    }
}