|
@@ -27,35 +27,38 @@ namespace MySystem
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
- List<string> BrandIds = new List<string>();
|
|
|
|
|
- BrandIds.Add("14");
|
|
|
|
|
- BrandIds.Add("17");
|
|
|
|
|
- BrandIds.Add("23");
|
|
|
|
|
- BrandIds.Add("24");
|
|
|
|
|
- BrandIds.Add("25");
|
|
|
|
|
- BrandIds.Add("26");
|
|
|
|
|
- BrandIds.Add("32");
|
|
|
|
|
- List<string> SaveDataBindIds = Utils.Instance.SaveDataBindIds();
|
|
|
|
|
- WebCMSEntities spdb = new WebCMSEntities();
|
|
|
|
|
- PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
|
|
|
|
|
- JavaProductModels.WebCMSEntities pdb = new JavaProductModels.WebCMSEntities();
|
|
|
|
|
- DateTime start = DateTime.Now.AddDays(-60);
|
|
|
|
|
- DateTime end = DateTime.Now.AddMinutes(-3);
|
|
|
|
|
- int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
|
|
|
|
|
- IQueryable<TradeRecord> trades = spdb.TradeRecord.Where(m => m.Id >= StartId && !BrandIds.Contains(m.ProductType) && SaveDataBindIds.Contains(m.ProductType) && m.CreateDate >= start && m.Status == 1).OrderBy(m => m.CreateDate).Take(20);
|
|
|
|
|
- foreach (TradeRecord trade in trades.ToList())
|
|
|
|
|
|
|
+ if (Utils.PushTimeCheck())
|
|
|
{
|
|
{
|
|
|
- DoQueueTrade(db, pdb, trade);
|
|
|
|
|
- TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
|
|
|
|
|
- if (edit != null)
|
|
|
|
|
|
|
+ List<string> BrandIds = new List<string>();
|
|
|
|
|
+ BrandIds.Add("14");
|
|
|
|
|
+ BrandIds.Add("17");
|
|
|
|
|
+ BrandIds.Add("23");
|
|
|
|
|
+ BrandIds.Add("24");
|
|
|
|
|
+ BrandIds.Add("25");
|
|
|
|
|
+ BrandIds.Add("26");
|
|
|
|
|
+ BrandIds.Add("32");
|
|
|
|
|
+ List<string> SaveDataBindIds = Utils.Instance.SaveDataBindIds();
|
|
|
|
|
+ WebCMSEntities spdb = new WebCMSEntities();
|
|
|
|
|
+ PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
|
|
|
|
|
+ JavaProductModels.WebCMSEntities pdb = new JavaProductModels.WebCMSEntities();
|
|
|
|
|
+ DateTime start = DateTime.Now.AddDays(-60);
|
|
|
|
|
+ DateTime end = DateTime.Now.AddMinutes(-3);
|
|
|
|
|
+ int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
|
|
|
|
|
+ IQueryable<TradeRecord> trades = spdb.TradeRecord.Where(m => m.Id >= StartId && !BrandIds.Contains(m.ProductType) && SaveDataBindIds.Contains(m.ProductType) && m.CreateDate >= start && m.Status == 1).OrderBy(m => m.CreateDate).Take(20);
|
|
|
|
|
+ foreach (TradeRecord trade in trades.ToList())
|
|
|
{
|
|
{
|
|
|
- edit.Status = 2;
|
|
|
|
|
|
|
+ DoQueueTrade(db, pdb, trade);
|
|
|
|
|
+ TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
|
|
|
|
|
+ if (edit != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ edit.Status = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ spdb.SaveChanges();
|
|
|
}
|
|
}
|
|
|
- spdb.SaveChanges();
|
|
|
|
|
|
|
+ spdb.Dispose();
|
|
|
|
|
+ db.Dispose();
|
|
|
|
|
+ pdb.Dispose();
|
|
|
}
|
|
}
|
|
|
- spdb.Dispose();
|
|
|
|
|
- db.Dispose();
|
|
|
|
|
- pdb.Dispose();
|
|
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
@@ -68,20 +71,20 @@ namespace MySystem
|
|
|
public void DoQueueTrade(PxcModels.WebCMSEntities db, JavaProductModels.WebCMSEntities pdb, TradeRecord trade)
|
|
public void DoQueueTrade(PxcModels.WebCMSEntities db, JavaProductModels.WebCMSEntities pdb, TradeRecord trade)
|
|
|
{
|
|
{
|
|
|
string TradeSnNo = trade.TradeSnNo;
|
|
string TradeSnNo = trade.TradeSnNo;
|
|
|
- if(trade.ProductType == "30" && !trade.TradeSnNo.StartsWith("LKLYSMZCFYH"))
|
|
|
|
|
|
|
+ if (trade.ProductType == "30" && !trade.TradeSnNo.StartsWith("LKLYSMZCFYH"))
|
|
|
{
|
|
{
|
|
|
trade.MerNo = trade.Field2;
|
|
trade.MerNo = trade.Field2;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool op = true;
|
|
bool op = true;
|
|
|
//判断盒易付吱码交易
|
|
//判断盒易付吱码交易
|
|
|
- if(trade.ProductType == "12" && trade.TradeType == "2")
|
|
|
|
|
|
|
+ if (trade.ProductType == "12" && trade.TradeType == "2")
|
|
|
{
|
|
{
|
|
|
JavaProductModels.KxsMerchant merchant = pdb.KxsMerchant.FirstOrDefault(m => m.MerchantNo == trade.MerNo);
|
|
JavaProductModels.KxsMerchant merchant = pdb.KxsMerchant.FirstOrDefault(m => m.MerchantNo == trade.MerNo);
|
|
|
- if(merchant != null)
|
|
|
|
|
|
|
+ if (merchant != null)
|
|
|
{
|
|
{
|
|
|
JavaProductModels.KxsMachine pos = pdb.KxsMachine.FirstOrDefault(m => m.Id == merchant.MachineId);
|
|
JavaProductModels.KxsMachine pos = pdb.KxsMachine.FirstOrDefault(m => m.Id == merchant.MachineId);
|
|
|
- if(pos != null)
|
|
|
|
|
|
|
+ if (pos != null)
|
|
|
{
|
|
{
|
|
|
trade.TradeSnNo = pos.PosSn;
|
|
trade.TradeSnNo = pos.PosSn;
|
|
|
}
|
|
}
|
|
@@ -146,10 +149,10 @@ namespace MySystem
|
|
|
if (trade.TradeAmount == 9900 || trade.TradeAmount == 19900 || trade.TradeAmount == 29900)
|
|
if (trade.TradeAmount == 9900 || trade.TradeAmount == 19900 || trade.TradeAmount == 29900)
|
|
|
{
|
|
{
|
|
|
op = false;
|
|
op = false;
|
|
|
- if(trade.ProductType == "30")
|
|
|
|
|
|
|
+ if (trade.ProductType == "30")
|
|
|
{
|
|
{
|
|
|
PxcModels.LklMerNo mer = db.LklMerNo.FirstOrDefault(m => m.ExtMerNo == trade.MerNo);
|
|
PxcModels.LklMerNo mer = db.LklMerNo.FirstOrDefault(m => m.ExtMerNo == trade.MerNo);
|
|
|
- if(mer != null)
|
|
|
|
|
|
|
+ if (mer != null)
|
|
|
{
|
|
{
|
|
|
trade.MerNo = mer.MerNo;
|
|
trade.MerNo = mer.MerNo;
|
|
|
}
|
|
}
|
|
@@ -171,11 +174,11 @@ namespace MySystem
|
|
|
{
|
|
{
|
|
|
op = false;
|
|
op = false;
|
|
|
}
|
|
}
|
|
|
- if(trade.ProductType == "7" && trade.TradeStatus != "00")
|
|
|
|
|
|
|
+ if (trade.ProductType == "7" && trade.TradeStatus != "00")
|
|
|
{
|
|
{
|
|
|
op = false;
|
|
op = false;
|
|
|
}
|
|
}
|
|
|
- if(trade.ProductType == "34" && trade.TradeStatus != "SUCCESS")
|
|
|
|
|
|
|
+ if (trade.ProductType == "34" && trade.TradeStatus != "SUCCESS")
|
|
|
{
|
|
{
|
|
|
op = false;
|
|
op = false;
|
|
|
}
|
|
}
|
|
@@ -186,7 +189,7 @@ namespace MySystem
|
|
|
{
|
|
{
|
|
|
PosPushDataNewHelper.Trade(trade);
|
|
PosPushDataNewHelper.Trade(trade);
|
|
|
//创业帮交易数据推送
|
|
//创业帮交易数据推送
|
|
|
- if(trade.ProductType == "12")
|
|
|
|
|
|
|
+ if (trade.ProductType == "12")
|
|
|
{
|
|
{
|
|
|
int BankCardType = 1;
|
|
int BankCardType = 1;
|
|
|
if (trade.BankCardType == "C")
|
|
if (trade.BankCardType == "C")
|
|
@@ -217,25 +220,28 @@ namespace MySystem
|
|
|
{
|
|
{
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
- List<string> SaveDataBindIds = Utils.Instance.SaveDataBindIds();
|
|
|
|
|
- WebCMSEntities spdb = new WebCMSEntities();
|
|
|
|
|
- PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
|
|
|
|
|
- DateTime start = DateTime.Now.AddDays(-40);
|
|
|
|
|
- int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
|
|
|
|
|
- IQueryable<TradeRecord> trades = spdb.TradeRecord.Where(m => m.Id >= StartId && m.ProductType == "14" && SaveDataBindIds.Contains(m.ProductType) && m.CreateDate >= start && m.Status == 1).OrderBy(m => m.CreateDate).Take(20);
|
|
|
|
|
- foreach (TradeRecord trade in trades.ToList())
|
|
|
|
|
|
|
+ if (Utils.PushTimeCheck())
|
|
|
{
|
|
{
|
|
|
- PosPushDataNewHelper.Trade(trade);
|
|
|
|
|
-
|
|
|
|
|
- TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
|
|
|
|
|
- if (edit != null)
|
|
|
|
|
|
|
+ List<string> SaveDataBindIds = Utils.Instance.SaveDataBindIds();
|
|
|
|
|
+ WebCMSEntities spdb = new WebCMSEntities();
|
|
|
|
|
+ PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
|
|
|
|
|
+ DateTime start = DateTime.Now.AddDays(-40);
|
|
|
|
|
+ int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
|
|
|
|
|
+ IQueryable<TradeRecord> trades = spdb.TradeRecord.Where(m => m.Id >= StartId && m.ProductType == "14" && SaveDataBindIds.Contains(m.ProductType) && m.CreateDate >= start && m.Status == 1).OrderBy(m => m.CreateDate).Take(20);
|
|
|
|
|
+ foreach (TradeRecord trade in trades.ToList())
|
|
|
{
|
|
{
|
|
|
- edit.Status = 2;
|
|
|
|
|
|
|
+ PosPushDataNewHelper.Trade(trade);
|
|
|
|
|
+
|
|
|
|
|
+ TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
|
|
|
|
|
+ if (edit != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ edit.Status = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ spdb.SaveChanges();
|
|
|
}
|
|
}
|
|
|
- spdb.SaveChanges();
|
|
|
|
|
|
|
+ spdb.Dispose();
|
|
|
|
|
+ db.Dispose();
|
|
|
}
|
|
}
|
|
|
- spdb.Dispose();
|
|
|
|
|
- db.Dispose();
|
|
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
@@ -278,14 +284,14 @@ namespace MySystem
|
|
|
{
|
|
{
|
|
|
int Status = 1;
|
|
int Status = 1;
|
|
|
bool op = db.PosMachinesTwo.Any(m => m.PosSn == trade.TradeSnNo);
|
|
bool op = db.PosMachinesTwo.Any(m => m.PosSn == trade.TradeSnNo);
|
|
|
- if(!op)
|
|
|
|
|
|
|
+ if (!op)
|
|
|
{
|
|
{
|
|
|
Status = -1;
|
|
Status = -1;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
op = db.PosMerchantInfo.Any(m => m.KqSnNo == trade.TradeSnNo);
|
|
op = db.PosMerchantInfo.Any(m => m.KqSnNo == trade.TradeSnNo);
|
|
|
- if(!op)
|
|
|
|
|
|
|
+ if (!op)
|
|
|
{
|
|
{
|
|
|
Status = -2;
|
|
Status = -2;
|
|
|
}
|
|
}
|
|
@@ -316,13 +322,13 @@ namespace MySystem
|
|
|
public void ActPos(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, decimal CheckMoney, int CheckDays, bool PrizeFlag = true, string ActivationTime = "")
|
|
public void ActPos(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, decimal CheckMoney, int CheckDays, bool PrizeFlag = true, string ActivationTime = "")
|
|
|
{
|
|
{
|
|
|
DateTime now = DateTime.Now;
|
|
DateTime now = DateTime.Now;
|
|
|
- if(!string.IsNullOrEmpty(ActivationTime))
|
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(ActivationTime))
|
|
|
{
|
|
{
|
|
|
now = DateTime.Parse(ActivationTime);
|
|
now = DateTime.Parse(ActivationTime);
|
|
|
}
|
|
}
|
|
|
DateTime TransferTime = pos.TransferTime == null ? DateTime.Parse("2050-01-01") : pos.TransferTime.Value;
|
|
DateTime TransferTime = pos.TransferTime == null ? DateTime.Parse("2050-01-01") : pos.TransferTime.Value;
|
|
|
int minute = 30;
|
|
int minute = 30;
|
|
|
- if(pos.BrandId == 14 && pos.PosSn.StartsWith("CS"))
|
|
|
|
|
|
|
+ if (pos.BrandId == 14 && pos.PosSn.StartsWith("CS"))
|
|
|
{
|
|
{
|
|
|
minute = 60 * 24 * 30;
|
|
minute = 60 * 24 * 30;
|
|
|
}
|
|
}
|
|
@@ -336,7 +342,7 @@ namespace MySystem
|
|
|
pos.ActivationState = 1;
|
|
pos.ActivationState = 1;
|
|
|
pos.ActivationTime = now;
|
|
pos.ActivationTime = now;
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:是否营训");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:是否营训");
|
|
|
- if(pos.CardType == 101)
|
|
|
|
|
|
|
+ if (pos.CardType == 101)
|
|
|
{
|
|
{
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "是营训");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "是营训");
|
|
|
pos.IsPurchase = 1;
|
|
pos.IsPurchase = 1;
|
|
@@ -350,7 +356,7 @@ namespace MySystem
|
|
|
merchant.MerStandardDate = now;
|
|
merchant.MerStandardDate = now;
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
|
|
|
|
|
- if(pos.BrandId != 14)
|
|
|
|
|
|
|
+ if (pos.BrandId != 14)
|
|
|
{
|
|
{
|
|
|
//发放奖励MQ
|
|
//发放奖励MQ
|
|
|
PrizeSetHelper.Do("1", pos.PosSn);
|
|
PrizeSetHelper.Do("1", pos.PosSn);
|
|
@@ -361,11 +367,11 @@ namespace MySystem
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:绑定时间不超过" + CheckDays + "天;当前绑定时间:" + pos.BindingTime.ToString() + "");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:绑定时间不超过" + CheckDays + "天;当前绑定时间:" + pos.BindingTime.ToString() + "");
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:非营训;当前类型:" + pos.CardType);
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:非营训;当前类型:" + pos.CardType);
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:奖励开关;当前:" + PrizeFlag);
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:奖励开关;当前:" + PrizeFlag);
|
|
|
- if(pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
|
|
|
|
+ if (pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
{
|
|
{
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放开机奖励");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放开机奖励");
|
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
- if(pos.BrandId == 14)
|
|
|
|
|
|
|
+ if (pos.BrandId == 14)
|
|
|
{
|
|
{
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放运营中心奖励");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放运营中心奖励");
|
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
@@ -373,7 +379,7 @@ namespace MySystem
|
|
|
PxcModels.Leaders leader = db.Leaders.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new PxcModels.Leaders();
|
|
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;
|
|
DateTime ExpiredDate = leader.ExpiredDate == null ? DateTime.Parse("1900-01-01") : leader.ExpiredDate.Value;
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:盟主是否过期;过期时间:" + pos.LeaderUserId);
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:盟主是否过期;过期时间:" + pos.LeaderUserId);
|
|
|
- if(pos.LeaderUserId > 0 && ExpiredDate > now)
|
|
|
|
|
|
|
+ if (pos.LeaderUserId > 0 && ExpiredDate > now)
|
|
|
{
|
|
{
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放大盟主奖励");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放大盟主奖励");
|
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
@@ -383,7 +389,7 @@ namespace MySystem
|
|
|
}
|
|
}
|
|
|
//发放大盟主奖励
|
|
//发放大盟主奖励
|
|
|
decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
- if(pos.BrandId != 14)
|
|
|
|
|
|
|
+ if (pos.BrandId != 14)
|
|
|
{
|
|
{
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:有押金;当前押金:" + Deposit);
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:有押金;当前押金:" + Deposit);
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:大盟主标记;当前大盟主Id:" + pos.LeaderUserId);
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:大盟主标记;当前大盟主Id:" + pos.LeaderUserId);
|
|
@@ -403,7 +409,7 @@ namespace MySystem
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放运营中心奖励");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放运营中心奖励");
|
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
}
|
|
}
|
|
|
- if(pos.CardType < 100)
|
|
|
|
|
|
|
+ if (pos.CardType < 100)
|
|
|
{
|
|
{
|
|
|
//统计激活数
|
|
//统计激活数
|
|
|
RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
|
|
RedisDbconn.Instance.AddList("StatActQueue", "{\"TradeDate\":\"" + now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
|
|
@@ -427,19 +433,19 @@ namespace MySystem
|
|
|
RedisDbconn.Instance.AddList("PosWithholdQueue", "{\"UserId\":\"" + pos.BuyUserId + "\",\"SnNo\":\"" + pos.PosSn + "\"}");
|
|
RedisDbconn.Instance.AddList("PosWithholdQueue", "{\"UserId\":\"" + pos.BuyUserId + "\",\"SnNo\":\"" + pos.PosSn + "\"}");
|
|
|
|
|
|
|
|
//推送激活数据
|
|
//推送激活数据
|
|
|
- if(Deposit == 0) Utils.Instance.SendActData(pos);
|
|
|
|
|
|
|
+ if (Deposit == 0) Utils.Instance.SendActData(pos);
|
|
|
}
|
|
}
|
|
|
else if (pos.ActivationState == 1 && pos.BrandId == 14)
|
|
else if (pos.ActivationState == 1 && pos.BrandId == 14)
|
|
|
{
|
|
{
|
|
|
- if(pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
|
|
|
|
+ if (pos.BindingTime > now.AddDays(-CheckDays) && pos.CardType < 100 && PrizeFlag)
|
|
|
{
|
|
{
|
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
- if(pos.BrandId == 14)
|
|
|
|
|
|
|
+ if (pos.BrandId == 14)
|
|
|
{
|
|
{
|
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
PxcModels.Leaders leader = db.Leaders.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new PxcModels.Leaders();
|
|
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;
|
|
DateTime ExpiredDate = leader.ExpiredDate == null ? DateTime.Parse("1900-01-01") : leader.ExpiredDate.Value;
|
|
|
- if(pos.LeaderUserId > 0 && ExpiredDate > now)
|
|
|
|
|
|
|
+ if (pos.LeaderUserId > 0 && ExpiredDate > now)
|
|
|
{
|
|
{
|
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
|
}
|
|
}
|
|
@@ -450,7 +456,7 @@ namespace MySystem
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:绑定后台30天到60天之间;绑定时间:" + pos.BindingTime.Value.ToString() + "");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:绑定后台30天到60天之间;绑定时间:" + pos.BindingTime.Value.ToString() + "");
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:贷记卡是否刷满10000;贷记卡交易:" + pos.CreditTrade + "");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:贷记卡是否刷满10000;贷记卡交易:" + pos.CreditTrade + "");
|
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "条件:非营训;当前类型:" + pos.CardType);
|
|
Utils.Instance.PrizeRecord(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)
|
|
|
|
|
|
|
+ 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(1, pos.PosSn, "满足条件,发放盟主开机奖励");
|
|
Utils.Instance.PrizeRecord(1, pos.PosSn, "满足条件,发放盟主开机奖励");
|
|
|
RedisDbconn.Instance.AddList("LeaderRewardQueue", pos.Id.ToString());
|
|
RedisDbconn.Instance.AddList("LeaderRewardQueue", pos.Id.ToString());
|
|
@@ -464,7 +470,7 @@ namespace MySystem
|
|
|
public void LiShuaActPrize(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, int prize)
|
|
public void LiShuaActPrize(PxcModels.WebCMSEntities db, PxcModels.PosMachinesTwo pos, int prize)
|
|
|
{
|
|
{
|
|
|
PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
|
- if(merchant != null)
|
|
|
|
|
|
|
+ if (merchant != null)
|
|
|
{
|
|
{
|
|
|
PxcModels.Users getUser = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new PxcModels.Users();
|
|
PxcModels.Users getUser = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new PxcModels.Users();
|
|
|
int BuyTopUserId = 0;
|
|
int BuyTopUserId = 0;
|
|
@@ -481,15 +487,15 @@ namespace MySystem
|
|
|
BuyTopUserId = int.Parse(ParentNavList[0]);
|
|
BuyTopUserId = int.Parse(ParentNavList[0]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(prize == 50)
|
|
|
|
|
|
|
+ if (prize == 50)
|
|
|
{
|
|
{
|
|
|
StatService.Instance.doActiveReward(db, merchant, pos, getUser.Id, getUser.ParentNav, BuyTopUserId, prize);
|
|
StatService.Instance.doActiveReward(db, merchant, pos, getUser.Id, getUser.ParentNav, BuyTopUserId, prize);
|
|
|
}
|
|
}
|
|
|
- if(prize == 40)
|
|
|
|
|
|
|
+ if (prize == 40)
|
|
|
{
|
|
{
|
|
|
StatService.Instance.doActiveReward(db, merchant, pos, getUser.Id, getUser.ParentNav, BuyTopUserId, prize, 12);
|
|
StatService.Instance.doActiveReward(db, merchant, pos, getUser.Id, getUser.ParentNav, BuyTopUserId, prize, 12);
|
|
|
}
|
|
}
|
|
|
- if(prize == 30)
|
|
|
|
|
|
|
+ if (prize == 30)
|
|
|
{
|
|
{
|
|
|
StatService.Instance.doActiveReward(db, merchant, pos, getUser.Id, getUser.ParentNav, BuyTopUserId, prize, 133);
|
|
StatService.Instance.doActiveReward(db, merchant, pos, getUser.Id, getUser.ParentNav, BuyTopUserId, prize, 133);
|
|
|
}
|
|
}
|
|
@@ -498,7 +504,7 @@ namespace MySystem
|
|
|
|
|
|
|
|
private int GetLeShuaHaiKe(int UserId, int BrandId)
|
|
private int GetLeShuaHaiKe(int UserId, int BrandId)
|
|
|
{
|
|
{
|
|
|
- if(DateTime.Now >= DateTime.Parse("2023-08-01 00:00:00"))
|
|
|
|
|
|
|
+ if (DateTime.Now >= DateTime.Parse("2023-08-01 00:00:00"))
|
|
|
{
|
|
{
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
@@ -507,20 +513,20 @@ namespace MySystem
|
|
|
{
|
|
{
|
|
|
string Date = DateTime.Now.ToString("yyyyMMdd");
|
|
string Date = DateTime.Now.ToString("yyyyMMdd");
|
|
|
int checkNum = 0;
|
|
int checkNum = 0;
|
|
|
- if(Date == "20230720") checkNum = 12;
|
|
|
|
|
- if(Date == "20230721") checkNum = 11;
|
|
|
|
|
- if(Date == "20230722") checkNum = 10;
|
|
|
|
|
- if(Date == "20230723") checkNum = 9;
|
|
|
|
|
- if(Date == "20230724") checkNum = 8;
|
|
|
|
|
- if(Date == "20230725") checkNum = 7;
|
|
|
|
|
- if(Date == "20230726") checkNum = 6;
|
|
|
|
|
- if(Date == "20230727") checkNum = 5;
|
|
|
|
|
- if(Date == "20230728") checkNum = 4;
|
|
|
|
|
- if(Date == "20230729") checkNum = 3;
|
|
|
|
|
- if(Date == "20230730") checkNum = 2;
|
|
|
|
|
- if(Date == "20230731") checkNum = 1;
|
|
|
|
|
|
|
+ if (Date == "20230720") checkNum = 12;
|
|
|
|
|
+ if (Date == "20230721") checkNum = 11;
|
|
|
|
|
+ if (Date == "20230722") checkNum = 10;
|
|
|
|
|
+ if (Date == "20230723") checkNum = 9;
|
|
|
|
|
+ if (Date == "20230724") checkNum = 8;
|
|
|
|
|
+ if (Date == "20230725") checkNum = 7;
|
|
|
|
|
+ if (Date == "20230726") checkNum = 6;
|
|
|
|
|
+ if (Date == "20230727") checkNum = 5;
|
|
|
|
|
+ if (Date == "20230728") checkNum = 4;
|
|
|
|
|
+ if (Date == "20230729") checkNum = 3;
|
|
|
|
|
+ if (Date == "20230730") checkNum = 2;
|
|
|
|
|
+ if (Date == "20230731") checkNum = 1;
|
|
|
int check = int.Parse(function.CheckInt(RedisDbconn.Instance.Get<string>("lscut:" + UserId + ":" + BrandId + ":" + Date)));
|
|
int check = int.Parse(function.CheckInt(RedisDbconn.Instance.Get<string>("lscut:" + UserId + ":" + BrandId + ":" + Date)));
|
|
|
- if(check <= checkNum)
|
|
|
|
|
|
|
+ if (check <= checkNum)
|
|
|
{
|
|
{
|
|
|
check += 1;
|
|
check += 1;
|
|
|
RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, check.ToString());
|
|
RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, check.ToString());
|
|
@@ -531,7 +537,7 @@ namespace MySystem
|
|
|
RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, "0");
|
|
RedisDbconn.Instance.Set("lscut:" + UserId + ":" + BrandId + ":" + Date, "0");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- catch(Exception ex)
|
|
|
|
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "乐刷海科计数异常");
|
|
Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "乐刷海科计数异常");
|
|
|
}
|
|
}
|