/// <summary> /// 得到网点的经纬度 /// </summary> /// <param name="id"></param> /// <returns></returns> public string GetWebSiteLocationById(Guid id) { using (var websiteInfoService = new WebsiteInfoService()) { return(websiteInfoService.GetAll().Where(p => p.Id == id).Select(p => p.Location).FirstOrDefault()); } }
/// <summary> /// 添加网点 /// </summary> /// <param name="info">网点信息</param> /// <param name="operatorId">操作员id</param> /// <returns></returns> public async Task CreateWebSite(DTO.WebSiteInfoDto info, Guid operatorId) { var website = new Model.WebsiteInfo() { SiteName = info.Name, Province = info.Province, Address = info.Address, Location = info.Location, ChargeMan = info.ChargeMan, ChargeManTel = info.ChargeManTel, Type = info.Type.Trim() }; using (var websiteInfoService = new WebsiteInfoService()) { await websiteInfoService.CreateAsync(website); } using (var websiteInfoLogService = new WebsiteOperateLogService()) { await websiteInfoLogService.CreateAsync(new Model.WebSiteOperateLog() { WebsiteId = website.Id, OperatorId = operatorId }); } }
public List <WebsiteInfoLookDto> GetWebsite(string websiteName = null) { using (var websiteInfoService = new WebsiteInfoService()) { var websites = websiteInfoService.GetAll().Select(p => new WebsiteInfoLookDto() { Name = p.SiteName, Province = p.Province, Address = p.Address, ChargeManTel = p.ChargeManTel, ChargeMan = p.ChargeMan, Type = p.Type, CreateTime = p.CreatTime, Id = p.Id }).ToList(); if (string.IsNullOrEmpty(websiteName)) { return(websites); } else { return(websites.Where(p => p.Name == websiteName).ToList()); } } }
public List <WebSiteInfoDto> GetAllWebSite() { using (var websiteInfoService = new WebsiteInfoService()) { return(websiteInfoService.GetAllOrder().Where(p => p.Type == "1").Select(p => new WebSiteInfoDto() { Name = p.SiteName, Location = p.Location, Address = p.Address }).ToList()); } }
/// <summary> /// 根据id得到网点信息 /// </summary> /// <returns></returns> public Dictionary <Guid, string> GetAllWebSite() { using (var webSiteInfoService = new WebsiteInfoService()) { var res = new Dictionary <Guid, string>(); var websites = webSiteInfoService.GetAll(); foreach (var website in websites) { res.Add(website.Id, website.SiteName); } return(res); } }
public Dictionary <Guid, string> GetAllWebSiteLocationByType(string type, string city) { using (var websiteInfoService = new WebsiteInfoService()) { var webLocations = new Dictionary <Guid, string>(); var websites = websiteInfoService.GetAll().Where(p => p.Type == type && p.Province.Contains(city)); foreach (var website in websites) { webLocations.Add(website.Id, website.Location); } return(webLocations); } }
public List <OrderListDto> GetOrderByWebsite(out Guid id, out string websiteLocation, string name = null, string type = null) { using (var websiteServicce = new WebsiteInfoService()) { if (name == null || type == null) { id = new Guid(); websiteLocation = null; return(null); } else { var website = websiteServicce.GetAll().Where(p => p.SiteName == name).FirstOrDefault(); Guid _id = website.Id; websiteLocation = website.Location; using (var orderDetailsService = new OrderDetailsService()) { var orderData = orderDetailsService.GetAllOrder(false).Include(p => p.Order).Include(p => p.Sender).Include(p => p.Receiver) .Where(p => p.Order.Status == type && p.Order.StartWebsiteId == _id) .Select(p => new OrderListDto() { OrderId = p.Order.BarCode.Substring(2), SenderAddress = p.Sender.DetailAddress, ReceiverAddress = p.Receiver.Provinces, Time = p.GetGoodsTime, Location = type == "1" ? p.Sender.Location : p.Receiver.Location, Income = p.Freight, CargoWeight = p.CargoWeight, CargoVolume = p.CargoVolume, UnitNUm = p.UitNum }).ToList(); id = _id; return(orderData); } } } }
public async Task <BookingNoteInfoDto> GetAllOrderMess(string id) { var bookingNote = new BookingNoteInfoDto(); using (var OrderService = new OrderService()) { var order = await OrderService.GetAll().Where(p => p.BarCode == id).FirstOrDefaultAsync(); if (order != null) { bookingNote.CreateTime = order.CreatTime.ToLongDateString() + " " + order.CreatTime.ToShortTimeString(); bookingNote.OrderId = order.BarCode; switch (order.Status) { case "1": bookingNote.Stutas = "未处理"; break; case "2": bookingNote.Stutas = "接货中"; break; case "3": bookingNote.Stutas = "配货中"; break; case "4": bookingNote.Stutas = "运输中"; break; case "5": bookingNote.Stutas = "配送中"; break; default: bookingNote.Stutas = "已完成"; break; } using (var orderDetailsService = new OrderDetailsService()) { var orderDetail = await orderDetailsService.GetAll().Where(p => p.OrderId == order.Id).Include(p => p.Sender).Include(p => p.Receiver).FirstOrDefaultAsync(); bookingNote.CargoName = orderDetail.CargoName; bookingNote.CargoUnit = orderDetail.UitNum; bookingNote.CargoVolumn = (Convert.ToInt32(orderDetail.UitNum) * Convert.ToDouble(orderDetail.CargoVolume)).ToString(); bookingNote.CargoWeight = (Convert.ToInt32(orderDetail.UitNum) * Convert.ToDouble(orderDetail.CargoWeight)).ToString(); bookingNote.PayType = orderDetail.PayType ? "现付" : "到付"; bookingNote.Mark = orderDetail.Mark; bookingNote.GetGoodsTime = orderDetail.GetGoodsTime; bookingNote.Freight = orderDetail.Freight.ToString("f2"); bookingNote.ServiceFee = orderDetail.ServiceCharge.ToString("f2"); bookingNote.SenderName = orderDetail.Sender.Name; bookingNote.SMobilePhone = orderDetail.Sender.MobliePhone; bookingNote.SFirm = orderDetail.Sender.FirmName; bookingNote.STel = orderDetail.Sender.TelPhone; bookingNote.SAddress = orderDetail.Sender.Provinces + orderDetail.Sender.DetailAddress; bookingNote.ReceiverName = orderDetail.Receiver.Name; bookingNote.RMobilePhone = orderDetail.Receiver.MobliePhone; bookingNote.RFirm = orderDetail.Receiver.FirmName; bookingNote.RTel = orderDetail.Receiver.TelPhone; bookingNote.RAddress = orderDetail.Receiver.Provinces + orderDetail.Receiver.DetailAddress; if (!orderDetail.IsInsured) { bookingNote.InsureFee = "0"; bookingNote.Value = "0"; } else { using (var insuranceInfoService = new InsuranceInfoService()) { var insurance = await insuranceInfoService.GetAll().Where(p => p.OrderId == order.Id).FirstOrDefaultAsync(); bookingNote.InsureFee = insurance.Fee.ToString("f2"); bookingNote.Value = insurance.Value; } } if (order.StartWebsiteId != new Guid()) { using (var websiteInfoService = new WebsiteInfoService()) { var website = await websiteInfoService.GetAll().Where(p => p.Id == order.StartWebsiteId).FirstOrDefaultAsync(); bookingNote.WebSiteName = website.SiteName; } } else { bookingNote.WebSiteName = ""; } } return(bookingNote); } else { return(null); } } }