|
|
@@ -53,7 +53,9 @@ namespace MySystem
|
|
|
while(check)
|
|
|
{
|
|
|
string sql = "";
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(TradeAmount),count(Id),SnNo,TradeDate from TradeRecord where Id>20000000 and ActStatus=1 and BrandId!=14 and UserId>0 and CreateDate>='" + date + " 00:00:00' and CreateDate<='" + date + " 23:59:59' group by UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),SnNo,TradeDate order by UserId limit " + pageNum + ",50", AppConfig.Base.TmpReadSqlConn);
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "---" + pageNum + "----start", "统计交易额日志");
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(TradeAmount),count(Id),SnNo,TradeDate from TradeRecord where Id>20000000 and ActStatus=1 and BrandId!=14 and UserId>0 and CreateDate>='" + date + " 00:00:00' and CreateDate<='" + date + " 23:59:59' group by UserId,ParentNav,BrandId,BankCardType,QrPayFlag,MerHelpFlag,Version,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),SnNo,TradeDate order by UserId limit " + pageNum + ",500", AppConfig.Base.TmpReadSqlConn);
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "---" + pageNum + "----query", "统计交易额日志");
|
|
|
if(dt.Rows.Count > 0)
|
|
|
{
|
|
|
foreach (DataRow dr in dt.Rows)
|
|
|
@@ -75,7 +77,8 @@ namespace MySystem
|
|
|
int TradeCount = 1;
|
|
|
string TradeMonth = TradeDate.Substring(0, 6);
|
|
|
ParentNav += "," + UserId + ",";
|
|
|
- string[] UserIdList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
+ string ParentNavString = ParentNav.Trim(',').Replace(",,", ",");
|
|
|
+ string[] UserIdList = ParentNavString.Split(',');
|
|
|
|
|
|
if(Version < 2)
|
|
|
{
|
|
|
@@ -272,7 +275,10 @@ namespace MySystem
|
|
|
{
|
|
|
check = false;
|
|
|
}
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "---" + pageNum + "----end", "统计交易额日志");
|
|
|
+ // function.WriteLog(sql, "SQL脚本");
|
|
|
CustomerSqlConn.op(sql, AppConfig.Base.SqlConn);
|
|
|
+ function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "---" + pageNum + "----fiinsh\n\n", "统计交易额日志");
|
|
|
}
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
@@ -282,14 +288,17 @@ namespace MySystem
|
|
|
function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "统计交易额日志");
|
|
|
}
|
|
|
|
|
|
+ List<string> rediskeys = new List<string>();
|
|
|
public string InsertOrUpdate(string table, string fields, string vals, string condition)
|
|
|
{
|
|
|
string sql = "";
|
|
|
- string check = RedisDbconn.Instance.Get<string>("statreset:" + table + ":" + function.MD5_16(condition));
|
|
|
- if(string.IsNullOrEmpty(check))
|
|
|
+ // string check = RedisDbconn.Instance.Get<string>("statreset:" + table + ":" + function.MD5_16(condition));
|
|
|
+ // if(string.IsNullOrEmpty(check))
|
|
|
+ if(!rediskeys.Contains(table + ":" + function.MD5_16(condition)))
|
|
|
{
|
|
|
- RedisDbconn.Instance.Set("statreset:" + table + ":" + function.MD5_16(condition), fields + "#cut#" + vals);
|
|
|
- RedisDbconn.Instance.SetExpire("statreset:" + table + ":" + function.MD5_16(condition), 3600);
|
|
|
+ rediskeys.Add(table + ":" + function.MD5_16(condition));
|
|
|
+ // RedisDbconn.Instance.Set("statreset:" + table + ":" + function.MD5_16(condition), fields + "#cut#" + vals);
|
|
|
+ // RedisDbconn.Instance.SetExpire("statreset:" + table + ":" + function.MD5_16(condition), 3600);
|
|
|
string[] conditionList = condition.Split(new string[]{ " and " }, StringSplitOptions.None);
|
|
|
foreach(string sub in conditionList)
|
|
|
{
|