发送通知消息

目录

1 himall3.0商城源码

1.1 SendMessageOnOrderShipping

1.1.1 //发送通知消息

1.2 /// 所有订单是否都支付

1.2.1 //有待付款的订单,则未支付完成

  1. himall3.0商城源码

        public static List GetInvoiceTitles(long userid)

        {

            return _iOrderService.GetInvoiceTitles(userid);

        }

        ///

    1. SendMessageOnOrderShipping

        public static void SendMessageOnOrderShipping(long orderId)

        {

            var order = _iOrderService.GetOrder(orderId);

#if DEBUG

            Log.Debug("[SGM]" + orderId + "_" + order.ExpressCompanyName + "_" + order.ShipOrderNumber);

#endif

      1.             //发送通知消息

            var orderMessage = new MessageOrderInfo();

            orderMessage.OrderTime = order.OrderDate;

            orderMessage.OrderId = order.Id.ToString();

            orderMessage.ShopId = order.ShopId;

            orderMessage.UserName = order.UserName;

            orderMessage.ShopName = order.ShopName;

            orderMessage.SiteName = ServiceProvider.Instance.Create.GetSiteSettings().SiteName;

            orderMessage.TotalMoney = order.OrderTotalAmount;

            orderMessage.ShippingCompany = order.ExpressCompanyName;

            orderMessage.ShippingNumber = order.ShipOrderNumber;

            orderMessage.ShipTo = (order.Platform == PlatformType.WeiXinSmallProg || order.Platform == PlatformType.WeiXinO2OSmallProg) ? ((DateTime)order.ShippingDate).ToString("yyyy-MM-dd HH:mm:ss") : (order.ShipTo + " " + order.RegionFullName + " " + order.Address);

            orderMessage.ProductName = order.OrderItemInfo.FirstOrDefault().ProductName;

            if (order.Platform == PlatformType.WeiXinSmallProg)

            {

                orderMessage.MsgOrderType = MessageOrderType.Applet;

            }

            if (order.Platform == PlatformType.WeiXinO2OSmallProg)

            {

                orderMessage.MsgOrderType = MessageOrderType.O2OApplet;

            }

            Task.Factory.StartNew(() => ServiceProvider.Instance.Create.SendMessageOnOrderShipping(order.UserId, orderMessage));

        }

        ///

    1.         /// 所有订单是否都支付

        ///

        ///

        ///

        public static bool AllOrderIsPaied(string orderids)

        {

            var orders = _iOrderService.GetOrders(orderids.Split(',').Select(t => long.Parse(t)));

            IEnumerable waitPayOrders = orders.Where(p => p.OrderStatus == OrderInfo.OrderOperateStatus.WaitPay);

            if (waitPayOrders.Count() > 0)

            {

      1. //有待付款的订单,则未支付完成

                return false;

            }

            return true;

        }

        #endregion

你可能感兴趣的:(java,windows,开发语言)