Ejemplo n.º 1
0
Archivo: Client.cs Proyecto: uvbs/mmp
        /// <summary>
        /// 根据本地订单映射出驿氪订单
        /// </summary>
        /// <param name="orderSrc"></param>
        /// <returns></returns>
        public Entity.OrderInfo GeiMappingOrderInfo(ZentCloud.BLLJIMP.Model.WXMallOrderInfo orderSrc)
        {
            BLLMall bllMall = new BLLMall();

            Entity.OrderInfo order = new Entity.OrderInfo();

            order.ShopCode   = CurrEfastShopId.ToString();
            order.Code       = orderSrc.OrderID;
            order.OrderTime  = orderSrc.InsertDate.ToString();
            order.TotalQty   = orderSrc.ProductCount;
            order.TotalMoney = 0;// (double)orderSrc.TotalAmount;
            order.IsPayed    = orderSrc.PaymentStatus == 1;
            order.PayAmount  = (double)orderSrc.TotalAmount;

            var userInfo = new BLLUser().GetUserInfo(orderSrc.OrderUserID);

            order.BuyerCode = userInfo.Ex2;

            order.OrderStatus = GetOrderStatusCode(orderSrc.Status);
            order.StatusTime  = DateTime.Now.ToString();
            order.SellerId    = orderSrc.SellerId;
            order.DataOrigin  = 1;
            order.PayTime     = DateTime.Now.ToString();
            order.ExpressFee  = (double)orderSrc.Transport_Fee;

            order.RecvAddress   = orderSrc.Address;
            order.RecvCity      = orderSrc.ReceiverCity;
            order.RecvConsignee = orderSrc.Consignee;
            order.RecvCounty    = orderSrc.ReceiverDist;
            order.RecvMobile    = orderSrc.Phone;
            order.RecvProvince  = orderSrc.ReceiverProvince;

            List <ZentCloud.BLLJIMP.Model.WXMallOrderDetailsInfo> detailList = bllMall.GetOrderDetailsList(orderSrc.OrderID);
            List <Entity.OrderDetail> dtls = new List <Entity.OrderDetail>();

            int saleProdQty = 0;

            foreach (var item in detailList)
            {
                Entity.OrderDetail dtl = new Entity.OrderDetail();
                saleProdQty++;

                dtl.BarCode       = bllMall.GetEfastBarcode(item.SkuId.Value);
                dtl.PriceOriginal = (double)item.OrderPrice;
                dtl.PriceSell     = (double)item.OrderPrice;
                dtl.Quantity      = item.TotalCount;
                dtl.Amount        = dtl.PriceSell * dtl.Quantity;
                dtl.IsGift        = false;

                order.TotalMoney += dtl.Amount;

                dtls.Add(dtl);
            }

            order.Dtls = dtls;


            return(order);
        }
Ejemplo n.º 2
0
Archivo: Client.cs Proyecto: uvbs/mmp
        /// <summary>
        /// 订单上传
        /// </summary>
        /// <param name="orderSrc"></param>
        /// <param name="saleType"></param>
        /// <returns></returns>
        public Entity.ReqBase OrderUpload(ZentCloud.BLLJIMP.Model.WXMallOrderInfo orderSrc, string saleType = "S")
        {
            Entity.ReqBase result = new Entity.ReqBase();

            BLLMall bllMall = new BLLMall();

            List <Entity.OrderInfo> orderList = new List <Entity.OrderInfo>();

            Entity.OrderInfo order = GeiMappingOrderInfo(orderSrc);

            orderList.Add(order);

            result = GetCommand <Entity.ReqBase>(JsonConvert.SerializeObject(orderList), APIUrl + "api/morder/ordadd", "post");

            return(result);
        }