|
@@ -133,6 +133,7 @@ namespace MySystem
|
|
PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
|
|
PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posFor.SnId);
|
|
if (pos != null)
|
|
if (pos != null)
|
|
{
|
|
{
|
|
|
|
+ PxcModels.KqProducts brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new PxcModels.KqProducts();
|
|
if (pos.BindMerchantId > 0)
|
|
if (pos.BindMerchantId > 0)
|
|
{
|
|
{
|
|
PxcModels.Users user = db.Users.FirstOrDefault(m => m.Id == pos.UserId) ?? new PxcModels.Users();
|
|
PxcModels.Users user = db.Users.FirstOrDefault(m => m.Id == pos.UserId) ?? new PxcModels.Users();
|
|
@@ -295,7 +296,7 @@ namespace MySystem
|
|
pos.Sort = 1;
|
|
pos.Sort = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- decimal CheckMoney = 1000;
|
|
|
|
|
|
+ decimal CheckMoney = brand.ActTradeAmount > 0 ? brand.ActTradeAmount : 1000;
|
|
int CheckDays = 30;
|
|
int CheckDays = 30;
|
|
//联动
|
|
//联动
|
|
if(BankCardType == 1 && trade.TradeType == "M015" && (pos.BrandId == 10 || pos.BrandId == 11))
|
|
if(BankCardType == 1 && trade.TradeType == "M015" && (pos.BrandId == 10 || pos.BrandId == 11))
|
|
@@ -332,6 +333,11 @@ namespace MySystem
|
|
{
|
|
{
|
|
pos.CreditTrade += SourceTradeAmount;
|
|
pos.CreditTrade += SourceTradeAmount;
|
|
}
|
|
}
|
|
|
|
+ //广电卡
|
|
|
|
+ else if(pos.BrandId == 14)
|
|
|
|
+ {
|
|
|
|
+ pos.CreditTrade += SourceTradeAmount;
|
|
|
|
+ }
|
|
else if (BankCardType == 0)
|
|
else if (BankCardType == 0)
|
|
{
|
|
{
|
|
pos.DebitCardTrade += TradeAmount;
|
|
pos.DebitCardTrade += TradeAmount;
|
|
@@ -350,30 +356,37 @@ namespace MySystem
|
|
merchant.ActiveStatus = 1;
|
|
merchant.ActiveStatus = 1;
|
|
merchant.MerStandardDate = DateTime.Now;
|
|
merchant.MerStandardDate = DateTime.Now;
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
- function.WriteLog("商户" + merchant.KqMerNo, "开机奖励在激活中监控");
|
|
|
|
|
|
|
|
- // 推荐王逻辑(激活)
|
|
|
|
- string SendData = "{\"Kind\":\"3\",\"Data\":{\"UserId\":\"" + pos.BuyUserId + "\",\"PosId\":\"" + pos.Id + "\",\"TradeMonth\":\"" + DateTime.Now.ToString("yyyyMM") + "\"}}";
|
|
|
|
- RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
|
|
|
|
-
|
|
|
|
- //发放开机奖励
|
|
|
|
- function.WriteLog("首台" + pos.IsFirst, "开机奖励在激活中监控");
|
|
|
|
- if(pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
|
|
|
|
|
|
+ if(pos.BrandId != 14)
|
|
{
|
|
{
|
|
- RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
|
|
|
+ function.WriteLog("商户" + merchant.KqMerNo, "开机奖励在激活中监控");
|
|
|
|
+
|
|
|
|
+ // 推荐王逻辑(激活)
|
|
|
|
+ // string SendData = "{\"Kind\":\"3\",\"Data\":{\"UserId\":\"" + pos.BuyUserId + "\",\"PosId\":\"" + pos.Id + "\",\"TradeMonth\":\"" + DateTime.Now.ToString("yyyyMM") + "\"}}";
|
|
|
|
+ // RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
|
|
|
|
+
|
|
|
|
+ //发放开机奖励
|
|
|
|
+ function.WriteLog("首台" + pos.IsFirst, "开机奖励在激活中监控");
|
|
|
|
+ if(pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
|
|
|
|
+ {
|
|
|
|
+ RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //发放大盟主奖励
|
|
|
|
- if(pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
|
|
|
|
- {
|
|
|
|
- RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
|
|
- }
|
|
|
|
- //发放运营中心奖励
|
|
|
|
- if(pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
|
|
|
|
|
|
+ if(pos.BrandId != 14)
|
|
{
|
|
{
|
|
- RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
|
|
|
+ //发放大盟主奖励
|
|
|
|
+ if (pos.LeaderUserId > 0 && pos.IsFirst == 1 && db.Leaders.Any(m => m.Id == pos.LeaderUserId && m.ExpiredDate > now) && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
|
|
|
|
+ {
|
|
|
|
+ RedisDbconn.Instance.AddList("LeaderPrizeQueue", pos.Id);
|
|
|
|
+ }
|
|
|
|
+ //发放运营中心奖励
|
|
|
|
+ if (pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-CheckDays))
|
|
|
|
+ {
|
|
|
|
+ RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
|
|
|
|
+ }
|
|
|
|
+ AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
|
|
}
|
|
}
|
|
- 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\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"UserId\":\"" + pos.BuyUserId + "\",\"BrandId\":\"" + pos.BrandId + "\"}");
|
|
@@ -386,7 +399,7 @@ namespace MySystem
|
|
{
|
|
{
|
|
MerHelpFlag = 2;
|
|
MerHelpFlag = 2;
|
|
}
|
|
}
|
|
- else if (DepositAmt > 0 && pos.IsFirst == 1)
|
|
|
|
|
|
+ else if ((DepositAmt > 0 && pos.IsFirst == 1) || pos.BrandId == 14)
|
|
{
|
|
{
|
|
string DayString = RedisDbconn.Instance.Get<string>("pobjrule:" + pos.BrandId + ":HelpPolicy:Days");
|
|
string DayString = RedisDbconn.Instance.Get<string>("pobjrule:" + pos.BrandId + ":HelpPolicy:Days");
|
|
int Days = int.Parse(DayString); //天数
|
|
int Days = int.Parse(DayString); //天数
|
|
@@ -471,11 +484,11 @@ namespace MySystem
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
|
|
|
// 推荐王逻辑(交易)
|
|
// 推荐王逻辑(交易)
|
|
- if(TradeAmount > 0)
|
|
|
|
- {
|
|
|
|
- string Send = "{\"Kind\":\"4\",\"Data\":{\"PosId\":\"" + pos.Id + "\",\"TradeMonth\":\"" + trade.CreateDate.Value.ToString("yyyyMM") + "\",\"TradeAmount\":\"" + TradeAmount + "\"}}";
|
|
|
|
- RedisDbconn.Instance.AddList("RecommendActStatQueue", Send);
|
|
|
|
- }
|
|
|
|
|
|
+ // if(TradeAmount > 0)
|
|
|
|
+ // {
|
|
|
|
+ // string Send = "{\"Kind\":\"4\",\"Data\":{\"PosId\":\"" + pos.Id + "\",\"TradeMonth\":\"" + trade.CreateDate.Value.ToString("yyyyMM") + "\",\"TradeAmount\":\"" + TradeAmount + "\"}}";
|
|
|
|
+ // RedisDbconn.Instance.AddList("RecommendActStatQueue", Send);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
|
|
TradeRecord edit = spdb.TradeRecord.FirstOrDefault(m => m.Id == trade.Id);
|
|
if (edit != null)
|
|
if (edit != null)
|