//获取债权转让列表 public void GetZQZRCanTransferList() { int pageSize = GlobalUtils.PageSize; int pageIndex = Tool.SafeConvert.ToInt32(Context.Request.Form["pageIndex"], 1); string pStatus = WEBRequest.GetFormString("status"); if (pageIndex < 1) { pageIndex = 1; } Guid userid = WebUserAuth.UserId.HasValue ? WebUserAuth.UserId.Value : Guid.Empty; if (userid == Guid.Empty) { PrintJson("0", "您还未登录!"); return; } int outputStatus = 0; if (pStatus == "CanTran") { #region 可转让标 int count = 0; List <NegotiableInfo> list = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetNegotiableList(userid, 3, pageIndex, pageSize, out outputStatus, out count); List <NegotiableInfoExt> dataList = new List <NegotiableInfoExt>(); if (outputStatus == -1) { PrintJson("0", "有发净股标或者逾期垫付未还"); } else { foreach (NegotiableInfo item in list) { NegotiableInfoExt extItem = new NegotiableInfoExt(); extItem.ProjectId = item.ProjectId; extItem.Id = item.Id; extItem.Title = item.Title; extItem.TotalRefundMonths = item.TotalRefundMonths; extItem.RefundedMonths = item.RefundedMonths; extItem.TypeName = ToolStatus.ConvertProjectType(item.Type); extItem.DueInAmount = ToolStatus.ConvertLowerMoney(item.Amount + item.InterestAmout); extItem.PreCycDateStr = item.PreCycDate.ToString("yyyy-MM-dd"); extItem.TenderModeName = GetTenderMode(item.TenderMode); extItem.InterestRate = ToolStatus.DeleteZero(item.InterestRate); extItem.RepaymentType = ToolStatus.ConvertRepaymentType(item.RepaymentType); dataList.Add(extItem); } } if (count == 0) { PrintJson("0", "没有找到数据"); return; } int pageCount = GetPageCount(count, pageSize); var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList }; PrintJson(objData); #endregion } else if (pStatus == "Traning") { #region 转让中 int transferCount = 0; List <SubScribeTransferInfo> tempList = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetSubScribeTransferList(userid, 1, pageSize, pageIndex, out transferCount); if (transferCount == 0) { PrintJson("0", "没有找到数据"); return; } int pageCount = GetPageCount(transferCount, pageSize); List <SubScribeTransferInfoExt> dataList = new List <SubScribeTransferInfoExt>(); foreach (SubScribeTransferInfo item in tempList) { SubScribeTransferInfoExt extItem = new SubScribeTransferInfoExt(); extItem.ProjectId = item.ProjectId; extItem.Id = item.Id; extItem.Title = item.Title; extItem.SumTransferAmount = ToolStatus.ConvertLowerMoney(item.sumTransferAmount); extItem.ProgressStr = Convert.ToDouble(item.Progress).ToString("f1"); extItem.LastTimeStr = item.remainTime; extItem.AddDate = item.AddDate; extItem.TotalAmountStr = ToolStatus.ConvertLowerMoney(item.TotalAmount); DateTime EndTransferDate = DateTime.Parse(item.AddDate.ToString("yyyy-MM-dd") + " 23:59:59"); if (DateTime.Now > EndTransferDate) { extItem.LastSecond = 0; } else { extItem.LastSecond = Convert.ToInt32((EndTransferDate - DateTime.Now).TotalSeconds); } dataList.Add(extItem); } var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList }; PrintJson(objData); #endregion } else { #region 已完成 int transferCount = 0; List <SubScribeTransferInfo> tempList = new TuanDai.PortalSystem.BLL.SubScriberansferBLL().GetSubScribeTransferList(userid, 2, pageSize, pageIndex, out transferCount); if (transferCount == 0) { PrintJson("0", "没有找到数据"); return; } int pageCount = GetPageCount(transferCount, pageSize); List <SubScribeTransferInfoExt> dataList = new List <SubScribeTransferInfoExt>(); foreach (SubScribeTransferInfo item in tempList) { SubScribeTransferInfoExt extItem = new SubScribeTransferInfoExt(); extItem.ProjectId = item.ProjectId; extItem.Id = item.Id; extItem.Title = item.Title; extItem.SumTransferAmount = ToolStatus.ConvertLowerMoney(item.sumTransferAmount); extItem.ProgressStr = Convert.ToDouble(item.Progress).ToString("f1"); dataList.Add(extItem); } var objData = new { result = "1", msg = "", pageCount = pageCount, list = dataList }; PrintJson(objData); #endregion } }
protected void Page_Load(object sender, EventArgs e) { string type = WEBRequest.GetQueryString("type"); string code = ""; switch (type.Trim().ToLower()) { case "": string ReturnUrl = WEBRequest.GetQueryString("ReturnUrl"); code = WEBRequest.GetQueryString("code"); string goBackUrl = ReturnUrl; if (ReturnUrl.IndexOf("?") != -1) { goBackUrl += "&code=" + code; } else { goBackUrl += "?code=" + code; } Response.Redirect(goBackUrl); break; //获取微细OpenId case "getopenid": #region Response.ContentType = "application/json"; try { code = WEBRequest.GetQueryString("code"); ThirdLoginSDK sdkApi = new ThirdLoginSDK(); sdkApi.InitSDK(ThirdLoginSDK.ThirdLoginType.WeiXin); string wxOpenId = sdkApi.GetCookieOpenId(code); TuanDai.LogSystem.LogClient.LogClients.TraceLog(TdConfig.ApplicationName, "getopenid", "", wxOpenId); this.PrintJson("1", wxOpenId); } catch (Exception ex) { this.PrintJson("-100", "程序异常:" + ex.Message); } finally { Response.End(); } break; #endregion //获取微信用户信息 case "getuserinfor": #region Response.ContentType = "application/json"; try { DateTime beginTime = DateTime.Now; code = WEBRequest.GetQueryString("code"); //写入openid 因为code被使用过一次后,就会失效,缓存的openid就取不到。 string openId = WEBRequest.GetQueryString("openid"); if (openId.IsNotEmpty()) { GlobalUtils.WriteOpenIdToCookie(openId); } ThirdLoginSDK sdk = new ThirdLoginSDK(); sdk.InitSDK(ThirdLoginSDK.ThirdLoginType.WeiXin); //获取微信上用户信息 TuanDai.WXApiWeb.Common.ThirdLoginSDK.WXOAuthUser wxUserInfo = sdk.GetWXUserSubscribeInfor(code, openId.ToText()); var jsonStr = JsonHelper.ToJson(wxUserInfo); this.PrintJson("1", jsonStr); DateTime endTime = DateTime.Now; LogClients.TraceLog("WXTouch", "微信授权时间差", openId, (endTime - beginTime).TotalMilliseconds.ToString()); } catch (Exception ex) { this.PrintJson("-100", "程序异常:" + ex.Message); LogClients.ErrorLog("WXTouch", "微信授权错误", "", ex.Message + ex.StackTrace); } finally { Response.End(); } break; #endregion //获取Token case "getaccesstoken": #region string token = WEBRequest.GetQueryString("Token"); string configToken = ConfigHelper.getConfigString("APIKey"); Response.ContentType = "application/json"; try { if (configToken != token) { this.PrintJson("99", "验证不通过!"); return; } //从同一个缓存中读取全局的Token ThirdLoginSDK sdkApi = new ThirdLoginSDK(); sdkApi.InitSDK(ThirdLoginSDK.ThirdLoginType.WeiXin); TuanDai.WXApiWeb.Common.ThirdLoginSDK.WXOAuth_Token accessToken = sdkApi.GetWXUserOpenIdByCgi(code); var jsonStr = JsonHelper.ToJson(accessToken); this.PrintJson("1", jsonStr); } catch (Exception ex) { this.PrintJson("-100", "程序异常:" + ex.Message); } finally { Response.End(); } break; #endregion //App中活动登录 case "appajaxlogin": #region Response.ContentType = "application/json"; try { string appActivityToken = WEBRequest.GetFormString("appActivityToken"); if (!string.IsNullOrEmpty(appActivityToken)) { TuanDai.PortalSystem.Model.UserBasicInfoInfo model = new TuanDai.PortalSystem.BLL.AppUserTokenRecBLL().GetAppActivityUser(appActivityToken); if (model != null) { string DOMAINNAME = ConfigurationManager.AppSettings["CookieDomain"]; Tool.CookieHelper.WriteCookie("TDW_WapUserName", model.UserName); string strLastLoginDate = DateTime.Now.ToString("yyyy-MM-dd") + model.UserName; if (string.IsNullOrEmpty(CookieHelper.GetCookie("TDLastLoginDate")) || CookieHelper.GetCookie("TDLastLoginDate") != strLastLoginDate) { TuanDai.PortalSystem.BLL.VipGetWorthBLL.AddGetWorth(model.Id, (int)ConstString.UserGrowthType.EveryDayFirstLogin, null, 0); } Tool.CookieHelper.WriteCookie(DOMAINNAME, "TDLastLoginDate", strLastLoginDate); WebUserAuth.SignIn(model.Id.ToString()); } else { WebUserAuth.SignOut(); } } this.PrintJson("1", "登录成功!"); } catch (Exception ex) { this.PrintJson("-1", ex.Message); } finally { Response.End(); } #endregion break; //获取用户推送开关设置 case "getwxpushswitch": #region token = WEBRequest.GetQueryString("Token"); configToken = ConfigHelper.getConfigString("APIKey"); string pushtype = WEBRequest.GetQueryString("PushType"); Response.ContentType = "application/json"; try { if (configToken != token) { this.PrintJson("99", "验证不通过!"); return; } string strSQL = "SELECT DISTINCT OpenId FROM dbo.UserWXNotice WHERE ISNULL(OpenId,'')!=''"; if (pushtype.ToLower() == "wexnotice") { strSQL += " and IsWeXNotice=1"; } else if (pushtype.ToLower() == "actnotice") { strSQL += " and IsActivityNotice=1"; } else { strSQL += " and 1=0"; } Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters(); List <string> OpenIDList = PublicConn.QueryBySql <string>(strSQL, ref dyParams); var jsonStr = JsonHelper.ToJson(OpenIDList); this.PrintJson("1", jsonStr); } catch (Exception ex) { this.PrintJson("-100", "程序异常:" + ex.Message); } finally { Response.End(); } #endregion break; } }
private void ConfirmPay() { Guid userid; if (WebUserAuth.UserId != null) { userid = WebUserAuth.UserId.Value; } else { PrintJson("0", "您还未登录!"); return; } string orderId = WEBRequest.GetFormString("OrderId"); string valCode = WEBRequest.GetFormString("SMSCode"); string isBindCard = WEBRequest.GetFormString("IsBindCard"); try { if (isBindCard == "1") { AccountRechareInfo ar = getAccountRechare(orderId); if (null == ar) { PrintJson("0", "充值交易未成功!"); return; } BankCardPay.ConfirmBindBankCard(orderId, valCode); } else { //获取个人信息 UserBLL userbll = new UserBLL(); UserBasicInfoInfo userInfo = userbll.GetUserBasicInfoModelById(userid); if (null == userInfo) { PrintJson("0", "获取用户信息错误!"); return; } GetBankCardNo(userInfo, userid); //是否绑定银行卡 if (string.IsNullOrEmpty(userInfo.BankAccountNo)) { PrintJson("0", "银行卡未绑定!"); return; } string requestId = WEBRequest.GetFormString("RequestId").ToUpper(); //确认绑卡 BindBankCard.ConfirmBindBankCard(requestId, valCode); //无短信充值 AccountRechareInfo ar = getAccountRechare(orderId); if (null == ar) { PrintJson("0", "充值交易未成功!"); return; } var identityId = userInfo.Id.ToString().Replace("-", string.Empty).ToUpper(); var bindCardModel = BindBankCardList.GetBindCardList(identityId, userInfo.BankAccountNo.Trim()); var rechargeAmount = (int)(ar.Amount * 100); BindBankCardPay.BindPay(new BankCardPayRequestModel { Amount = rechargeAmount, CallBackUrl = EBNotifyUrl, CardLast = bindCardModel.Card_Last, CardTop = bindCardModel.Card_Top, IdentityId = identityId, OrderId = orderId }); } } catch (Exception ex) { SysLogHelper.WriteErrorLog("易宝充值出错:ConfirmPay", Tool.ExceptionHelper.GetExceptionMessage(ex)); PrintJson("0", "发生错误:" + ex.Message); return; } PrintJson("1", ""); }
public void GetMyFtbInvestList() { Guid?weOrderId = SafeConvert.ToGuid(WEBRequest.GetFormString("weOrderId")); int pageIndex; int.TryParse(Context.Request["pageIndex"], out pageIndex); int totalCount = 0; List <WeFTBWxInvestInfo> dataList = null; if (GlobalUtils.IsOpenSubscribeApi)//走CDC查询服务 { string err = ""; string resp = HttpClient.HttpUtil.HttpGet(TdConfig.ApplicationName, GlobalUtils.SubApiUrl + "/app/appGetMyFTBClaimDetail?weOrderId=" + weOrderId + "&userId=" + WebUserAuth.UserId.Value + "&pagesize=15&pageindex=" + pageIndex, "", out err); if (!string.IsNullOrEmpty(resp)) { var pub = JsonConvert.DeserializeObject < ResponsePublicModel <ResponseGeWeFTBWxInvestInfo> >(resp); if (pub != null) { dataList = pub.data.dataList; totalCount = pub.data.totalCount; } } //dataList = service.GetDataPager<WeFTBWxInvestInfo>("/app/APPGetMyFTBClaimDetail", param, // out totalCount); } else { string strSQL = @"SELECT * FROM ( select SUM(1) OVER() as TotalCount, s.Id as SubscribeId,s.ContractNo,p.[Type], case when isnull(s.TotalShares,0)=0 and isnull(s.TransferedShares,0)=0 then s.Amount when isnull(s.TransferedShares,0)>0 and (s.TotalShares=0 or s.TotalShares=s.TransferedShares) then ISNULL(s.TranedAmount,0) else s.Amount+isnull(s.TranedAmount,0) end Amount,p.Title,u.RealName as UserName,isnull(s.TranDate,s.AddDate) as AddDate, isnull(s.IsFromTran,0) as IsFromTran, s.TranId, ROW_NUMBER() OVER(order by s.AddDate desc) rownumber from Subscribe s with(nolock) left join Project p with(nolock) on s.ProjectId=p.Id left join UserBasicInfo u with(nolock) on p.UserId=u.Id where s.SubscribeUserId=@userId AND s.WeOrderId=@weOrderId and s.ContractNo not like '%[_]%' )M WHERE M.rownumber> @pagesize*(@pageindex-1) and M.rownumber<=@pagesize*@pageindex "; Dapper.DynamicParameters dyParams = new Dapper.DynamicParameters(); dyParams.Add("@weOrderId", weOrderId); dyParams.Add("@userId", WebUserAuth.UserId.Value); dyParams.Add("@pagesize", 15); dyParams.Add("@pageindex", pageIndex); dataList = TuanDai.DB.TuanDaiDB.Query <WeFTBWxInvestInfo>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); if (dataList != null && dataList.Count > 0) { totalCount = dataList[0].TotalCount; foreach (var item in dataList) { if (item.UserName != null) { if (item.UserName.Length > 1) { item.UserName = item.UserName.Substring(0, 1) + "**"; } } } } } if (dataList != null && dataList.Count > 0) { WebSettingInfo ftzqSet = new WebSettingBLL().GetWebSettingInfo("BA8B8D06-A510-436C-B996-3D66D43FDF40"); foreach (var item in dataList) { item.IsFromTran = item.IsFromTran && item.AddDate > DateTime.Parse(ftzqSet.Param2Value); if (GlobalUtils.IsOpenSubscribeApi) { item.ContractUrl = GetContractViewUrl(item.TypeId, item.IsFromTran, item.ContractUrl, item.SubscribeId); item.Title = item.ProjectTitle; var borrowerModel = new UserBLL().GetUserBasicInfoModelById(item.BorrowerId); if (borrowerModel == null) { borrowerModel = new UserBasicInfoInfo(); } var relName = borrowerModel.RealName; if (!string.IsNullOrEmpty(relName)) { item.UserName = relName.Substring(0, 1) + "**"; } } else { item.ContractUrl = GetContractViewUrl(item.Type, item.IsFromTran, item.ContractNo, item.SubscribeId); } } if (ftzqSet.Param1Value == "1") { DateTime checkDate = DateTime.Parse(ftzqSet.Param2Value.Trim()); //查询是否有承接记录 List <string> subIdList = dataList.Select(p => p.SubscribeId.ToString()).ToList(); if (subIdList != null && subIdList.Any()) { //加开关控制 dataList.ForEach(p => p.IsFromTran = p.AddDate > checkDate && p.IsFromTran); //string strSQL = "select UsedShares,SubscribeId, AddDate from dbo.ProjectFQBExTransfer where SubscribeId in(" + StrObj.StrToInSQL(subIdList) + ")"; //var dyParams = new Dapper.DynamicParameters(); //List<ProjectFQBExTransferInfo> fqbTranList = TuanDai.DB.TuanDaiDB.Query<ProjectFQBExTransferInfo>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); //if (fqbTranList == null || fqbTranList.Count == 0 || fqbTranList.Count < dataList.Count) //{ // //查询历史库 // List<ProjectFQBExTransferInfo> fqbTranList2 = TuanDai.DB.TuanDaiDB.Query<ProjectFQBExTransferInfo>(TdConfig.ApplicationName, TdConfig.DBWePlanRead, strSQL, ref dyParams); // if (fqbTranList2 != null) // { // if (fqbTranList == null) // fqbTranList = new List<ProjectFQBExTransferInfo>(); // fqbTranList.AddRange(fqbTranList2); // } //} string subids = ""; if (subIdList != null && subIdList.Count > 0) { foreach (var subid in subIdList) { if (string.IsNullOrEmpty(subids)) { subids = subid.ToUpper(); } else { subids += "," + subid.ToUpper(); } } } List <ProjectFQBExTransferInfo> fqbTranList = GetTranList(subids); if (fqbTranList != null && fqbTranList.Any()) { foreach (var item in dataList) { ProjectFQBExTransferInfo findObj = fqbTranList.Where(p => p.SubscribeId == item.SubscribeId).FirstOrDefault(); if (findObj != null) { //加开关控制 item.IsHaveTranList = findObj.AddDate > checkDate && findObj.UsedShares > 0; } } } } } } this.Context.Response.Write(JsonConvert.SerializeObject( new { result = totalCount > 0 ? 1 : 0, totalcount = totalCount, msg = dataList })); this.Context.Response.End(); }
/// <summary> /// 获取我的复投宝转让记录 /// </summary> public void GetMyFtbTranList() { string subId = WEBRequest.GetFormString("SubId"); int pageIndex; int.TryParse(Context.Request["pageIndex"], out pageIndex); int totalCount = 0; //string strSQL = @" select Id from dbo.ProjectFQBExTransfer where SubscribeId=@subId"; //var dyParams = new Dapper.DynamicParameters(); //dyParams.Add("@subId", subId); //Guid? tranId = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault<Guid?>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); Guid?tranId = GetTranList(subId.ToUpper()).FirstOrDefault().Id; List <FTBChengJieInfo> dataList = null; if (!tranId.HasValue) { totalCount = 0; dataList = new List <FTBChengJieInfo>(); } else { var strSQL = @" select * from (select ROW_NUMBER() OVER(order by a.TranDate desc) rownumber, isnull(a.TranDate,a.AddDate) as InvestDate, a.Amount as InvestAmount,b.TelNo,a.ContractNo,a.Id as SubscribeId,p.Type from Subscribe a with(nolock) inner join Project p with(nolock) on a.ProjectId=p.id left join UserBasicInfo b with(nolock) on b.Id=a.SubscribeUserId where a.TranId=@tranId )M WHERE M.rownumber> @pagesize*(@pageindex-1) and M.rownumber<=@pagesize*@pageindex "; var dyParams = new Dapper.DynamicParameters(); dyParams.Add("@tranId", tranId); dyParams.Add("@pagesize", 15); dyParams.Add("@pageindex", pageIndex); dataList = TuanDai.DB.TuanDaiDB.Query <FTBChengJieInfo>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); if (dataList != null && dataList.Count > 0) { foreach (var item in dataList) { item.ContractUrl = GetContractViewUrl(item.Type, true, item.ContractNo, item.SubscribeId); if (!string.IsNullOrEmpty(item.TelNo)) { item.TelNo = BusinessDll.StringHandler.MaskTelNo(item.TelNo); } item.InvestDateStr = item.InvestDate.ToShortDateString(); } } strSQL = "select count(1) from Subscribe where TranId=@tranId"; dyParams = new Dapper.DynamicParameters(); dyParams.Add("@tranId", tranId); totalCount = TuanDai.DB.TuanDaiDB.QueryFirstOrDefault <int>(TdConfig.ApplicationName, TdConfig.DBRead, strSQL, ref dyParams); } this.Context.Response.Write(JsonConvert.SerializeObject( new { result = totalCount > 0 ? 1 : 0, totalcount = totalCount, msg = dataList })); this.Context.Response.End(); }
public void ApplyFTBTransfer() { Guid userid = WebUserAuth.UserId.Value; if (userid == Guid.Empty) { PrintJson("-99", "登陆超时"); } TuanDai.PortalSystem.BLL.UserBLL userbll = new TuanDai.PortalSystem.BLL.UserBLL(); TuanDai.PortalSystem.Model.UserBasicInfoInfo model = userbll.GetUserBasicInfoModelById(userid); if (model == null) { PrintJson("-98", "用户不存在"); } if ((model.uStatus ?? 0) != 1) { PrintJson("-10", "用户已被冻结"); } Guid weOrderId = WEBRequest.GetFormGuid("WeOrderId"); if (weOrderId == Guid.Empty) { PrintJson("-9", "We订单不存在"); } decimal applyAmount = WEBRequest.GetFormString("ApplyAmount").ToDecimal(0); if (applyAmount <= 0) { PrintJson("-1", "申请的退出本金必须大于0"); } if (applyAmount % 1 != 0) { PrintJson("-1", "请输入大于0的整数金额"); } if (GlobalUtils.IsOpenCGT) { var reqMode = new CgtCallbackUrl.Model.ModelRequest.ApplyFTBTransferRequest { WeOrderId = weOrderId, TransferAmount = applyAmount }; string url = CgtCallBackConfig.GetCgtTradePwdUrl(reqMode, CgtCallBackConfig.CgtCallBackType.FTBPreExit); PrintJson("8888", url); } else { //验证交易密码 var bll = new UserSettingBLL(); var usersetting = bll.GetUserSettingInfo(userid); if (usersetting != null) { #region if (usersetting.PayPwdErrorDate.HasValue) { DateTime date1 = Convert.ToDateTime(usersetting.PayPwdErrorDate.Value.ToString("yyyy/MM/dd")); DateTime date2 = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd")); if (date1 == date2 && usersetting.PayPwdErrorCount >= 5) { PrintJson("-151", "交易密码已错误5次,请24小时后再进行此操作"); } if (date1 != date2 && usersetting.PayPwdErrorCount > 1) { usersetting.PayPwdErrorCount = 0; usersetting.PayPwdErrorDate = null; } } string PayPwd = Tool.Encryption.MD5(Context.Request["TranPwd"]); if (PayPwd != model.PayPwd) { //记录登录错误次数 if (usersetting.PayPwdErrorCount == null) { usersetting.PayPwdErrorCount = 0; } usersetting.PayPwdErrorCount += 1; usersetting.PayPwdErrorDate = DateTime.Now; //db.SaveChanges(); bll.UpdateUserSettingInfo(usersetting); if (usersetting.PayPwdErrorCount == 5) { PrintJson("-151", "交易密码已错误5次,请24小时后再进行此操作"); } else { PrintJson("-15", "交易密码错误,您还剩下" + (5 - usersetting.PayPwdErrorCount).ToString() + "次机会"); } } else { //清除错误记录 usersetting.PayPwdErrorCount = 0; usersetting.PayPwdErrorDate = null; bll.UpdateUserSettingInfo(usersetting); } #endregion } int status = 0; string strError = ""; TuanDai.PortalSystem.BLL.WeFTBBLL webll = new TuanDai.PortalSystem.BLL.WeFTBBLL(); webll.ApplyFTBRansom(weOrderId, applyAmount, out status, out strError); PrintJson(status.ToString(), strError); } }
/// <summary> /// 获取复投宝债仅信息 /// </summary> public void GetWeFtbObligatoryList() { Guid?productId = SafeConvert.ToGuid(WEBRequest.GetFormString("projectid")); int pageSize, pageIndex, totalCount; pageSize = 15; int.TryParse(Context.Request["pageIndex"], out pageIndex); WeFTBBLL weFtBll = new WeFTBBLL(); List <FTBInvestProjectInfo> ftbInvestProjectInfoList = weFtBll.GetFTBObligatoryList(productId.Value, pageSize, pageIndex, out totalCount); List <FTBInvestProjectInfo> newList = new List <FTBInvestProjectInfo>(); for (int i = 0; i < ftbInvestProjectInfoList.Count; i++) { var borrowerName = ftbInvestProjectInfoList[i].BorrowerName; var phone = ftbInvestProjectInfoList[i].TelNo; var IdentityCard = ftbInvestProjectInfoList[i].IdentityCard; var address = ftbInvestProjectInfoList[i].Address.ToText(); if (borrowerName.Length > 0) { borrowerName = borrowerName.Substring(0, 1) + "**"; } if (!phone.IsEmpty()) { if (phone.Length > 11) { phone = phone.Left(11); } phone = StringHandler.MaskTelNo(phone); } if (!string.IsNullOrWhiteSpace(IdentityCard)) { if (IdentityCard.Length > 18) { IdentityCard = IdentityCard.Left(18); } IdentityCard = StringHandler.MaskCardNo(IdentityCard); } if (address.Length > 5) { address = address.Substring(0, 6) + "..."; } FTBInvestProjectInfo tempModel = new FTBInvestProjectInfo(); tempModel.Address = address; tempModel.Amount = ftbInvestProjectInfoList[i].Amount; tempModel.BorrowerName = borrowerName; tempModel.Id = ftbInvestProjectInfoList[i].Id; tempModel.InvestDate = ftbInvestProjectInfoList[i].InvestDate; tempModel.ProductName = ftbInvestProjectInfoList[i].ProductName; tempModel.ProjectTitle = ftbInvestProjectInfoList[i].ProjectTitle; tempModel.ProjectId = ftbInvestProjectInfoList[i].ProjectId; tempModel.TelNo = phone; tempModel.IdentityCard = IdentityCard; newList.Add(tempModel); } this.Context.Response.Write(JsonConvert.SerializeObject( new { result = totalCount > 0 ? 1 : 0, totalcount = totalCount, msg = newList })); this.Context.Response.End(); }
/// <summary> /// 获取参数者列表 /// </summary> public void GetParticpantsList() { string keyword = WEBRequest.GetFormString("keyword"); int pageIndex = string.IsNullOrEmpty(WEBRequest.GetFormString("pageIndex")) == true ? 1 : int.Parse(WEBRequest.GetFormString("pageIndex")); var beginRowNumber = (pageIndex - 1) * 20 + 1; var endRowNumber = pageIndex * 20; const string querySql = @"select @Total=count(1) from [dbo].[20150901_MountaineeringPhotos] where Name like '%'+@keyword+'%' or OrderNo like '%'+@keyword+'%'; with t1 as( select ROW_NUMBER() over(order by t.OrderNo asc) as RowNumber,[Id] ParticipantId,OrderNo,[Name],[ThumbnailsUrl],[BigImageUrl],Records from [dbo].[20150901_MountaineeringPhotos] t where t.Name like '%'+@keyword+'%' or t.OrderNo like '%'+@keyword+'%') select * from t1 where t1.RowNumber between @beginRow and @endRow"; DynamicParameters parameters = new DynamicParameters(); parameters.Add("@Total", ParameterDirection.Output); parameters.Add("@beginRow", beginRowNumber); parameters.Add("@endRow", endRowNumber); parameters.Add("@keyword", keyword); var dataList = QueryList <OrderListViewMode>(querySql, parameters); if (dataList.Any()) { var responseObj = new { Success = true, Message = "", list = dataList, pagecount = dataList.Count }; PrintJson(responseObj); } else { var responseObj = new { Success = false, Message = "没有找到数据!" }; PrintJson(responseObj); } }
public void GetGodSendRedPacket() { try { Response.ContentType = "application/json"; string ExtendOpenId = WEBRequest.GetFormString("extendkey"); //财神爷OpenId if (DateTime.Now < WealthPage.ActivityStartDate) { PrintJson("-3", "您来得太早了,活动还未开始!"); return; } if (DateTime.Now > WealthPage.ActivityEndDate) { PrintJson("-3", "您来得太晚了,活动已结束了!"); return; } if (ExtendOpenId.IsNotEmpty()) { if (!WealthPage.CheckGodIsExists(ExtendOpenId)) { PrintJson("-3", "对不起,该财神爷不存在!"); return; } } ThirdLoginSDK sdkApi = new ThirdLoginSDK(); sdkApi.InitSDK(ThirdLoginSDK.ThirdLoginType.WeiXin); string OpenId = sdkApi.GetCookieOpenId(""); bool isGetHisPrize = WealthPage.CheckUserHasGetRedPacket(ExtendOpenId, OpenId); if (isGetHisPrize) { //这里必须要判断自已是否有做过财神,不然没法得到红包 WealthPage.GodWealthRecordInfo wealthInfo = WealthPage.GetUserGodWealthInfo(SelfOpenId); if (wealthInfo != null) { PrintJson("-2", "对不起,您已经领过他派的红包!"); } else { PrintJson("1", ""); } return; } // using (SqlConnection connection = WealthPage.OpenConnection(2)) // { // string strSQL = @"insert into Activity_GodWealth_Friend(Id,WXOpenId,FriendOpenId,UserAgent,AddDate) // values(@Id,@WXOpenId,@FriendOpenId,@UserAgent,@AddDate)"; // DynamicParameters dyParams = new DynamicParameters(); // dyParams.Add("@Id", Guid.NewGuid()); // dyParams.Add("@WXOpenId", ExtendOpenId); // dyParams.Add("@FriendOpenId", OpenId); // //获取用户浏览器信息 // string strAgent = ""; // strAgent += string.Format("用户IP: {0}\r\n", Tool.WebFormHandler.GetIP()); // strAgent += string.Format("用户浏览器: {0}\r\n", HttpContext.Current.Request.UserAgent); // dyParams.Add("@UserAgent", strAgent); // dyParams.Add("@AddDate", DateTime.Now); // int iCount = connection.Execute(strSQL, dyParams); // //领取成功时,更新财神爷派发个数 // if (iCount > 0) // { // strSQL = " update Activity_GodWealth_Record set FriendNum=isnull(FriendNum,0)+1 where WXOpenId=@WXOpenId"; // dyParams = new DynamicParameters(); // dyParams.Add("@WXOpenId", ExtendOpenId); // connection.Execute(strSQL, dyParams); // } // } PrintJson("1", ""); } catch (Exception ex) { BusinessDll.NetLog.WriteLoginHandler("财神爷活动上传图片出错", Tool.ExceptionHelper.GetExceptionMessage(ex), "触屏版"); PrintJson("0", "获取红包失败!"); } finally { Response.End(); } }
public void GetZhphApplySMSCode() { Guid userid = WebUserAuth.UserId.Value; //UserBasicInfo model = db.UserBasicInfo.FirstOrDefault(p => p.Id == userid); var model = new UserBLL().GetUserBasicInfoModelById(userid); if (model == null) { PrintJson("-1", "用户不存在"); } string mobileNo = WEBRequest.GetFormString("mobileno"); if (mobileNo.ToText().IsEmpty()) { PrintJson("-1", "未输入手机号"); } //string random = StringUtilily.GetRandomString(6); string telNo = mobileNo; string token = Tool.Encryption.MD5(userid.ToString()); //CodeRecord codeRecord = new CodeRecord(); //codeRecord.Id = Guid.NewGuid(); //codeRecord.UserId = userid; //codeRecord.Code = random; //codeRecord.AddDate = DateTime.Now; //codeRecord.Status = 0; //codeRecord.Type = MsCodeType.PhoneCode; //codeRecord.Type2 = MsCodeType2.ZhphFastLoanCode; //codeRecord.token = token; //codeRecord.TypeValue = telNo; //db.CodeRecord.AddObject(codeRecord); var canSend = new CodeRecordBLL().IsCanSendNewCodeRecord(telNo, MsCodeType.PhoneCode, MsCodeType2.ZhphFastLoanCode, null, 1, token); if (!canSend.Success) { PrintJson("-1", "一天之内最多发送5次!"); } var code = new CodeRecordBLL().CreateCodeRecordInfo(userid, Tool.WebFormHandler.GetIP(), MsCodeType.PhoneCode, MsCodeType2.ZhphFastLoanCode, telNo); //if (db.SaveChanges() > 0) if (code != null) { var parameters = new Dictionary <string, object>(); parameters.Add("ValidateCode", code.Code); var msgSender = new BusinessDll.MessageSend(); var sendResult = msgSender.SendMessage2(option: SendOption.Sms, eventCode: MessageTemplates.ValidateCode, parameters: parameters, mobile: telNo, content: code.Code); if (sendResult != "1") { PrintJson("-1", "短信发送失败"); } else { PrintJson("1", ""); } } else { PrintJson("-1", "短信发送失败"); } }
public void SubmitZhphLoan() { PrintJson("-1", "触屏版不支持正合普惠借款,请前往PC或APP"); return; Guid userId = WebUserAuth.UserId.Value; int ApplyType = WEBRequest.GetFormInt("ApplyType", 0); if (!ApplyType.ToString().IsIn("1", "2", "3", "4")) { PrintJson("0", "借款方案不支持"); return; } var userbll = new UserBLL(); var user = userbll.GetUserBasicInfoModelById(userId); if (user == null) { this.PrintJson("-2", "用户不存在"); } string code = WEBRequest.GetFormString("code"); string telno = WEBRequest.GetFormString("phone"); if (telno.IsEmpty()) { PrintJson("0", "手机号不能为空!"); return; } if (code.IsEmpty()) { PrintJson("0", "验证码不能为空!"); return; } int msgCode = new TuanDai.PortalSystem.BLL.CodeRecordBLL().CheckCodeRecord(code, telno, MsCodeType.PhoneCode, MsCodeType2.ZhphFastLoanCode, userId, true); /*1:验证通过;0:参数错误;-1:验证码不存在;-2:验证码已过期;-3:验证码已使用;-4:验证已过期*/ string msg = string.Empty; switch (msgCode) { case 0: msg = "参数错误"; break; case -1: msg = "验证码不存在"; break; case -2: msg = "验证码已过期"; break; case -3: msg = "验证码已使用"; break; case -4: msg = "验证已过期"; break; default: break; } if (msgCode != 1) { PrintJson(msgCode.ToString(), msg); return; } ProjectBLL projectbll = new ProjectBLL(); TuanDai.PortalSystem.Model.WXZhphApplyLoanInfo loanInfo = new TuanDai.PortalSystem.Model.WXZhphApplyLoanInfo(); loanInfo.Id = Guid.NewGuid(); loanInfo.AppTypeId = ApplyType; loanInfo.UserId = userId; loanInfo.AddDate = DateTime.Now; loanInfo.AppName = WEBRequest.GetFormString("name"); loanInfo.Phone = WEBRequest.GetFormString("phone"); loanInfo.Provice = WEBRequest.GetFormString("sel_city1"); loanInfo.City = WEBRequest.GetFormString("sel_city2"); loanInfo.AreaCode = WEBRequest.GetFormString("areacode"); //1:pc 2: ios 3:android 4:触屏版 5:服务号 loanInfo.DeviceType = 4; if (GlobalUtils.IsWeiXinBrowser) { loanInfo.DeviceType = 5; } bool isSave = projectbll.SubmitZhphLoan(loanInfo); if (!isSave) { PrintJson("0", "数据保存异常,请重试!"); return; } PrintJson("1", ""); }
//发送短信验证码 protected void GetPhoneRegCode() { Response.ContentType = "application/json"; try { string mobileNumber = WEBRequest.GetFormString("mobilenumber"); if (string.IsNullOrEmpty(mobileNumber)) { PrintJson("-1", "手机号码不能为空"); return; } string phoneRegex = @"^1[3|4|5|8][0-9]\d{4,8}$"; if (!Regex.IsMatch(mobileNumber, phoneRegex)) { PrintJson("-1", "手机号码格式不正确"); return; } string sVerCode = Tool.WEBRequest.GetFormString("validatecode"); if (sVerCode == "" || sVerCode.Length != 4) { PrintJson("-1", "图形码不能为空"); return; } string valued = HttpContext.Current.Session["webcheckcodereg"] == null ? "" : HttpContext.Current.Session["webcheckcodereg"].ToString(); BusinessDll.NetLog.WriteTraceLog("接收到验证码", "Session-Code:" + valued + " InputCode:" + sVerCode, "触屏版"); HttpContext.Current.Session["webcheckcodereg"] = null; if (sVerCode.ToLower() != valued.ToLower()) { PrintJson("-1", "发送失败:请重新输入图形验证码"); return; } //JunTeEntities db = new JunTeEntities(); //string strIP = Tool.WebFormHandler.GetIP(); //if (strIP != "121.13.249.210") //{ // DateTime enddate = DateTime.Parse(DateTime.Now.AddDays(-1).ToShortDateString()); // int count = db.CodeRecord.Where(p => (p.token == strIP || p.TypeValue == mobileNumber) && p.AddDate >= enddate).Count(); // if (count > 5) // { // PrintJson("-1", "发送失败:验证码获取太频繁!"); // return; // } //} //string random = StringUtilily.GetRandomString(6); //CodeRecord codeRcord = new CodeRecord(); //codeRcord.AddDate = DateTime.Now; //codeRcord.Code = random; //codeRcord.Id = Guid.NewGuid(); //codeRcord.Status = (int)ConstString.MSCodeStatus.Unused; //codeRcord.token = strIP; //codeRcord.Type = (int)ConstString.MSCodeType.PhoneCode; //codeRcord.Type2 = (int)ConstString.MSCodeType2.RegPhoneValid; //codeRcord.TypeValue = mobileNumber; //codeRcord.UserId = null; //db.CodeRecord.AddObject(codeRcord); //int result = db.SaveChanges(); if (false) { //var parameters = new Dictionary<string, object>(); //parameters.Add("ValidateCode", random); //var msgSender = new BusinessDll.MessageSend(); //var sendResult = msgSender.SendMessage2(option: SendOption.Sms, // eventCode: TuanDai.PortalSystem.Model.Enums.MessageTemplates.ValidateCode, parameters: parameters, mobile: mobileNumber); //if (sendResult != "1") //{ // PrintJson("0", "发送失败:发送短信验证码异常!"); //} //else //{ // PrintJson("1", ""); //} } else { PrintJson("0", "发送失败!"); } } catch (Exception ex) { BusinessDll.NetLog.WriteLoginHandler("财神爷活动发送验证码报错", Tool.ExceptionHelper.GetExceptionMessage(ex), "触屏版"); PrintJson("0", "发送失败"); } finally { Response.End(); } }