|
@@ -49,11 +49,11 @@ namespace MySystem
|
|
|
Dictionary<string, string> data = new Dictionary<string, string>();
|
|
|
data.Add("ErrTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
data.Add("ErrMsg", ex.ToString());
|
|
|
- function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "public_err");
|
|
|
+ LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "public_err");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -78,11 +78,11 @@ namespace MySystem
|
|
|
Dictionary<string, string> data = new Dictionary<string, string>();
|
|
|
data.Add("ErrTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
|
|
data.Add("ErrMsg", ex.ToString());
|
|
|
- function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "public_err");
|
|
|
+ LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "public_err");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1016,7 +1016,7 @@ namespace MySystem
|
|
|
}
|
|
|
catch(Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "实时获取开机奖励异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "实时获取开机奖励异常");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1218,7 +1218,7 @@ namespace MySystem
|
|
|
}
|
|
|
public void doFluxRecord()
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "执行流量费返佣");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "执行流量费返佣");
|
|
|
SpModels.WebCMSEntities spdb = new SpModels.WebCMSEntities();
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
DateTime start = DateTime.Now.AddDays(-2);
|
|
@@ -1375,16 +1375,16 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n$" + trade.Id + "$\n" + ex.ToString(), "流量卡分佣异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n$" + trade.Id + "$\n" + ex.ToString(), "流量卡分佣异常");
|
|
|
}
|
|
|
}
|
|
|
spdb.Dispose();
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n", "执行流量费返佣");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n", "执行流量费返佣");
|
|
|
}
|
|
|
public void CheckFluxForTrade()
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "扫描交易记录中的流量费");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "扫描交易记录中的流量费");
|
|
|
SpModels.WebCMSEntities spdb = new SpModels.WebCMSEntities();
|
|
|
DateTime start = DateTime.Now.AddDays(-1);
|
|
|
int StartId = int.Parse(function.CheckInt(function.ReadInstance("/SycnSp/TradeRecordId.txt")));
|
|
@@ -1443,11 +1443,11 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n$" + sub.Id + "$\n" + ex.ToString(), "扫描交易记录中的流量费异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n$" + sub.Id + "$\n" + ex.ToString(), "扫描交易记录中的流量费异常");
|
|
|
}
|
|
|
}
|
|
|
spdb.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n", "扫描交易记录中的流量费");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n", "扫描交易记录中的流量费");
|
|
|
|
|
|
doFluxRecord();
|
|
|
}
|
|
@@ -1483,7 +1483,7 @@ namespace MySystem
|
|
|
public void StatTradeAmountEverDay(object sender)
|
|
|
{
|
|
|
string date = sender.ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行昨天交易额日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -1498,21 +1498,21 @@ namespace MySystem
|
|
|
{
|
|
|
startId = startDt.Rows[0][0].ToString();
|
|
|
}
|
|
|
- function.WriteLog(startId + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(startId + "\n\n", "执行昨天交易额日志");
|
|
|
// DataTable endDt = OtherMySqlConn.dtable("select max(Id) from TradeRecord where CreateDate<'" + end + "'");
|
|
|
// if (endDt.Rows.Count > 0)
|
|
|
// {
|
|
|
// endId = endDt.Rows[0][0].ToString();
|
|
|
// }
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select Id,ParentNav from Users where Id in (select DISTINCT UserId from TradeRecord where Id>=" + startId + " and Id<=" + endId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "')");
|
|
|
- function.WriteLog("交易人数:" + userDt.Rows.Count + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog("交易人数:" + userDt.Rows.Count + "\n\n", "执行昨天交易额日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(userDr["Id"].ToString());
|
|
|
string ParentNav = userDr["ParentNav"].ToString();
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
DataTable selfdt = OtherMySqlConn.dtable("select BrandId,BankCardType,QrPayFlag,sum(TradeAmount) from TradeRecord where Id>=" + startId + " and Id<=" + endId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "' and UserId=" + UserId + " group by BrandId,BankCardType,QrPayFlag");
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
foreach (DataRow selfDr in selfdt.Rows)
|
|
|
{
|
|
|
int BrandId = int.Parse(selfDr["BrandId"].ToString());
|
|
@@ -1553,9 +1553,9 @@ namespace MySystem
|
|
|
{
|
|
|
uids.Add(NavUserIdString + start);
|
|
|
int NavUserId = int.Parse(NavUserIdString);
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
DataTable teamDt = OtherMySqlConn.dtable("select BrandId,BankCardType,QrPayFlag,sum(TradeAmount) from TradeRecord where Id>=" + startId + " and Id<=" + endId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "' and UserId in (select Id from Users where ParentNav like '%," + NavUserId + ",%' or Id=" + NavUserId + ") group by BrandId,BankCardType,QrPayFlag");
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
foreach (DataRow teamDr in teamDt.Rows)
|
|
|
{
|
|
|
int BrandId = int.Parse(teamDr["BrandId"].ToString());
|
|
@@ -1604,10 +1604,10 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计昨天的交易额异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计昨天的交易额异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天交易额日志");
|
|
|
|
|
|
StatMerchantTrade(date);
|
|
|
}
|
|
@@ -1623,7 +1623,7 @@ namespace MySystem
|
|
|
//统计商户交易额
|
|
|
private void StatMerchantTrade(string date)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行商户交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行商户交易额日志");
|
|
|
// WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -1659,10 +1659,10 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计商户的交易额");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计商户的交易额");
|
|
|
}
|
|
|
// db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行商户交易额日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行商户交易额日志");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1696,7 +1696,7 @@ namespace MySystem
|
|
|
try
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "创客升级日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "创客升级日志");
|
|
|
DateTime start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
DateTime end = start.AddDays(1);
|
|
|
string TradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
|
|
@@ -1706,7 +1706,7 @@ namespace MySystem
|
|
|
while(op)
|
|
|
{
|
|
|
var users = db.Users.Select(m => new { m.Id, m.AuthFlag }).Where(m => m.Id > startid && m.AuthFlag == 1).OrderBy(m => m.Id).Take(500).ToList();
|
|
|
- function.WriteLog(users.Count.ToString(), "创客升级日志");
|
|
|
+ LogHelper.Instance.WriteLog(users.Count.ToString(), "创客升级日志");
|
|
|
if(users.Count > 0)
|
|
|
{
|
|
|
foreach (var subuser in users)
|
|
@@ -1778,7 +1778,7 @@ namespace MySystem
|
|
|
}
|
|
|
if (AfterLevel > BeforeLevel && AfterLevel > 1 && upFlag)
|
|
|
{
|
|
|
- function.WriteLog("升级:" + user.Id.ToString() + BeforeLevel + "->" + AfterLevel, "创客升级日志");
|
|
|
+ LogHelper.Instance.WriteLog("升级:" + user.Id.ToString() + BeforeLevel + "->" + AfterLevel, "创客升级日志");
|
|
|
user.UserLevel = AfterLevel;
|
|
|
DateTime checkTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
UserRank rank = db.UserRank.FirstOrDefault(m => m.CreateDate >= checkTime && m.UserId == user.Id);
|
|
@@ -1814,7 +1814,7 @@ namespace MySystem
|
|
|
}
|
|
|
if (AfterLevel < BeforeLevel && BeforeLevel > 1)
|
|
|
{
|
|
|
- function.WriteLog(user.MakerCode + "-" + user.RealName + ":K" + BeforeLevel + "->K" + AfterLevel, "创客降级日志");
|
|
|
+ LogHelper.Instance.WriteLog(user.MakerCode + "-" + user.RealName + ":K" + BeforeLevel + "->K" + AfterLevel, "创客降级日志");
|
|
|
user.UserLevel = AfterLevel;
|
|
|
DateTime checkTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
|
|
|
UserRank rank = db.UserRank.FirstOrDefault(m => m.CreateDate >= checkTime && m.UserId == user.Id);
|
|
@@ -1847,18 +1847,18 @@ namespace MySystem
|
|
|
}
|
|
|
startid = subuser.Id;
|
|
|
}
|
|
|
- function.WriteLog(startid.ToString(), "创客升级日志");
|
|
|
+ LogHelper.Instance.WriteLog(startid.ToString(), "创客升级日志");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
op = false;
|
|
|
}
|
|
|
}
|
|
|
- function.WriteLog(DateTime.Now.ToString(), "创客升级日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "创客升级日志");
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(ex.ToString(), "创客升级异常");
|
|
|
+ LogHelper.Instance.WriteLog(ex.ToString(), "创客升级异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
|
|
@@ -1894,7 +1894,7 @@ namespace MySystem
|
|
|
public void StartPosActNumDo(object sender)
|
|
|
{
|
|
|
string date = sender.ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行创客激活数日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -1904,14 +1904,14 @@ namespace MySystem
|
|
|
string end = DateTime.Parse(date).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
|
|
|
List<string> uids = new List<string>();
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select Id,ParentNav from Users where Id in (select DISTINCT BuyUserId from PosMachinesTwo where QueryCount=0 and ActivationState=1 and ActivationTime>='" + start + "' and ActivationTime<'" + end + "')");
|
|
|
- function.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "执行创客激活数日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(userDr["Id"].ToString());
|
|
|
string ParentNav = userDr["ParentNav"].ToString();
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
DataTable selfdt = OtherMySqlConn.dtable("select BrandId,count(Id) from PosMachinesTwo where QueryCount=0 and ActivationState=1 and ActivationTime>='" + start + "' and ActivationTime<'" + end + "' and BuyUserId=" + UserId + " group by BrandId");
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
foreach (DataRow selfDr in selfdt.Rows)
|
|
|
{
|
|
|
int BrandId = int.Parse(selfDr["BrandId"].ToString());
|
|
@@ -1944,9 +1944,9 @@ namespace MySystem
|
|
|
{
|
|
|
uids.Add(NavUserIdString + start);
|
|
|
int NavUserId = int.Parse(NavUserIdString);
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
DataTable teamDt = OtherMySqlConn.dtable("select BrandId,count(Id) from PosMachinesTwo where QueryCount=0 and ActivationState=1 and ActivationTime>='" + start + "' and ActivationTime<'" + end + "' and BuyUserId in (select Id from Users where ParentNav like '%," + NavUserId + ",%' or Id=" + NavUserId + ") group by BrandId");
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
foreach (DataRow teamDr in teamDt.Rows)
|
|
|
{
|
|
|
int BrandId = int.Parse(teamDr["BrandId"].ToString());
|
|
@@ -1977,16 +1977,16 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "执行创客激活数异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "执行创客激活数异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行创客激活数日志");
|
|
|
Thread.Sleep(60000);
|
|
|
}
|
|
|
public void StartPosActNumEverTime()
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行创客激活数日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -2001,7 +2001,7 @@ namespace MySystem
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select BuyUserId,BrandId,DATE_FORMAT(ActivationTime, '%Y%m%d'),count(Id) from PosMachinesTwo where Id in (" + ids.TrimEnd(',') + ") group by BuyUserId,BrandId,DATE_FORMAT(ActivationTime, '%Y%m%d')");
|
|
|
if (userDt.Rows.Count > 0)
|
|
|
{
|
|
|
- function.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "实时执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "实时执行创客激活数日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(userDr["BuyUserId"].ToString());
|
|
@@ -2062,10 +2062,10 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时执行创客激活数异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时执行创客激活数异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行创客激活数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行创客激活数日志");
|
|
|
}
|
|
|
|
|
|
// 统计新增创客数
|
|
@@ -2097,7 +2097,7 @@ namespace MySystem
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
string date = sender.ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行新增创客数日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -2107,14 +2107,14 @@ namespace MySystem
|
|
|
string end = DateTime.Parse(date).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
|
|
|
List<string> uids = new List<string>();
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select Id,ParentNav from Users where QueryCount=0 and AuthFlag=1 and AuthDate>='" + start + "' and AuthDate<'" + end + "'");
|
|
|
- function.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "执行新增创客数日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(userDr["Id"].ToString());
|
|
|
string ParentNav = userDr["ParentNav"].ToString();
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
DataTable selfdt = OtherMySqlConn.dtable("select count(Id) from Users where QueryCount=0 and AuthFlag=1 and AuthDate>='" + start + "' and AuthDate<'" + end + "' and ParentUserId=" + UserId + "");
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
foreach (DataRow selfDr in selfdt.Rows)
|
|
|
{
|
|
|
int AddCount = int.Parse(selfDr[0].ToString());
|
|
@@ -2143,9 +2143,9 @@ namespace MySystem
|
|
|
{
|
|
|
uids.Add(NavUserIdString + start);
|
|
|
int NavUserId = int.Parse(NavUserIdString);
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
DataTable teamDt = OtherMySqlConn.dtable("select count(Id) from Users where QueryCount=0 and AuthFlag=1 and AuthDate>='" + start + "' and AuthDate<'" + end + "' and ParentNav like '%," + NavUserId + ",%'");
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
foreach (DataRow teamDr in teamDt.Rows)
|
|
|
{
|
|
|
int AddCount = int.Parse(teamDr[0].ToString());
|
|
@@ -2172,16 +2172,16 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "执行新增创客数异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "执行新增创客数异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行新增创客数日志");
|
|
|
Thread.Sleep(60000);
|
|
|
}
|
|
|
public void StartNewUserNumEverTime()
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行新增创客数日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -2196,7 +2196,7 @@ namespace MySystem
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select ParentUserId,DATE_FORMAT(AuthDate, '%Y%m%d'),count(Id) from Users where Id in (" + ids.TrimEnd(',') + ") group by ParentUserId,DATE_FORMAT(AuthDate, '%Y%m%d')");
|
|
|
if(userDt.Rows.Count > 0)
|
|
|
{
|
|
|
- function.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "实时执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "实时执行新增创客数日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
string StatDate = userDr[1].ToString();
|
|
@@ -2251,10 +2251,10 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时执行新增创客数异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时执行新增创客数异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行新增创客数日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行新增创客数日志");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2289,7 +2289,7 @@ namespace MySystem
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
string date = sender.ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行昨天收益日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -2304,16 +2304,16 @@ namespace MySystem
|
|
|
{
|
|
|
startId = startDt.Rows[0][0].ToString();
|
|
|
}
|
|
|
- function.WriteLog(startId + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(startId + "\n\n", "执行昨天收益日志");
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select Id,ParentNav from Users where Id in (select DISTINCT UserId from UserAccountRecord where Id>=" + startId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "')");
|
|
|
- function.WriteLog("交易人数:" + userDt.Rows.Count + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog("交易人数:" + userDt.Rows.Count + "\n\n", "执行昨天收益日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(userDr["Id"].ToString());
|
|
|
string ParentNav = userDr["ParentNav"].ToString();
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
DataTable selfdt = OtherMySqlConn.dtable("select ChangeType,ProductType,sum(ChangeAmount) from UserAccountRecord where Id>=" + startId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "' and UserId=" + UserId + " group by ChangeType,ProductType");
|
|
|
- function.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(UserId + ":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
foreach (DataRow selfDr in selfdt.Rows)
|
|
|
{
|
|
|
int ChangeType = int.Parse(selfDr["ChangeType"].ToString());
|
|
@@ -2346,9 +2346,9 @@ namespace MySystem
|
|
|
{
|
|
|
uids.Add(NavUserIdString + start);
|
|
|
int NavUserId = int.Parse(NavUserIdString);
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
DataTable teamDt = OtherMySqlConn.dtable("select ChangeType,ProductType,sum(ChangeAmount) from UserAccountRecord where Id>=" + startId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "' and UserId in (select Id from Users where ParentNav like '%," + NavUserId + ",%' or Id=" + NavUserId + ") group by ChangeType,ProductType");
|
|
|
- function.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(NavUserId + ":team:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
foreach (DataRow teamDr in teamDt.Rows)
|
|
|
{
|
|
|
int ChangeType = int.Parse(teamDr["ChangeType"].ToString());
|
|
@@ -2378,16 +2378,16 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计昨天收益异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计昨天收益异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "执行昨天收益日志");
|
|
|
}
|
|
|
|
|
|
public void StatProfitEverDayEverTime()
|
|
|
{
|
|
|
OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时统计收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时统计收益日志");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
try
|
|
|
{
|
|
@@ -2408,7 +2408,7 @@ namespace MySystem
|
|
|
DataTable userDt = OtherMySqlConn.dtable("select UserId,ChangeType,ProductType,DATE_FORMAT(CreateDate, '%Y%m%d'),sum(ChangeAmount) from UserAccountRecord where Id in (" + ids.TrimEnd(',') + ") group by UserId,ChangeType,ProductType,DATE_FORMAT(CreateDate, '%Y%m%d')");
|
|
|
if (userDt.Rows.Count > 0)
|
|
|
{
|
|
|
- function.WriteLog("收益人数:" + userDt.Rows.Count + "\n\n", "实时统计收益日志");
|
|
|
+ LogHelper.Instance.WriteLog("收益人数:" + userDt.Rows.Count + "\n\n", "实时统计收益日志");
|
|
|
foreach (DataRow userDr in userDt.Rows)
|
|
|
{
|
|
|
int UserId = int.Parse(userDr["UserId"].ToString());
|
|
@@ -2470,10 +2470,10 @@ namespace MySystem
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时统计收益异常");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时统计收益异常");
|
|
|
}
|
|
|
db.Dispose();
|
|
|
- function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时统计收益日志");
|
|
|
+ LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时统计收益日志");
|
|
|
}
|
|
|
|
|
|
|