|
|
@@ -69,68 +69,49 @@ namespace MySystem.Controllers
|
|
|
|
|
|
public string test(int UserId, decimal Amount)
|
|
|
{
|
|
|
- // StatHelpProfitService.Instance.ResetMaxTradeAmountGo("202301");
|
|
|
- string result = "";
|
|
|
- // string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
- // // int UserId = 145842;
|
|
|
- // Dictionary<string, decimal> dic = new Dictionary<string, decimal>();
|
|
|
- // dic.Add("31", Amount);
|
|
|
- // foreach(string day in dic.Keys)
|
|
|
- // {
|
|
|
- // DataTable dt = CustomerSqlConn.dtable("SELECT MerchantId FROM HelpProfitMerIds WHERE UserId=" + UserId + " order by RAND()", conn);
|
|
|
- // decimal total = dic[day];
|
|
|
- // decimal avg = total / dt.Rows.Count;
|
|
|
- // int min = ((int)avg - 100) * 100;
|
|
|
- // if(min < 1) min = 1;
|
|
|
- // int max = ((int)avg + 100) * 100;
|
|
|
- // foreach(DataRow dr in dt.Rows)
|
|
|
- // {
|
|
|
- // string MerchantId = dr["MerchantId"].ToString();
|
|
|
- // decimal amount = (decimal)function.get_Random(min, max) / 100;
|
|
|
- // if(total > 0)
|
|
|
- // {
|
|
|
- // if(total < amount)
|
|
|
- // {
|
|
|
- // amount = total;
|
|
|
- // }
|
|
|
- // DataTable check = CustomerSqlConn.dtable("SELECT Id,TradeAmount FROM HelpProfitMerTradeSummay WHERE MerchantId=" + MerchantId + " and TradeDate='202301" + day + "'", conn);
|
|
|
- // if(check.Rows.Count > 0)
|
|
|
- // {
|
|
|
- // if(day == "30")
|
|
|
- // {
|
|
|
- // decimal today = decimal.Parse(check.Rows[0]["TradeAmount"].ToString());
|
|
|
- // if(today < amount)
|
|
|
- // {
|
|
|
- // amount -= today;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // amount = 0;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if(amount > 0) result += "update HelpProfitMerTradeSummay set TradeAmount=" + amount + " where Id=" + check.Rows[0]["Id"].ToString() + ";\n";
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // if(amount > 0) result += "INSERT INTO HelpProfitMerTradeSummay (`TradeAmount`, `TradeDate`, `TradeMonth`, `MerchantId`) VALUES (" + amount + ", '202301" + day + "', '202301', " + MerchantId + ");\n";
|
|
|
- // }
|
|
|
- // check = CustomerSqlConn.dtable("SELECT Id FROM HelpProfitMerTradeMonthSummay WHERE MerchantId=" + MerchantId + " and TradeMonth='202301'", conn);
|
|
|
- // if(check.Rows.Count > 0)
|
|
|
- // {
|
|
|
- // if(amount > 0) result += "update HelpProfitMerTradeMonthSummay set TradeAmount=TradeAmount+" + amount + " where Id=" + check.Rows[0][0].ToString() + ";\n";
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // if(amount > 0) result += "INSERT INTO HelpProfitMerTradeMonthSummay (`TradeAmount`, `TradeMonth`, `MerchantId`) VALUES (" + amount + ", '202301', " + MerchantId + ");\n";
|
|
|
- // }
|
|
|
- // total -= amount;
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+ string result = "ok";
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12\",\"TradeDate\":\"2024-02-01\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"13,15\",\"TradeDate\":\"2024-02-01\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-02\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-03\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-04\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-05\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-06\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-07\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-08\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-09\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-10\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-11\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-12\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-13\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-14\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-15\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-16\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-17\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-18\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-19\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-20\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-21\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-22\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-23\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-24\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-25\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-26\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-27\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-28\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-02-29\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-01\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-02\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-03\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-04\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-05\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-06\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-07\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-08\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-09\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-10\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-11\"}");
|
|
|
+ RedisDbconn.Instance.AddList("StatResetUserTradeQueue", "{\"BrandId\":\"12,13,15\",\"TradeDate\":\"2024-03-12\"}");
|
|
|
return result;
|
|
|
}
|
|
|
}
|