duheng
2024-08-12 1a12ef2743134f7fdea6d0abbfec34543b85bdb5
BLL/HStation.BLL.Assets.Core/04-bll/01-PumpProdcuct/01-PumpSeries/PumpSeries.cs
@@ -1,11 +1,14 @@
using Yw.Dto;
using AutoMapper;
using System.Collections.Generic;
using Yw;
using Yw.Dto;
namespace HStation.BLL
{
    /// <summary>
    ///
    /// </summary>
    public class PumpSeries : CAL.IPumpSeries
    public class PumpSeries
    {
        private readonly HStation.CAL.IPumpSeries _cal = CALCreateHelper.CreateCAL<HStation.CAL.IPumpSeries>();
@@ -14,17 +17,25 @@
        /// <summary>
        ///
        /// </summary>
        public async Task<List<PumpSeriesDto>> GetAll()
        public async Task<List<Vmo.PumpSeries>> GetAll()
        {
            return await _cal.GetAll();
            var DtoList = await _cal.GetAll();
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>()
 ).CreateMapper();
            var vmoList = mapper.Map<List<Dto.Assets.PumpSeriesDto>, List<Vmo.PumpSeries>>(DtoList);
            return vmoList;
        }
        /// <summary>
        ///
        /// </summary>
        public async Task<PumpSeriesDto> GetByID(long ID)
        public async Task<Vmo.PumpSeries> GetByID(long ID)
        {
            return await _cal.GetByID(ID);
            var DtoList = await _cal.GetByID(ID);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>()
 ).CreateMapper();
            var vmo = mapper.Map<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>(DtoList);
            return vmo;
        }
        /// <summary>
@@ -32,7 +43,11 @@
        /// </summary>
        public async Task<List<PumpSeriesDto>> GetByIds(List<long> Ids)
        {
            return await _cal.GetByIds(Ids);
            var DtoList = await _cal.GetByIds(Ids);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Dto.Assets.PumpSeriesDto, Vmo.PumpSeries>()
 ).CreateMapper();
            var vmoList = mapper.Map<List<Dto.Assets.PumpSeriesDto>, List<Vmo.PumpSeries>>(DtoList);
            return DtoList;
        }
        #endregion Query
@@ -42,25 +57,35 @@
        /// <summary>
        ///
        /// </summary>
        public async Task<long> Insert(AddPumpSeriesDto model)
        public async Task<long> Insert(Vmo.PumpSeries model)
        {
            return await _cal.Insert(model);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.AddPumpSeriesDto>()
).CreateMapper();
            var vmoList = mapper.Map<Vmo.PumpSeries, AddPumpSeriesDto>(model);
            return await _cal.Insert(vmoList);
        }
        /// <summary>
        ///
        /// </summary>
        public async Task<bool> Inserts(List<AddPumpSeriesDto> list)
        public async Task<bool> Inserts(List<Vmo.PumpSeries> list)
        {
            return await _cal.Inserts(list);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.AddPumpSeriesDto>()
).CreateMapper();
            var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<AddPumpSeriesDto>>(list);
            return await _cal.Inserts(vmoList);
        }
        /// <summary>
        ///
        /// </summary>
        public async Task<bool> BulkInserts(List<AddPumpSeriesDto> list)
        public async Task<bool> BulkInserts(List<Vmo.PumpSeries> list)
        {
            return await _cal.BulkInserts(list);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.AddPumpSeriesDto>()
).CreateMapper();
            var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<AddPumpSeriesDto>>(list);
            return await _cal.BulkInserts(vmoList);
        }
        #endregion Insert
@@ -70,25 +95,36 @@
        /// <summary>
        ///
        /// </summary>
        public async Task<bool> Update(UpdatePumpSeriesDto model)
        public async Task<bool> Update(Vmo.PumpSeries model)
        {
            return await _cal.Update(model);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.UpdatePumpSeriesDto>()
).CreateMapper();
            var vmo = mapper.Map<Vmo.PumpSeries, UpdatePumpSeriesDto>(model);
            return await _cal.Update(vmo);
        }
        /// <summary>
        ///
        /// </summary>
        public async Task<bool> Updates(List<UpdatePumpSeriesDto> list)
        public async Task<bool> Updates(List<Vmo.PumpSeries> list)
        {
            return await _cal.Updates(list);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.UpdatePumpSeriesDto>()
).CreateMapper();
            var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<UpdatePumpSeriesDto>>(list);
            return await _cal.Updates(vmoList);
        }
        /// <summary>
        ///
        /// </summary>
        public async Task<bool> BulkUpdates(List<UpdatePumpSeriesDto> list)
        public async Task<bool> BulkUpdates(List<Vmo.PumpSeries> list)
        {
            return await _cal.BulkUpdates(list);
            var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpSeries, Dto.Assets.UpdatePumpSeriesDto>()
).CreateMapper();
            var vmoList = mapper.Map<List<Vmo.PumpSeries>, List<UpdatePumpSeriesDto>>(list);
            return await _cal.BulkUpdates(vmoList);
        }
        /// <summary>