|
|
@@ -16,7 +16,7 @@ public class TestHelper
|
|
|
|
|
|
public void Start()
|
|
|
{
|
|
|
- Thread th = new Thread(tmpdo);
|
|
|
+ Thread th = new Thread(tmpgo);
|
|
|
th.IsBackground = true;
|
|
|
th.Start();
|
|
|
}
|
|
|
@@ -2527,18 +2527,41 @@ public class TestHelper
|
|
|
foreach(TradeDaySummary subData in statNew)
|
|
|
{
|
|
|
index += 1;
|
|
|
- if(index > 6440)
|
|
|
+ if(index > 8740)
|
|
|
{
|
|
|
- db.TradeDaySummary.Add(subData);
|
|
|
- if(index % 20 == 0) db.SaveChanges();
|
|
|
+ RedisDbconn.Instance.AddList("TmpAddTradeDaySummaryQueue", subData);
|
|
|
function.WriteLog(index.ToString(), "统计来量吧漏掉的交易");
|
|
|
}
|
|
|
}
|
|
|
- db.SaveChanges();
|
|
|
db.Dispose();
|
|
|
function.WriteLog("end", "统计来量吧漏掉的交易");
|
|
|
}
|
|
|
|
|
|
+ public void tmpgo()
|
|
|
+ {
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
+ bool op = true;
|
|
|
+ int index = 0;
|
|
|
+ while(op)
|
|
|
+ {
|
|
|
+ TradeDaySummary trade = RedisDbconn.Instance.RPop<TradeDaySummary>("TmpAddTradeDaySummaryQueue");
|
|
|
+ if(trade != null)
|
|
|
+ {
|
|
|
+ index += 1;
|
|
|
+ db.TradeDaySummary.Add(trade);
|
|
|
+ if(index % 20 == 0)
|
|
|
+ {
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ op = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
+
|
|
|
List<TradeDaySummary> statNew = new List<TradeDaySummary>();
|
|
|
public void StatTrade(List<Users> users, int UserId, int BrandId, string TradeMonth, decimal TradeAmount)
|
|
|
{
|