/// <summary> /// 修改用户基础信息 /// </summary> /// <param name="userId"></param> /// <param name="displayName"></param> /// <param name="hideNameCode"></param> /// <param name="headImage"></param> /// <param name="regTime"></param> /// <param name="userToken"></param> public void UpdateProfileUserInfo(string userId, string displayName, int?hideNameCode, string headImage, DateTime?regTime) { try { var biz = new CacheDataBusiness(); biz.UpdateProfileUserInfo(userId, displayName, hideNameCode, headImage, null, null, regTime); } catch (Exception ex) { Common.Log.LogWriterGetter.GetLogWriter().Write("Error", "UpdateProfileVisitHistory", ex); } }
//private void ForeachInnerMainSendAddress(string receivers, Func<InnerMailSendAddress> addressCreateInstanceHandler, Action<InnerMailSendAddress> addressAction) //{ // foreach (var item in receivers.Split('|')) // { // var address = addressCreateInstanceHandler(); // if (item.Equals("ALL", StringComparison.OrdinalIgnoreCase)) // { // address.ReceiverType = InnerMailReceiverType.All; // address.ReceiverId = null; // } // else if (item.StartsWith("R:", StringComparison.OrdinalIgnoreCase)) // { // address.ReceiverType = InnerMailReceiverType.Roles; // address.ReceiverId = item.Substring(2); // } // else if (item.StartsWith("U:", StringComparison.OrdinalIgnoreCase)) // { // address.ReceiverType = InnerMailReceiverType.Users; // address.ReceiverId = item.Substring(2); // } // else // { // throw new ArgumentException("接收者格式错误 - " + receivers); // } // addressAction(address); // } //} #endregion #endregion #region 手机短信 /// <summary> /// 发送短信 /// </summary> public void SendSMS(string mobile, string content, string userId) { if (string.IsNullOrEmpty(mobile) || string.IsNullOrEmpty(content)) { return; } var biz = new CacheDataBusiness(); var filterArray = biz.QueryCoreConfigFromRedis("SMS.Filter.Words").Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries); foreach (var word in filterArray) { content = content.Replace(word, ""); } var key = biz.QueryCoreConfigFromRedis("CFSMS.Key"); var pwd = biz.QueryCoreConfigFromRedis("CFSMS.Password"); var sender = SMSSenderFactory.GetSMSSenderInstance(new SMSConfigInfo { AgentName = "CFSMS", UserName = key, Password = pwd, Attach = "", }); var r = string.Empty; r = sender.SendSMS(mobile, content, ""); //保存到发送记录 new InnerMailManager().AddMoibleSMSSendRecord(new MoibleSMSSendRecord { CreateTime = DateTime.Now, Mobile = mobile, SendStatus = r, SMSContent = content, UserId = userId, }); }
public bool IsFillMoney(string userId, DateTime time) { var manager = new LoginLocalManager(); var resManager = new RestrictionsBetMoneyManager(); var isAuthenFillMoney = new CacheDataBusiness().QueryCoreConfigByKey("IsAuthenFillMoney").ConfigValue == "1"; if (isAuthenFillMoney)//判断是否需要实名、手机认证后充值 { var mobile = new MobileAuthenticationBusiness().QueryMobileByUserId(userId); var realName = new RealNameAuthenticationBusiness().QueryRealNameByUserId(userId); if (mobile == null || realName == null || !mobile.IsSettedMobile || string.IsNullOrEmpty(mobile.Mobile) || !realName.IsSettedRealName || string.IsNullOrEmpty(realName.RealName)) { return(false); } return(true); } return(true); //var isBet = resManager.IsBet(userId); //if (isBet) // return true; //else // return manager.IsFillMoney(userId, time); }
/// <summary> /// 查询已关注用户 /// </summary> public ProfileAttentionCollection QueryProfileAttentionCollection(string userId, int pageIndex, int pageSize) { var biz = new CacheDataBusiness(); return(biz.QueryProfileAttentionCollection(userId, pageIndex, pageSize)); }
/// <summary> /// 查询已关注用户数量 /// </summary> public int QueryProfileAttentionedCount(string userId) { var biz = new CacheDataBusiness(); return(biz.QueryProfileAttentionedCount(userId)); }
/// <summary> /// 查询已跟单数 /// </summary> public int QueryProfileFollowedCount(string userId, string gameCode, string gameType) { var biz = new CacheDataBusiness(); return(biz.QueryProfileFollowedCount(userId, gameCode, gameType)); }
/// <summary> /// 查询最新中奖 /// </summary> /// <param name="userId"></param> /// <param name="userToken"></param> /// <returns></returns> public ProfileLastBonusCollection QueryProfileLastBonusCollection(string userId) { var biz = new CacheDataBusiness(); return(biz.QueryProfileLastBonusCollection(userId)); }
/// <summary> /// 查询获奖级别 /// </summary> public ProfileBonusLevelInfo QueryProfileBonusLevelInfo(string userId) { var biz = new CacheDataBusiness(); return(biz.QueryProfileBonusLevelInfo(userId)); }
/// <summary> /// 查询获奖级别标题 /// </summary> public string QueryProfileBonusLevelTitle(string userId) { var biz = new CacheDataBusiness(); return(biz.QueryProfileBonusLevelTitle(userId)); }
/// <summary> /// 查询历史访客 /// </summary> public ProfileVisitHistoryCollection QueryProfileVisitHistoryCollection(string userId, int count) { var biz = new CacheDataBusiness(); return(biz.QueryProfileVisitHistoryCollection(userId)); }
/// <summary> /// 查询统计数据 /// </summary> /// <param name="userId"></param> /// <param name="userToken"></param> /// <returns></returns> public ProfileDataReport QueryProfileDataReport(string userId) { var biz = new CacheDataBusiness(); return(biz.QueryProfileDataReport(userId)); }
public Task <List <APP_Advertising> > GetGameInfoIndex() { try { var Key = EntityModel.Redis.RedisKeys.APP_Advertising_V2; var RedisValue = RedisHelperEx.DB_Other.GetObjs <APP_Advertising>(Key); if (RedisValue == null) { var Business = new CacheDataBusiness(); var Config = Business.QueryCoreConfigByKey(Key); Record_AppAd AppAd = null; List <APP_Advertising> AdList = null; if (Config != null && !string.IsNullOrEmpty(Config.ConfigValue)) { //.Replace("\r","").Replace("\n","").Replace("\t","") AppAd = JsonHelper.Deserialize <Record_AppAd>(Config.ConfigValue); } if (AppAd == null || AppAd.records == null) { AdList = new List <APP_Advertising>(); } else { AdList = AppAd.records; } var AllGame = Business.QueryLotteryAllGame(); var RetuenAdList = new List <APP_Advertising>(); foreach (var item in AllGame) { if (item.GameCode.ToLower() == "ctzq") { var ctzqgametype = new List <string>() { "tr9", "t14c", "t4cjq", "t6bqc" }; foreach (var gametype in ctzqgametype) { var tempitem = AdList.FirstOrDefault(p => p.name == gametype); if (tempitem == null) { RetuenAdList.Add(new APP_Advertising() { name = gametype, desc = item.EnableStatus == 0 ? "欢迎购彩" : "暂未开售", flag = item.EnableStatus == 0 ? "1" : "0" }); } else { RetuenAdList.Add(new APP_Advertising() { name = gametype, desc = item.EnableStatus == 0 ? tempitem.desc : "暂未开售", flag = item.EnableStatus == 0 ? "1" : "0" }); } } } else if (item.GameCode.ToLower() == "sjb") { var gyjitem = AdList.FirstOrDefault(p => p.name.ToLower() == "gyj"); if (gyjitem == null) { RetuenAdList.Add(new APP_Advertising() { name = "gyj", desc = item.EnableStatus == 0 ? "欢迎购彩" : "暂未开售", flag = item.EnableStatus == 0 ? "1" : "0" }); } var gjitem = AdList.FirstOrDefault(p => p.name == "gj"); if (gjitem == null) { RetuenAdList.Add(new APP_Advertising() { name = "gj", desc = item.EnableStatus == 0 ? "欢迎购彩" : "暂未开售", flag = item.EnableStatus == 0 ? "1" : "0" }); } } else { var templist = AdList.Where(p => p.name.ToLower().StartsWith(item.GameCode.ToLower())).ToList(); if (templist != null && templist.Count > 0) { var list = templist.Select(p => new APP_Advertising() { name = p.name, desc = item.EnableStatus == 0 ? p.desc : "暂未开售", flag = item.EnableStatus == 0 ? "1" : "0" }); RetuenAdList.AddRange(list); } else { RetuenAdList.Add(new APP_Advertising() { name = item.GameCode.ToLower(), desc = item.EnableStatus == 0 ? "欢迎购彩" : "暂未开售", flag = item.EnableStatus == 0 ? "1" : "0" }); } } } RedisHelperEx.DB_Other.SetObj(Key, RetuenAdList, TimeSpan.FromMinutes(5)); return(Task.FromResult(RetuenAdList)); } else { return(Task.FromResult(RedisValue)); } } catch (Exception ex) { throw new Exception("获取出错", ex); } }
/// <summary> /// 申请提现 /// 实际添加提现记录,扣除用户资金 /// </summary> public void RequestWithdraw_Step2(Withdraw_RequestInfo info, string userId, string password) { var userManager = new UserBalanceManager(); var user = userManager.QueryUserRegister(userId); if (!user.IsEnable) { throw new LogicException("用户已禁用"); } DB.Begin(); var resonseMoney = 0M; var orderId = BusinessHelper.GetWithdrawId(); BusinessHelper businessHelper = new BusinessHelper(); var category = businessHelper.Payout_To_Frozen_Withdraw(BusinessHelper.FundCategory_RequestWithdraw, userId, orderId, info.RequestMoney , string.Format("申请提现:{0:N2}元", info.RequestMoney), "Withdraw", password, out resonseMoney); var fundManager = new FundManager(); var addWithdraw = new C_Withdraw { OrderId = orderId, BankCardNumber = info.BankCardNumber, BankCode = info.BankCode, BankName = info.BankName, BankSubName = info.BankSubName, CityName = info.CityName, RequestTime = DateTime.Now, ProvinceName = info.ProvinceName, UserId = userId, RequestMoney = info.RequestMoney, WithdrawAgent = (int)info.WithdrawAgent, Status = (int)WithdrawStatus.Requesting, WithdrawCategory = (int)category, ResponseMoney = resonseMoney, }; fundManager.AddWithdraw(addWithdraw); //查询到账金额 var wi = GetWithdrawById(orderId); //判断DP是否可用 var cacheDataBusiness = new CacheDataBusiness(); var iscoreConfigInfo = cacheDataBusiness.QueryCoreConfigByKey("DP.Isvailable"); //获取当前系统时间(4-5点DP关闭) var datetime = System.DateTime.Now; var nowHourAndM = datetime.ToString("t"); var datestar = cacheDataBusiness.QueryCoreConfigByKey("DP.StartTime"); var dateend = cacheDataBusiness.QueryCoreConfigByKey("DP.EndTime"); DateTime dstar = Convert.ToDateTime(datestar.ConfigValue); DateTime dend = Convert.ToDateTime(dateend.ConfigValue); if (iscoreConfigInfo.ConfigValue == "1") { if (datetime <= dstar || datetime >= dend) { //发送消息到DP //判断是否发送到DP String htmls = info.BankName; //获取Dp提现最大限额 var coreConfigInfo = cacheDataBusiness.QueryCoreConfigByKey("DP.WithdrawHigthMoney"); //获取Dp给的公司编码 var coreConfigInfoC = cacheDataBusiness.QueryCoreConfigByKey("DP.Companyid"); //获取DP给的key var ck = cacheDataBusiness.QueryCoreConfigByKey("DP.Key"); //获取DP访问路径 var cw = cacheDataBusiness.QueryCoreConfigByKey("DP.WebUrl"); decimal withdrawHigthMoney = decimal.Parse(coreConfigInfo.ConfigValue); //var writer = Common.Log.LogWriterGetter.GetLogWriter(); //writer.Write("关于DP日志", "关于DP日志", Common.Log.LogType.Information, "关于DP日志", "withdrawHigthMoney===============" + withdrawHigthMoney); String str = String.Format("BankCardNumber=" + info.BankCardNumber + ",BankCode=" + info.BankCode + ",BankName=" + info.BankName + ",BankSubName=" + info.BankSubName + ",CityName=" + info.CityName + ",ProvinceName=" + info.ProvinceName + ",RequestMoney=" + info.RequestMoney + ",userRealName=" + info.userRealName + ",WithdrawAgent=" + info.WithdrawAgent + ""); //writer.Write("输出参数写测试用例", "输出参数写测试用例", Common.Log.LogType.Information, "输出参数写测试用例", "输出参数写测试用例===============" + str); WithdrawApplyInfo wai = new WithdrawApplyInfo(); wai.company_order_num = orderId; wai.company_user = userId; wai.card_name = info.userRealName; wai.card_num = info.BankCardNumber; wai.issue_bank_name = info.BankName; wai.issue_bank_address = info.BankSubName; wai.memo = ""; String amount = wi.ResponseMoney.ToString(); wai.amount = Math.Round(decimal.Parse(amount), 2); wai.company_id = Int32.Parse(coreConfigInfoC.ConfigValue); String dpresult = null; decimal dpHighmoney = decimal.Parse(coreConfigInfo.ConfigValue); if (info.RequestMoney < withdrawHigthMoney) { if (htmls.Contains("工商银行")) { int bankid = (int)BankCode.ICBC; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("招商银行")) { int bankid = (int)BankCode.CMB; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("建设银行")) { int bankid = (int)BankCode.CCB; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("农业银行")) { int bankid = (int)BankCode.ABC; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("中国银行")) { int bankid = (int)BankCode.BOC; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("交通银行")) { int bankid = (int)BankCode.BCM; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("中国民生银行") || htmls.Contains("民生银行")) { int bankid = (int)BankCode.CMBC; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("中信银行")) { int bankid = (int)BankCode.ECC; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("浦东发展银行") || htmls.Contains("浦发") || htmls.Contains("浦东")) { int bankid = (int)BankCode.SPDB; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("邮政储蓄") || htmls.Contains("中国邮政")) { int bankid = (int)BankCode.PSBC; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("光大银行")) { int bankid = (int)BankCode.CEB; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("平安银行")) { int bankid = (int)BankCode.PINGAN; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("广东发展银行") || htmls.Contains("广发银行")) { int bankid = (int)BankCode.CGB; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("华夏银行")) { int bankid = (int)BankCode.HXB; wai.bank_id = bankid.ToString(); } else if (htmls.Contains("兴业银行")) { int bankid = (int)BankCode.CIB; wai.bank_id = bankid.ToString(); } else { var pListe = new List <string>(); pListe.Add(string.Format("{0}={1}", "[OrderId]", orderId)); pListe.Add(string.Format("{0}={1}", "[UserName]", user.DisplayName)); pListe.Add(string.Format("{0}={1}", "[RequestMoney]", info.RequestMoney)); pListe.Add(string.Format("{0}={1}", "[ResponseMoney]", resonseMoney)); //发送短信 new SiteMessageControllBusiness().DoSendSiteMessage(userId, "", "ON_User_Request_Withdraw", pListe.ToArray()); DB.Commit(); //刷新余额 BusinessHelper.RefreshRedisUserBalance(userId); return; } dpresult = Withdrawal(wai, ck.ConfigValue, cw.ConfigValue); if (dpresult == null || dpresult == "") { DB.Rollback(); throw new Exception("服务繁忙,请稍后重试,如多次尝试失败,请在客服服务时间内联系在线客服咨询"); } } } } #region 发送站内消息:手机短信或站内信 var pList = new List <string>(); pList.Add(string.Format("{0}={1}", "[OrderId]", orderId)); pList.Add(string.Format("{0}={1}", "[UserName]", "")); pList.Add(string.Format("{0}={1}", "[RequestMoney]", info.RequestMoney)); pList.Add(string.Format("{0}={1}", "[ResponseMoney]", resonseMoney)); //发送短信 new SiteMessageControllBusiness().DoSendSiteMessage(userId, "", "ON_User_Request_Withdraw", pList.ToArray()); #endregion DB.Commit(); //刷新余额 BusinessHelper.RefreshRedisUserBalance(userId); }