|
|
@@ -819,60 +819,79 @@ namespace MySystem
|
|
|
{
|
|
|
minute = 60 * 24 * 30;
|
|
|
}
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:贷记卡是否刷满" + CheckMoney + ";贷记卡交易:" + pos.CreditTrade + "");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:是否有机具所属人;机具所属人Id:" + pos.BuyUserId + "");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:是否未激活;机具激活状态:" + pos.ActivationState + "");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:划拨时间不能超过绑定时间" + minute + "分钟;划拨时间:" + pos.TransferTime.Value.ToString() + ",绑定时间:" + pos.BindingTime.Value.ToString());
|
|
|
if (pos.CreditTrade >= CheckMoney && pos.BuyUserId > 0 && pos.ActivationState == 0 && TransferTime.AddMinutes(-minute) < pos.BindingTime)
|
|
|
{
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件");
|
|
|
pos.ActivationState = 1;
|
|
|
pos.ActivationTime = now;
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:是否营训");
|
|
|
if(pos.CardType == 101)
|
|
|
{
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "是营训");
|
|
|
pos.IsPurchase = 1;
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "取消循环资格");
|
|
|
}
|
|
|
- function.WriteLog("\n\n\n" + DateTime.Now.ToString(), "开机奖励在激活中监控");
|
|
|
- function.WriteLog("机具" + pos.PosSn, "开机奖励在激活中监控");
|
|
|
- function.WriteLog("PrizeFlag:" + PrizeFlag, "开机奖励在激活中监控");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:是否关联商户信息");
|
|
|
PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
|
if (merchant != null)
|
|
|
{
|
|
|
- function.WriteLog("查询到商户", "开机奖励在激活中监控");
|
|
|
merchant.ActiveStatus = 1;
|
|
|
merchant.MerStandardDate = now;
|
|
|
db.SaveChanges();
|
|
|
|
|
|
- function.WriteLog("商户" + merchant.KqMerNo, "开机奖励在激活中监控");
|
|
|
-
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "已关联");
|
|
|
//发放开机奖励
|
|
|
- function.WriteLog("首台" + pos.IsFirst, "开机奖励在激活中监控");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:绑定时间不超过" + CheckDays + "天;当前绑定时间:" + pos.BindingTime.ToString() + "");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:非营训;当前类型:" + pos.CardType);
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:奖励开关;当前:" + PrizeFlag);
|
|
|
if(pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
{
|
|
|
- function.WriteLog("开机奖发放", "开机奖励在激活中监控");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件,发放开机奖励");
|
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
if(pos.BrandId == 14)
|
|
|
{
|
|
|
- if(pos.LeaderUserId > 0 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now))
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件,发放运营中心奖励");
|
|
|
+ RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:大盟主标记;当前大盟主Id:" + pos.LeaderUserId);
|
|
|
+ PxcModels.Leaders leader = db.Leaders.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new PxcModels.Leaders();
|
|
|
+ DateTime ExpiredDate = leader.ExpiredDate == null ? DateTime.Parse("1900-01-01") : leader.ExpiredDate.Value;
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:盟主是否过期;过期时间:" + pos.LeaderUserId);
|
|
|
+ if(pos.LeaderUserId > 0 && ExpiredDate > now)
|
|
|
{
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件,发放大盟主奖励");
|
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
|
}
|
|
|
- RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//发放大盟主奖励
|
|
|
decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
- function.WriteLog("大盟主---PrizeFlag:" + PrizeFlag + ";Deposit:" + Deposit + ";LeaderUserId:" + pos.LeaderUserId + ";pos.IsFirst:" + pos.IsFirst + ";pos.BindingTime:" + pos.BindingTime + ";now.AddDays(-CheckDays):" + now.AddDays(-CheckDays) + ";", "开机奖励在激活中监控");
|
|
|
+ if(pos.BrandId != 14)
|
|
|
+ {
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:有押金;当前押金:" + Deposit);
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:大盟主标记;当前大盟主Id:" + pos.LeaderUserId);
|
|
|
+ PxcModels.Leaders leader = db.Leaders.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new PxcModels.Leaders();
|
|
|
+ DateTime ExpiredDate = leader.ExpiredDate == null ? DateTime.Parse("1900-01-01") : leader.ExpiredDate.Value;
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:盟主是否过期;过期时间:" + pos.LeaderUserId);
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:绑定时间不超过" + CheckDays + "天;绑定时间:" + pos.BindingTime.Value.ToString() + "");
|
|
|
+ }
|
|
|
if (Deposit > 0 && pos.LeaderUserId > 0 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
{
|
|
|
- function.WriteLog("大盟主奖发放", "开机奖励在激活中监控");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件,发放大盟主奖励");
|
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
|
}
|
|
|
//发放运营中心奖励
|
|
|
if (Deposit > 0 && pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
{
|
|
|
- function.WriteLog("运营中心奖发放", "开机奖励在激活中监控");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件,发放运营中心奖励");
|
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
}
|
|
|
if(pos.CardType < 100)
|
|
|
{
|
|
|
- // AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
|
|
|
//统计激活数
|
|
|
RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
|
|
|
//运营中心额度变更
|
|
|
@@ -897,8 +916,13 @@ namespace MySystem
|
|
|
//推送激活数据
|
|
|
Utils.Instance.SendActData(pos);
|
|
|
}
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:已激活;当前状态:" + pos.ActivationState);
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:绑定后台30天到60天之间;绑定时间:" + pos.BindingTime.Value.ToString() + "");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:贷记卡是否刷满10000;贷记卡交易:" + pos.CreditTrade + "");
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "条件:非营训;当前类型:" + pos.CardType);
|
|
|
if(pos.ActivationState == 1 && pos.BindingTime.Value.AddDays(30) <= DateTime.Now && pos.BindingTime.Value.AddDays(60) > DateTime.Now && pos.CreditTrade >= 10000 && pos.CardType < 100)
|
|
|
{
|
|
|
+ Utils.Instance.PrizeRecord(db, 1, pos.PosSn, "满足条件,发放盟主开机奖励");
|
|
|
RedisDbconn.Instance.AddList("LeaderRewardQueue", pos.Id.ToString());
|
|
|
}
|
|
|
}
|