コード例 #1
0
        protected void InitFormData()
        {
            Guid userId = WebUserAuth.UserId.Value;

            vipInfo = MUserVipInfoBLL.GetUserVipInfoById(WebUserAuth.UserId.Value);
            if (vipInfo == null)
            {
                vipInfo       = new MUserVipInfo();
                vipInfo.Level = 1;
            }

            NextReturnDay = GetNextReturnMoneyDay(userId);

            fundModel = new FundAccountBLL().GetFundAccountInfoById(userId);

            //待收本息加上复投宝的
            Tuple <decimal, decimal> ftbDueIn = GetFTBDueInAmountInterest(userId);

            fundModel.DueInPAndI  = (fundModel.DueInPAndI ?? 0) + ftbDueIn.Item1 + ftbDueIn.Item2;
            fundModel.DueOutPAndI = (fundModel.DueOutPAndI ?? 0) + fundModel.CurrentPreAdvance;

            #region 减去智享计划部分
            string sql      = @"SELECT  
                         sum(sd.Amount )+
                         sum(sd.InterestAmout )+
                         sum(ISNULL(sd.TuandaiRedPacket,0) )+
                        sum(ISNULL(sd.PublisherRedPacket,0))  
                        FROM dbo.SubscribeDetail sd with(nolock) 
                        inner join Project p with(nolock) on sd.ProjectId = p.Id
                        WHERE isnull(sd.InvestType,0)!=1 and sd.SubscribeUserId=@UserId  and sd.CycDate>getdate() and p.Type=37 ";
            var    dyParams = new Dapper.DynamicParameters();
            dyParams.Add("@UserId", userId);
            decimal p2pZxDueInAndI = TuanDaiDB.QuerySingle <decimal>(TdConfig.ApplicationName, "/BD/zxread", sql, ref dyParams);
            fundModel.DueInPAndI = fundModel.DueInPAndI - p2pZxDueInAndI;
            sql = @"SELECT  
                         sum(sd.Amount )+
                         sum(sd.InterestAmout )+
                         sum(ISNULL(sd.TuandaiRedPacket,0) )+
                        sum(ISNULL(sd.PublisherRedPacket,0))  
                        FROM dbo.SubscribeDetail sd with(nolock) 
                        inner join Project p with(nolock) on sd.ProjectId = p.Id
                        WHERE isnull(sd.InvestType,0)!=1 and sd.BorrowerUserId=@UserId  and sd.CycDate>getdate() and p.Type=37 ";
            decimal p2pZxDueOutPAndI = TuanDaiDB.QuerySingle <decimal>(TdConfig.ApplicationName, "/BD/zxread", sql, ref dyParams);
            fundModel.DueOutPAndI = fundModel.DueOutPAndI - p2pZxDueOutPAndI;
            #endregion

            decimal weWaitInvestAmount = GetWePlanWaitInvestment(userId);
            fundModel.FreezeAcount = fundModel.FreezeAcount + weWaitInvestAmount;  //冻结资金加上We待投

            pageModel = new PageMoneyModel();
            if (fundModel != null)
            {
                pageModel.P2PSumAmount = (fundModel.AviMoney ?? 0) + (fundModel.DueInPAndI ?? 0)
                                         + (fundModel.BorrowerOut ?? 0) + (fundModel.DueConfirmWithdrawDeposit ?? 0)
                                         + (fundModel.RewardMoney ?? 0) + (fundModel.FreezeAcount ?? 0);
            }

            pageModel.P2PAviAmount = fundModel.AviMoney ?? 0;
            pageModel.P2PDueIn     = fundModel.DueInPAndI ?? 0;
        }
コード例 #2
0
        protected void InitFormData()
        {
            pageModel = new PageMoneyModel();
            //GetUserAddInterest();
            UserBLL bll = new UserBLL();

            userModel = bll.GetUserBasicInfoModelById(userId);
            if (userModel != null && !string.IsNullOrWhiteSpace(userModel.HeadImage))
            {
                headImage = userModel.HeadImage;
            }
            GetAccountInfo(userId);
            GetDQLCFundData(userId);

            string read = Tool.CookieHelper.GetCookie("ReadUserPrizeFlag");

            if (!string.IsNullOrEmpty(read))
            {
                isShowPrizeBoxIco = !(read == "ReadPass");
            }
            else
            {
                isShowPrizeBoxIco = bll.GetUnReceiveCount(userId) > 0;
            }


            //获取用户收益
            //GetProfitStatistics(userId);
            UserVipModel = GetNewVipUserInfo();

            //待收本息加上复投宝的
            Tuple <decimal, decimal> ftbDueIn = GetFTBDueInAmountInterest(userId);

            accountModel.DueInPAndI = accountModel.DueInPAndI + ftbDueIn.Item1 + ftbDueIn.Item2;

            decimal weWaitInvestAmount = GetWePlanWaitInvestment(userId);

            accountModel.FreezeAcount = accountModel.FreezeAcount + weWaitInvestAmount;  //冻结资金加上We待投

            if (accountModel != null)
            {
                pageModel.P2PSumAmount = (accountModel.AviMoney) + (accountModel.DueInPAndI)
                                         + (accountModel.BorrowerOut) + (accountModel.DueConfirmWithdrawDeposit)
                                         + (accountModel.RewardMoney) + (accountModel.FreezeAcount);
            }
            if (!GlobalUtils.IsOpenSubscribeApi)
            {
                pageModel.P2PSumAmount += dqAccountModel.TotalAmount;
            }

            decimal p2pZxDueIn      = new ZXWXSelectBLL().GetDueDaiShow(userId, "37"); //p2p智享待收
            decimal dqZxDueInFromZx = new ZXWXSelectBLL().GetDueDaiShow(userId, "38"); //定期智享待收从智享数据库取

            decimal?dqZxDueInFromDq = 0;                                               //定期智享待收从定期数据库取
            string  sql             = "select  isnull(DueINAmount,0)+isnull(DueInInterest,0) from dbo.FundAccountInfo_zx with(nolock) where UserId=@UserId";
            var     para            = new Dapper.DynamicParameters();

            para.Add("@UserId", userId);
            dqZxDueInFromDq = TuanDaiDB.QueryFirstOrDefault <decimal?>(TdConfig.ApplicationName, "/BD/dqread", sql, ref para);

            pageModel.P2PAviAmount = accountModel.AviMoney;
            pageModel.P2PDueIn     = accountModel.DueInPAndI - p2pZxDueIn;

            pageModel.DQDueIn     = dqAccountModel.DueInPAndI - (dqZxDueInFromDq ?? 0);
            pageModel.DQAviAmount = dqAccountModel.AviMoney;
            pageModel.DQSumAmount = dqAccountModel.TotalAmount;

            GetPersonalNotice();


            zxDueInMoney = p2pZxDueIn + dqZxDueInFromZx;
        }