Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string data = context.Request["data"];
                if (string.IsNullOrEmpty(data))
                {
                    resp.code = (int)APIErrCode.PrimaryKeyIncomplete;
                    resp.msg  = "data 参数必传";
                    bllMall.ContextResponse(context, resp);
                    return;
                }
                Tolog(data);

                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load("D:\\result.xml");
                xmlDoc.LoadXml(data);

                string json = Newtonsoft.Json.JsonConvert.SerializeXmlNode(xmlDoc);

                resp.status = true;
                resp.msg    = "ok";
            }
            catch (Exception ex)
            {
                resp.code   = (int)APIErrCode.OperateFail;
                resp.msg    = ex.Message;
                resp.result = ex.ToString();
                Tolog("制券通知异常" + ex.ToString());
            }
            bllMall.ContextResponse(context, resp);
        }
Ejemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            string settlementId = context.Request["settlement_id"];
            string remark       = context.Request["remark"];
            string img          = context.Request["img"];
            string status       = context.Request["status"];

            if (status == "供应商已确认" && currentUserInfo.UserType != 7)
            {
                apiResp.msg = "只有商户才可以确认";
                bllMall.ContextResponse(context, apiResp);
                return;
            }


            if (bllMall.UpdateSupplierSettlement(settlementId, status, remark, img))
            {
                apiResp.status = true;
                apiResp.msg    = "操作成功";
            }
            else
            {
                apiResp.msg = "操作失败";
            }
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            string orderId = context.Request["order_id"];

            if (string.IsNullOrEmpty(orderId))
            {
                apiResp.code = 1;
                apiResp.msg  = "order_id 必传";
                bllMall.ContextResponse(context, apiResp);
                return;
            }
            var orderInfo = bllMall.GetOrderInfo(orderId);

            if (orderInfo == null)
            {
                apiResp.code = 1;
                apiResp.msg  = "order_id 不存在";
                bllMall.ContextResponse(context, apiResp);
                return;
            }
            if (orderInfo.PaymentStatus == 1)
            {
                apiResp.code = 1;
                apiResp.msg  = "订单已经支付";
                bllMall.ContextResponse(context, apiResp);
                return;
            }
            Open.HongWareSDK.Client cl = new Open.HongWareSDK.Client(bllMall.WebsiteOwner);
            string callBackUrl         = string.Format("http://{0}/customize/shop/?v=1.0&ngroute=/orderList#/orderDetail/{1}", context.Request.Url.Host, orderInfo.OrderID);

            callBackUrl = HttpUtility.UrlEncode(callBackUrl);
            string payUrl    = "";
            string errMsg    = "";
            bool   payResult = cl.OrderPay(orderInfo.OrderID, (orderInfo.TotalAmount * 100).ToString("F0"), callBackUrl, out payUrl, out errMsg);

            if (payResult && (!string.IsNullOrEmpty(payUrl)))
            {
                apiResp.status = true;
                apiResp.result = new
                {
                    pay_url = payUrl
                };
            }
            else
            {
                apiResp.msg = errMsg;
            }
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 4
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex   = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1;
            int    pageSize    = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10;
            string productId   = context.Request["product_id"];
            string productName = context.Request["product_name"];

            int total = 0;

            List <ProductStock> stockList = bllMall.GetProductStockList(pageIndex, pageSize, productId, productName, out total);

            var list = from p in stockList
                       select new
            {
                autoid    = p.AutoId,
                sku_id    = p.SkuId,
                pid       = p.ProductId,
                title     = p.PName,
                time      = p.CreateDate,
                count     = p.Count,
                head_img  = p.WXHeadimgurl,
                nick_name = p.WXNickname,
                props     = bllMall.GetProductStockProperties(p.Props)
            };

            apiResp.msg    = "查询完成";
            apiResp.status = true;

            apiResp.result = new
            {
                totalcount = total,
                list       = list//列表
            };
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex    = !string.IsNullOrEmpty(context.Request["page"]) ? int.Parse(context.Request["page"]) : 1;
            int    pageSize     = !string.IsNullOrEmpty(context.Request["rows"]) ? int.Parse(context.Request["rows"]) : 10;
            string settlementId = context.Request["settlement_id"];
            string orderId      = context.Request["order_id"];
            int    totalCount   = 0;
            var    sourceData   = bllMall.SettlementDetail(settlementId, orderId, pageIndex, pageSize, out totalCount);
            var    data         = from p in sourceData
                                  select new
            {
                id                = p.AutoId,
                settlement_id     = p.SettlementId,
                order_id          = p.OrderId,
                baseamount        = p.BaseAmount,
                transportfee      = p.TransportFee,
                refund_amount     = p.RefundAmount,
                settlement_amount = p.SettlementAmount,
                insert_date       = p.InsertDate
            };

            apiResp.status = true;
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = data
            };
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 6
0
        public void ProcessRequest(HttpContext context)
        {
            string id        = context.Request["id"];
            string isInvoice = context.Request["is_invoice"];

            if (bllMall.Update(new SupplierSettlement(), string.Format("IsInvoice={0}", isInvoice), string.Format("AutoId={0}", id)) > 0)
            {
                apiResp.status = true;
                apiResp.msg    = "操作成功";
            }
            else
            {
                apiResp.msg = "操作失败";
            }
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 7
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex      = !string.IsNullOrEmpty(context.Request["page"]) ? int.Parse(context.Request["page"]) : 1;
            int    pageSize       = !string.IsNullOrEmpty(context.Request["rows"]) ? int.Parse(context.Request["rows"]) : 10;
            string status         = context.Request["status"];           //状态
            string date           = context.Request["date"];             //日期
            string settlementId   = context.Request["settlement_id"];    //结算单号
            string supplierUserId = context.Request["supplier_user_id"]; //供应商账号

            if (bllUser.IsSupplier(currentUserInfo))
            {
                supplierUserId = currentUserInfo.UserID;
            }
            int totalCount = 0;
            var sourceData = bllMall.SettlementList(bllMall.WebsiteOwner, supplierUserId, pageIndex, pageSize, status, settlementId, date, out totalCount);
            var data       = from p in sourceData
                             select new
            {
                id                       = p.AutoId,
                settlement_id            = p.SettlementId,
                supplier_user_id         = p.SupplierUserId,
                supplier_name            = p.SupplierName,
                from_date                = p.FromDate.ToString(),
                to_date                  = p.ToDate.ToString(),
                status                   = p.Status,
                total_baseamount         = p.TotalBaseAmount,
                total_transportfee       = p.TotalTransportFee,
                refund_total_amount      = p.RefundTotalAmount,
                settlement_total_amount  = p.SettlementTotalAmount,
                insert_date              = p.InsertDate,
                remark                   = p.Remark,
                img_url                  = p.ImgUrl,
                settlement_sale_amount   = p.SaleTotalAmount,
                settlement_server_amount = p.ServerTotalAmount,
                is_invoice               = p.IsInvoice
            };

            apiResp.status = true;
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = data
            };
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 8
0
        public void ProcessRequest(HttpContext context)
        {
            string settlementId = context.Request["settlement_id"];
            string remark       = context.Request["remark"];
            string img          = context.Request["img"];
            string status       = context.Request["status"];



            if (bllMall.UpdateSupplierChannelSettlement(settlementId, status, remark, img))
            {
                apiResp.status = true;
                apiResp.msg    = "操作成功";
            }
            else
            {
                apiResp.msg = "操作失败";
            }
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 9
0
        public void ProcessRequest(HttpContext context)
        {
            int    pageIndex     = !string.IsNullOrEmpty(context.Request["page"]) ? int.Parse(context.Request["page"]) : 1;
            int    pageSize      = !string.IsNullOrEmpty(context.Request["rows"]) ? int.Parse(context.Request["rows"]) : 10;
            string orderStatus   = context.Request["order_status"];    //订单状态
            string orderFromDate = context.Request["order_from_date"]; //日期
            string orderToDate   = context.Request["order_to_date"];   //日期

            if (!string.IsNullOrEmpty(orderToDate))
            {
                orderToDate = Convert.ToDateTime(orderToDate).AddDays(1).AddSeconds(-1).ToString();
            }
            string orderId        = context.Request["order_id"];         //订单号
            string supplierUserId = context.Request["supplier_user_id"]; //供应商账号

            int totalCount = 0;
            var sourceData = bllMall.UnSettlementList(bllMall.WebsiteOwner, pageIndex, pageSize, supplierUserId, orderId, orderStatus, orderFromDate, orderToDate, out totalCount);
            var data       = from p in sourceData
                             select new
            {
                id                       = p.AutoId,
                supplier_name            = p.SupplierName,
                supplier_user_id         = p.SupplierUserId,
                order_id                 = p.OrderId,
                order_date               = p.OrderDate.ToString(),
                order_status             = p.OrderStatus,
                settlement_baseamount    = p.BaseAmount,
                settlement_sale_amount   = p.SaleAmount,
                settlement_server_amount = p.ServerAmount,
                transportfee             = p.TransportFee,
                settlement_amount        = p.SettlementAmount
            };

            apiResp.status = true;
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = data
            };
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 10
0
        public void ProcessRequest(HttpContext context)
        {
            //string startDate = context.Request["start_date"];
            //string eDate = context.Request["stop_date"];
            //string sort = context.Request["sort"];
            int         totalCount = 0;
            WebsiteInfo model      = bllMall.GetWebsiteInfoModelFromDataBase();
            string      monthDate  = DateTime.Now.AddDays(-30).ToString();

            if (model != null && model.MallStatisticsLimitDate > 0)
            {
                monthDate = DateTime.Now.AddDays(-model.MallStatisticsLimitDate).ToString();
            }
            string currentDate = DateTime.Now.ToString();
            List <WXMallStatistics> statisticsList = bllMall.GetWXMallStatisticsList(int.MaxValue, 1, monthDate, currentDate, " Date ", out totalCount);

            apiResp.status = true;
            apiResp.msg    = "ok";
            apiResp.result = statisticsList;
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 11
0
        public void ProcessRequest(HttpContext context)
        {
            string taskId = context.Request["task_id"];

            List <WXMallStatisticsOrder> list = new List <WXMallStatisticsOrder>();

            BLLJIMP.Model.WXMallStatisticsOrder model = bllMall.Get <BLLJIMP.Model.WXMallStatisticsOrder>(string.Format("TaskId='{0}' And WebsiteOwner='{1}'", taskId, bllMall.WebsiteOwner));
            list.Add(model);
            apiResp.status = true;
            apiResp.msg    = "ok";
            apiResp.result = new
            {
                totalcount = 1,
                list       = from p in list
                             select new {
                    insert_date         = p.InsertDate.ToString(),
                    from_date           = p.FromDate != null ? ((DateTime)p.FromDate).ToString("yyyy-MM-dd HH:mm:ss") : "",
                    to_date             = p.ToDate != null ? ((DateTime)p.ToDate).ToString("yyyy-MM-dd HH:mm:ss") : "",
                    total_count         = p.TotalCount,
                    total_amount        = p.TotalAmount,
                    base_total_amount   = p.BaseTotalAmount,
                    total_transport_fee = p.TotalTransportFee,
                    profit = p.Profit,
                    total_coupon_exchang_amount        = p.TotalCouponExchangAmount,
                    total_score_exchang_amount         = p.TotalScoreExchangAmount,
                    total_accountamount_exchang_amount = p.TotalAccountAmountExchangAmount,
                    total_storecard_exchang_amount     = p.TotalStorecardExchangAmount,
                    total_product_count           = p.TotalProductCount,
                    total_product_fee             = p.TotalProductFee,
                    total_refund_amount           = p.TotalRefundAmount,
                    task_id                       = p.TaskId,
                    should_commission_order_count = p.ShouldCommissionOrderCount,
                    real_commission_order_count   = p.RealCommissionOrderCount,
                    last_receiving_time           = p.LastReceivingTime,
                    refund_order_count            = p.RefundOrderCount,
                    wait_process_order_count      = p.WaitProcessOrderCount
                }
            };
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 12
0
        public void ProcessRequest(HttpContext context)
        {
            System.Text.StringBuilder sbWhere = new System.Text.StringBuilder(string.Format(" WebsiteOwner='{0}'", bllMall.WebsiteOwner));
            var sourceData = bllMall.GetList <WXMallCategory>(sbWhere.ToString());
            var list       = from p in sourceData
                             select new
            {
                category_id   = p.AutoID,
                category_name = p.CategoryName,
                parent_id     = p.PreID
            };

            resp.status = true;
            resp.msg    = "ok";
            resp.result = new
            {
                totalcount = list.Count(),
                list       = list,//列表
            };

            bllMall.ContextResponse(context, resp);
        }
Ejemplo n.º 13
0
        public void ProcessRequest(HttpContext context)
        {
            string taskId     = context.Request["task_id"];
            int    pageIndex  = int.Parse(context.Request["page"]);
            int    pageSize   = int.Parse(context.Request["rows"]);
            string type       = context.Request["type"];
            int    totalCount = 0;
            List <WXMallStatisticsOrderDetail> list = bllMall.GetWXMallStatisticsOrderDetail(pageSize, pageIndex, taskId, type, out totalCount);

            apiResp.status = true;
            apiResp.msg    = "ok";
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = from p in list
                             select new
                {
                    order_id = p.OrderId
                }
            };
            bllMall.ContextResponse(context, apiResp);
        }
Ejemplo n.º 14
0
        public void ProcessRequest(HttpContext context)
        {
            string taskId    = context.Request["task_id"];
            string sortField = context.Request["sort"];  //排序字段
            string order     = context.Request["order"]; //asc desc
            string keyWord   = context.Request["keyword"];
            string orderBy   = " Order By AutoId ASC";

            System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
            sbWhere.AppendFormat("TaskId='{0}' And WebsiteOwner='{1}'", taskId, bllMall.WebsiteOwner);
            if (!string.IsNullOrEmpty(keyWord))
            {
                sbWhere.AppendFormat(" And ProductName like '%{0}%'", keyWord);
            }
            if (!string.IsNullOrEmpty(sortField))
            {
                switch (sortField)
                {
                case "order_total_count":        //总订单数
                    orderBy = " Order By OrderTotalCount ";
                    break;

                case "order_total_amount":        //总订单金额
                    orderBy = " Order By OrderTotalAmount ";
                    break;

                case "order_base_total_amount":        //总基价
                    orderBy = " Order By OrderBaseTotalAmount ";
                    break;

                case "profit":        //总利润
                    orderBy = " Order By Profit ";
                    break;

                case "order_total_order_price":        //总售价
                    orderBy = " Order By OrderTotalOrderPrice ";
                    break;

                case "product_total_count":        //商品总件数
                    orderBy = " Order By ProductTotalCount ";
                    break;

                case "product_name":        //商品名称
                    orderBy = " Order By ProductName ";
                    break;

                default:
                    break;
                }
                orderBy += order;
            }


            sbWhere.AppendFormat(" {0}", orderBy);
            List <BLLJIMP.Model.WXMallStatisticsProduct> list = bllMall.GetList <BLLJIMP.Model.WXMallStatisticsProduct>(sbWhere.ToString());

            apiResp.status = true;
            apiResp.msg    = "ok";
            apiResp.result = new
            {
                totalcount = list.Count,
                list       = from p in list
                             select new
                {
                    insert_date             = p.InsertDate.ToString(),
                    from_date               = p.FromDate != null ? ((DateTime)p.FromDate).ToString("yyyy-MM-dd HH:mm:ss") : "",
                    to_date                 = p.ToDate != null ? ((DateTime)p.ToDate).ToString("yyyy-MM-dd HH:mm:ss") : "",
                    product_name            = p.ProductName,
                    product_total_count     = p.ProductTotalCount,
                    order_total_count       = p.OrderTotalCount,
                    order_total_amount      = p.OrderTotalAmount,
                    order_base_total_amount = p.OrderBaseTotalAmount,
                    order_total_order_price = p.OrderTotalOrderPrice,
                    profit = p.Profit,
                    total_refund_amount = p.TotalRefundAmount
                }
            };
            bllMall.ContextResponse(context, apiResp);
        }