/// <summary> /// 手续费划转:执行从最近一次转账时间以来的手续费划转 /// </summary> public void TransferFee() { var relations = Init(); Dictionary <string, decimal> dic = new Dictionary <string, decimal>(); foreach (var v in relations) { if (v.Value.Count == 0) { continue; } var to = MvcApplication.OptionService.Model.Traders.Where(a => a.Name == v.Key.UserName).FirstOrDefault(); if (to == null) { continue; } var slaves = v.Value.Select(u => new InvitorFeeTrans(MvcApplication.OptionService.Model.Traders.Where(a => a.Name == u.UserName).FirstOrDefault(), u.InvitorFeeRatio, u.LastTransferFeeTime, (d) => { if (!dic.ContainsKey(u.UserName)) { dic.Add(u.UserName, d); } else { dic[u.UserName] += d; } })) .ToList(); InvitorFeeService.TransFee(slaves, to); SaveFeeDelta(dic); } }
/// <summary> /// 奖金划转 /// </summary> /// <param name="t">推荐人</param> /// <param name="invitedNames">被推荐人名字</param> public decimal TransBonus(Trader t, List <string> invitedNames) { return(InvitorFeeService.TransBonus(t, invitedNames)); }