lixiaojun
2025-01-13 abf3ceabdd98abd0d955b03732e581a43c4e9fb0
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 Yw.BLL
{
    /// <summary>
    /// 单位转换
    /// </summary>
    public partial class SysUnitTransfer
    {
        private readonly Yw.CAL.ISysUnitTransfer _cal = CALCreateHelper.CreateCAL<Yw.CAL.ISysUnitTransfer>();
 
        /// <summary>
        /// 
        /// </summary>
        public virtual async Task<List<SysUnitTransferVmo>> GetByTypeID(long TypeID)
        {
            var dtoList = await _cal.GetByTypeID(TypeID);
            return Dto2Vmos(dtoList);
        }
 
        /// <summary>
        /// 
        /// </summary>
        public virtual async Task<SysUnitTransferVmo> GetByID(long ID)
        {
            var dto = await _cal.GetByID(ID);
            return Dto2Vmo(dto);
        }
 
        /// <summary>
        /// 
        /// </summary>
        public virtual async Task<List<SysUnitTransferVmo>> GetByIds(List<long> Ids)
        {
            if (Ids == null || Ids.Count < 1)
            {
                return default;
            }
            var dtoList = await _cal.GetByIds(Ids);
            return Dto2Vmos(dtoList);
        }
 
        /// <summary>
        /// 
        /// </summary>
        public virtual async Task<bool> SetByTypeID(long TypeID, List<Yw.Vmo.SysUnitTransferTypeSetter> Setters)
        {
            var dtoList = Setters?.Select(x => new Yw.Dto.SysUnitTransferTypeSetter()
            {
                FromValueID = x.FromValueID,
                ToValueID = x.ToValueID,
                Expression = x.Expression
            }).ToList();
            var bol = await _cal.SetByTypeID(TypeID, dtoList);
            return bol;
        }
 
 
    }
}