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
41
42
43
44
45
46
47
48
49
50
51
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);
            });
        }
 
    }
}