|
|
@@ -970,65 +970,69 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
[HttpPost]
|
|
|
- public string MachinePrizeNewDo(string PosSn, int ActPrize, int OpenPrize, int DepositPrize, int LeaderPrize, int OperterPrize)
|
|
|
+ public string MachinePrizeNewDo(string PosSns, int ActPrize, int OpenPrize, int DepositPrize, int LeaderPrize, int OperterPrize)
|
|
|
{
|
|
|
- if (string.IsNullOrEmpty(PosSn))
|
|
|
+ if (string.IsNullOrEmpty(PosSns))
|
|
|
{
|
|
|
return "请输入SN";
|
|
|
}
|
|
|
- string log = DateTime.Now.ToString() + "\n";
|
|
|
- log += "PosSn:" + PosSn + "\n";
|
|
|
- log += "ActPrize:" + ActPrize + "\n";
|
|
|
- log += "OpenPrize:" + OpenPrize + "\n";
|
|
|
- log += "DepositPrize:" + DepositPrize + "\n";
|
|
|
- log += "LeaderPrize:" + LeaderPrize + "\n";
|
|
|
- log += "OperterPrize:" + OperterPrize + "\n";
|
|
|
- log += "\n\n";
|
|
|
- function.WriteLog(log, "补录日志");
|
|
|
- PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
|
|
|
- if(pos == null)
|
|
|
- {
|
|
|
- return "SN不存在";
|
|
|
- }
|
|
|
- int PosId = pos.Id;
|
|
|
- int UserId = pos.BuyUserId;
|
|
|
- if(ActPrize == 1)
|
|
|
+ string[] PosSnList = PosSns.Split('\n');
|
|
|
+ foreach(string PosSn in PosSnList)
|
|
|
{
|
|
|
- decimal RewardAmount = 100M;
|
|
|
- if(pos.BrandId == 14)
|
|
|
+ string log = DateTime.Now.ToString() + "\n";
|
|
|
+ log += "PosSn:" + PosSn + "\n";
|
|
|
+ log += "ActPrize:" + ActPrize + "\n";
|
|
|
+ log += "OpenPrize:" + OpenPrize + "\n";
|
|
|
+ log += "DepositPrize:" + DepositPrize + "\n";
|
|
|
+ log += "LeaderPrize:" + LeaderPrize + "\n";
|
|
|
+ log += "OperterPrize:" + OperterPrize + "\n";
|
|
|
+ log += "\n\n";
|
|
|
+ function.WriteLog(log, "补录日志");
|
|
|
+ PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
|
|
|
+ if(pos == null)
|
|
|
{
|
|
|
- RewardAmount = 28.5M;
|
|
|
+ return "SN不存在";
|
|
|
}
|
|
|
- else if(pos.BrandId == 18 || pos.BrandId == 19 || pos.BrandId == 20 || pos.BrandId == 21)
|
|
|
+ int PosId = pos.Id;
|
|
|
+ int UserId = pos.BuyUserId;
|
|
|
+ if(ActPrize == 1)
|
|
|
{
|
|
|
- pos.PrizeParams = pos.SeoKeyword;
|
|
|
- decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
- if(Deposit == 198) RewardAmount = 70;
|
|
|
- if(Deposit == 249) RewardAmount = 100;
|
|
|
- if(Deposit == 228) RewardAmount = 61;
|
|
|
- if(Deposit == 380) RewardAmount = 151;
|
|
|
- if(Deposit == 399) RewardAmount = 100;
|
|
|
+ decimal RewardAmount = 100M;
|
|
|
+ if(pos.BrandId == 14)
|
|
|
+ {
|
|
|
+ RewardAmount = 28.5M;
|
|
|
+ }
|
|
|
+ else if(pos.BrandId == 18 || pos.BrandId == 19 || pos.BrandId == 20 || pos.BrandId == 21)
|
|
|
+ {
|
|
|
+ pos.PrizeParams = pos.SeoKeyword;
|
|
|
+ decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
|
|
|
+ if(Deposit == 198) RewardAmount = 70;
|
|
|
+ if(Deposit == 249) RewardAmount = 100;
|
|
|
+ if(Deposit == 228) RewardAmount = 61;
|
|
|
+ if(Deposit == 380) RewardAmount = 151;
|
|
|
+ if(Deposit == 399) RewardAmount = 100;
|
|
|
+ }
|
|
|
+ if(RewardAmount > 0)
|
|
|
+ {
|
|
|
+ RedisDbconn.Instance.AddList("ActRewardQueue", "{\"PosId\":\"" + PosId + "\",\"UserId\":\"" + UserId + "\",\"RewardAmount\":\"" + RewardAmount + "\",\"ChangeType\":\"0\"}");
|
|
|
+ }
|
|
|
}
|
|
|
- if(RewardAmount > 0)
|
|
|
+ if(OpenPrize == 1)
|
|
|
{
|
|
|
- RedisDbconn.Instance.AddList("ActRewardQueue", "{\"PosId\":\"" + PosId + "\",\"UserId\":\"" + UserId + "\",\"RewardAmount\":\"" + RewardAmount + "\",\"ChangeType\":\"0\"}");
|
|
|
+ RedisDbconn.Instance.AddList("OpenRewardQueue", PosId.ToString());
|
|
|
+ }
|
|
|
+ if(DepositPrize == 1)
|
|
|
+ {
|
|
|
+ RedisDbconn.Instance.AddList("DepositActPrizeQueue", PosId.ToString());
|
|
|
+ }
|
|
|
+ if(LeaderPrize == 1)
|
|
|
+ {
|
|
|
+ RedisDbconn.Instance.AddList("LeaderPrizeQueue", PosId.ToString());
|
|
|
+ }
|
|
|
+ if(OperterPrize == 1)
|
|
|
+ {
|
|
|
+ RedisDbconn.Instance.AddList("OperatePrizeQueue", PosId.ToString());
|
|
|
}
|
|
|
- }
|
|
|
- if(OpenPrize == 1)
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("OpenRewardQueue", PosId.ToString());
|
|
|
- }
|
|
|
- if(DepositPrize == 1)
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("DepositActPrizeQueue", PosId.ToString());
|
|
|
- }
|
|
|
- if(LeaderPrize == 1)
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("LeaderPrizeQueue", PosId.ToString());
|
|
|
- }
|
|
|
- if(OperterPrize == 1)
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("OperatePrizeQueue", PosId.ToString());
|
|
|
}
|
|
|
return "success";
|
|
|
}
|