protected string GetMonthExitRate(int month) { WeProductFTBRateInfo rateInfo = FTBRateList.Where(p => p.MonthType == month).FirstOrDefault(); if (rateInfo != null) { return(ToolStatus.DeleteZero(rateInfo.YearRate) + "%"); } return("0%"); }
private bool GetData() { //获取项目信息 if (GlobalUtils.IsRedis && GlobalUtils.IsWePlanRedis) { this.model = new WeProductBLL().GetWePlanByRedis(TypeId, projectId.Value, IsPreSell, TdConfig.ApplicationName); } else { this.model = bll.GetWeProductInfo(projectId.Value); } if (model == null || model.IsFTB == false) { return(false); } #region 判断满标 if (model.StartDate > DateTime.Now && model.StatusId == 1) { IsWeFinish = false; } else if (model.StartDate < DateTime.Now && model.OrderQty != model.TotalQty) { IsWeFinish = false; } else { IsWeFinish = true; } #endregion #region 判断新手标 if (!model.IsNewHand) { WeFTBBLL ftbll = new WeFTBBLL(); FTBRateList = this.GetWeFTBRateList(model.ProductTypeId ?? 0, model.StartDate ?? DateTime.Today); if (FTBRateList == null) { FTBRateList = new List <WeProductFTBRateInfo>(); } //补充提前退出前几个月的数据 if (FTBRateList.Any()) { WeProductFTBRateInfo firstRate = FTBRateList[0]; List <WeProductFTBRateInfo> tmpList = new List <WeProductFTBRateInfo>(); for (int i = 1; i < model.ExitLockMonth; i++) { tmpList.Add(new WeProductFTBRateInfo() { MonthType = i, ProductTypeId = model.ProductTypeId ?? 0, YearRate = firstRate.YearRate }); } if (tmpList.Any()) { FTBRateList.InsertRange(0, tmpList); } } FTBRateList = FTBRateList.OrderByDescending(p => p.MonthType).ToList(); } #endregion decimal deadLineType = model.DeadType == 1 ? 12 : 365; PreInterestRate = decimal.Parse("10000") * (model.Deadline ?? 0) * ((model.YearRate ?? 0) + (model.TuandaiRedRate ?? 0)) * decimal.Parse("0.01") / deadLineType; EbaoMultiple = int.Parse(Math.Ceiling(model.YearRate.Value / decimal.Parse("2.5")).ToString()); EbaoInterest = GetEbaoMultipleInterest(10000); GetLimitInvestMoney(); WebSettingBLL webSettingBll = new WebSettingBLL(); preSellSet = webSettingBll.GetWebSettingInfo("6F9D3B77-C15C-4A5A-B883-21004E10BE29"); curSellSet = webSettingBll.GetWebSettingInfo("B11558CB-3C6B-4DAD-9D2F-D6D2DE13CCF7"); sellSet518 = webSettingBll.GetWebSettingInfo("5E02F517-E6FC-4451-8232-378377837EC1"); IsPreView1218 = System.Configuration.ConfigurationManager.AppSettings["IsPreView1218"]; if (IsPreView1218 == "1") { preSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd"); preSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59"); } else if (IsPreView1218 == "2") { preSellSet.Param1Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd"); preSellSet.Param2Value = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd 23:59:59"); curSellSet.Param1Value = DateTime.Today.ToString("yyyy-MM-dd"); curSellSet.Param2Value = DateTime.Today.ToString("yyyy-MM-dd 23:59:59"); } return(true); }