Beispiel #1
0
        public void FlushUnhandledAddress()
        {
            var list = InterviewBll.LoadEntities(i => string.IsNullOrEmpty(i.Address)).AsEnumerable();

            list.ForEach(i =>
            {
                PhysicsAddress addr = i.IP.GetPhysicsAddressInfo().Result;
                if (addr?.Status == 0)
                {
                    i.Address           = $"{addr.AddressResult.FormattedAddress} {addr.AddressResult.AddressComponent.Direction}{addr.AddressResult.AddressComponent.Distance}米";
                    i.Province          = addr.AddressResult.AddressComponent.Province;
                    IList <string> strs = new List <string>();
                    addr.AddressResult.Pois.ForEach(s => strs.Add($"{s.AddressDetail} {s.Direction}{s.Distance}米"));
                    i.ReferenceAddress = string.Join("|", strs);
                }
                i.ISP = i.IP.GetISP();
                InterviewBll.UpdateEntitySaved(i);
            });
            InterviewBll.DeleteEntitySaved(i => i.IP.Contains(":") || i.IP.Equals("127.0.0.1"));
        }