浏览代码

打日志打控制台

lcl 4 月之前
父节点
当前提交
ec9d89256c

+ 23 - 23
Util/HaoDa/ActiveRewardService.cs

@@ -146,16 +146,16 @@ namespace MySystem
                     {
                         WebCMSEntities db = new WebCMSEntities();
                         Models.KxsMain.WebCMSEntities kxsdb = new Models.KxsMain.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, "开机奖励发放日志");
                             Models.KxsMain.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
                                         Models.KxsMain.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();
                         Models.KxsMain.WebCMSEntities kxsdb = new Models.KxsMain.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, "盟主奖励发放日志");
                             Models.KxsMain.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
                                         Models.KxsMain.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();
                         Models.KxsMain.WebCMSEntities kxsdb = new Models.KxsMain.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, "运营中心奖励发放日志");
                             Models.KxsMain.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
                                         Models.KxsMain.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
Util/HaoDa/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

+ 4 - 4
Util/HaoDa/GetHaoDaFTPInfoService.cs

@@ -150,12 +150,12 @@ namespace MySystem
                     // 根据响应状态码判断是否文件不存在
                     if (((FtpWebResponse)ex.Response).StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString() + "文件" + filePath + "不存在", "获取好哒FTP文件数据异常"); // 文件不存在,返回false
+                        Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString() + "文件" + filePath + "不存在", "获取好哒FTP文件数据异常"); // 文件不存在,返回false
                     }
                     else
                     {
                         // 其他错误
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
                     }
                 }
             }
@@ -269,7 +269,7 @@ namespace MySystem
                     }
                     catch (WebException ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+                        Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
                     }
                 }
             }
@@ -397,7 +397,7 @@ namespace MySystem
             }
             catch (WebException ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+                Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
             }
         }
 

+ 1 - 1
Util/HaoDa/GetStoreNoHelper.cs

@@ -121,7 +121,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "获取商户门店号队列异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "获取商户门店号队列异常");
             }
         }
         #endregion

+ 6 - 6
Util/HaoDa/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("StandardProfitQueue2", "{\"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);
             }

+ 1 - 1
Util/HaoDa/ProfitAfterHelper.cs

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

+ 2 - 2
Util/HaoDa/ProfitAfterNewHelper.cs

@@ -346,7 +346,7 @@ namespace MySystem
             //     user.UserLevel = int.Parse(dt.Rows[0]["user_level"].ToString());
             //     user.PreUserLevel = int.Parse(dt.Rows[0]["pre_level"].ToString());
             //     user.PreLeaderLevel = int.Parse(dt.Rows[0]["leader_level"].ToString());
-            //     function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(user), "检查666");
+            //     Utils.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(user), "检查666");
             // }
             return user;
         }
@@ -407,7 +407,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
     }

+ 1 - 1
Util/HaoDa/ProfitBeforeHelper.cs

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

+ 1 - 1
Util/HaoDa/ProfitBeforeNewHelper.cs

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

+ 1 - 1
Util/HaoDa/ProfitCheckHelper.cs

@@ -61,7 +61,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "检查订单是否在队列里异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "检查订单是否在队列里异常");
             }
         }
         #endregion

+ 26 - 26
Util/HaoDa/ProfitHelper.cs

@@ -66,7 +66,7 @@ namespace MySystem
 
         public void ReturnStat(string orderidstring, int PayMode)
         {
-            function.WriteLog("开始返现:" + orderidstring, "返现逻辑日志");
+            Utils.WriteLog("开始返现:" + orderidstring, "返现逻辑日志");
             int OrderId = int.Parse(function.CheckInt(orderidstring));
             WebCMSEntities db = new WebCMSEntities();
             using (var tran = db.Database.BeginTransaction())
@@ -78,7 +78,7 @@ namespace MySystem
                     {
                         decimal PayMoney = order.PayMoney;
                         int MerchantId = order.MerchantId;
-                        function.WriteLog("MerchantId:" + MerchantId, "返现逻辑日志");
+                        Utils.WriteLog("MerchantId:" + MerchantId, "返现逻辑日志");
                         MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == MerchantId);
                         if (merchant != null)
                         {
@@ -102,12 +102,12 @@ namespace MySystem
                             // decimal TotalActual = 0;
                             if (IsAll == 0 && PayMoney >= MinPayMoney && GetPercent < 1)
                             {
-                                function.WriteLog("活动开启", "返现逻辑日志");
+                                Utils.WriteLog("活动开启", "返现逻辑日志");
                                 // PayMoney * (1 - 0.1 - 0.0038 - 0.01);
                                 decimal DiviMoney = PayMoney * (1 - GetPercent - cusumerFeePercent - profitPercent);
                                 if (DiviMoney > 0)
                                 {
-                                    function.WriteLog("返现队列开始", "返现逻辑日志");
+                                    Utils.WriteLog("返现队列开始", "返现逻辑日志");
                                     RedisDbconn.Instance.AddRightList("ConsumerOrdersHd:Divi:" + PayMode + ":" + order.MerchantId, order);
                                     order.ReturnFlag = 1;
                                     db.SaveChanges();
@@ -130,27 +130,27 @@ namespace MySystem
 
                                     // 减去自己付的订单
                                     List<int> orderids = new List<int>();
-                                    function.WriteLog("人数:" + CurDiviPersons, "返现逻辑日志");
+                                    Utils.WriteLog("人数:" + CurDiviPersons, "返现逻辑日志");
                                     while (CurDiviPersons > 0)
                                     {
                                         ConsumerOrders suborder = RedisDbconn.Instance.RPopLPush<ConsumerOrders>("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, "ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId);
                                         if (suborder != null)
                                         {
                                             decimal TmpCurDivi = suborder.CurDivi;
-                                            function.WriteLog("返现对象订单:" + suborder.Id, "返现逻辑日志");
+                                            Utils.WriteLog("返现对象订单:" + suborder.Id, "返现逻辑日志");
                                             MerchantParamSet subset = Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantParamSet>(suborder.SeoDescription);
                                             int subProfitDays = subset.ProfitDays; //分红期限(天)
                                             bool IsOut = suborder.UpdateDate.Value.AddDays(subProfitDays) < DateTime.Now ? true : false;
                                             if (suborder.CurDivi < suborder.MaxDivi && suborder.MaxDivi - suborder.CurDivi >= 0.01M && !IsOut)
                                             {
-                                                function.WriteLog("没出局:" + suborder.CurDivi + "--" + suborder.MaxDivi, "返现逻辑日志");
+                                                Utils.WriteLog("没出局:" + suborder.CurDivi + "--" + suborder.MaxDivi, "返现逻辑日志");
                                                 //如果没过期并且当前退款金额没超过最大退款金额,就执行
                                                 decimal GetMoney = suborder.MaxDivi - suborder.CurDivi;
                                                 if (GetMoney >= DiviMoney)
                                                 {
                                                     GetMoney = DiviMoney;
                                                 }
-                                                function.WriteLog("GetMoney:" + GetMoney, "返现逻辑日志");
+                                                Utils.WriteLog("GetMoney:" + GetMoney, "返现逻辑日志");
                                                 if (GetMoney > minProfit)
                                                 {
                                                     MerchantAddInfo merchantAdd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == suborder.MerchantId) ?? new MerchantAddInfo();
@@ -164,22 +164,22 @@ namespace MySystem
                                                     if (MerchantList.Contains("," + suborder.MerchantId + ",") || SplitOrderStatus == "1")
                                                     {
                                                         CheckTime = SplitOrder(suborder.PayMoney, subset.MinPayMoney);
-                                                        function.WriteLog("CheckTime:" + CheckTime, "返现逻辑日志");
+                                                        Utils.WriteLog("CheckTime:" + CheckTime, "返现逻辑日志");
                                                         if (CheckTime > 0)
                                                         {
                                                             if (set.DiviPersons - DiviTimes < CheckTime)
                                                             {
                                                                 CheckTime = set.DiviPersons - DiviTimes;
                                                             }
-                                                            function.WriteLog("CheckTime:" + CheckTime, "返现逻辑日志");
+                                                            Utils.WriteLog("CheckTime:" + CheckTime, "返现逻辑日志");
                                                             GetMoney = GetMoney * CheckTime;
                                                             db.SaveChanges();
-                                                            function.WriteLog("CurDiviPersons1:" + CurDiviPersons, "返现逻辑日志");
+                                                            Utils.WriteLog("CurDiviPersons1:" + CurDiviPersons, "返现逻辑日志");
                                                             if (RedisDbconn.Instance.Count("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId) >= set.DiviPersons)
                                                             {
                                                                 CurDiviPersons -= CheckTime - 1;
                                                             }
-                                                            function.WriteLog("CurDiviPersons2:" + CurDiviPersons, "返现逻辑日志");
+                                                            Utils.WriteLog("CurDiviPersons2:" + CurDiviPersons, "返现逻辑日志");
                                                             decimal CheckMoney = suborder.MaxDivi - suborder.CurDivi;
                                                             if (GetMoney >= CheckMoney)
                                                             {
@@ -193,7 +193,7 @@ namespace MySystem
                                                     RefundAmount = PublicFunction.NumberFormat(RefundAmount, 0);
                                                     if (!orderids.Contains(suborder.Id) && DiviTimes < set.DiviPersons)
                                                     {
-                                                        function.WriteLog("请求退款接口", "返现逻辑日志");
+                                                        Utils.WriteLog("请求退款接口", "返现逻辑日志");
                                                         string RefundNo = "HDTK" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
                                                         var info = HaoDaHelper.Instance.AggregatedPayRefund(merchantAdd.OutMchtNo, merchantAdd.StoreNo, RefundNo, suborder.OrderNo, RefundAmount.ToString("f0"), merchantAdd.BrandId);
                                                         if (info.Contains("\"resultCode\":\"1\"") && info.Contains("\"tradeStatus\":\"2\""))
@@ -214,7 +214,7 @@ namespace MySystem
                                                             db.SaveChanges();
                                                             BackStatus = true;
                                                         }
-                                                        function.WriteLog("接口返回:" + info, "返现逻辑日志");
+                                                        Utils.WriteLog("接口返回:" + info, "返现逻辑日志");
                                                         orderids.Add(suborder.Id);
                                                         DiviTimes += CheckTime;
                                                     }
@@ -223,10 +223,10 @@ namespace MySystem
                                                     {
                                                         merchant.ActCurrentAmount += Math.Round(GetMoney, 2); //活动已返金额
                                                         db.SaveChanges();
-                                                        function.WriteLog(suborder.CurDivi + ":" + suborder.MaxDivi, "返现逻辑日志");
+                                                        Utils.WriteLog(suborder.CurDivi + ":" + suborder.MaxDivi, "返现逻辑日志");
                                                         if (suborder.CurDivi < suborder.MaxDivi)
                                                         {
-                                                            function.WriteLog("返现未达最大值继续", "返现逻辑日志");
+                                                            Utils.WriteLog("返现未达最大值继续", "返现逻辑日志");
                                                             // RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
                                                             RedisDbconn.Instance.SetList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, 0, suborder);
                                                             RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.CurDivi + "\"}");
@@ -234,7 +234,7 @@ namespace MySystem
                                                         else
                                                         {
                                                             suborder.CurDivi = TmpCurDivi;
-                                                            function.WriteLog("返现达最大值,出局", "返现逻辑日志");
+                                                            Utils.WriteLog("返现达最大值,出局", "返现逻辑日志");
                                                             ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
                                                             if (editOrder != null)
                                                             {
@@ -242,7 +242,7 @@ namespace MySystem
                                                                 db.SaveChanges();
                                                                 RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.MaxDivi + "\"}");
                                                             }
-                                                            function.WriteLog("删除队列数据:" + Newtonsoft.Json.JsonConvert.SerializeObject(suborder), "返现逻辑日志");
+                                                            Utils.WriteLog("删除队列数据:" + Newtonsoft.Json.JsonConvert.SerializeObject(suborder), "返现逻辑日志");
                                                             RedisDbconn.Instance.DelFromList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
                                                         }
                                                     }
@@ -253,7 +253,7 @@ namespace MySystem
                                             {
                                                 //否者计算人数不计入退款名额
                                                 suborder.CurDivi = TmpCurDivi;
-                                                function.WriteLog("返现达最大值,出局", "返现逻辑日志");
+                                                Utils.WriteLog("返现达最大值,出局", "返现逻辑日志");
                                                 ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
                                                 if (editOrder != null)
                                                 {
@@ -261,28 +261,28 @@ namespace MySystem
                                                     db.SaveChanges();
                                                     RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.MaxDivi + "\"}");
                                                 }
-                                                function.WriteLog("删除队列数据:" + Newtonsoft.Json.JsonConvert.SerializeObject(suborder), "返现逻辑日志");
+                                                Utils.WriteLog("删除队列数据:" + Newtonsoft.Json.JsonConvert.SerializeObject(suborder), "返现逻辑日志");
                                                 RedisDbconn.Instance.DelFromList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
                                                 CurDiviPersons += 1;
-                                                function.WriteLog("出局:CurDiviPersons:" + CurDiviPersons, "返现逻辑日志");
+                                                Utils.WriteLog("出局:CurDiviPersons:" + CurDiviPersons, "返现逻辑日志");
                                             }
                                         }
                                         CurDiviPersons -= 1;
                                         QueueCount = RedisDbconn.Instance.Count("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId);
-                                        function.WriteLog("当前队列数量:" + QueueCount, "返现逻辑日志");
+                                        Utils.WriteLog("当前队列数量:" + QueueCount, "返现逻辑日志");
                                         if (QueueCount == 0)
                                         {
                                             CurDiviPersons = 0;
                                         }
                                     }
-                                    function.WriteLog("返现队列结束", "返现逻辑日志");
+                                    Utils.WriteLog("返现队列结束", "返现逻辑日志");
                                 }
                             }
                         }
                     }
                     else
                     {
-                        function.WriteLog("没找到订单:" + orderidstring, "返现逻辑日志");
+                        Utils.WriteLog("没找到订单:" + orderidstring, "返现逻辑日志");
                         // Thread.Sleep(2000);
                         // List<ConsumerOrders> list = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrdersHd:Divi:" + order.PayMode + ":" + order.MerchantId + "", 1, 100000);
                         // ConsumerOrders check = list.FirstOrDefault(m => m.Id == order.Id);
@@ -302,7 +302,7 @@ namespace MySystem
                 }
             }
             db.Dispose();
-            function.WriteLog("结束返现:" + orderidstring + "\n\n\n", "返现逻辑日志");
+            Utils.WriteLog("结束返现:" + orderidstring + "\n\n\n", "返现逻辑日志");
         }
 
         //拆单算法
@@ -633,7 +633,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "设置订单当前返现金额异常");
             }
         }
     }

+ 1 - 1
Util/HaoDa/SettleAmountCheckHelper.cs

@@ -55,7 +55,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "检查未结算分账订单异常");
+                Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "检查未结算分账订单异常");
             }
         }
     }

+ 1 - 1
Util/HaoDa/Tencent/GetTencentAddressInfoService.cs

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

+ 5 - 5
Util/HaoDa/TestHaoDaService.cs

@@ -203,7 +203,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+                Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
             }
             return strs;
         }
@@ -314,12 +314,12 @@ namespace MySystem
                 // 根据响应状态码判断是否文件不存在
                 if (((FtpWebResponse)ex.Response).StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString() + "文件" + filePath + "不存在", "获取好哒FTP文件数据异常"); // 文件不存在,返回false
+                    Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString() + "文件" + filePath + "不存在", "获取好哒FTP文件数据异常"); // 文件不存在,返回false
                 }
                 else
                 {
                     // 其他错误
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+                    Utils.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
                 }
             }
         }
@@ -823,9 +823,9 @@ namespace MySystem
                             string storeNo = Regex.Match(m.Value, "\"storeNo\":\".*?\"").Value.Replace("\"storeNo\":\"", "").Replace("\"", "");
                             string outOrderNo = Regex.Match(m.Value, "\"outOrderNo\":\".*?\"").Value.Replace("\"outOrderNo\":\"", "").Replace("\"", "");
                             string refundAmount = Regex.Match(m.Value, "\"refundAmount\":\".*?\"").Value.Replace("\"refundAmount\":\"", "").Replace("\"", "");
-                            function.WriteLog("mchtNo:" + mchtNo + ";storeNo:" + storeNo + ";outOrderNo:" + outOrderNo + ";refundAmount:" + refundAmount + ";", "补充退款日志");
+                            Utils.WriteLog("mchtNo:" + mchtNo + ";storeNo:" + storeNo + ";outOrderNo:" + outOrderNo + ";refundAmount:" + refundAmount + ";", "补充退款日志");
                             var info = HaoDaHelper.Instance.AggregatedPayRefund(mchtNo, storeNo, "HDTK" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), outOrderNo, refundAmount);
-                            function.WriteLog(info + "\n\n", "补充退款日志");
+                            Utils.WriteLog(info + "\n\n", "补充退款日志");
                             Thread.Sleep(1000);
                         }
                     }

+ 1 - 1
Util/LogHelper.cs

@@ -36,7 +36,7 @@ public class LogHelper
         }
         else
         {
-            function.WriteLog(Content, FileName);
+            Utils.WriteLog(Content, FileName);
         }
     }
 

+ 3 - 3
Util/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;
         }
     }

+ 3 - 3
Util/OrderPushHelper.cs

@@ -63,10 +63,10 @@ namespace MySystem
         private string post(SortedList<string, string> 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;
         }
     }

+ 2 - 2
Util/PosPushDataNewHelper.cs

@@ -38,7 +38,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", "推送绑定数据异常");
             }
         }
 
@@ -66,7 +66,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
Util/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)
             {

+ 2 - 2
Util/PublicFunction.cs

@@ -251,7 +251,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;
@@ -268,7 +268,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;

+ 3 - 3
Util/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;
         }
 

+ 12 - 5
Util/Utils.cs

@@ -25,14 +25,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 
-    
-    
-    
+        #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
+
     
     }
 }