Browse Source

调整查询重置码牌、音响交易数据

DuGuYang 1 year ago
parent
commit
d41b9fd31b
2 changed files with 12 additions and 12 deletions
  1. 1 1
      AppStart/Helper/StatResetService.cs
  2. 11 11
      AppStart/Helper/StatResetService2.cs

+ 1 - 1
AppStart/Helper/StatResetService.cs

@@ -70,7 +70,7 @@ namespace MySystem
             var ParentNav = ParentNavs.Trim(',').Replace(",,", ",").TrimEnd(',');
 
             var SnNos = "";
-            DataTable SnNoInfo = CustomerSqlConn.dtable("SELECT SnNo FROM ConsumerOrders WHERE Status>0 AND MerchantId=" + merchantId + " AND CreateDate>='" + DateTime.Parse(startDate.Substring(0, 4) + "-" + startDate.Substring(4, 2) + "-" + startDate.Substring(6, 2)) + " 00:00:00' and CreateDate<='" + DateTime.Parse(endDate.Substring(0, 4) + "-" + endDate.Substring(4, 2) + "-" + endDate.Substring(6, 2)) + " 23:59:59' GROUP BY SnNo", AppConfig.Base.SqlConn);
+            DataTable SnNoInfo = CustomerSqlConn.dtable("SELECT SnNo FROM ConsumerOrders WHERE Status>0 AND MerchantId=" + merchantId + " AND CreateDate>='" + startDate.Substring(0, 4) + "-" + startDate.Substring(4, 2) + "-" + startDate.Substring(6, 2) + " 00:00:00' and CreateDate<='" + endDate.Substring(0, 4) + "-" + endDate.Substring(4, 2) + "-" + endDate.Substring(6, 2) + " 23:59:59' GROUP BY SnNo", AppConfig.Base.SqlConn);
             if (SnNoInfo.Rows.Count > 0)
             {
                 foreach (DataRow selfDr in SnNoInfo.Rows)

+ 11 - 11
AppStart/Helper/StatResetService2.cs

@@ -36,16 +36,16 @@ namespace MySystem
         }
         public void StartResetMerchantDo()
         {
-            while (true)
-            {
-                string content = RedisDbconn.Instance.RPop<string>("ResetMerchantStatDataQueue2");
-                if (!string.IsNullOrEmpty(content))
-                {
-                    StatResetMerchantAmount(content);
-                }
-                Thread.Sleep(10000);
-            }
-            // StatResetMerchantAmount("{\"MerchantId\":\"" + 1153 + "\",\"StartDate\":\"" + 20231028 + "\",\"EndDate\":\"" + 20231028 + "\"}");
+            // while (true)
+            // {
+            //     string content = RedisDbconn.Instance.RPop<string>("ResetMerchantStatDataQueue2");
+            //     if (!string.IsNullOrEmpty(content))
+            //     {
+            //         StatResetMerchantAmount(content);
+            //     }
+            //     Thread.Sleep(10000);
+            // }
+            StatResetMerchantAmount("{\"MerchantId\":\"" + 1153 + "\",\"StartDate\":\"" + 20231028 + "\",\"EndDate\":\"" + 20231028 + "\"}");
         }
         public void StatResetMerchantAmount(string content)
         {
@@ -71,7 +71,7 @@ namespace MySystem
             var ParentNav = ParentNavs.Trim(',').Replace(",,", ",").TrimEnd(',');
 
             var SnNos = "";
-            DataTable SnNoInfo = CustomerSqlConn.dtable("SELECT SnNo FROM ConsumerOrders WHERE Status>0 AND MerchantId=" + merchantId + " AND CreateDate>='" + DateTime.Parse(startDate.Substring(0, 4) + "-" + startDate.Substring(4, 2) + "-" + startDate.Substring(6, 2)) + " 00:00:00' and CreateDate<='" + DateTime.Parse(endDate.Substring(0, 4) + "-" + endDate.Substring(4, 2) + "-" + endDate.Substring(6, 2)) + " 23:59:59' GROUP BY SnNo", AppConfig.Base.SqlConn2);
+            DataTable SnNoInfo = CustomerSqlConn.dtable("SELECT SnNo FROM ConsumerOrders WHERE Status>0 AND MerchantId=" + merchantId + " AND CreateDate>='" + startDate.Substring(0, 4) + "-" + startDate.Substring(4, 2) + "-" + startDate.Substring(6, 2) + " 00:00:00' and CreateDate<='" + endDate.Substring(0, 4) + "-" + endDate.Substring(4, 2) + "-" + endDate.Substring(6, 2) + " 23:59:59' GROUP BY SnNo", AppConfig.Base.SqlConn2);
             if (SnNoInfo.Rows.Count > 0)
             {
                 foreach (DataRow selfDr in SnNoInfo.Rows)