|
@@ -3070,9 +3070,41 @@ namespace MySystem
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- //退押金时发放剩余激活奖励
|
|
|
+
|
|
|
+ //押金奖励发放
|
|
|
+ public void StartPreActPrize()
|
|
|
+ {
|
|
|
+ Thread th = new Thread(StartPreActPrizeDo);
|
|
|
+ th.IsBackground = true;
|
|
|
+ th.Start();
|
|
|
+ }
|
|
|
+ public void StartPreActPrizeDo()
|
|
|
+ {
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ string content = RedisDbconn.Instance.RPop<string>("DepositActPrizeQueue");
|
|
|
+ if(!string.IsNullOrEmpty(content))
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ int PosId = int.Parse(content);
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
+ PxcModels.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId) ?? new PxcModels.PosMachinesTwo();
|
|
|
+ PxcModels.PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId) ?? new PxcModels.PosMerchantInfo();
|
|
|
+ PreActPrize(db, pos, merchant, pos.SeoKeyword);
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
+ catch(Exception ex)
|
|
|
+ {
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "\nPosId:" + content + "\n" + ex.ToString(), "押金奖励发放异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Thread.Sleep(10000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
public void PreActPrize(WebCMSEntities db, PosMachinesTwo pos, PosMerchantInfo merchant, string Deposit)
|
|
|
{
|
|
|
decimal DepositNumber = decimal.Parse(function.CheckNum(Deposit));
|