/// <summary> /// 快递信息 /// </summary> /// <param name="orderId">订单Id</param> public ActionResult ExpressInfo(long orderId) { var order = OrderApplication.GetOrder(orderId); if (order == null) { throw new HimallException("错误的订单编号"); } if (order.ShopBranchId > 0) { var sbdata = ShopBranchApplication.GetShopBranchById(order.ShopBranchId); if (sbdata != null) { ViewBag.StoreLat = sbdata.Latitude; ViewBag.Storelng = sbdata.Longitude; } } else { var shopshiper = ShopShippersApplication.GetDefaultSendGoodsShipper(order.ShopId); if (shopshiper != null) { ViewBag.StoreLat = shopshiper.Latitude; ViewBag.Storelng = shopshiper.Longitude; } } return(View(order)); }
/// <summary> /// 已完成 /// </summary> /// <param name="orderId"></param> public static void SetOrderFinished(long orderId) { var order = OrderApplication.GetOrder(orderId); var member = MemberApplication.GetMember(order.UserId); OrderApplication.MembeConfirmOrder(orderId, member.UserName); }
/// <summary> /// 根据预约单ID获取结算详情(传入shopId防止跨诊所调用) /// </summary> /// <param name="orderId">预约单ID</param> /// <param name="shopId">诊所ID</param> /// <returns></returns> public static OrderSettlementDetail GetOrderSettlementDetail(long orderId, long?shopId = null) { var model = _iBillingService.GetSettlementOrderDetail(orderId); if (shopId.HasValue && shopId.Value != model.ShopId) { throw new Core.HimallException("找不到该诊所的结算详情"); } var order = OrderApplication.GetOrder(orderId); var refund = RefundApplication.GetOrderRefundList(orderId); OrderSettlementDetail detail = new OrderSettlementDetail(); detail.Freight = model.FreightAmount; detail.RefundAmount = model.RefundTotalAmount; detail.DistributorCommission = model.BrokerageAmount; detail.DistributorCommissionReturn = model.ReturnBrokerageAmount; detail.PlatCommission = model.CommissionAmount; detail.PlatCommissionReturn = model.RefundCommisAmount; detail.ProductsTotal = model.ProductActualPaidAmount; detail.OrderPayTime = order.PayDate.Value.ToString("yyyy-MM-dd HH:mm:ss"); if (refund != null && refund.Count > 0) { detail.OrderRefundTime = refund.FirstOrDefault().ManagerConfirmDate.ToString("yyyy-MM-dd HH:mm:ss"); } return(detail); }
public ActionResult Detail(long id) { var refund = _iRefundService.GetOrderRefund(id, CurrentUser.Id); if (refund == null) { refund = _iRefundService.GetOrderRefundById(id); if (refund == null) { throw new MallException("错误的退款服务号"); } } ViewBag.UserName = CurrentUser.UserName; int curappnum = refund.ApplyNumber; refund.IsOrderRefundTimeOut = _iOrderService.IsRefundTimeOut(refund.OrderId); var order = OrderApplication.GetOrder(refund.OrderId); var refundLogs = RefundApplication.GetRefundLogs(refund.Id, curappnum, true); if (order.DeliveryType == DeliveryType.SelfTake || order.ShopBranchId > 0) { foreach (var item in refundLogs) { var temp = item.OperateContent.Split('】'); item.OperateContent = temp[0].Replace("商家", "门店") + '】' + temp[1]; } } ViewBag.Order = order; ViewBag.RefundLogs = refundLogs; ViewBag.Keyword = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword; ViewBag.Keywords = SiteSettings.HotKeyWords; return(View(refund)); }
public object GetCancelDadaExpress(long orderId, int reasonId, string cancelReason) { CheckUserLogin(); long shopid = CurrentShopBranch.ShopId; long sbid = CurrentUser.ShopBranchId; var order = OrderApplication.GetOrder(orderId); if (order == null || order.ShopBranchId != sbid || order.OrderStatus != Entities.OrderInfo.OrderOperateStatus.WaitReceiving || order.DeliveryType != DeliveryType.CityExpress) { throw new HimallApiException("错误的订单编号"); } if (order.DadaStatus > DadaStatus.WaitTake.GetHashCode()) { throw new HimallApiException("订单配送不可取消!"); } var sbdata = ShopBranchApplication.GetShopBranchById(sbid); string json = ExpressDaDaHelper.orderFormalCancel(shopid, orderId.ToString(), reasonId, cancelReason); var resultObj = JsonConvert.DeserializeObject(json) as JObject; string status = resultObj["status"].ToString(); if (status != "success") { throw new HimallApiException(resultObj["msg"].ToString()); } ExpressDaDaApplication.SetOrderCancel(orderId, "商家主动取消"); var result = JsonConvert.DeserializeObject(resultObj["result"].ToString()) as JObject; return(new { success = true, deduct_fee = result["deduct_fee"].ToString() }); }
public ActionResult Detail(long id) { var refund = _iRefundService.GetOrderRefund(id, CurrentUser.Id); if (refund == null) { throw new HimallException("错误的退款服务号"); } ViewBag.UserName = CurrentUser.UserName; int curappnum = refund.ApplyNumber.HasValue ? refund.ApplyNumber.Value : 1; refund.IsOrderRefundTimeOut = _iOrderService.IsRefundTimeOut(refund.OrderId); var order = OrderApplication.GetOrder(refund.OrderId); refund.Order = order; var refundLogs = RefundApplication.GetRefundLogs(refund.Id, curappnum, false); if (order.DeliveryType == Himall.CommonModel.Enum.DeliveryType.SelfTake || (order.ShopBranchId.HasValue && order.ShopBranchId.Value > 0)) { foreach (var item in refundLogs) { var temp = item.OperateContent.Split('】'); item.OperateContent = temp[0].Replace("诊所", "门店") + '】' + temp[1]; } } ViewBag.RefundLogs = refundLogs; return(View(refund)); }
public JsonResult dadaOrderNotify(long order_id, int order_status, string client_id, string cancel_reason , int?cancel_from, int?update_time, string signature, int?dm_id, string dm_name, string dm_mobile) { Core.Log.Error("快递信息回调:" + order_id + "_" + order_status + "_" + client_id); var order = OrderApplication.GetOrder(order_id); if (order != null || order_status != 0) { if (order_status == (int)DadaStatus.Cancel) { ExpressDaDaApplication.SetOrderCancel(order_id, cancel_reason); } else if (order_status == (int)DadaStatus.WaitTake) { ExpressDaDaApplication.SetOrderWaitTake(order_id, client_id); OrderApplication.SendMessageOnOrderShipping(order_id); //发送发货消息 } else if (order_status == (int)DadaStatus.Finished) { ExpressDaDaApplication.SetOrderFinished(order_id); } //Core.Log.Error("快递信息回调已进入调用处理:" + order_id + "_" + order_status + "_" + client_id); ExpressDaDaApplication.SetOrderDadaStatus(order_id, order_status, client_id); } return(Json(new { })); }
/// <summary> /// 取发送记录 /// </summary> /// <param name="query"></param> /// <returns></returns> public static QueryPageModel <SendMessageRecord> GetSendRecords(IServices.QueryModel.SendRecordQuery query) { var data = _iWXMsgTemplateService.GetSendRecords(query); QueryPageModel <SendMessageRecord> item = new QueryPageModel <SendMessageRecord>(); item.Total = data.Total; var list = data.Models.ToList(); var dataList = Mapper.Map <List <SendMessageRecord> >(list); foreach (var info in dataList) { var record = _iWXMsgTemplateService.GetSendrecordCouponSnById(info.Id); info.CurrentCouponCount = record.Count; foreach (var items in record) { var result = _iWXMsgTemplateService.GetCouponRecordBySn(items.CouponSN); var orderResult = result.OrderId == null ? null : OrderApplication.GetOrder(result.OrderId.Value); if (result != null && orderResult != null) { info.CurrentUseCouponCount++; } } } item.Models = dataList; return(item); }
// GET: Web/OrderEvaluation public ActionResult Index(long id) { var model = CommentApplication.GetProductEvaluationByOrderId(id, CurrentUser.Id); var orderEvaluation = TradeCommentApplication.GetOrderComment(id, CurrentUser.Id); if (orderEvaluation != null) { ViewBag.Mark = Math.Round((orderEvaluation.PackMark + orderEvaluation.ServiceMark + orderEvaluation.DeliveryMark) / 3D); } else { ViewBag.Mark = 0; } ViewBag.OrderId = id; //检查当前产品是否产自官方自营店 ViewBag.IsSellerAdminProdcut = OrderApplication.GetOrder(id).ShopId.Equals(1L); ViewBag.Keyword = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword; ViewBag.Keywords = SiteSettings.HotKeyWords; var orderInfo = OrderApplication.GetOrder(id); if (orderInfo != null) { ViewBag.IsVirtual = orderInfo.OrderType == Himall.Entities.OrderInfo.OrderTypes.Virtual ? 1 : 0; } return(View(model)); }
/// <summary> /// 获取达达订单信息 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public JsonResult searchDada(long orderId) { var order = OrderApplication.GetOrder(orderId); string json = ExpressDaDaHelper.orderStatusQuery(order.ShopId, orderId.ToString()); var resultObj = JsonConvert.DeserializeObject(json) as JObject; var rdic = ExpressDaDaHelper.ToDictionary(resultObj); return Json(rdic, JsonRequestBehavior.AllowGet); }
private int GetShopbranch(long id) { var info = OrderApplication.GetOrder(id); if (info != null && info.ShopBranchId > 0) { return(1); } return(0); }
public object GetElectronicCredentials(long orderId) { bool validityType = false; string validityDate = string.Empty, validityDateStart = string.Empty; int total = 0; List <OrderVerificationCodeInfo> orderVerificationCodes = null; var orderInfo = OrderApplication.GetOrder(orderId); if (orderInfo != null && orderInfo.OrderType == OrderInfo.OrderTypes.Virtual) { var orderItemInfo = OrderApplication.GetOrderItemsByOrderId(orderId).FirstOrDefault(); if (orderItemInfo != null) { var virtualProductInfo = ProductManagerApplication.GetVirtualProductInfoByProductId(orderItemInfo.ProductId); if (virtualProductInfo != null) { validityType = virtualProductInfo.ValidityType; if (validityType) { validityDate = virtualProductInfo.EndDate.Value.ToString("yyyy-MM-dd"); validityDateStart = virtualProductInfo.StartDate.Value.ToString("yyyy-MM-dd"); } } orderVerificationCodes = OrderApplication.GetOrderVerificationCodeInfosByOrderIds(new List <long>() { orderId }); total = orderVerificationCodes.Count; orderVerificationCodes.ForEach(a => { a.QRCode = GetQRCode(a.VerificationCode); a.VerificationCode = System.Text.RegularExpressions.Regex.Replace(a.VerificationCode, @"(\d{4})", "$1 "); }); } } return(new { success = true, validityType = validityType, validityDate = validityDate, validityDateStart = validityDateStart, total = total, orderVerificationCodes = orderVerificationCodes.Select(a => { return new { QRCode = a.QRCode, VerificationCode = a.VerificationCode, Status = a.Status, StatusText = a.Status.ToDescription() }; }) }); }
public ActionResult Details(long orderId) { var orderComment = TradeCommentApplication.GetOrderComment(orderId, CurrentUser.Id); ViewBag.PackMark = orderComment != null ? orderComment.PackMark - 1 : -1; ViewBag.DeliveryMark = orderComment != null ? orderComment.DeliveryMark - 1 : -1; ViewBag.ServiceMark = orderComment != null ? orderComment.ServiceMark - 1 : -1; var model = CommentApplication.GetProductEvaluationByOrderIdNew(orderId, CurrentUser.Id); ViewBag.IsSellerAdminProdcut = OrderApplication.GetOrder(orderId).ShopId.Equals(1L); return(View(model)); }
public JsonResult CheckIsComment(long orderId) { var order = OrderApplication.GetOrder(orderId); var orderComments = OrderApplication.GetOrderCommentCount(new[] { orderId }); bool valid = false; if (order != null && (!orderComments.ContainsKey(orderId) || orderComments[orderId] == 0)) { // 订单还未被评价过,有效 valid = true; } return(SuccessResult <dynamic>(data: new { valid = valid })); }
/// <summary> /// 获取一条退货记录 /// </summary> /// <param name="id"></param> public static OrderRefund GetOrderRefund(long id, long?userId = null, long?shopId = null) { var data = Service.GetOrderRefund(id, userId); if (data == null) { return(null); } var order = OrderApplication.GetOrder(data.OrderId); var result = data.Map <DTO.OrderRefund>(); result.IsShopBranchOrder = order.ShopBranchId > 0; result.IsVirtual = order.OrderType == OrderInfo.OrderTypes.Virtual; return(result); }
/// <summary> /// 门店发货 /// </summary> /// <param name="model"></param> /// <returns></returns> public object PostShopSendGood(OrderDeliveryModel model) { CheckUserLogin(); string shopkeeperName = ""; long shopid = CurrentShopBranch.ShopId; long sbid = CurrentUser.ShopBranchId; shopkeeperName = CurrentShopBranch.UserName; var returnurl = String.Format("{0}/Common/ExpressData/SaveExpressData", CurrentUrlHelper.CurrentUrlNoPort()); if (model.deliveryType == DeliveryType.CityExpress.GetHashCode()) //同城物流 { var dadaconfig = CityExpressConfigApplication.GetDaDaCityExpressConfig(shopid); if (!dadaconfig.IsEnable) { throw new HimallApiException("未开启同城合作物流"); } var order = OrderApplication.GetOrder(model.orderId); if (order == null || order.ShopId != shopid || !(order.ShopBranchId > 0) || order.OrderStatus != Entities.OrderInfo.OrderOperateStatus.WaitDelivery) { throw new HimallApiException("错误的订单编号"); } //Log.Error("达达发货ShopBranchOrder-开始01:orderId:" + model.orderId); var sbdata = ShopBranchApplication.GetShopBranchById(sbid); string json = ExpressDaDaHelper.addAfterQuery(shopid, sbdata.DaDaShopId, model.shipOrderNumber); var resultObj = JsonConvert.DeserializeObject(json) as JObject; string status = resultObj["status"].ToString(); //Log.Error("达达发货ShopBranchOrder-开始02:status:" + status); if (status != "success") { //订单码过期,重发单 json = SendDaDaExpress(model.orderId, shopid, sbid, false); var rObj2 = JsonConvert.DeserializeObject(json) as JObject; string status2 = rObj2["status"].ToString(); if (status2 != "success") { string msg = rObj2["msg"].ToString(); return(ErrorResult(msg)); } } } OrderApplication.ShopSendGood(model.orderId, model.deliveryType, shopkeeperName, model.companyName, model.shipOrderNumber, returnurl); return(SuccessResult("发货成功")); }
// GET: Web/OrderEvaluation public ActionResult Index(long id) { var model = CommentApplication.GetProductEvaluationByOrderId(id, CurrentUser.Id); var orderEvaluation = TradeCommentApplication.GetOrderComment(id, CurrentUser.Id); if (orderEvaluation != null) { ViewBag.Mark = Math.Round((orderEvaluation.PackMark + orderEvaluation.ServiceMark + orderEvaluation.DeliveryMark) / 3D); } else { ViewBag.Mark = 0; } ViewBag.OrderId = id; //检查当前产品是否产自官方自营店 ViewBag.IsSellerAdminProdcut = OrderApplication.GetOrder(id).ShopId.Equals(1L); return(View(model)); }
/// <summary> /// 电子凭证 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public ActionResult ElectronicCredentials(long orderId) { bool validityType = false; string validityDate = string.Empty, validityDateStart = string.Empty; int total = 0; List <OrderVerificationCodeInfo> orderVerificationCodes = null; var orderInfo = OrderApplication.GetOrder(orderId); if (orderInfo != null && orderInfo.OrderType == OrderInfo.OrderTypes.Virtual) { var orderItemInfo = OrderApplication.GetOrderItemsByOrderId(orderId).FirstOrDefault(); if (orderItemInfo != null) { var virtualProductInfo = ProductManagerApplication.GetVirtualProductInfoByProductId(orderItemInfo.ProductId); if (virtualProductInfo != null) { validityType = virtualProductInfo.ValidityType; if (validityType) { validityDate = virtualProductInfo.EndDate.Value.ToString("yyyy-MM-dd"); validityDateStart = virtualProductInfo.StartDate.Value.ToString("yyyy-MM-dd"); } } orderVerificationCodes = OrderApplication.GetOrderVerificationCodeInfosByOrderIds(new List <long>() { orderId }); total = orderVerificationCodes.Count; orderVerificationCodes.ForEach(a => { a.QRCode = GetQRCode(a.VerificationCode); }); } } ViewBag.validityType = validityType; ViewBag.validityDate = validityDate; ViewBag.validityDateStart = validityDateStart; ViewBag.total = total; ViewBag.orderVerificationCodes = orderVerificationCodes; return(View()); }
public ActionResult Details(long orderId) { var orderComment = TradeCommentApplication.GetOrderComment(orderId, CurrentUser.Id); ViewBag.PackMark = orderComment != null ? orderComment.PackMark - 1 : -1; ViewBag.DeliveryMark = orderComment != null ? orderComment.DeliveryMark - 1 : -1; ViewBag.ServiceMark = orderComment != null ? orderComment.ServiceMark - 1 : -1; var model = CommentApplication.GetProductEvaluationByOrderIdNew(orderId, CurrentUser.Id); var orderInfo = OrderApplication.GetOrder(orderId); bool isVirtual = false; if (orderInfo != null) { ViewBag.IsSellerAdminProdcut = orderInfo.ShopId.Equals(1L); isVirtual = orderInfo.OrderType == Entities.OrderInfo.OrderTypes.Virtual; } ViewBag.IsVirtual = isVirtual; ViewBag.Keyword = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword; ViewBag.Keywords = SiteSettings.HotKeyWords; return(View(model)); }
// GET: Mobile/Comment public ActionResult Index(long orderId) { var order = OrderApplication.GetOrder(orderId); var orderComments = OrderApplication.GetOrderCommentCount(new[] { orderId }); bool valid = false; if (order != null && (!orderComments.ContainsKey(orderId) || orderComments[orderId] == 0)) { // 订单还未被评价过,有效 valid = true; var model = CommentApplication.GetProductEvaluationByOrderId(orderId, CurrentUser.Id); var orderEvaluation = TradeCommentApplication.GetOrderComment(orderId, CurrentUser.Id); ViewBag.Products = model; var orderItems = OrderApplication.GetOrderItemsByOrderId(orderId); ViewBag.OrderItemIds = orderItems.Select(item => item.Id); } ViewBag.Valid = valid; return(View()); }
/// <summary> /// 订单提货码 /// </summary> /// <param name="id"></param> /// <returns></returns> public object GetPickupGoods(long id) { CheckUserLogin(); var orderInfo = OrderApplication.GetOrder(id); if (orderInfo == null) { return(Json(new { Success = "false", ErrorMsg = "订单不存在!" })); } if (orderInfo.UserId != CurrentUser.Id) { return(Json(new { Success = "false", ErrorMsg = "只能查看自己的提货码!" })); } var productService = ServiceProvider.Instance <IProductService> .Create; AutoMapper.Mapper.CreateMap <Order, Himall.DTO.OrderListModel>(); AutoMapper.Mapper.CreateMap <DTO.OrderItem, OrderItemListModel>(); var orderModel = AutoMapper.Mapper.Map <Order, Himall.DTO.OrderListModel>(orderInfo); var orderItems = OrderApplication.GetOrderItemsByOrderId(orderInfo.Id); var newOrderItems = new List <DTO.OrderItem>(); foreach (var item in orderItems) { item.ThumbnailsUrl = Core.HimallIO.GetRomoteProductSizeImage(productService.GetProduct(item.ProductId).RelativePath, 1, (int)Himall.CommonModel.ImageSize.Size_50); // item.ThumbnailsUrl = Himall.Core.HimallIO.GetRomoteProductSizeImage(item.ThumbnailsUrl, 1, (int)Himall.CommonModel.ImageSize.Size_50); newOrderItems.Add(item); } // orderModel.OrderItemList = AutoMapper.Mapper.Map<List<DTO.OrderItem>, List<OrderItemListModel>>(orderItems); orderModel.OrderItemList = AutoMapper.Mapper.Map <List <DTO.OrderItem>, List <OrderItemListModel> >(newOrderItems); if (orderInfo.ShopBranchId.HasValue && orderInfo.ShopBranchId.Value != 0) {//补充数据 var branch = ShopBranchApplication.GetShopBranchById(orderInfo.ShopBranchId.Value); orderModel.ShopBranchName = branch.ShopBranchName; orderModel.ShopBranchAddress = branch.AddressFullName; orderModel.ShopBranchContactPhone = branch.ContactPhone; } return(Json(new { Success = "true", OrderModel = orderModel })); }
/// <summary> /// 拼团活动商品详情 /// </summary> /// <param name="id">拼团活动ID</param> /// /// <param name="grouId">团活动ID</param> /// <returns></returns> public JsonResult <Result <dynamic> > GetActiveDetail(long id, long grouId = 0, bool isFirst = true, string ids = "") { var userList = new List <FightGroupOrderInfo>(); var data = FightGroupApplication.GetActive(id, true, true); FightGroupActiveModel result = data; //先初始化拼团商品主图 result.InitProductImages(); var imgpath = data.ProductImgPath; if (result != null) { result.IsEnd = true; if (data.EndTime.Date >= DateTime.Now.Date) { result.IsEnd = false; } //商品图片地址修正 result.ProductDefaultImage = HimallIO.GetRomoteProductSizeImage(imgpath, 1, (int)ImageSize.Size_350); result.ProductImgPath = HimallIO.GetRomoteProductSizeImage(imgpath, 1); } if (result.ProductImages != null) {//将主图相对路径处理为绝对路径 result.ProductImages = result.ProductImages.Select(e => HimallIO.GetRomoteImagePath(e)).ToList(); } if (!string.IsNullOrWhiteSpace(result.IconUrl)) { result.IconUrl = Himall.Core.HimallIO.GetRomoteImagePath(result.IconUrl); } bool IsUserEnter = false; long currentUser = 0; if (CurrentUser != null) { currentUser = CurrentUser.Id; } if (grouId > 0)//获取已参团的用户 { userList = ServiceProvider.Instance <IFightGroupService> .Create.GetActiveUsers(id, grouId); foreach (var item in userList) { item.Photo = !string.IsNullOrWhiteSpace(item.Photo) ? Core.HimallIO.GetRomoteImagePath(item.Photo) : ""; item.HeadUserIcon = !string.IsNullOrWhiteSpace(item.HeadUserIcon) ? Core.HimallIO.GetRomoteImagePath(item.HeadUserIcon) : ""; if (currentUser.Equals(item.OrderUserId)) { IsUserEnter = true; } } } #region 商品规格 var product = ProductManagerApplication.GetProduct((long)result.ProductId); ProductShowSkuInfoModel model = new ProductShowSkuInfoModel(); model.MinSalePrice = data.MiniSalePrice; model.ProductImagePath = string.IsNullOrWhiteSpace(imgpath) ? "" : HimallIO.GetRomoteProductSizeImage(imgpath, 1, (int)Himall.CommonModel.ImageSize.Size_350); List <SKUDataModel> skudata = data.ActiveItems.Where(d => d.ActiveStock > 0).Select(d => new SKUDataModel { SkuId = d.SkuId, Color = d.Color, Size = d.Size, Version = d.Version, Stock = (int)d.ActiveStock, CostPrice = d.ProductCostPrice, SalePrice = d.ProductPrice, Price = d.ActivePrice, }).ToList(); Entities.TypeInfo typeInfo = ServiceProvider.Instance <ITypeService> .Create.GetType(product.TypeId); string colorAlias = (typeInfo == null || string.IsNullOrEmpty(typeInfo.ColorAlias)) ? SpecificationType.Color.ToDescription() : typeInfo.ColorAlias; string sizeAlias = (typeInfo == null || string.IsNullOrEmpty(typeInfo.SizeAlias)) ? SpecificationType.Size.ToDescription() : typeInfo.SizeAlias; string versionAlias = (typeInfo == null || string.IsNullOrEmpty(typeInfo.VersionAlias)) ? SpecificationType.Version.ToDescription() : typeInfo.VersionAlias; if (product != null) { colorAlias = !string.IsNullOrWhiteSpace(product.ColorAlias) ? product.ColorAlias : colorAlias; sizeAlias = !string.IsNullOrWhiteSpace(product.SizeAlias) ? product.SizeAlias : sizeAlias; versionAlias = !string.IsNullOrWhiteSpace(product.VersionAlias) ? product.VersionAlias : versionAlias; } model.ColorAlias = colorAlias; model.SizeAlias = sizeAlias; model.VersionAlias = versionAlias; if (result.ActiveItems != null && result.ActiveItems.Count() > 0) { long colorId = 0, sizeId = 0, versionId = 0; var skus = ProductManagerApplication.GetSKUs((long)result.ProductId); foreach (var sku in result.ActiveItems) { var specs = sku.SkuId.Split('_'); if (specs.Count() > 0 && !string.IsNullOrEmpty(sku.Color)) { if (long.TryParse(specs[1], out colorId)) { } if (colorId != 0) { if (!model.Color.Any(v => v.Value.Equals(sku.Color))) { var c = result.ActiveItems.Where(s => s.Color.Equals(sku.Color)).Sum(s => s.ActiveStock); model.Color.Add(new ProductSKU { //Name = "选择颜色", Name = "选择" + colorAlias, EnabledClass = c != 0 ? " " : "disabled", //SelectedClass = !model.Color.Any(c1 => c1.SelectedClass.Equals("selected")) && c != 0 ? "selected" : "", SelectedClass = "", SkuId = colorId, Value = sku.Color, Img = string.IsNullOrWhiteSpace(sku.ShowPic) ? "" : Core.HimallIO.GetRomoteImagePath(sku.ShowPic) }); } } } if (specs.Count() > 1 && !string.IsNullOrEmpty(sku.Size)) { if (long.TryParse(specs[2], out sizeId)) { } if (sizeId != 0) { if (!model.Size.Any(v => v.Value.Equals(sku.Size))) { var ss = result.ActiveItems.Where(s => s.Size.Equals(sku.Size)).Sum(s1 => s1.ActiveStock); model.Size.Add(new ProductSKU { //Name = "选择尺码", Name = "选择" + sizeAlias, EnabledClass = ss != 0 ? "enabled" : "disabled", SelectedClass = "", SkuId = sizeId, Value = sku.Size }); } } } if (specs.Count() > 2 && !string.IsNullOrEmpty(sku.Version)) { if (long.TryParse(specs[3], out versionId)) { } if (versionId != 0) { if (!model.Version.Any(v => v.Value.Equals(sku.Version))) { var v = result.ActiveItems.Where(s => s.Version.Equals(sku.Version)).Sum(s => s.ActiveStock); model.Version.Add(new ProductSKU { //Name = "选择规格", Name = "选择" + versionAlias, EnabledClass = v != 0 ? "enabled" : "disabled", SelectedClass = "", SkuId = versionId, Value = sku.Version }); } } } } } #endregion var cashDepositModel = CashDepositsApplication.GetCashDepositsObligation((long)result.ProductId);//提供服务(消费者保障、七天无理由、及时发货) var GroupsData = new List <FightGroupsListModel>(); List <FightGroupBuildStatus> stlist = new List <FightGroupBuildStatus>(); stlist.Add(FightGroupBuildStatus.Ongoing); GroupsData = FightGroupApplication.GetGroups(id, stlist, null, null, 1, 10).Models.ToList(); foreach (var item in GroupsData) { TimeSpan mid = item.AddGroupTime.AddHours((double)item.LimitedHour) - DateTime.Now; item.Seconds = (int)mid.TotalSeconds; item.EndHourOrMinute = item.ShowHourOrMinute(item.GetEndHour); item.HeadUserIcon = !string.IsNullOrWhiteSpace(item.HeadUserIcon) ? Core.HimallIO.GetRomoteImagePath(item.HeadUserIcon) : ""; } #region 商品评论 ProductCommentShowModel modelSay = new ProductCommentShowModel(); modelSay.ProductId = (long)result.ProductId; var productSay = ProductManagerApplication.GetProduct((long)result.ProductId); modelSay.CommentList = new List <ProductDetailCommentModel>(); modelSay.IsShowColumnTitle = true; modelSay.IsShowCommentList = true; if (productSay == null) { //跳转到404页面 throw new Core.HimallException("商品不存在"); } var comments = CommentApplication.GetCommentsByProduct(product.Id); modelSay.CommentCount = comments.Count; if (comments.Count > 0) { var comment = comments.OrderByDescending(a => a.ReviewDate).FirstOrDefault(); var orderItem = OrderApplication.GetOrderItem(comment.SubOrderId); var order = OrderApplication.GetOrder(orderItem.OrderId); modelSay.CommentList = comments.OrderByDescending(a => a.ReviewDate) .Take(1) .Select(c => { var images = CommentApplication.GetProductCommentImagesByCommentIds(new List <long> { c.Id }); return(new ProductDetailCommentModel { Sku = ServiceProvider.Instance <IProductService> .Create.GetSkuString(orderItem.SkuId), UserName = c.UserName, ReviewContent = c.ReviewContent, AppendContent = c.AppendContent, AppendDate = c.AppendDate, ReplyAppendContent = c.ReplyAppendContent, ReplyAppendDate = c.ReplyAppendDate, FinshDate = order.FinishDate, Images = images.Where(a => a.CommentType == 0).Select(a => a.CommentImage).ToList(), AppendImages = images.Where(a => a.CommentType == 1).Select(a => a.CommentImage).ToList(), ReviewDate = c.ReviewDate, ReplyContent = string.IsNullOrWhiteSpace(c.ReplyContent) ? "暂无回复" : c.ReplyContent, ReplyDate = c.ReplyDate, ReviewMark = c.ReviewMark, BuyDate = order.OrderDate }); }).ToList(); foreach (var citem in modelSay.CommentList) { if (citem.Images.Count > 0) { for (var _imgn = 0; _imgn < citem.Images.Count; _imgn++) { citem.Images[_imgn] = Himall.Core.HimallIO.GetRomoteImagePath(citem.Images[_imgn]); } } if (citem.AppendImages.Count > 0) { for (var _imgn = 0; _imgn < citem.AppendImages.Count; _imgn++) { citem.AppendImages[_imgn] = Himall.Core.HimallIO.GetRomoteImagePath(citem.AppendImages[_imgn]); } } } } #endregion #region 店铺信息 VShopShowShopScoreModel modelShopScore = new VShopShowShopScoreModel(); modelShopScore.ShopId = result.ShopId; var shop = ServiceProvider.Instance <IShopService> .Create.GetShop(result.ShopId); if (shop == null) { throw new HimallException("错误的店铺信息"); } modelShopScore.ShopName = shop.ShopName; #region 获取店铺的评价统计 var shopStatisticOrderComments = ServiceProvider.Instance <IShopService> .Create.GetShopStatisticOrderComments(result.ShopId); var productAndDescription = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.ProductAndDescription).FirstOrDefault(); var sellerServiceAttitude = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerServiceAttitude).FirstOrDefault(); var sellerDeliverySpeed = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerDeliverySpeed).FirstOrDefault(); var productAndDescriptionPeer = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.ProductAndDescriptionPeer).FirstOrDefault(); var sellerServiceAttitudePeer = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerServiceAttitudePeer).FirstOrDefault(); var sellerDeliverySpeedPeer = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerDeliverySpeedPeer).FirstOrDefault(); var productAndDescriptionMax = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.ProductAndDescriptionMax).FirstOrDefault(); var productAndDescriptionMin = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.ProductAndDescriptionMin).FirstOrDefault(); var sellerServiceAttitudeMax = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerServiceAttitudeMax).FirstOrDefault(); var sellerServiceAttitudeMin = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerServiceAttitudeMin).FirstOrDefault(); var sellerDeliverySpeedMax = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerDeliverySpeedMax).FirstOrDefault(); var sellerDeliverySpeedMin = shopStatisticOrderComments.Where(c => c.CommentKey == Entities.StatisticOrderCommentInfo.EnumCommentKey.SellerDeliverySpeedMin).FirstOrDefault(); decimal defaultValue = 5; modelShopScore.SellerServiceAttitude = defaultValue; modelShopScore.SellerServiceAttitudePeer = defaultValue; modelShopScore.SellerServiceAttitudeMax = defaultValue; modelShopScore.SellerServiceAttitudeMin = defaultValue; //宝贝与描述 if (productAndDescription != null && productAndDescriptionPeer != null && !shop.IsSelf) { modelShopScore.ProductAndDescription = productAndDescription.CommentValue; modelShopScore.ProductAndDescriptionPeer = productAndDescriptionPeer.CommentValue; modelShopScore.ProductAndDescriptionMin = productAndDescriptionMin.CommentValue; modelShopScore.ProductAndDescriptionMax = productAndDescriptionMax.CommentValue; } else { modelShopScore.ProductAndDescription = defaultValue; modelShopScore.ProductAndDescriptionPeer = defaultValue; modelShopScore.ProductAndDescriptionMin = defaultValue; modelShopScore.ProductAndDescriptionMax = defaultValue; } //卖家服务态度 if (sellerServiceAttitude != null && sellerServiceAttitudePeer != null && !shop.IsSelf) { modelShopScore.SellerServiceAttitude = sellerServiceAttitude.CommentValue; modelShopScore.SellerServiceAttitudePeer = sellerServiceAttitudePeer.CommentValue; modelShopScore.SellerServiceAttitudeMax = sellerServiceAttitudeMax.CommentValue; modelShopScore.SellerServiceAttitudeMin = sellerServiceAttitudeMin.CommentValue; } else { modelShopScore.SellerServiceAttitude = defaultValue; modelShopScore.SellerServiceAttitudePeer = defaultValue; modelShopScore.SellerServiceAttitudeMax = defaultValue; modelShopScore.SellerServiceAttitudeMin = defaultValue; } //卖家发货速度 if (sellerDeliverySpeedPeer != null && sellerDeliverySpeed != null && !shop.IsSelf) { modelShopScore.SellerDeliverySpeed = sellerDeliverySpeed.CommentValue; modelShopScore.SellerDeliverySpeedPeer = sellerDeliverySpeedPeer.CommentValue; modelShopScore.SellerDeliverySpeedMax = sellerDeliverySpeedMax != null ? sellerDeliverySpeedMax.CommentValue : 0; modelShopScore.sellerDeliverySpeedMin = sellerDeliverySpeedMin != null ? sellerDeliverySpeedMin.CommentValue : 0; } else { modelShopScore.SellerDeliverySpeed = defaultValue; modelShopScore.SellerDeliverySpeedPeer = defaultValue; modelShopScore.SellerDeliverySpeedMax = defaultValue; modelShopScore.sellerDeliverySpeedMin = defaultValue; } #endregion modelShopScore.ProductNum = ServiceProvider.Instance <IProductService> .Create.GetShopOnsaleProducts(result.ShopId); modelShopScore.IsFavoriteShop = false; modelShopScore.FavoriteShopCount = ServiceProvider.Instance <IShopService> .Create.GetShopFavoritesCount(result.ShopId); if (CurrentUser != null) { modelShopScore.IsFavoriteShop = ServiceProvider.Instance <IShopService> .Create.GetFavoriteShopInfos(CurrentUser.Id).Any(d => d.ShopId == result.ShopId); } long vShopId; var vshopinfo = ServiceProvider.Instance <IVShopService> .Create.GetVShopByShopId(shop.Id); if (vshopinfo == null) { vShopId = -1; } else { vShopId = vshopinfo.Id; } modelShopScore.VShopId = vShopId; modelShopScore.VShopLog = ServiceProvider.Instance <IVShopService> .Create.GetVShopLog(vShopId); if (!string.IsNullOrWhiteSpace(modelShopScore.VShopLog)) { modelShopScore.VShopLog = Himall.Core.HimallIO.GetRomoteImagePath(modelShopScore.VShopLog); } // 客服 var customerServices = CustomerServiceApplication.GetMobileCustomerServiceAndMQ(shop.Id); #endregion #region 根据运费模板获取发货地址 var freightTemplateService = ServiceApplication.Create <IFreightTemplateService>(); var template = freightTemplateService.GetFreightTemplate(product.FreightTemplateId); string productAddress = string.Empty; if (template != null) { var fullName = ServiceApplication.Create <IRegionService>().GetFullName(template.SourceAddress); if (fullName != null) { var ass = fullName.Split(' '); if (ass.Length >= 2) { productAddress = ass[0] + " " + ass[1]; } else { productAddress = ass[0]; } } } var ProductAddress = productAddress; var FreightTemplate = template; #endregion #region 获取店铺优惠信息 VShopShowPromotionModel modelVshop = new VShopShowPromotionModel(); modelVshop.ShopId = result.ShopId; var shopInfo = ServiceProvider.Instance <IShopService> .Create.GetShop(result.ShopId); if (shopInfo == null) { throw new HimallException("错误的店铺编号"); } modelVshop.FreeFreight = shop.FreeFreight; var bonus = ServiceApplication.Create <IShopBonusService>().GetByShopId(result.ShopId); if (bonus != null) { modelVshop.BonusCount = bonus.Count; modelVshop.BonusGrantPrice = bonus.GrantPrice; modelVshop.BonusRandomAmountStart = bonus.RandomAmountStart; modelVshop.BonusRandomAmountEnd = bonus.RandomAmountEnd; } FullDiscountActive fullDiscount = null; //var fullDiscount = FullDiscountApplication.GetOngoingActiveByProductId(id, shop.Id); #endregion //商品描述 var description = ProductManagerApplication.GetProductDescription(result.ProductId); if (description == null) { throw new HimallException("错误的商品编号"); } string DescriptionPrefix = "", DescriptiondSuffix = ""; var iprodestempser = ServiceApplication.Create <IProductDescriptionTemplateService>(); if (description.DescriptionPrefixId != 0) { var desc = iprodestempser.GetTemplate(description.DescriptionPrefixId, product.ShopId); DescriptionPrefix = desc == null ? "" : desc.MobileContent; } if (description.DescriptiondSuffixId != 0) { var desc = iprodestempser.GetTemplate(description.DescriptiondSuffixId, product.ShopId); DescriptiondSuffix = desc == null ? "" : desc.MobileContent; } var productDescription = DescriptionPrefix + description.ShowMobileDescription + DescriptiondSuffix; //统计商品浏览量、店铺浏览人数 StatisticApplication.StatisticVisitCount(product.Id, product.ShopId); AutoMapper.Mapper.CreateMap <FightGroupActiveModel, FightGroupActiveResult>(); var fightGroupData = AutoMapper.Mapper.Map <FightGroupActiveResult>(result); decimal discount = 1M; if (CurrentUser != null) { discount = CurrentUser.MemberDiscount; } var shopItem = ShopApplication.GetShop(result.ShopId); fightGroupData.MiniSalePrice = shopItem.IsSelf ? fightGroupData.MiniSalePrice * discount : fightGroupData.MiniSalePrice; string loadShowPrice = string.Empty;//app拼团详细页加载时显示的区间价 loadShowPrice = fightGroupData.MiniSalePrice.ToString("f2"); if (fightGroupData != null && fightGroupData.ActiveItems.Count() > 0) { decimal min = fightGroupData.ActiveItems.Min(s => s.ActivePrice); decimal max = fightGroupData.ActiveItems.Max(s => s.ActivePrice); loadShowPrice = (min < max) ? (min.ToString("f2") + " - " + max.ToString("f2")) : min.ToString("f2"); } var _result = new { success = true, FightGroupData = fightGroupData, ShowSkuInfo = new { ColorAlias = model.ColorAlias, SizeAlias = model.SizeAlias, VersionAlias = model.VersionAlias, MinSalePrice = model.MinSalePrice, ProductImagePath = model.ProductImagePath, Color = model.Color.OrderByDescending(p => p.SkuId), Size = model.Size.OrderByDescending(p => p.SkuId), Version = model.Version.OrderByDescending(p => p.SkuId) }, ShowPromotion = modelVshop, fullDiscount = fullDiscount, ShowNewCanJoinGroup = GroupsData, ProductCommentShow = modelSay, ProductDescription = productDescription.Replace("src=\"/Storage/", "src=\"" + Core.HimallIO.GetRomoteImagePath("/Storage") + "/"), ShopScore = modelShopScore, CashDepositsServer = cashDepositModel, ProductAddress = ProductAddress, //Free = FreightTemplate.IsFree == FreightTemplateType.Free ? "免运费" : "", userList = userList, IsUserEnter = IsUserEnter, SkuData = skudata, CustomerServices = customerServices, IsOpenLadder = product.IsOpenLadder, VideoPath = string.IsNullOrWhiteSpace(product.VideoPath) ? string.Empty : Himall.Core.HimallIO.GetRomoteImagePath(product.VideoPath), LoadShowPrice = loadShowPrice, //商品时区间价 ProductSaleCountOnOff = (SiteSettingApplication.SiteSettings.ProductSaleCountOnOff == 1), //是否显示销量 SaleCounts = data.ActiveItems.Sum(d => d.BuyCount), //销量 FreightStr = FreightTemplateApplication.GetFreightStr(product.Id, FreightTemplate, CurrentUser, product), //运费多少或免运费 SendTime = (FreightTemplate != null && !string.IsNullOrEmpty(FreightTemplate.SendTime) ? (FreightTemplate.SendTime + "h内发货") : ""), //运费模板发货时间 }; return(JsonResult <dynamic>(_result)); }
/// <summary> /// 查看订单物流 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public object GetLogisticsData(string expressCompanyName, string shipOrderNumber, long orderid) { var order = OrderApplication.GetOrder(orderid); if (order != null && order.DeliveryType == DeliveryType.CityExpress) { float StoreLat = 0, Storelng = 0; if (order.ShopBranchId > 0) { var sbdata = ShopBranchApplication.GetShopBranchById(order.ShopBranchId); if (sbdata != null) { StoreLat = sbdata.Latitude; Storelng = sbdata.Longitude; } } else { var shopshiper = ShopShippersApplication.GetDefaultSendGoodsShipper(order.ShopId); if (shopshiper != null && shopshiper.Latitude.HasValue && shopshiper.Longitude.HasValue) { StoreLat = shopshiper.Latitude.Value; Storelng = shopshiper.Longitude.Value; } } return(new { success = true, deliveryType = DeliveryType.CityExpress.GetHashCode(), userLat = order.ReceiveLatitude, userLng = order.ReceiveLongitude, storeLat = StoreLat, Storelng = Storelng, shipOrderNumber = order.ShipOrderNumber, }); } else { var expressData = Application.OrderApplication.GetExpressData(expressCompanyName, shipOrderNumber); if (expressData != null) { if (expressData.Success) { expressData.ExpressDataItems = expressData.ExpressDataItems.OrderByDescending(item => item.Time);//按时间逆序排列 } var json = new { success = expressData.Success, msg = expressData.Message, data = expressData.ExpressDataItems.Select(item => new { time = item.Time.ToString("yyyy-MM-dd HH:mm:ss"), content = item.Content }) }; return(json); } else { var json = new { success = false, msg = "无物流信息" }; return(json); } } }
private string SendDaDaExpress(long orderId, long shopid, long sbid, bool isQueryOrder) { //Log.Error("达达发货ShopBranchOrder-01:orderId:" + orderId); var order = OrderApplication.GetOrder(orderId); if (order == null || order.ShopBranchId != sbid || order.OrderStatus != Entities.OrderInfo.OrderOperateStatus.WaitDelivery) { throw new HimallApiException("错误的订单编号"); } var dadaconfig = CityExpressConfigApplication.GetDaDaCityExpressConfig(shopid); if (!dadaconfig.IsEnable) { throw new HimallApiException("未开启同城合作物流"); } //Log.Error("达达发货ShopBranchOrder-02:OrderStatus:" + order.OrderStatus + "--RegionId:" + order.RegionId); if (order.ReceiveLatitude <= 0 || order.ReceiveLongitude <= 0) { throw new HimallApiException("未获取到客户收货地址坐标信息,无法使用该配送方式"); } var sbdata = ShopBranchApplication.GetShopBranchById(sbid); if (sbdata == null || string.IsNullOrWhiteSpace(sbdata.DaDaShopId)) { throw new HimallApiException("门店未在达达注册,或所在城市达达不支持配送,无法发单,请商家在后台进行设置"); } //Log.Error("达达发货ShopBranchOrder-03:Latitude:" + sbdata.DaDaShopId); string cityCode = ""; var _adregion = RegionApplication.GetRegion(order.RegionId); var _city = GetCity(_adregion); try { string cityJson = ExpressDaDaHelper.cityCodeList(shopid); var cityObj = JsonConvert.DeserializeObject(cityJson) as JObject; JArray citylist = (JArray)cityObj["result"]; foreach (JToken item in citylist) { if (_city.ShortName == item["cityName"].ToString()) { cityCode = item["cityCode"].ToString(); break; } } } catch { } //达达不支持的城市 if (cityCode == "") { throw new HimallApiException("配送范围超区,无法配送"); } string callback = CurrentUrlHelper.CurrentUrl() + "/pay/dadaOrderNotify/"; bool isreaddorder = (order.DadaStatus == DadaStatus.Cancel.GetHashCode()); if (isQueryOrder) { isreaddorder = false; } //Log.Error(DateTime.Now + "ShopBranchOrder-0:callback:" + callback + "|shopid:" + shopid + "|DaDaShopId:" + sbdata.DaDaShopId + "|orderId:" + order.Id + "|cityCode:" + cityCode + "|isreaddorder:" + isreaddorder); string json = ExpressDaDaHelper.addOrder(shopid, sbdata.DaDaShopId, order.Id.ToString() , cityCode, (double)order.TotalAmount, 0, ExpressDaDaHelper.DateTimeToUnixTimestamp(DateTime.Now.AddMinutes(15)) , order.ShipTo, order.Address, order.ReceiveLatitude, order.ReceiveLongitude , callback, order.CellPhone, order.CellPhone, isQueryDeliverFee: isQueryOrder , isReAddOrder: isreaddorder); //Log.Error(DateTime.Now + "达达发货ShopBranchOrder-1:json:" + json); return(json); }
/// <summary> /// 取打印元素值 /// </summary> /// <param name="shopId"></param> /// <param name="orderId"></param> /// <param name="printElementIndexes"></param> /// <returns></returns> public static IDictionary <int, string> GetPrintElementIndexAndOrderValue(long shopId, long orderId, IEnumerable <ExpressElementType> printElementIndexes) { var order = OrderApplication.GetOrder(orderId); if (order == null) { throw new NullReferenceException("订单为空"); } var shopShipper = ShopShippersApplication.GetDefaultSendGoodsShipper(shopId); var dic = new Dictionary <int, string>(); string[] regionNames = order.RegionFullName.Split(' '); string[] sellerRegionNames = new string[] { }; if (shopShipper == null) { throw new NullReferenceException("商家需先设置“发/退货地址”"); } string sellerRegionFullName = RegionApplication.GetFullName(shopShipper.RegionId); sellerRegionNames = sellerRegionFullName.Split(' '); string value; foreach (var index in printElementIndexes.ToList()) { value = string.Empty; #region 获取对应值 switch (index) { case ExpressElementType.ReceiverUser: //"收货人-姓名" value = order.ShipTo; break; case ExpressElementType.ReceiverAddress: //"收货人-地址" value = order.Address; break; case ExpressElementType.ReceiverPhone: //"收货人-电话" value = order.CellPhone; break; case ExpressElementType.ReceiverPostCode: //"收货人-邮编" value = ""; break; case ExpressElementType.ReceiverAddressLevel1: //"收货人-地区1级" value = regionNames[0]; break; case ExpressElementType.ReceiverAddressLevel2: //"收货人-地区2级" value = regionNames.Length > 1 ? regionNames[1] : ""; break; case ExpressElementType.ReceiverAddressLevel3: //"收货人-地区3级" value = regionNames.Length > 2 ? regionNames[2] : ""; break; case ExpressElementType.ShipToUser: //"发货人-姓名" value = shopShipper.ShipperName; break; case ExpressElementType.ShipToAddressLevel1: //"发货人-地区1级" value = sellerRegionNames.Length > 0 ? sellerRegionNames[0] : ""; break; case ExpressElementType.ShipToAddressLevel2: // "发货人-地区2级" value = sellerRegionNames.Length > 1 ? sellerRegionNames[1] : ""; break; case ExpressElementType.ShipToAddressLevel3: //"发货人-地区3级" value = sellerRegionNames.Length > 2 ? sellerRegionNames[2] : ""; break; case ExpressElementType.ShipToAddress: //"发货人-地址" value = shopShipper.Address; break; case ExpressElementType.ShipToPostCode: //"发货人-邮编" value = ""; break; case ExpressElementType.ShipToPhone: //"发货人-电话" value = shopShipper.TelPhone; break; case ExpressElementType.OrderNo: //"订单-订单号" value = order.Id.ToString(); break; case ExpressElementType.OrderAmount: //"订单-总金额" value = order.OrderTotalAmount.ToString("F2"); break; case ExpressElementType.OrderWeight: //"订单-物品总重量" value = string.Empty; break; case ExpressElementType.OrderRemark: //"订单-备注" value = string.IsNullOrWhiteSpace(order.UserRemark) ? "" : order.UserRemark.ToString(); break; case ExpressElementType.OrderDetail: //"订单-详情" value = string.Empty; break; case ExpressElementType.ShopName: //"网店名称" value = order.ShopName; break; case ExpressElementType.RightChar: //"对号-√" value = "√"; break; default: value = string.Empty; break; } #endregion dic.Add((int)index, value); } return(dic); }