duheng
2024-08-21 6c88a90d2330a27c0052a22538f6ebd6200faae7
Service/HStation.Service.Assets.Core/05-service/03-PumpMain/PumpMain.cs
@@ -1,6 +1,4 @@
using System.Security.Cryptography;
namespace HStation.Service
namespace HStation.Service
{
    /// <summary>
    ///
@@ -121,6 +119,18 @@
        }
        /// <summary>
        /// 通过 ID 获取所有产品
        /// </summary>
        public List<Model.PumpPartMain> GetPartByID(long ID)
        {
            var all = GetAll();
            var allidlist = PumpMainAndPartMap.GetByPumpMainID(ID);
            var partmain = new PumpPartMain();
            var allpart = partmain.GetByIds(allidlist);
            return allpart;
        }
        /// <summary>
        /// 通过 ID 获取
        /// </summary>
        public List<Model.PumpMain> GetByIds(List<long> Ids)
@@ -185,16 +195,16 @@
        /// <summary>
        /// 插入拓展
        /// </summary>
        public long InsertEx(Model.PumpMain model, Model.PumpGroupAndMainMap map)
        public long InsertEx(Model.PumpMain main, Model.PumpGroupAndMainMap map)
        {
            if (model == null)
            if (main == null)
            {
                return default;
            }
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IPumpMain>();
            var main = Model2Entity(model);
            var entity = PumpGroupAndMainMap.Model2Entity(map);
            var id = dal.InsertsEx(main, entity);
            var mainEntity = Model2Entity(main);
            var groupMapEntity = PumpGroupAndMainMap.Model2Entity(map);
            var id = dal.InsertsEx(mainEntity, groupMapEntity);
            if (id > 0)
            {
                UpdateCache(id);