|
@@ -1197,17 +1197,18 @@ namespace MySystem
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
|
|
|
function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行交易额V2日志");
|
|
|
- try
|
|
|
+ WebCMSEntities db = new WebCMSEntities();
|
|
|
+ using (var tran = db.Database.BeginTransaction())
|
|
|
{
|
|
|
- string startId = function.ReadInstance("/TradeRecord/Id.txt");
|
|
|
- if(string.IsNullOrEmpty(startId))
|
|
|
- {
|
|
|
- startId = "718574";
|
|
|
- }
|
|
|
- DataTable idsDt = OtherMySqlConn.dtable("select Id from TradeRecord where Id>=" + startId + " and QueryCount=0 order by Id limit 50");
|
|
|
- if(idsDt.Rows.Count > 0)
|
|
|
+ try
|
|
|
{
|
|
|
- using (WebCMSEntities db = new WebCMSEntities())
|
|
|
+ string startId = function.ReadInstance("/TradeRecord/Id.txt");
|
|
|
+ if(string.IsNullOrEmpty(startId))
|
|
|
+ {
|
|
|
+ startId = "718574";
|
|
|
+ }
|
|
|
+ DataTable idsDt = OtherMySqlConn.dtable("select Id from TradeRecord where Id>=" + startId + " and QueryCount=0 order by Id limit 50");
|
|
|
+ if(idsDt.Rows.Count > 0)
|
|
|
{
|
|
|
string ids = "";
|
|
|
foreach (DataRow idsDr in idsDt.Rows)
|
|
@@ -1345,12 +1346,15 @@ namespace MySystem
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
+ tran.Commit();
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ tran.Rollback();
|
|
|
+ function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计昨天交易额V2异常");
|
|
|
}
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计昨天交易额V2异常");
|
|
|
- }
|
|
|
+ db.Dispose();
|
|
|
function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行交易额V2日志");
|
|
|
}
|
|
|
|
|
@@ -1514,7 +1518,6 @@ namespace MySystem
|
|
|
|
|
|
StatMerchantTrade(date);
|
|
|
}
|
|
|
-
|
|
|
public void StatTradeAmountEverDaySum()
|
|
|
{
|
|
|
// WebCMSEntities db = new WebCMSEntities();
|
|
@@ -1730,7 +1733,7 @@ namespace MySystem
|
|
|
{
|
|
|
StartPosActNumEverTime();
|
|
|
}
|
|
|
- Thread.Sleep(120000);
|
|
|
+ Thread.Sleep(100);
|
|
|
}
|
|
|
}
|
|
|
public void StartPosActNumDo(object sender)
|