|
@@ -420,15 +420,15 @@ namespace MySystem
|
|
|
RedisDbconn.Instance.AddList("StatMerTradeAmountQueue", "{\"TradeDate\":\"" + TradeDate + "\",\"TradeAmount\":\"" + TradeAmount + "\",\"MerchantId\":\"" + pos.BindMerchantId + "\",\"BrandId\":\"" + BrandId + "\"}");
|
|
|
}
|
|
|
// 立刷60天内刷满10000,再返40
|
|
|
- if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) > 0&& pos.CreditTrade >= 10000 && pos.ActivationState == 1 && pos.BindingTime > DateTime.Now.AddDays(-60))
|
|
|
- {
|
|
|
- LiShuaActPrize(db, pos, 40);
|
|
|
- }
|
|
|
+ // if (pos.BrandId == 6 && decimal.Parse(function.CheckNum(pos.SeoKeyword)) > 0&& pos.CreditTrade >= 10000 && pos.ActivationState == 1 && pos.BindingTime > DateTime.Now.AddDays(-60))
|
|
|
+ // {
|
|
|
+ // LiShuaActPrize(db, pos, 40);
|
|
|
+ // }
|
|
|
//9月1日-9月30日立刷机具刷5000激活时额外奖励30元立刷活动奖
|
|
|
- if(pos.BrandId == 6 && pos.CreditTrade >= 5000M && pos.ActivationTime >= DateTime.Parse("2023-08-31 00:00:00") && pos.ActivationTime < DateTime.Parse("2023-11-01 00:00:00"))
|
|
|
- {
|
|
|
- LiShuaActPrize(db, pos, 30);
|
|
|
- }
|
|
|
+ // if(pos.BrandId == 6 && pos.CreditTrade >= 5000M && pos.ActivationTime >= DateTime.Parse("2023-08-31 00:00:00") && pos.ActivationTime < DateTime.Parse("2023-11-01 00:00:00"))
|
|
|
+ // {
|
|
|
+ // LiShuaActPrize(db, pos, 30);
|
|
|
+ // }
|
|
|
db.SpOrderNos.Add(new PxcModels.SpOrderNos()
|
|
|
{
|
|
|
OrderNo = trade.TradeSerialNo
|
|
@@ -464,19 +464,24 @@ namespace MySystem
|
|
|
}
|
|
|
|
|
|
//机具激活逻辑
|
|
|
- public void ActPos(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, decimal CheckMoney, int CheckDays, bool PrizeFlag = true)
|
|
|
+ public void ActPos(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, decimal CheckMoney, int CheckDays, bool PrizeFlag = true, string ActivationTime = "")
|
|
|
{
|
|
|
DateTime now = DateTime.Now;
|
|
|
+ if(!string.IsNullOrEmpty(ActivationTime))
|
|
|
+ {
|
|
|
+ now = DateTime.Parse(ActivationTime);
|
|
|
+ }
|
|
|
DateTime TransferTime = pos.TransferTime == null ? DateTime.Now : pos.TransferTime.Value;
|
|
|
int minute = 30;
|
|
|
if(pos.BrandId == 14)
|
|
|
{
|
|
|
minute = 0;
|
|
|
+ PrizeFlag = false;
|
|
|
}
|
|
|
if (pos.CreditTrade >= CheckMoney && pos.BuyUserId > 0 && pos.ActivationState == 0 && TransferTime.AddMinutes(-minute) < pos.BindingTime)
|
|
|
{
|
|
|
pos.ActivationState = 1;
|
|
|
- pos.ActivationTime = DateTime.Now;
|
|
|
+ pos.ActivationTime = now;
|
|
|
function.WriteLog("机具" + pos.PosSn, "开机奖励在激活中监控");
|
|
|
function.WriteLog("PrizeFlag:" + PrizeFlag, "开机奖励在激活中监控");
|
|
|
PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
@@ -484,33 +489,33 @@ namespace MySystem
|
|
|
{
|
|
|
function.WriteLog("查询到商户", "开机奖励在激活中监控");
|
|
|
merchant.ActiveStatus = 1;
|
|
|
- merchant.MerStandardDate = DateTime.Now;
|
|
|
+ merchant.MerStandardDate = now;
|
|
|
db.SaveChanges();
|
|
|
|
|
|
function.WriteLog("商户" + merchant.KqMerNo, "开机奖励在激活中监控");
|
|
|
|
|
|
//发放开机奖励
|
|
|
function.WriteLog("首台" + pos.IsFirst, "开机奖励在激活中监控");
|
|
|
- if(pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
+ if(pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
{
|
|
|
function.WriteLog("开机奖发放", "开机奖励在激活中监控");
|
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
}
|
|
|
}
|
|
|
- else if(pos.BrandId == 14 && pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
+ else if(pos.BrandId == 14 && pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
{
|
|
|
function.WriteLog("开机奖发放", "开机奖励在激活中监控");
|
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
}
|
|
|
//发放大盟主奖励
|
|
|
- function.WriteLog("大盟主---PrizeFlag:" + PrizeFlag + ";LeaderUserId:" + pos.LeaderUserId + ";pos.IsFirst:" + pos.IsFirst + ";pos.BindingTime:" + pos.BindingTime + ";DateTime.Now.AddDays(-CheckDays):" + DateTime.Now.AddDays(-CheckDays) + ";", "开机奖励在激活中监控");
|
|
|
- if (pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
+ function.WriteLog("大盟主---PrizeFlag:" + PrizeFlag + ";LeaderUserId:" + pos.LeaderUserId + ";pos.IsFirst:" + pos.IsFirst + ";pos.BindingTime:" + pos.BindingTime + ";now.AddDays(-CheckDays):" + now.AddDays(-CheckDays) + ";", "开机奖励在激活中监控");
|
|
|
+ if (pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
{
|
|
|
function.WriteLog("大盟主奖发放", "开机奖励在激活中监控");
|
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
|
}
|
|
|
//发放运营中心奖励
|
|
|
- if (pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
+ if (pos.IsFirst == 1 && pos.BindingTime > now.AddDays(-CheckDays) && PrizeFlag)
|
|
|
{
|
|
|
function.WriteLog("运营中心奖发放", "开机奖励在激活中监控");
|
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
@@ -518,7 +523,7 @@ namespace MySystem
|
|
|
AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
|
|
|
|
|
|
//统计激活数
|
|
|
- RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
|
|
|
}
|
|
|
}
|
|
|
|