lixiaojun
2024-07-24 61f13137f1a7f1b0410fc6666ceeee0f04576943
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
52
53
54
55
56
57
58
 
namespace HStation.CAL.LocalClient
{
    /// <summary>
    /// 报警等级
    /// </summary>
    public class XhsProjectSiteStd : IXhsProjectSiteStd
    {
        private readonly HStation.Service.XhsProjectSite _service = new();
 
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public async Task<List<XhsProjectSiteStdDto>> GetAll()
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = _service.GetAll();
                var vm_list = list?.Select(x => new XhsProjectSiteStdDto(x)).ToList();
                return vm_list;
            });
        }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ProjectID"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<List<XhsProjectSiteStdDto>> GetByProjectID(long ProjectID)
        {
            return await Task.Factory.StartNew(() =>
            {
                var list = _service.GetByProjectID(ProjectID);
                var vmList = list?.Select(x => new XhsProjectSiteStdDto(x)).ToList();
                return vmList;
            });
        }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ProjectID"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<XhsProjectSiteStdDto> GetDefaultByProjectID(long ProjectID)
        {
            return await Task.Run(() =>
            {
                var model = _service.GetDefaultByProjectID(ProjectID);
                return model == null ? null : new XhsProjectSiteStdDto(model);
            });
        }
 
 
    }
}