Пример #1
0
        /// <summary>
        /// 获取所有大客户得openApp配置
        /// </summary>
        /// <returns></returns>
        public JsonResult GetAllBigCustomerOpenAppIds()
        {
            UnivRedemptionCodeManager manager = new UnivRedemptionCodeManager();
            var result = manager.GetAllBigCustomerOpenAppIds();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 根据服务码或手机号查询服务码详情
        /// </summary>
        /// <param name="serviceCode"></param>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public async Task <ActionResult> SearchServiceCode(string serviceCode, string mobile, int pageIndex = 1, int pageSize = 1000, string tabValue = "BeautyCode")
        {
            var log = new DataAccess.Entity.BeautyOprLog
            {
                LogType     = "SearchServiceCode",
                IdentityID  = $"{serviceCode}|{mobile}",
                OldValue    = null,
                NewValue    = null,
                Remarks     = $"根据服务码[{serviceCode}]或手机号[{mobile}]查询服务码详情[{tabValue}]",
                OperateUser = User.Identity.Name,
            };

            LoggerManager.InsertLog("BeautyOprLog", log);
            if (String.Equals(tabValue, "BeautyCode"))
            {
                Tuple <List <ServiceCodeDetail>, int> result = null;
                result = await SearchCodeManager.GetBeautyServicePackageDetailCodes(mobile, serviceCode, pageIndex, pageSize);

                var shopDic = await SearchCodeManager.GetShopInfoByShopIds(result.Item1.Where(w => !string.IsNullOrEmpty(w.VerifyShop)).Select(s => int.Parse(s.VerifyShop)));

                if (shopDic.Any())
                {
                    result.Item1.ForEach(f =>
                    {
                        if (!string.IsNullOrEmpty(f.VerifyShop) && shopDic.ContainsKey(f.VerifyShop))
                        {
                            f.VerifyShop = shopDic[f.VerifyShop];
                        }
                        if (!string.IsNullOrEmpty(f.OrderNo))
                        {
                            f.OrderNoLink = IsOnline ?
                                            "https://oms.tuhu.cn/Order/Details/" + f.OrderNo.Remove(0, 2) :
                                            "https://oms.tuhu.work/Order/Details/" + f.OrderNo.Remove(0, 2);
                        }
                    });
                }
                return(Json(new { Status = true, Data = result.Item1, TotalCount = result.Item2, TotalPage = 0 }, JsonRequestBehavior.AllowGet));
            }
            else if (String.Equals(tabValue, "GeneralServiceCode"))
            {
                var result = await GeneralBeautyServerCodeManager.GetGeneralBeautyServerCodes(mobile, serviceCode, pageIndex, pageSize);

                return(Json(new { Status = true, Data = result, TotalCount = 0, TotalPage = 0 }, JsonRequestBehavior.AllowGet));
            }
            else if (String.Equals(tabValue, "GeneralRedemtionCode"))
            {
                var result = await UnivRedemptionCodeManager.GetRedeemMrServerCodes(mobile, serviceCode, pageIndex, pageSize);

                return(Json(new { Status = true, Data = result, TotalCount = 0, TotalPage = 0 }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Status = true, Data = new List <ServiceCodeDetail>(), TotalCount = 0, TotalPage = 0 }, JsonRequestBehavior.AllowGet));
            }
        }