|
@@ -764,7 +764,12 @@ namespace MySystem
|
|
|
|
|
|
public void doActiveReward(WebCMSEntities db, PosMerchantInfo merchant, PosMachinesTwo pos, int GetUserId, string ParentNav, int TopUserId, decimal ActPrize, int ChangeType = 0, int ActType = 0)
|
|
|
{
|
|
|
- bool check = db.ActiveReward.Any(m => m.KqMerNo == merchant.KqMerNo && m.RewardAmount == ActPrize && m.ActType == ActType);
|
|
|
+ string MerNo = merchant.KqMerNo;
|
|
|
+ if(string.IsNullOrEmpty(MerNo))
|
|
|
+ {
|
|
|
+ MerNo = "n" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
|
|
|
+ }
|
|
|
+ bool check = db.ActiveReward.Any(m => m.KqMerNo == MerNo && m.RewardAmount == ActPrize && m.ActType == ActType);
|
|
|
bool check1 = db.ActiveReward.Any(m => m.KqSnNo == pos.PosSn && m.RewardAmount == ActPrize && m.ActType == ActType);
|
|
|
if (!check && !check1)
|
|
|
{
|
|
@@ -781,7 +786,7 @@ namespace MySystem
|
|
|
BrandId = pos.BrandId, //品牌
|
|
|
UserNav = ParentNav, //创客父级
|
|
|
DirectBuddyNo = merchant.UserId, //商户直属创客
|
|
|
- KqMerNo = merchant.KqMerNo, //渠道商户编号
|
|
|
+ KqMerNo = MerNo, //渠道商户编号
|
|
|
KqSnNo = pos.PosSn, //渠道SN号
|
|
|
SnType = pos.PosSnType, //机具类型
|
|
|
SnApplyUserId = pos.BuyUserId, //机具申请创客
|
|
@@ -975,31 +980,6 @@ namespace MySystem
|
|
|
AfterBalanceAmount = AfterBalanceAmount, //变更后余额
|
|
|
}).Entity;
|
|
|
db.SaveChanges();
|
|
|
-
|
|
|
- string dateString = pos.ActivationTime.Value.ToString("yyyyMMdd");
|
|
|
- string monthString = pos.ActivationTime.Value.ToString("yyyyMM");
|
|
|
- // 激活奖励列表
|
|
|
- List<string> dates = RedisDbconn.Instance.GetList<string>("ActiveRewardDay:" + GetUserId + ":" + pos.BrandId);
|
|
|
- if (!dates.Contains(dateString))
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("ActiveRewardDay:" + GetUserId + ":" + pos.BrandId, dateString);
|
|
|
- }
|
|
|
- RedisDbconn.Instance.AddNumber("ActiveRewardAmt:" + GetUserId + ":" + pos.BrandId + ":" + dateString, ActPrize);
|
|
|
-
|
|
|
- List<string> months = RedisDbconn.Instance.GetList<string>("ActiveRewardMonth:" + GetUserId + ":" + pos.BrandId);
|
|
|
- if (!months.Contains(monthString))
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("ActiveRewardMonth:" + GetUserId + ":" + pos.BrandId, monthString);
|
|
|
- }
|
|
|
- RedisDbconn.Instance.AddNumber("ActiveRewardAmt:" + GetUserId + ":" + pos.BrandId + ":" + monthString, ActPrize);
|
|
|
-
|
|
|
- // 激活奖励详情
|
|
|
- List<int> actPrizeList = RedisDbconn.Instance.GetList<int>("ActiveRewardDetail:" + GetUserId + ":" + pos.BrandId + ":" + dateString);
|
|
|
- if (!actPrizeList.Contains(pos.BindMerchantId))
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("ActiveRewardDetail:" + GetUserId + ":" + pos.BrandId + ":" + dateString, pos.BindMerchantId);
|
|
|
- }
|
|
|
- RedisDbconn.Instance.AddNumber("ActiveRewardAmt:mer:" + pos.BindMerchantId + ":" + pos.BrandId + ":" + dateString, ActPrize);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1151,26 +1131,6 @@ namespace MySystem
|
|
|
}).Entity;
|
|
|
db.SaveChanges();
|
|
|
|
|
|
- string dateString = yesterday.ToString("yyyyMMdd");
|
|
|
- string monthString = yesterday.ToString("yyyyMM");
|
|
|
- // 开机奖励列表
|
|
|
- List<string> dates = RedisDbconn.Instance.GetList<string>("OpenRewardDay:" + puser.Id + ":" + pos.BrandId);
|
|
|
- if (!dates.Contains(dateString))
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("OpenRewardDay:" + puser.Id + ":" + pos.BrandId, dateString);
|
|
|
- }
|
|
|
- RedisDbconn.Instance.AddNumber("OpenRewardAmt:" + puser.Id + ":" + pos.BrandId + ":" + dateString, Prize);
|
|
|
-
|
|
|
- List<string> months = RedisDbconn.Instance.GetList<string>("OpenRewardMonth:" + puser.Id + ":" + pos.BrandId);
|
|
|
- if (!months.Contains(monthString))
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddList("OpenRewardMonth:" + puser.Id + ":" + pos.BrandId, monthString);
|
|
|
- }
|
|
|
- RedisDbconn.Instance.AddNumber("OpenRewardAmt:" + puser.Id + ":" + pos.BrandId + ":" + monthString, Prize);
|
|
|
-
|
|
|
- // 开机奖励详情
|
|
|
- RedisDbconn.Instance.AddList("OpenRewardDetail:" + puser.Id + ":" + pos.BrandId + ":" + dateString, detail);
|
|
|
-
|
|
|
Prize = 0;
|
|
|
}
|
|
|
}
|
|
@@ -1306,7 +1266,7 @@ namespace MySystem
|
|
|
int PosId = int.Parse(content);
|
|
|
Thread.Sleep(1000);
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
- PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.ActivationState == 1 && m.CreditTrade >= 10000);
|
|
|
+ PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId && m.ActivationState == 1 && m.CreditTrade >= 10000 && m.BrandId != 14);
|
|
|
if (pos != null)
|
|
|
{
|
|
|
function.WriteLog("sn:" + pos.PosSn, "盟主开机奖励发放日志");
|