lcl 1 год назад
Родитель
Сommit
221c9fe151

+ 23 - 23
AppStart/Helper/ActiveRewardService.cs

@@ -146,16 +146,16 @@ namespace MySystem
                     {
                         WebCMSEntities db = new WebCMSEntities();
                         KxsMainModels.WebCMSEntities kxsdb = new KxsMainModels.WebCMSEntities();
-                        function.WriteLog("\n\n" + DateTime.Now.ToString() + "\nposid:" + content, "开机奖励发放日志");
+                        Utils.WriteLog("\n\n" + DateTime.Now.ToString() + "\nposid:" + content, "开机奖励发放日志");
                         int MerchantId = int.Parse(content);
                         MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == MerchantId);
                         if (merchant != null)
                         {
-                            function.WriteLog("商户:" + merchant.Name, "开机奖励发放日志");
+                            Utils.WriteLog("商户:" + merchant.Name, "开机奖励发放日志");
                             KxsMainModels.Users user = kxsdb.Users.FirstOrDefault(m => m.Id == merchant.UserId);
                             if (user != null)
                             {
-                                function.WriteLog("所属人:" + user.MakerCode, "开机奖励发放日志");
+                                Utils.WriteLog("所属人:" + user.MakerCode, "开机奖励发放日志");
                                 string ParentNav = function.CheckNull(user.ParentNav) + "," + user.Id + ",";
                                 if (!string.IsNullOrEmpty(ParentNav))
                                 {
@@ -167,8 +167,8 @@ namespace MySystem
                                         KxsMainModels.Users puser = kxsdb.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1 && m.Status > -1);
                                         if (puser != null && Prize > 0)
                                         {
-                                            function.WriteLog("上级:" + puser.MakerCode, "开机奖励发放日志");
-                                            function.WriteLog("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "开机奖励发放日志");
+                                            Utils.WriteLog("上级:" + puser.MakerCode, "开机奖励发放日志");
+                                            Utils.WriteLog("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "开机奖励发放日志");
                                             if(puser.LeaderLevel > 0 || puser.UserType == 1)
                                             {
                                                 bool leaderOp = true;
@@ -176,11 +176,11 @@ namespace MySystem
                                                 {
                                                     DateTime now = DateTime.Now;
                                                     leaderOp = kxsdb.Leaders.Any(m => m.Id == puser.Id && m.ExpiredDate >= now);
-                                                    function.WriteLog("条件:leaderOp:" + leaderOp, "开机奖励发放日志");
+                                                    Utils.WriteLog("条件:leaderOp:" + leaderOp, "开机奖励发放日志");
                                                 }
                                                 if(leaderOp)
                                                 {
-                                                    function.WriteLog("满足条件", "开机奖励发放日志");
+                                                    Utils.WriteLog("满足条件", "开机奖励发放日志");
                                                     int pTopUserId = 0;
                                                     if (!string.IsNullOrEmpty(puser.ParentNav))
                                                     {
@@ -249,7 +249,7 @@ namespace MySystem
                     }
                     catch(Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "实时获取开机奖励异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "实时获取开机奖励异常");
                     }
                 }
                 else
@@ -280,16 +280,16 @@ namespace MySystem
                     {
                         WebCMSEntities db = new WebCMSEntities();
                         KxsMainModels.WebCMSEntities kxsdb = new KxsMainModels.WebCMSEntities();
-                        function.WriteLog("\n\n" + DateTime.Now.ToString() + "\nposid:" + content, "盟主奖励发放日志");
+                        Utils.WriteLog("\n\n" + DateTime.Now.ToString() + "\nposid:" + content, "盟主奖励发放日志");
                         int MerchantId = int.Parse(content);
                         MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == MerchantId);
                         if (merchant != null)
                         {
-                            function.WriteLog("商户:" + merchant.Name, "盟主奖励发放日志");
+                            Utils.WriteLog("商户:" + merchant.Name, "盟主奖励发放日志");
                             KxsMainModels.Users user = kxsdb.Users.FirstOrDefault(m => m.Id == merchant.UserId);
                             if (user != null)
                             {
-                                function.WriteLog("所属人:" + user.MakerCode, "盟主奖励发放日志");
+                                Utils.WriteLog("所属人:" + user.MakerCode, "盟主奖励发放日志");
                                 string ParentNav = function.CheckNull(user.ParentNav) + "," + user.Id + ",";
                                 if (!string.IsNullOrEmpty(ParentNav))
                                 {
@@ -301,16 +301,16 @@ namespace MySystem
                                         KxsMainModels.Users puser = kxsdb.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1 && m.Status > -1);
                                         if (puser != null && Prize > 0)
                                         {
-                                            function.WriteLog("上级:" + puser.MakerCode, "盟主奖励发放日志");
-                                            function.WriteLog("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "盟主奖励发放日志");
+                                            Utils.WriteLog("上级:" + puser.MakerCode, "盟主奖励发放日志");
+                                            Utils.WriteLog("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "盟主奖励发放日志");
                                             if(puser.LeaderLevel == 2)
                                             {
                                                 DateTime now = DateTime.Now;
                                                 bool leaderOp = kxsdb.Leaders.Any(m => m.Id == puser.Id && m.ExpiredDate >= now);
-                                                function.WriteLog("条件:leaderOp:" + leaderOp, "盟主奖励发放日志");
+                                                Utils.WriteLog("条件:leaderOp:" + leaderOp, "盟主奖励发放日志");
                                                 if(leaderOp)
                                                 {
-                                                    function.WriteLog("满足条件", "盟主奖励发放日志");
+                                                    Utils.WriteLog("满足条件", "盟主奖励发放日志");
                                                     int pTopUserId = 0;
                                                     if (!string.IsNullOrEmpty(puser.ParentNav))
                                                     {
@@ -379,7 +379,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "盟主奖发放日志异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "盟主奖发放日志异常");
                     }
                     Thread.Sleep(100);
                 }
@@ -411,16 +411,16 @@ namespace MySystem
                     {
                         WebCMSEntities db = new WebCMSEntities();
                         KxsMainModels.WebCMSEntities kxsdb = new KxsMainModels.WebCMSEntities();
-                        function.WriteLog("\n\n" + DateTime.Now.ToString() + "\nposid:" + content, "运营中心奖励发放日志");
+                        Utils.WriteLog("\n\n" + DateTime.Now.ToString() + "\nposid:" + content, "运营中心奖励发放日志");
                         int MerchantId = int.Parse(content);
                         MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == MerchantId);
                         if (merchant != null)
                         {
-                            function.WriteLog("商户:" + merchant.Name, "运营中心奖励发放日志");
+                            Utils.WriteLog("商户:" + merchant.Name, "运营中心奖励发放日志");
                             KxsMainModels.Users user = kxsdb.Users.FirstOrDefault(m => m.Id == merchant.UserId);
                             if (user != null)
                             {
-                                function.WriteLog("所属人:" + user.MakerCode, "运营中心奖励发放日志");
+                                Utils.WriteLog("所属人:" + user.MakerCode, "运营中心奖励发放日志");
                                 string ParentNav = function.CheckNull(user.ParentNav) + "," + user.Id + ",";
                                 if (!string.IsNullOrEmpty(ParentNav))
                                 {
@@ -432,11 +432,11 @@ namespace MySystem
                                         KxsMainModels.Users puser = kxsdb.Users.FirstOrDefault(m => m.Id == UserId && m.AuthFlag == 1 && m.Status > -1);
                                         if (puser != null && Prize > 0)
                                         {
-                                            function.WriteLog("上级:" + puser.MakerCode, "运营中心奖励发放日志");
-                                            function.WriteLog("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "运营中心奖励发放日志");
+                                            Utils.WriteLog("上级:" + puser.MakerCode, "运营中心奖励发放日志");
+                                            Utils.WriteLog("条件:LeaderLevel:" + puser.LeaderLevel + ",UserType:" + puser.UserType, "运营中心奖励发放日志");
                                             if(puser.UserType == 1)
                                             {
-                                                function.WriteLog("满足条件", "运营中心奖励发放日志");
+                                                Utils.WriteLog("满足条件", "运营中心奖励发放日志");
                                                 int pTopUserId = 0;
                                                 if (!string.IsNullOrEmpty(puser.ParentNav))
                                                 {
@@ -504,7 +504,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "运营中心奖发放日志异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "运营中心奖发放日志异常");
                     }
                     Thread.Sleep(100);
                 }

+ 1 - 1
AppStart/Helper/AlipayPayBackFeeService.cs

@@ -37,7 +37,7 @@ namespace MySystem
                     }
                     catch(Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "直联支付宝支付回调异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "直联支付宝支付回调异常");
                     }
                 }
                 else

+ 6 - 6
AppStart/Helper/MerchantStandardService.cs

@@ -33,7 +33,7 @@ namespace MySystem
                 }
                 catch(Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "商户达标奖异常");
+                    Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "商户达标奖异常");
                 }
                 Thread.Sleep(600000);
             }
@@ -45,18 +45,18 @@ namespace MySystem
             DateTime start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
             DateTime end = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
             string month = DateTime.Now.ToString("yyyyMM");
-            function.WriteLog(DateTime.Now.ToString() + "-start", "达标奖励日志");
+            Utils.WriteLog(DateTime.Now.ToString() + "-start", "达标奖励日志");
             var orders = db.MerchantDepositOrder.Where(m => m.Status > 0 && m.Version == 0 && m.UpdateDate >= start && m.UpdateDate < end).ToList();
             foreach(var order in orders)
             {
-                function.WriteLog("MerchantId:" + order.MerchantId, "达标奖励日志");
+                Utils.WriteLog("MerchantId:" + order.MerchantId, "达标奖励日志");
                 decimal TradeMoney = 0;
                 bool has = db.MerchantAmountSummay.Any(m => m.MerchantId == order.MerchantId && m.IsAct == 1 && m.TradeMonth == month);
                 if(has)
                 {
                     TradeMoney = db.MerchantAmountSummay.Where(m => m.MerchantId == order.MerchantId && m.IsAct == 1 && m.TradeMonth == month).Sum(m => m.TradeAmount);
                 }
-                function.WriteLog("TradeMoney:" + TradeMoney, "达标奖励日志");
+                Utils.WriteLog("TradeMoney:" + TradeMoney, "达标奖励日志");
                 if(TradeMoney >= 10000)
                 {
                     RedisDbconn.Instance.AddList("StandardProfitQueue", "{\"MerchantId\":\"" + order.MerchantId + "\",\"Prize\":\"50\"}");
@@ -68,7 +68,7 @@ namespace MySystem
                 }
                 db.SaveChanges();
             }
-            function.WriteLog(DateTime.Now.ToString() + "-end", "达标奖励日志");
+            Utils.WriteLog(DateTime.Now.ToString() + "-end", "达标奖励日志");
             db.Dispose();
         }
 
@@ -93,7 +93,7 @@ namespace MySystem
                 }
                 catch(Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "商户连续3月达标奖异常");
+                    Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "商户连续3月达标奖异常");
                 }
                 Thread.Sleep(605000);
             }

+ 3 - 3
AppStart/Helper/MqLinksHelper.cs

@@ -43,10 +43,10 @@ namespace MySystem
         private string post(Dictionary<string, object> data)
         {
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(data);
-            function.WriteLog("请求地址:" + reqUrl, "云音响播报日志");
-            function.WriteLog("请求参数:" + req, "云音响播报日志");
+            Utils.WriteLog("请求地址:" + reqUrl, "云音响播报日志");
+            Utils.WriteLog("请求参数:" + req, "云音响播报日志");
             string result = function.PostWebRequest(reqUrl, req, "application/json");
-            function.WriteLog("响应数据:" + result, "云音响播报日志");
+            Utils.WriteLog("响应数据:" + result, "云音响播报日志");
             return result;
         }
     }

+ 1 - 1
AppStart/Helper/Profit/ProfitAfterHelper.cs

@@ -1568,7 +1568,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
 

+ 1 - 1
AppStart/Helper/Profit/ProfitAfterNewHelper.cs

@@ -1569,7 +1569,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
 

+ 1 - 1
AppStart/Helper/Profit/ProfitBeforeHelper.cs

@@ -1565,7 +1565,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
 

+ 1 - 1
AppStart/Helper/Profit/ProfitBeforeNewHelper.cs

@@ -1566,7 +1566,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
 

+ 1 - 1
AppStart/Helper/Profit/ProfitHelper.cs

@@ -2175,7 +2175,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
 

+ 1 - 1
AppStart/Helper/Tencent/GetTencentAddressInfoService.cs

@@ -56,7 +56,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取腾讯地图地址线程异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取腾讯地图地址线程异常");
                     }
                 }
                 else

+ 3 - 3
AppStart/Helper/TianYuVoiceHelper.cs

@@ -83,10 +83,10 @@ namespace MySystem
             string signString = function.BuildQueryString(data);
             data.Add("sign", hmac_sha256(signString));
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(data);
-            function.WriteLog("请求地址:" + reqUrl, "天谕音响日志");
-            function.WriteLog("请求参数:" + req, "天谕音响日志");
+            Utils.WriteLog("请求地址:" + reqUrl, "天谕音响日志");
+            Utils.WriteLog("请求参数:" + req, "天谕音响日志");
             string result = function.PostWebRequest(reqUrl, req, "application/json");
-            function.WriteLog("响应数据:" + result, "天谕音响日志");
+            Utils.WriteLog("响应数据:" + result, "天谕音响日志");
             return result;
         }
 

+ 1 - 1
AppStart/LogHelper.cs

@@ -27,7 +27,7 @@ public class LogHelper
             RedisDbconn.Instance.Set(key, "1");
             RedisDbconn.Instance.SetExpire(key, 3600);
         }
-        function.WriteLog(Content, FileName);
+        Utils.WriteLog(Content, FileName);
         if(sls)
         {
             Dictionary<string, string> dic = new Dictionary<string, string>();

+ 2 - 2
AppStart/PublicFunction.cs

@@ -54,7 +54,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "获取网络文件内容异常");
+                    Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "获取网络文件内容异常");
                 }
             }
             return textContent;
@@ -71,7 +71,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "获取网络文件流异常");
+                    Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "获取网络文件流异常");
                 }
             }
             return textContent;

+ 2 - 2
Utils/PosPushDataNewHelper.cs

@@ -31,7 +31,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "推送绑定数据异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "推送绑定数据异常");
             }
         }
 
@@ -59,7 +59,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "推送交易数据异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString() + "\n\n", "推送交易数据异常");
             }
         }
 

+ 2 - 2
Utils/PrizePushHelper.cs

@@ -35,9 +35,9 @@ namespace MySystem
                 prizeItemList.Add(prizeItemSub);
                 prizeItem.Add("prize_list", prizeItemList);
                 string prizeOutContent = Newtonsoft.Json.JsonConvert.SerializeObject(prizeItem);
-                function.WriteLog("请求参数:" + prizeOutContent, "奖励通知返回报文");
+                Utils.WriteLog("请求参数:" + prizeOutContent, "奖励通知返回报文");
                 string noticeJson = function.PostWebRequest(NoticeUrl, prizeOutContent, "application/json");
-                function.WriteLog("返回报文:" + noticeJson + "\n\n\n", "奖励通知返回报文");
+                Utils.WriteLog("返回报文:" + noticeJson + "\n\n\n", "奖励通知返回报文");
             }
             catch(Exception ex)
             {

+ 11 - 1
Utils/Utils.cs

@@ -24,11 +24,21 @@ namespace MySystem
             // data += "\"sn\":\"\",";
             // data += "\"actType\":\"" + actType + "\"";
             // data += "}";
-            // function.WriteLog(DateTime.Now.ToString() + "\n" + data, "推送激活数据信息MQ日志");
+            // Utils.WriteLog(DateTime.Now.ToString() + "\n" + data, "推送激活数据信息MQ日志");
             // RedisDbconn.Instance.AddList("KxsActQueue", data);
         }
 
         #endregion 
+
+
+        #region 打控制台日志
+
+        public static void WriteLog(string msg, string filename = "message")
+        {
+            Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "--" + filename + "--" + msg);
+        }
+
+        #endregion