コード例 #1
0
        /// <summary>
        /// 获取商品图片列表
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="uid"></param>
        /// <param name="gid"></param>
        /// <returns></returns>
        public static MResultList <ProductImg> GetGoodsPicList(string sid, string uid, int gid)
        {
            var result = new MResultList <ProductImg>(true);

            try
            {
                var goods = DALFactory.Goods();
                var list  = goods.GetGoodsPicList(gid);
                list.ForEach(picInfo =>
                {
                    try
                    {
                        result.list.Add(new ProductImg
                        {
                            id         = picInfo.intPicID,
                            product_id = picInfo.intProductID,
                            url        = FormatProductPicUrl(picInfo.vchPicURL),
                            position   = MCvHelper.To <int>(picInfo.vchPicType, 0),
                            created    = picInfo.dtAddTime
                        });
                    }
                    catch
                    { }
                });
                result.status = MResultStatus.Success;
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                result.msg    = "查询商品列表数据出错!";
            }

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// 获取配送方式
        /// </summary>
        /// <param name="channelId"></param>
        /// <param name="regionId"></param>
        /// <param name="payGroupId"></param>
        /// <returns></returns>
        public static MResultList <ItemLogistics> GetDeliverList(int channelId, int regionId, int payGroupId)
        {
            var result = new MResultList <ItemLogistics>(true);

            try
            {
                var basedata = DALFactory.BaseData();
                var list     = basedata.GetDeliverList(channelId, regionId, payGroupId);
                list.ForEach(item =>
                {
                    try
                    {
                        result.list.Add(new ItemLogistics
                        {
                            id     = item.intDeliverID,
                            name   = item.vchDeliverName,
                            remark = item.vchDeliverDesc
                        });
                    }
                    catch
                    {
                    }
                });
                result.status = MResultStatus.Success;
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                result.msg    = "获取配送方式列表异常!";
            }

            return(result);
        }
コード例 #3
0
        /// <summary>
        /// 获取区域列表数据
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        public static MResultList <ItemRegion> GetRegionList(int parentId)
        {
            var result = new MResultList <ItemRegion>(true);

            try
            {
                var basedata = DALFactory.BaseData();
                var list     = basedata.GetRegionList(parentId);
                list.ForEach(item =>
                {
                    try
                    {
                        var regionType = string.Empty;
                        switch (item.intRegionType)
                        {
                        case 1:
                            regionType = "国家"; break;

                        case 2:
                            regionType = "省/直辖市"; break;

                        case 3:
                            regionType = "地区"; break;

                        case 4:
                            regionType = "区县"; break;

                        default:
                            regionType = item.intRegionType + "";
                            break;
                        }
                        result.list.Add(new ItemRegion()
                        {
                            id   = item.intRegionID,
                            name = item.vchRegionName,
                            zip  = item.vchPostCode,
                            code = item.vchShortSpell,
                            pid  = item.intFRegionID,
                            type = regionType
                        });
                    }
                    catch
                    {
                    }
                });
                result.status = MResultStatus.Success;
            }
            catch (Exception)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "获取区域列表数据异常";
            }
            return(result);
        }
コード例 #4
0
        /// <summary>
        /// 获取支付列表
        /// </summary>
        /// <param name="sType"></param>
        /// <param name="paygroupId"></param>
        /// <returns></returns>
        public static MResultList <ItemPay> GetPayList(SystemType sType, int paygroupId)
        {
            var result = new MResultList <ItemPay>(true);

            try
            {
                var baseDataDal = DALFactory.BaseData();
                List <Base_Pay_Type> payList = baseDataDal.GetPayList(sType, paygroupId);
                if (payList != null && payList.Any())
                {
                    payList.ForEach(item =>
                    {
                        try
                        {
                            var payItem = new ItemPay
                            {
                                payid   = item.intPayID,
                                payname = item.vchPayName,
                                paytype = item.intPayGroup,
                                icon    = string.IsNullOrWhiteSpace(item.vchPicAddr) ? "" : "http://muyingzhijia.com/" + item.vchPicAddr,
                                payurl  = item.vchPayURL,
                                remark  = item.vchPayDesc
                            };
                            result.list.Add(payItem);
                        }
                        catch
                        {
                        }
                    });
                }

                if (paygroupId == 0)
                {
                    result.data = "货到付款(送货上门后再付款,支持现金或POS机刷卡)";
                }
                else if (paygroupId == 1)
                {
                    result.data = "在线支付(支持绝大数银行借记卡及部分银行信息卡)";
                }
                else if (paygroupId == 3)
                {
                    result.data = "支付宝(手机)支付(支持支付宝)";
                }

                result.status = MResultStatus.Success;
            }
            catch (Exception)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "获取支付列表 异常";
            }
            return(result);
        }
コード例 #5
0
        /// <summary>
        /// 获取用户收货地址里列表
        /// </summary>
        /// <param name="user_id"></param>
        /// <returns></returns>
        public static MResultList <AddressEntity> GetMemberAddressList(int user_id)
        {
            var result = new MResultList <AddressEntity>(true);

            try
            {
                var member = DALFactory.Member();
                var list   = member.GetMemberAddressList(user_id);
                list.ForEach(item =>
                {
                    try
                    {
                        result.list.Add(new AddressEntity
                        {
                            id           = item.intAddressID,
                            contact_id   = item.intUserID,
                            contact_name = item.vchConsignee,
                            name         = item.vchCAName,
                            phone        = item.vchPhone,
                            mobile       = item.vchMobile,
                            type         = item.intAddrType,
                            province_id  = item.intStateID,
                            province     = item.vchStateName,
                            city_id      = item.intCityID,
                            city         = item.vchCityName,
                            county_id    = item.intCountyID,
                            county       = item.vchCountyName,
                            addr         = item.vchDetailAddr,
                            zip          = item.vchPostCode,
                            get_def      = item.intIsDefaultAddr == 1 ? true : false,
                            created      = item.dtAddTime,
                            modify_date  = item.dtLastModTime,
                            deliver_id   = item.intDeliverID,
                            pay_id       = item.intPayID
                        });
                    }
                    catch
                    {
                    }
                });
                result.status = MResultStatus.Success;
            }
            catch (Exception)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "获取用户收货地址里列表 出错!";
            }
            return(result);
        }
コード例 #6
0
        public MResultList <ItemRegion> GetRegionList(string sid, string token, string guid, string user_id, string uid, string parentid)
        {
            var result = new MResultList <ItemRegion>();

            try
            {
                var parentId = MCvHelper.To <int>(parentid);
                result = BaseDataBLL.GetRegionList(parentId);
            }
            catch (Exception)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }
            return(result);
        }
コード例 #7
0
        public MResultList <AddressEntity> GetAddressList(string sid, string token, string guid, string user_id, string uid)
        {
            var result = new MResultList <AddressEntity>();

            try
            {
                result = MemberBLL.GetMemberAddressList(UserId);
            }
            catch (Exception)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }

            return(result);
        }
コード例 #8
0
        public MResultList<ItemOrderGoods> GetOrderGoodsList(string sid, string token, string guid, string user_id, string uid,
            string orderCode)
        {
            var result = new MResultList<ItemOrderGoods>();
            try
            {
                result = OrderBLL.GetOrderGoodsList((int)SystemType, Uid, UserId, orderCode);
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg = "处理数据出错!";
            }

            return result;
        }
コード例 #9
0
        public MResultList <ItemOrderGoods> GetOrderGoodsList(string sid, string token, string guid, string user_id, string uid,
                                                              string orderCode)
        {
            var result = new MResultList <ItemOrderGoods>();

            try
            {
                result = OrderBLL.GetOrderGoodsList((int)SystemType, Uid, UserId, orderCode);
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }

            return(result);
        }
コード例 #10
0
        /// <summary>
        /// 获取支付方式
        /// </summary>
        /// <param name="channelId"></param>
        /// <param name="regionId"> </param>
        /// <returns></returns>
        public static MResultList <ItemPay> GetPaymentList(int channelId, int regionId)
        {
            var result = new MResultList <ItemPay>(true);

            try
            {
                var basedata = DALFactory.BaseData();
                result.list   = basedata.GetPaymentList(channelId, regionId);
                result.status = MResultStatus.Success;
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "获取支付方式列表异常!";
            }

            return(result);
        }
コード例 #11
0
        public MResultList <ItemPay> GetPayList(string sid, string token, string guid, string user_id, string uid,
                                                string paygroupid)
        {
            var result = new MResultList <ItemPay>();

            try
            {
                var paygroupId = MCvHelper.To <int>(paygroupid);
                result = BaseDataBLL.GetPayList(SystemType, paygroupId);
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }

            return(result);
        }
コード例 #12
0
        public MResultList <ItemPay> GetPayMentList(string sid, string token, string guid, string user_id, string uid, string regionid)
        {
            var result = new MResultList <ItemPay>();

            try
            {
                var regionId = MCvHelper.To <int>(regionid);
                result = MCacheManager.UseCached <MResultList <ItemPay> >(
                    string.Format("GetPayList_{0}_{1}", sid, regionid),
                    MCaching.CacheGroup.BaseData, () => BaseDataBLL.GetPaymentList((int)SystemType, regionId));
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }
            return(result);
        }
コード例 #13
0
        public MResultList <ItemOrder> GetOrdersList(string sid, string token, string guid, string user_id, string uid, string begintime, string endtime)
        {
            var result = new MResultList <ItemOrder>();

            try
            {
                var begimTime = MCvHelper.To <DateTime>(begintime, DateTime.Now.AddMonths(-1));
                var endTime   = MCvHelper.To <DateTime>(endtime, DateTime.Now);

                result = OrderBLL.GetOrdersList((int)SystemType, Uid, UserId, begimTime, endTime);
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }

            return(result);
        }
コード例 #14
0
        public MResultList <ProductImg> GetGoodsPicList(string sid, string token, string guid, string user_id, string uid, string gid)
        {
            var result = new MResultList <ProductImg>(true);

            try
            {
                var iGid = MCvHelper.To <int>(gid);
                result = MCacheManager.UseCached <MResultList <ProductImg> >(
                    string.Format("GetGoodsPicList{0}_{1}", sid, gid),
                    MCaching.CacheGroup.Goods,
                    () => GoodsBLL.GetGoodsPicList(sid, uid, iGid));
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理图片列表数据出错!";
            }

            return(result);
        }
コード例 #15
0
        public MResultList <ItemGoods> GetGoodsList(string sid, string token, string guid, string user_id, string uid, string bid, string cid, string age, string price, string sort, string page, string size)
        {
            var result = new MResultList <ItemGoods>(true);

            try
            {
                var brandId    = MCvHelper.To <int>(bid);
                var categoryId = MCvHelper.To <int>(cid);
                var pIndex     = MCvHelper.To <int>(page);
                var pSize      = MCvHelper.To <int>(size);
                var channelId  = MCvHelper.To <SystemType>(sid);

                result = MCacheManager.UseCached <MResultList <ItemGoods> >(
                    string.Format("GetGoodsList_{0}_{1}_{2}_{3}_{4}_{5}_{6}_{7}_{8}", sid, user_id, bid, cid, age, price, sort, page, size),
                    MCaching.CacheGroup.Goods, () => GoodsBLL.GetGoodsList(sid, uid, (int)channelId, categoryId, brandId, age, price, sort, pSize, pIndex));
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg    = "处理数据出错!";
            }

            return(result);
        }
コード例 #16
0
        public MResultList<ItemGoods> GetGoodsList(string sid, string token, string guid, string user_id, string uid, string bid, string cid, string age, string price, string sort, string page, string size)
        {
            var result = new MResultList<ItemGoods>(true);

            try
            {
                var brandId = MCvHelper.To<int>(bid);
                var categoryId = MCvHelper.To<int>(cid);
                var pIndex = MCvHelper.To<int>(page);
                var pSize = MCvHelper.To<int>(size);
                var channelId = MCvHelper.To<SystemType>(sid);

                result = MCacheManager.UseCached<MResultList<ItemGoods>>(
                        string.Format("GetGoodsList_{0}_{1}_{2}_{3}_{4}_{5}_{6}_{7}_{8}", sid, user_id, bid, cid, age, price, sort, page, size),
                        MCaching.CacheGroup.Goods, () => GoodsBLL.GetGoodsList(sid, uid, (int)channelId, categoryId, brandId, age, price, sort, pSize, pIndex));
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg = "处理数据出错!";
            }

            return result;
        }
コード例 #17
0
        /// <summary>
        /// 获取订单列表
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="uid"></param>
        /// <param name="userId"></param>
        /// <param name="begimTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public static MResultList <ItemOrder> GetOrdersList(int sid, string uid, int userId, DateTime begimTime, DateTime endTime)
        {
            var result = new MResultList <ItemOrder>(true);

            #region 参数验证

            if (userId <= 0)
            {
                result.status = MResultStatus.ParamsError;
                result.msg    = "用户标识错误!";
            }

            #endregion

            try
            {
                var orderDal = DALFactory.Order();

                var orderList = orderDal.GetOrdersList(userId, begimTime, endTime);
                if (orderList.Any())
                {
                    orderList.ForEach(item =>
                    {
                        var payType = item.payMethod == 0 ? "货到付款" : "在线支付";

                        var payStatus = item.payStatus == 2 ? "已付款" : "未付款";
                        #region 订单状态
                        string orderStatus;
                        switch (item.flowStatus)
                        {
                        case 0: orderStatus = "付款未审核"; break;

                        case 1: orderStatus = "未确定"; break;

                        case 4: orderStatus = "客户已确认"; break;

                        case 5: orderStatus = "生成配货单"; break;

                        case 7: orderStatus = "已出库"; break;

                        case 20: orderStatus = "完成"; break;

                        default:
                            orderStatus = "未知"; break;
                        }
                        #endregion
                        var orderInfo = new ItemOrder
                        {
                            oid           = item.orderNo,
                            ocode         = item.orderCode,
                            created       = item.createDate,
                            statusid      = item.flowStatus,
                            paytype       = payType,
                            status        = orderStatus,
                            total_fee     = item.actuallyPay,
                            total_freight = item.carriage,
                            total_order   = item.shouldPay
                        };
                        result.list.Add(orderInfo);
                    });
                    result.status = MResultStatus.Success;
                }
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                MLogManager.Error(MLogGroup.Order.获取订单列表, null, "获取订单列表", ex);
            }

            return(result);
        }
コード例 #18
0
        /// <summary>
        /// 获取订单商品列表
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="uid"></param>
        /// <param name="userId"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        public static MResultList <ItemOrderGoods> GetOrderGoodsList(int sid, string uid, int userId, string orderCode)
        {
            var result = new MResultList <ItemOrderGoods>(true);

            try
            {
                #region 参数判断
                if (userId <= 0)
                {
                    result.status = MResultStatus.ParamsError;
                    result.msg    = "用户标识错误!";
                }
                if (string.IsNullOrEmpty(orderCode))
                {
                    result.status = MResultStatus.ParamsError;
                    result.msg    = "订单标识错误!";
                }
                #endregion

                var orderDal  = DALFactory.Order();
                var memberDal = DALFactory.Member();

                var memberInfo = memberDal.GetMemberInfo(userId);
                if (memberInfo == null || memberInfo.membNo <= 0)
                {
                    result.status = MResultStatus.Undefined;
                    result.msg    = "用户不存在!";
                }
                var clusterId = MCvHelper.To(memberInfo.clusterId, 1);

                var orderGoodsList = orderDal.GetOrderGoodsList(userId, orderCode, clusterId);
                if (orderGoodsList.Any())
                {
                    orderGoodsList.ForEach(item =>
                    {
                        var goodsItem = new ItemOrderGoods()
                        {
                            gid         = item.intProductID,
                            title       = item.vchProductName,
                            price       = item.numSalePrice,
                            num         = item.intQty,
                            total       = item.numTotalAmount,
                            pic_url     = GoodsBLL.FormatProductPicUrl(item.PicUrl),
                            score       = item.intScores,
                            marketprice = MCvHelper.To <decimal>(item.numStandarPrice, item.numSalePrice),
                            productcode = item.vchProductPrinted
                        };
                        result.list.Add(goodsItem);
                    });
                    result.status = MResultStatus.Success;
                }
                else
                {
                    result.status = MResultStatus.Undefined;
                    result.msg    = "没有数据!";
                }
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                MLogManager.Error(MLogGroup.Order.获取订单信息, null, "获取订单信息", ex);
            }

            return(result);
        }
コード例 #19
0
        /// <summary>
        /// 获取商品列表
        /// </summary>
        /// <param name="sid"> </param>
        /// <param name="uid">用户id</param>
        /// <param name="channelId">调用 渠道</param>
        /// <param name="categoryId">分类id</param>
        /// <param name="brandId">品牌id</param>
        /// <param name="age">年龄区间</param>
        /// <param name="price">价格区间</param>
        /// <param name="sort">排序类型</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <param name="pageIndex">当前页数</param>
        /// <returns></returns>
        public static MResultList <ItemGoods> GetGoodsList(string sid, string uid, int channelId, int categoryId, int brandId,
                                                           string age, string price, string sort, int pageSize, int pageIndex)
        {
            var result = new MResultList <ItemGoods>(true);

            var      clusterId  = 0;
            var      starAge    = 0;
            var      endAge     = 0;
            decimal  startPrice = 0;
            decimal  endPrice   = 0;
            SortType?sortType   = null;
            var      pageTotal  = 0;

            #region 数据转换
            try
            {
                #region 会员等级
                if (!string.IsNullOrEmpty(uid))
                {
                    var member     = Factory.DALFactory.Member();
                    var memberInfo = member.GetMemberInfo(uid);
                    clusterId = MCvHelper.To(memberInfo.clusterId, 0);
                }
                if (clusterId < 1)
                {
                    clusterId = 1;
                }
                #endregion

                #region 年龄
                if (!string.IsNullOrEmpty(age))
                {
                    var ageSplit = age.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
                    if (ageSplit.Length == 2)
                    {
                        starAge = MCvHelper.To <int>(ageSplit[0]);
                        endAge  = MCvHelper.To <int>(ageSplit[1]);
                    }
                }
                #endregion

                #region 价格
                if (!string.IsNullOrEmpty(price))
                {
                    var priceSplit = price.Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
                    if (priceSplit.Length == 2)
                    {
                        startPrice = MCvHelper.To <decimal>(priceSplit[0]);
                        endPrice   = MCvHelper.To <decimal>(priceSplit[1]);
                    }
                }
                #endregion

                #region 排序类型
                if (!string.IsNullOrEmpty(sort))
                {
                    sortType = MCvHelper.To <SortType>(sort);
                }
                #endregion
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                result.msg    = "调用参数异常,请检查参数格式";
                MLogManager.Error(MLogGroup.Goods.读取商品数据, null, "调用参数异常,请检查参数格式", ex);
            }

            #endregion

            try
            {
                var goods = Factory.DALFactory.Goods();
                var list  = goods.GetGoodsList(clusterId, channelId, categoryId, brandId, starAge, endAge, startPrice,
                                               endPrice, sortType, pageSize, pageIndex, out pageTotal);
                result.page   = pageIndex;
                result.size   = pageSize;
                result.total  = pageTotal;
                result.status = MResultStatus.Success;

                list.ForEach(item =>
                {
                    try
                    {
                        result.list.Add(new ItemGoods()
                        {
                            gid     = item.intProductID,
                            title   = item.vchProductName,
                            pic_url = FormatProductPicUrl(item.vchMainPicURL),
                            price   = MCvHelper.To <decimal>(item.numVipPrice, 0)
                        });
                    }
                    catch
                    {
                    }
                });
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                MLogManager.Error(MLogGroup.Goods.读取商品数据, null, "调用读取商品列表出错", ex);
            }
            return(result);
        }
コード例 #20
0
ファイル: OrderBLL.cs プロジェクト: jinwyp/MyzjCodeRepository
        /// <summary>
        /// 获取订单商品列表
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="uid"></param>
        /// <param name="userId"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        public static MResultList<ItemOrderGoods> GetOrderGoodsList(int sid, string uid, int userId, string orderCode)
        {
            var result = new MResultList<ItemOrderGoods>(true);

            try
            {
                #region 参数判断
                if (userId <= 0)
                {
                    result.status = MResultStatus.ParamsError;
                    result.msg = "用户标识错误!";
                }
                if (string.IsNullOrEmpty(orderCode))
                {
                    result.status = MResultStatus.ParamsError;
                    result.msg = "订单标识错误!";
                }
                #endregion

                var orderDal = DALFactory.Order();
                var memberDal = DALFactory.Member();

                var memberInfo = memberDal.GetMemberInfo(userId);
                if (memberInfo == null || memberInfo.membNo <= 0)
                {
                    result.status = MResultStatus.Undefined;
                    result.msg = "用户不存在!";
                }
                var clusterId = MCvHelper.To(memberInfo.clusterId, 1);

                var orderGoodsList = orderDal.GetOrderGoodsList(userId, orderCode, clusterId);
                if (orderGoodsList.Any())
                {
                    orderGoodsList.ForEach(item =>
                                               {
                                                   var goodsItem = new ItemOrderGoods()
                                                                       {
                                                                           gid = item.intProductID,
                                                                           title = item.vchProductName,
                                                                           price = item.numSalePrice,
                                                                           num = item.intQty,
                                                                           total = item.numTotalAmount,
                                                                           pic_url = GoodsBLL.FormatProductPicUrl(item.PicUrl),
                                                                           score = item.intScores,
                                                                           marketprice = MCvHelper.To<decimal>(item.numStandarPrice, item.numSalePrice),
                                                                           productcode = item.vchProductPrinted
                                                                       };
                                                   result.list.Add(goodsItem);
                                               });
                    result.status = MResultStatus.Success;
                }
                else
                {
                    result.status = MResultStatus.Undefined;
                    result.msg = "没有数据!";
                }

            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                MLogManager.Error(MLogGroup.Order.获取订单信息, null, "获取订单信息", ex);
            }

            return result;
        }
コード例 #21
0
        public MResultList<ProductImg> GetGoodsPicList(string sid, string token, string guid, string user_id, string uid, string gid)
        {
            var result = new MResultList<ProductImg>(true);

            try
            {
                var iGid = MCvHelper.To<int>(gid);
                result = MCacheManager.UseCached<MResultList<ProductImg>>(
                        string.Format("GetGoodsPicList{0}_{1}", sid, gid),
                        MCaching.CacheGroup.Goods,
                        () => GoodsBLL.GetGoodsPicList(sid, uid, iGid));
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg = "处理图片列表数据出错!";
            }

            return result;
        }
コード例 #22
0
        public MResultList<ItemOrder> GetOrdersList(string sid, string token, string guid, string user_id, string uid, string begintime, string endtime)
        {
            var result = new MResultList<ItemOrder>();
            try
            {
                var begimTime = MCvHelper.To<DateTime>(begintime, DateTime.Now.AddMonths(-1));
                var endTime = MCvHelper.To<DateTime>(endtime, DateTime.Now);

                result = OrderBLL.GetOrdersList((int)SystemType, Uid, UserId, begimTime, endTime);
            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExceptionError;
                result.msg = "处理数据出错!";
            }

            return result;
        }
コード例 #23
0
ファイル: OrderBLL.cs プロジェクト: jinwyp/MyzjCodeRepository
        /// <summary>
        /// 获取订单列表
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="uid"></param>
        /// <param name="userId"></param>
        /// <param name="begimTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public static MResultList<ItemOrder> GetOrdersList(int sid, string uid, int userId, DateTime begimTime, DateTime endTime)
        {
            var result = new MResultList<ItemOrder>(true);

            #region 参数验证

            if (userId <= 0)
            {
                result.status = MResultStatus.ParamsError;
                result.msg = "用户标识错误!";
            }

            #endregion

            try
            {
                var orderDal = DALFactory.Order();

                var orderList = orderDal.GetOrdersList(userId, begimTime, endTime);
                if (orderList.Any())
                {
                    orderList.ForEach(item =>
                                          {
                                              var payType = item.payMethod == 0 ? "货到付款" : "在线支付";

                                              var payStatus = item.payStatus == 2 ? "已付款" : "未付款";
                                              #region 订单状态
                                              string orderStatus;
                                              switch (item.flowStatus)
                                              {
                                                  case 0: orderStatus = "付款未审核"; break;
                                                  case 1: orderStatus = "未确定"; break;
                                                  case 4: orderStatus = "客户已确认"; break;
                                                  case 5: orderStatus = "生成配货单"; break;
                                                  case 7: orderStatus = "已出库"; break;
                                                  case 20: orderStatus = "完成"; break;
                                                  default:
                                                      orderStatus = "未知"; break;
                                              }
                                              #endregion
                                              var orderInfo = new ItemOrder
                                                                  {
                                                                      oid = item.orderNo,
                                                                      ocode = item.orderCode,
                                                                      created = item.createDate,
                                                                      statusid = item.flowStatus,
                                                                      paytype = payType,
                                                                      status = orderStatus,
                                                                      total_fee = item.actuallyPay,
                                                                      total_freight = item.carriage,
                                                                      total_order = item.shouldPay
                                                                  };
                                              result.list.Add(orderInfo);
                                          });
                    result.status = MResultStatus.Success;
                }

            }
            catch (Exception ex)
            {
                result.status = MResultStatus.ExecutionError;
                MLogManager.Error(MLogGroup.Order.获取订单列表, null, "获取订单列表", ex);
            }

            return result;
        }