Beispiel #1
0
        public async Task <JsonResult> GetGeneralBeautyServerCodeProductsList(Guid packageId)
        {
            var result          = (await GeneralBeautyServerCodeManager.Instanse.GetGeneralBeautyServerCodeProductsListAsync(packageId))?.ToArray();
            var codeTypeConfigs = BeautyServicePackageManager.SelectAllBeautyServiceCodeTypeConfig(0)?.ToList();

            result?.ForEach(f =>
            {
                f.PID = codeTypeConfigs?.FirstOrDefault(e => e.PKID == f.CodeTypeConfigId)?.PID;
            });
            return(Json(new { Result = result }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetAllBeautyServiceCodeTypeConfig()
        {
            var result = new Dictionary <string, string>();
            var temp   = BeautyServicePackageManager.SelectAllBeautyServiceCodeTypeConfig();

            temp.ForEach(f =>
            {
                if (!result.ContainsKey(f.PID))
                {
                    result.Add(f.PID, f.Name);
                }
            });
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult UpsertBankMRActivityConfig(BankMRActivityConfig config, IEnumerable <BankMRActivityAdConfig> adConfig)
        {
            var result = false;

            if (config != null)
            {
                var operateUser   = HttpContext.User.Identity.Name;
                var cooperateUser = manager.FetchMrCooperateUserConfigByPKID(config.CooperateId);
                if (cooperateUser != null)
                {
                    var BeautyServiceCodeTypes = BeautyServicePackageManager.SelectAllBeautyServiceCodeTypeConfig();
                    config.BankId           = cooperateUser.VipUserId;
                    config.CodeTypeConfigId = BeautyServiceCodeTypes?.FirstOrDefault(x => x.PID.Equals(config.ServiceId)).PKID ?? 0;
                    result = manager.UpsertBankMRActivityConfig(config, adConfig, operateUser);
                }
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
        public async Task <Tuple <bool, object, string> > GetGeneralBeautyServerCodeSendRecordsDetail(int pkid)
        {
            var sendRecordDetail = (await GetGeneralBeautyServerCodeSendRecordDetail(pkid))?.ToArray();

            if (sendRecordDetail == null && !sendRecordDetail.Any())
            {
                return(Tuple.Create <bool, object, string>(false, null, "服务码详细记录信息为空"));//Json(new { Result = new { }, IsSuccess = false, Msg = "" });
            }
            var sendRecord = await GetGeneralBeautyServerCodeSendRecordById(pkid);

            if (sendRecord == null)
            {
                return(Tuple.Create <bool, object, string>(false, null, "服务码记录信息为空"));
            }
            var productList = await GetGeneralBeautyServerCodeProductsListAsync(sendRecord.PackageId);

            if (sendRecord == null)
            {
                return(Tuple.Create <bool, object, string>(false, null, "服务码记录对应产品信息为空"));
            }
            var codeTypeConfigs = BeautyServicePackageManager.SelectAllBeautyServiceCodeTypeConfig(0)?.ToList();
            var codes           = (await new KuaiXiuService.KuaiXiuService().GetServiceCodeDetailsByCodes(sendRecordDetail.Select(s => s.ServiceCode)))?.ToArray();
            var shopDetails     = (await ShopServiceProxy.ShopServiceProxy.Instanse.SelectShopDetailsAsync(codes.Where(w => (w.InstallShopId ?? 0) > 0).Select(s => s.InstallShopId ?? 0).Distinct()))?.ToArray();
            var result          = from a in sendRecordDetail
                                  join b in productList
                                  on new { a.PackageId, a.PackageProductId } equals new { b.PackageId, PackageProductId = b.PKID }
            where a.PackageId == sendRecord.PackageId
            select new
            {
                ServiceCode      = a.ServiceCode,
                Name             = b.Name,
                CodeTypeConfigId = b.CodeTypeConfigId,
                Phone            = sendRecord.Phone,
                PID        = codeTypeConfigs?.FirstOrDefault(f => f.PKID == b.CodeTypeConfigId)?.PID,
                ShopName   = shopDetails?.FirstOrDefault(f => f.ShopId == codes.FirstOrDefault(e => e.Code == a.ServiceCode)?.InstallShopId)?.SimpleName,
                VerifyTime = codes.FirstOrDefault(f => f.Code == a.ServiceCode)?.VerifyTime?.ToString("yyyy-MM-dd HH:mm:ss"),
                VerifyArea = shopDetails?.FirstOrDefault(f => f.ShopId == codes.FirstOrDefault(e => e.Code == a.ServiceCode)?.InstallShopId)?.Province + shopDetails?.FirstOrDefault(f => f.ShopId == codes.FirstOrDefault(e => e.Code == a.ServiceCode)?.InstallShopId)?.City,
            };

            return(Tuple.Create <bool, object, string>(true, result, ""));
        }
        public ActionResult GetAllBeautyServiceCodeTypeConfig(int ServerType = 0)
        {
            var result = BeautyServicePackageManager.SelectAllBeautyServiceCodeTypeConfig(ServerType);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }