Ejemplo n.º 1
0
        public static int InsertOrUpdateAddressMapImg(AddressMap entity)
        {
            var addressMaps = AddressMapDA.QueryAddressMapList(new AddressMapFilter {
                AddressSysNo = entity.AddressSysNo, PageSize = 100
            }).data;

            if (addressMaps.Count > 0)
            {
                entity.SysNo = addressMaps.First().SysNo;
                AddressMapDA.UpdateAddressMapImg(entity);
                UpdateHomeCacheData(entity.AddressSysNo);
            }
            else
            {
                entity.SysNo = InsertAddressMap(entity);
            }

            return(entity.SysNo);
        }
        public static SmokeMap GetAddressMapSmokes(int companySysNo, int addressId)
        {
            var model = new SmokeMap();

            model.AddressNo   = addressId;
            model.AddressMaps = AddressMapDA.QueryAddressMapList(new AddressMapFilter {
                AddressSysNo = addressId, PageSize = 100000
            }).data;

            //标记点分两种 烟感器 和 下级地址
            model.Smokes  = new List <AddressMapMarker>();
            model.Markers = new List <AddressMapMarker>();
            var smokes = SmokeDetectorDA.GetSmokeDetectorByAddressSysNo(companySysNo, new List <int> {
                addressId
            });

            if (smokes != null)
            {
                smokes.ForEach(a =>
                {
                    model.Smokes.Add(new AddressMapMarker {
                        SysNo = a.SysNo, Name = string.IsNullOrEmpty(a.Position) ? a.Code : a.Position, Type = AddressMapMarkerType.SmokeDetector,
                    });
                });
            }

            var address = AddressDA.GetTopLevelChildren(addressId);

            if (address != null)
            {
                address.ForEach(a =>
                {
                    model.Smokes.Add(new AddressMapMarker {
                        SysNo = a.SysNo, Name = a.Name, Type = AddressMapMarkerType.Address,
                    });
                });
            }

            return(model);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 分页查询AddressSmoke信息
 /// </summary>
 public static QueryResult <AddressMap> QueryAddressMapList(AddressMapFilter filter)
 {
     return(AddressMapDA.QueryAddressMapList(filter));
 }