|
@@ -128,6 +128,78 @@ namespace MySystem
|
|
|
|
|
|
|
|
|
|
|
|
+ //广电卡激活奖励
|
|
|
+ public void StartSimActive()
|
|
|
+ {
|
|
|
+ Thread th = new Thread(StartSimActiveListen);
|
|
|
+ th.IsBackground = true;
|
|
|
+ th.Start();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void StartSimActiveListen()
|
|
|
+ {
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + ":start", "实时处理广电卡激活奖励");
|
|
|
+
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + ":end\n\n", "实时处理广电卡激活奖励");
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "实时处理广电卡激活奖励异常");
|
|
|
+ }
|
|
|
+ Thread.Sleep(29000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void StartSimActiveDo(int posid = 0)
|
|
|
+ {
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
+ DateTime yesterday = DateTime.Now.AddDays(-30);
|
|
|
+ DateTime today = DateTime.Now.AddMinutes(-10);
|
|
|
+ IQueryable<PosMachinesTwo> posList = db.PosMachinesTwo.Where(m => m.ActivationState == 1 && m.BrandId == 14 && m.Detail != "1");
|
|
|
+ if (posid > 0)
|
|
|
+ {
|
|
|
+ posList = posList.Where(m => m.Id == posid);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ posList = posList.Where(m => m.ActivationTime >= yesterday && m.ActivationTime < today);
|
|
|
+ }
|
|
|
+ foreach (PosMachinesTwo pos in posList.ToList())
|
|
|
+ {
|
|
|
+ PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
|
+ if (merchant != null)
|
|
|
+ {
|
|
|
+ string ParentNav = "";
|
|
|
+ Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
|
|
|
+ if (user != null)
|
|
|
+ {
|
|
|
+ int GetUserId = user.Id;
|
|
|
+ ParentNav = user.ParentNav;
|
|
|
+ int TopUserId = 0;
|
|
|
+ if (!string.IsNullOrEmpty(ParentNav))
|
|
|
+ {
|
|
|
+ TopUserId = int.Parse(ParentNav.Trim(',').Replace(",,", ",").Split(',')[0]);
|
|
|
+ }
|
|
|
+ decimal Amount = 19 * 1.5M;
|
|
|
+ doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, Amount);
|
|
|
+ PosMachinesTwo item = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
|
|
|
+ if(item != null)
|
|
|
+ {
|
|
|
+ item.Detail = "1";
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -316,33 +388,25 @@ namespace MySystem
|
|
|
}
|
|
|
if (ActPrize > 0)
|
|
|
{
|
|
|
- if(pos.BrandId == 14)
|
|
|
+ if (ActPrize == 99)
|
|
|
{
|
|
|
- ActPrize = ActPrize * 1.5M;
|
|
|
+ ActPrize = 100;
|
|
|
}
|
|
|
- else
|
|
|
+ else if (ActPrize == 199)
|
|
|
{
|
|
|
- if (ActPrize == 99)
|
|
|
- {
|
|
|
- ActPrize = 100;
|
|
|
- }
|
|
|
- else if (ActPrize == 199)
|
|
|
- {
|
|
|
- ActPrize = 200;
|
|
|
- }
|
|
|
- else if (ActPrize == 299)
|
|
|
- {
|
|
|
- ActPrize = 300;
|
|
|
- }
|
|
|
- else if (ActPrize == 249)
|
|
|
- {
|
|
|
- ActPrize = 260;
|
|
|
- }
|
|
|
+ ActPrize = 200;
|
|
|
+ }
|
|
|
+ else if (ActPrize == 299)
|
|
|
+ {
|
|
|
+ ActPrize = 300;
|
|
|
+ }
|
|
|
+ else if (ActPrize == 249)
|
|
|
+ {
|
|
|
+ ActPrize = 260;
|
|
|
}
|
|
|
if (GetUserId > 0)
|
|
|
{
|
|
|
doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, ActPrize);
|
|
|
- doJk30(db, pos, merchant, GetUserId, ParentNav, TopUserId);
|
|
|
}
|
|
|
}
|
|
|
else if(ActPrize == 0)
|
|
@@ -418,11 +482,6 @@ namespace MySystem
|
|
|
{
|
|
|
doActiveReward(db, merchant, pos, GetUserId, ParentNav, TopUserId, 50);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- //金控活动机返奖励
|
|
|
- doJk30(db, pos, merchant, GetUserId, ParentNav, TopUserId);
|
|
|
- }
|
|
|
PosMachinesTwo edit = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id);
|
|
|
if(edit != null)
|
|
|
{
|
|
@@ -1098,7 +1157,7 @@ namespace MySystem
|
|
|
decimal Prize = 20;
|
|
|
if(pos.BrandId == 14)
|
|
|
{
|
|
|
- Prize = ActPrize * 0.3M;
|
|
|
+ Prize = 19 * 0.3M;
|
|
|
}
|
|
|
string[] ParentNavs = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
for (int i = ParentNavs.Length - 1; i >= 0; i--)
|