duheng
2024-07-18 7bf79c6515f27ba9be8d2b3fb4e3ceae5718e3e5
Service/HStation.Service.Assets.Core/03-service/03-PumpMain/PumpMain.cs
ÎļþÃû´Ó Service/HStation.Service.Xhs.PumpProduct.Core/03-service/03-PumpMain/PumpMain.cs ÐÞ¸Ä
@@ -121,6 +121,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,20 +197,24 @@
        /// <summary>
        /// æ’入拓展
        /// </summary>
        public long InsertEx(Model.PumpMain model, Model.PumpGroupAndMainMap map)
        public long InsertEx(Model.PumpMain main, Model.PumpGroupAndMainMap map, Model.PumpPartMain part, List<Model.PumpPropContent> content, Model.PumpMainAndPartMap partmap)
        {
            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 partEntity = PumpPartMain.Model2Entity(part);
            var contentEntity = PumpPropContent.Model2Entities(content);
            var partmapEntity = PumpMainAndPartMap.Model2Entity(partmap);
            var id = dal.InsertsEx(mainEntity, groupMapEntity, partEntity, contentEntity, partmapEntity);
            if (id > 0)
            {
                UpdateCache(id);
                PumpGroupAndMainMap.UpdateCacheByMainID(id);
                // PumpPartMain.Entity2Model
            }
            return id;
        }