lcl 1 жил өмнө
parent
commit
7379ed962d
87 өөрчлөгдсөн 449 нэмэгдсэн , 369 устгасан
  1. 8 8
      AppStart/Alipay/AliIotFunction.cs
  2. 22 21
      AppStart/Alipay/AlipayFunction.cs
  3. 4 4
      AppStart/Alipay/AlipayFunctionForHD.cs
  4. 1 1
      AppStart/GlobalExceptions.cs
  5. 2 2
      AppStart/HaoDa/HaoDaExtHelper.cs
  6. 2 2
      AppStart/HaoDa/HaoDaExtQueryHelper.cs
  7. 3 3
      AppStart/Helper/AlipayPayBackService.cs
  8. 1 1
      AppStart/Helper/AlipayShareService.cs
  9. 2 2
      AppStart/Helper/AutoOpOrderService.cs
  10. 1 1
      AppStart/Helper/BalancePayBackService.cs
  11. 1 1
      AppStart/Helper/CheckAlipaySignService.cs
  12. 1 1
      AppStart/Helper/CheckWeChatSignService.cs
  13. 1 1
      AppStart/Helper/ConsumerOrdersReturnDoService.cs
  14. 2 2
      AppStart/Helper/ConsumerOrdersReturnStatService.cs
  15. 3 3
      AppStart/Helper/ConsumerOrdersStatService.cs
  16. 1 1
      AppStart/Helper/DelMySql/DeleteMySqlDataService.cs
  17. 1 1
      AppStart/Helper/DepositReturnService.cs
  18. 1 1
      AppStart/Helper/DepositReturnStatService.cs
  19. 1 1
      AppStart/Helper/LeaderApplyCouponsHelper.cs
  20. 1 1
      AppStart/Helper/LeaderPrizeService.cs
  21. 1 1
      AppStart/Helper/MakeReferenceQrCodeService.cs
  22. 1 1
      AppStart/Helper/MerchantConfirmService.cs
  23. 2 2
      AppStart/Helper/MerchantTypeSetService.cs
  24. 1 1
      AppStart/Helper/MessageCenterService.cs
  25. 2 2
      AppStart/Helper/Operate/OperateAmountService.cs
  26. 1 1
      AppStart/Helper/Operate/OperateStockService.cs
  27. 1 1
      AppStart/Helper/OperatePrizeService.cs
  28. 1 1
      AppStart/Helper/OperateService.cs
  29. 3 3
      AppStart/Helper/Profit/ActiveService.cs
  30. 3 3
      AppStart/Helper/Profit/DiviService.cs
  31. 3 3
      AppStart/Helper/Profit/FluxService.cs
  32. 8 8
      AppStart/Helper/Profit/HelpProfitHelper.cs
  33. 3 3
      AppStart/Helper/Profit/OpenService.cs
  34. 12 12
      AppStart/Helper/Profit/ProfitCheckHelper.cs
  35. 37 37
      AppStart/Helper/Profit/ProfitHelper.cs
  36. 18 18
      AppStart/Helper/Profit/ProfitHelperV2.cs
  37. 3 3
      AppStart/Helper/Profit/ProfitService.cs
  38. 3 3
      AppStart/Helper/Profit/StandardService.cs
  39. 1 1
      AppStart/Helper/ProfitShareService.cs
  40. 2 2
      AppStart/Helper/ReceiveProfitService.cs
  41. 2 2
      AppStart/Helper/ReceiveTaskService.cs
  42. 1 1
      AppStart/Helper/RecommendActStatService.cs
  43. 1 1
      AppStart/Helper/ReservePayBackService.cs
  44. 41 41
      AppStart/Helper/SetDepositPostService.cs
  45. 1 1
      AppStart/Helper/SetDepositService.cs
  46. 4 4
      AppStart/Helper/SetFeeFlagService.cs
  47. 2 2
      AppStart/Helper/StatDataService.cs
  48. 67 67
      AppStart/Helper/StatService.cs
  49. 12 12
      AppStart/Helper/StatServiceTmp.cs
  50. 1 1
      AppStart/Helper/StatStoreDataService.cs
  51. 1 1
      AppStart/Helper/StatTimerService.cs
  52. 1 1
      AppStart/Helper/SycnMysql/ConsumerOpenIdsHelper.cs
  53. 1 1
      AppStart/Helper/SycnMysql/ConsumersHelper.cs
  54. 1 1
      AppStart/Helper/SycnMysql/MachineApplyHelper.cs
  55. 1 1
      AppStart/Helper/SycnMysql/MerchantParamSetHelper.cs
  56. 1 1
      AppStart/Helper/SycnMysql/OrderProductHelper.cs
  57. 1 1
      AppStart/Helper/SycnMysql/OrdersHelper.cs
  58. 1 1
      AppStart/Helper/SycnMysql/PosMachinesHelper.cs
  59. 1 1
      AppStart/Helper/SycnMysql/ProductsHelper.cs
  60. 1 1
      AppStart/Helper/SycnMysql/StoreChangeHistoryHelper.cs
  61. 1 1
      AppStart/Helper/SycnMysql/StoreStockChangeHelper.cs
  62. 1 1
      AppStart/Helper/SycnMysql/TeamApplyHelper.cs
  63. 1 1
      AppStart/Helper/SycnMysql/TeamOfferApplyHelper.cs
  64. 1 1
      AppStart/Helper/SycnMysql/UserAddressHelper.cs
  65. 1 1
      AppStart/Helper/SycnMysql/UserBackHelper.cs
  66. 1 1
      AppStart/Helper/SycnMysql/UserCashRecordHelper.cs
  67. 1 1
      AppStart/Helper/SycnMysql/UserLoginRecordHelper.cs
  68. 1 1
      AppStart/Helper/SycnMysql/UserMachineDataHelper.cs
  69. 1 1
      AppStart/Helper/SycnMysql/UserStoreChangeHelper.cs
  70. 1 1
      AppStart/Helper/SycnMysql/UsersHelper.cs
  71. 1 1
      AppStart/Helper/TimeOutPosChargeReturnService.cs
  72. 1 1
      AppStart/Helper/TimeOutPosChargeService.cs
  73. 1 1
      AppStart/Helper/TimeOutPosSendMessageService.cs
  74. 2 2
      AppStart/Helper/WeChatPayBackService.cs
  75. 79 0
      AppStart/LogHelper.cs
  76. 4 4
      AppStart/Timer/RedPackageHelper.cs
  77. 5 5
      AppStart/Timer/RedPackageV2Helper.cs
  78. 6 6
      AppStart/Timer/ResetSmallStoreHelper.cs
  79. 1 1
      AppStart/Timer/SetDespositHelper.cs
  80. 6 6
      AppStart/Timer/StoreApplyHelper.cs
  81. 3 3
      AppStart/Timer/TestHelper.cs
  82. 1 1
      AppStart/Timer/TradeStatTimer.cs
  83. 1 1
      AppStart/Timer/TradeStatTimer2.cs
  84. 15 15
      AppStart/WeChatFunction.cs
  85. 4 4
      AppStart/WeChatFunctionForHD.cs
  86. 1 1
      Areas/Api/Controllers/v1/PublicMethodController.cs
  87. 1 1
      Controllers/HomeController.cs

+ 8 - 8
AppStart/Alipay/AliIotFunction.cs

@@ -36,7 +36,7 @@ namespace MySystem
             "  \"device_id\":\"" + DeviceId + "\"," +
             "  \"supplier_id\":\"202208101504455785\"" +
             "}";
-            function.WriteLog(request.BizContent, "间连iot设备和间连商户绑定");
+            LogHelper.Instance.WriteLog(request.BizContent, "间连iot设备和间连商户绑定");
 
             string result = "";
             try
@@ -46,7 +46,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "间连iot设备和间连商户绑定异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "间连iot设备和间连商户绑定异常");
                 result = "";
             }
             return result;
@@ -65,7 +65,7 @@ namespace MySystem
             "  \"device_id\":\"" + DeviceId + "\"," +
             "  \"supplier_id\":\"202208101504455785\"" +
             "}";
-            function.WriteLog(request.BizContent, "间连iot设备和间连商户解绑");
+            LogHelper.Instance.WriteLog(request.BizContent, "间连iot设备和间连商户解绑");
 
             string result = "";
             try
@@ -75,7 +75,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "间连iot设备和间连商户解绑异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "间连iot设备和间连商户解绑异常");
                 result = "";
             }
             return result;
@@ -92,7 +92,7 @@ namespace MySystem
             "  \"sn\":\"" + Sn + "\"," +
             "  \"supplier_id\":\"202208101504455785\"" +
             "}";
-            function.WriteLog(request.BizContent, "查询设备基础信息");
+            LogHelper.Instance.WriteLog(request.BizContent, "查询设备基础信息");
 
             string result = "";
             try
@@ -102,7 +102,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "查询设备基础信息异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "查询设备基础信息异常");
                 result = "";
             }
             return result;
@@ -123,7 +123,7 @@ namespace MySystem
             "  \"amount\":\"" + Amount + "\"" +
             // "  \"msg_id\":\"202108020001101043\"" +
             "}";
-            function.WriteLog(request.BizContent, "到账播报");
+            LogHelper.Instance.WriteLog(request.BizContent, "到账播报");
 
             string result = "";
             try
@@ -133,7 +133,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "到账播报异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "到账播报异常");
                 result = "";
             }
             return result;

+ 22 - 21
AppStart/Alipay/AlipayFunction.cs

@@ -46,12 +46,12 @@ namespace MySystem
             {
                 AlipayOpenAgentCreateResponse response = client.Execute(request);
                 result = response.Body;
-                function.WriteLog(result, "开启事务");
+                LogHelper.Instance.WriteLog(result, "开启事务");
                 //{"alipay_open_agent_create_response":{"code":"10000","msg":"Success","batch_no":"2022021011321326200059849","batch_status":"init"},"sign":"su+weyK1CZEXES8mdckalg16J4BELTQeVNJSpXVYg3nh5g3E7jDh/mQctkjH8HbM0RybQSahZ2j60aUTossPMXqdq2nPRkR4c/kM34toFFNU/2p7jqo9k/MbB1JotW+qFI+C/GCX/9mZQqm2tSQdYIiZlCsEtP13ZP2EQ6momEZrApyLQYUl1H54PojJgqo6zGKDXTnXuZcpi/VPP5YoWhYMx8WPFMS6+T3zr+LNPDOI94j5vDdUHQdjFAGiQMyyhfNOBcFFi18bAfWhPqlLWwblCZamTHN/QaOHo+fkBZeo9uKqrnSHPn8XW0tDAIf1qNUfY2eBzYZUIqWKbz509A=="}
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "接口创建应用事务异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "接口创建应用事务异常");
                 result = "";
             }
             return result;
@@ -67,14 +67,14 @@ namespace MySystem
             string result = "";
             try
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + Newtonsoft.Json.JsonConvert.SerializeObject(request), "提交代商户签约");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + Newtonsoft.Json.JsonConvert.SerializeObject(request), "提交代商户签约");
                 AlipayOpenAgentConfirmResponse response = client.Execute(request);
                 result = response.Body;
-                function.WriteLog(result + "\n\n", "提交代商户签约");
+                LogHelper.Instance.WriteLog(result + "\n\n", "提交代商户签约");
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "提交代商户签约异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "提交代商户签约异常");
                 result = "";
             }
             return result;
@@ -137,12 +137,12 @@ namespace MySystem
         //     {
         //         AlipayOpenAgentCommonSignResponse response = client.Execute(request);
         //         result = response.Body;
-        //         function.WriteLog(result, "代商家发起签约产品申请");
+        //         LogHelper.Instance.WriteLog(result, "代商家发起签约产品申请");
         //         //{"alipay_open_agent_common_sign_response":{"code":"10000","msg":"Success"},"sign":"qt0DiXFXIJ7mX+W2+IX+cyYXx8ROGe8yxesXHGNltxpEv/s/zW16xzf4HQLtUlaAiWf3DiD2QV7Hj+REyoZw9AcktDAmlobcjQ28lTYufPECZoUJHpkn9VpGB932FC0hScVwCbsxQakH84MGT4cmjr1hCuSs7+XogdhlCTIKjau1e7ZglLnt7f1NqT8JnljVhmvkkE9gJTLq5H+Zq6XbFfBVptvM9w09HdjfhrsxAXJyQ4yU6JYX2tUYsRGz8ZrveDQMvXKTN9jnwKE9hh8ik6Sq49eUqfutV9GkKqhC96+Vy3nOTOTnPoECXZkco1wP5jsqHottWVsRV+NxdylnTw=="}
         //     }
         //     catch (Exception ex)
         //     {
-        //         function.WriteLog(ex.ToString(), "代签约产品通用接口异常");
+        //         LogHelper.Instance.WriteLog(ex.ToString(), "代签约产品通用接口异常");
         //         result = "";
         //     }
         //     return result;
@@ -216,14 +216,14 @@ namespace MySystem
             string result = "";
             try
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + Newtonsoft.Json.JsonConvert.SerializeObject(request), "代商家发起签约产品申请");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + Newtonsoft.Json.JsonConvert.SerializeObject(request), "代商家发起签约产品申请");
                 AlipayOpenAgentFacetofaceSignResponse response = client.Execute(request);
                 result = response.Body;
-                function.WriteLog(result, "代商家发起签约产品申请");
+                LogHelper.Instance.WriteLog(result, "代商家发起签约产品申请");
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "代签约产品通用接口异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "代签约产品通用接口异常");
                 result = "";
             }
             return result;
@@ -241,12 +241,12 @@ namespace MySystem
             {
                 AlipayOpenAgentCommonsignConfirmResponse response = client.Execute(request);
                 result = response.Body;
-                function.WriteLog(result, "提交信息确认");
+                LogHelper.Instance.WriteLog(result, "提交信息确认");
                 //{"alipay_open_agent_order_query_response":{"code":"10000","msg":"Success","order_no":"20220210034000100000015895929361","product_agent_status_infos":[{"product_code":"QUICK_WAP_WAY","product_name":"手机网站支付","status":"WAIT_CONFIRM"}],"order_status":"MERCHANT_CONFIRM","confirm_url":"https:\/\/openhome.alipay.com\/isv\/settling\/confirm.htm?orderNo=20220210034000100000015895929361","merchant_pid":"2088012934025363"},"sign":"mgdhauHMV9352S3FVrQmesXvHOrk633FX/EOXRYdc2ix5phCBZJ2KZRRP9MWJ566YEtWbnQlAJzHVS9X29hjgiJWOQ/wCidql4AoSAYYeqPtxiqKAZw/QEM/du5AdbWC0xBmmkQljXF9Hx8cm+IrOyPMSJXIw4Tqpm/T96YBwhsjw4Xr5dcUcvF6HX9h/i5FSdIJODxQ26PJcqQ98GQ3Y50YhTpPQkIPDFVE2QzcL6dvuhBOpwu5KbTxvgzS8Wtm3G6nMbzJ33Cv/I2lhTCIMHz90c9bvyjJpWxPWBzywO2zzv7+EZCbDkZGkdRic9l5s6qac+ZVMHkPbveaZ2wyig=="}
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "接口创建应用事务异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "接口创建应用事务异常");
                 result = "";
             }
             return result;
@@ -267,11 +267,11 @@ namespace MySystem
             {
                 AlipayOpenAgentOrderQueryResponse response = client.Execute(request);
                 result = response.Body;
-                function.WriteLog(result, "查询签约申请的结果");
+                LogHelper.Instance.WriteLog(result, "查询签约申请的结果");
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "查询签约申请的结果异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "查询签约申请的结果异常");
                 result = "";
             }
             return result;
@@ -298,7 +298,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "支付宝统一收单交易创建(获取authtoken)异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "支付宝统一收单交易创建(获取authtoken)异常");
                 result = "";
             }
             return result;
@@ -324,7 +324,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "支付宝统一收单交易创建异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "支付宝统一收单交易创建异常");
                 result = "";
             }
             return result;
@@ -345,7 +345,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "统一收单线下交易查询异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "统一收单线下交易查询异常");
                 result = "";
             }
             return result;
@@ -380,7 +380,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "退款异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "退款异常");
                 result = "";
             }
             return result;
@@ -419,7 +419,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "分账异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "分账异常");
                 result = "";
             }
             return result;
@@ -453,7 +453,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "绑定分账关系异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "绑定分账关系异常");
                 result = "";
             }
             return result;
@@ -475,10 +475,11 @@ namespace MySystem
             {
                 AlipayTradeOrderSettleQueryResponse response = client.Execute(request, null, MerToken);
                 result = response.Body;
+                LogHelper.Instance.WriteLog(request.BizContent + "\n" + result, "支付宝查询分账结果");
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "分账异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "分账异常");
                 result = "";
             }
             return result;

+ 4 - 4
AppStart/Alipay/AlipayFunctionForHD.cs

@@ -112,7 +112,7 @@ namespace MySystem
             "  }" +
             "}";
             request.BizContent = BizContent;
-            function.WriteLog(BizContent, "商家认证申请单提交异常");
+            LogHelper.Instance.WriteLog(BizContent, "商家认证申请单提交异常");
 
             string result = "";
             try
@@ -122,7 +122,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "商家认证申请单提交异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "商家认证申请单提交异常");
                 result = "";
             }
             return result;
@@ -138,7 +138,7 @@ namespace MySystem
             request.BizContent = "{" +
             "  \"order_no\":\"" + OrderNo + "\"" +
             "}";
-            function.WriteLog(request.BizContent, "查询商家认证申请单状态");
+            LogHelper.Instance.WriteLog(request.BizContent, "查询商家认证申请单状态");
 
             string result = "";
             try
@@ -148,7 +148,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(ex.ToString(), "查询商家认证申请单状态异常");
+                LogHelper.Instance.WriteLog(ex.ToString(), "查询商家认证申请单状态异常");
                 result = "";
             }
             return result;

+ 1 - 1
AppStart/GlobalExceptions.cs

@@ -10,7 +10,7 @@ namespace MySystem
         {
             string Message = context.Exception.Message;
             string StackTrace = context.Exception.StackTrace;
-            function.WriteLog(DateTime.Now.ToString() + "\r\n" + Message + "\r\n" + StackTrace, "Global全局异常处理日志");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + Message + "\r\n" + StackTrace, "Global全局异常处理日志");
         }
     }
 }

+ 2 - 2
AppStart/HaoDa/HaoDaExtHelper.cs

@@ -65,7 +65,7 @@ public class HaoDaExtHelper
         }
         catch(Exception ex)
         {
-            function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "微信开户意愿申请异常");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "微信开户意愿申请异常");
         }
     }
 
@@ -119,7 +119,7 @@ public class HaoDaExtHelper
         }
         catch(Exception ex)
         {
-            function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "支付宝开户意愿申请异常");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "支付宝开户意愿申请异常");
         }
     }
 }

+ 2 - 2
AppStart/HaoDa/HaoDaExtQueryHelper.cs

@@ -73,7 +73,7 @@ public class HaoDaExtQueryHelper
         }
         catch(Exception ex)
         {
-            function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "微信开户意愿申请异常");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "微信开户意愿申请异常");
         }
     }
 
@@ -148,7 +148,7 @@ public class HaoDaExtQueryHelper
         }
         catch(Exception ex)
         {
-            function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "支付宝开户意愿申请异常");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "支付宝开户意愿申请异常");
         }
     }
 }

+ 3 - 3
AppStart/Helper/AlipayPayBackService.cs

@@ -35,7 +35,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝回调异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝回调异常");
                     }
                 }
                 else
@@ -118,7 +118,7 @@ namespace MySystem
                                 if(merchantAdd.Sort == 0)
                                 {
                                     string content = AlipayFunction.Instance.BindSettleRelation(DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), AlipayFunction.Instance.Pid, merchantAdd.AlipayAuthToken);
-                                    function.WriteLog(DateTime.Now.ToString() + "\n" + content, "支付宝添加分账方");
+                                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content, "支付宝添加分账方");
                                     merchantAdd.Sort = 1;
                                     db.SaveChanges();
                                 }
@@ -156,7 +156,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝分账队列异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝分账队列异常");
                 }
                 Thread.Sleep(2000);
             }

+ 1 - 1
AppStart/Helper/AlipayShareService.cs

@@ -70,7 +70,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝查询分账异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝查询分账异常");
             }
         }
     }

+ 2 - 2
AppStart/Helper/AutoOpOrderService.cs

@@ -36,7 +36,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "定时取消未支付订单异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "定时取消未支付订单异常");
                 }
             }
         }
@@ -64,7 +64,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "定时自动确认收货异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "定时自动确认收货异常");
                 }
             }
         }

+ 1 - 1
AppStart/Helper/BalancePayBackService.cs

@@ -40,7 +40,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "商城订单余额支付异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "商城订单余额支付异常");
                     Thread.Sleep(2000);
                 }
             }

+ 1 - 1
AppStart/Helper/CheckAlipaySignService.cs

@@ -175,7 +175,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝签约审核队列异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "支付宝签约审核队列异常");
             }
             return "";
         }

+ 1 - 1
AppStart/Helper/CheckWeChatSignService.cs

@@ -127,7 +127,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "微信进件回调队列异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "微信进件回调队列异常");
             }
             return "";
         }

+ 1 - 1
AppStart/Helper/ConsumerOrdersReturnDoService.cs

@@ -76,7 +76,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "退款返现队列异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "退款返现队列异常");
                     }
                 }
                 db.Dispose();

+ 2 - 2
AppStart/Helper/ConsumerOrdersReturnStatService.cs

@@ -31,11 +31,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");
                 }
             }
         }

+ 3 - 3
AppStart/Helper/ConsumerOrdersStatService.cs

@@ -31,11 +31,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");
                 }
             }
         }
@@ -167,7 +167,7 @@ namespace MySystem
                         catch (Exception ex)
                         {
                             tran.Rollback();
-                            function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
+                            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
                         }
                     }
                     db.Dispose();

+ 1 - 1
AppStart/Helper/DelMySql/DeleteMySqlDataService.cs

@@ -29,7 +29,7 @@ namespace MySystem
                 ErrorMsg msg = new ErrorMsg();
                 msg.Time = DateTime.Now;
                 msg.ErrorContent = ex.ToString();
-                function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:MerchantInfo:Error");
+                LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:MerchantInfo:Error");
             }
             db.Dispose();
         }

+ 1 - 1
AppStart/Helper/DepositReturnService.cs

@@ -46,7 +46,7 @@ namespace MySystem
                 }
                 catch(Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "退还押金到支付宝余额异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "退还押金到支付宝余额异常");
                     Thread.Sleep(600000);
                 }
             }

+ 1 - 1
AppStart/Helper/DepositReturnStatService.cs

@@ -35,7 +35,7 @@ namespace MySystem
                     }
                     catch(Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计押金达标数据异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计押金达标数据异常");
                     }
                 }
                 Thread.Sleep(60000);

+ 1 - 1
AppStart/Helper/LeaderApplyCouponsHelper.cs

@@ -98,7 +98,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "盟主兑换机具券异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "盟主兑换机具券异常");
                     }
                 }
                 else

+ 1 - 1
AppStart/Helper/LeaderPrizeService.cs

@@ -76,7 +76,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(), "大盟主奖励异常");
                     }
                     Thread.Sleep(100);
                 }

+ 1 - 1
AppStart/Helper/MakeReferenceQrCodeService.cs

@@ -68,7 +68,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
             }
         }
         public string MergeQrCode(Users user, int pid = 0)

+ 1 - 1
AppStart/Helper/MerchantConfirmService.cs

@@ -42,7 +42,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
                     }
                 }
                 else

+ 2 - 2
AppStart/Helper/MerchantTypeSetService.cs

@@ -31,11 +31,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");
                 }
             }
         }

+ 1 - 1
AppStart/Helper/MessageCenterService.cs

@@ -40,7 +40,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

+ 2 - 2
AppStart/Helper/Operate/OperateAmountService.cs

@@ -32,7 +32,7 @@ namespace MySystem
                     try
                     {
                         WebCMSEntities db = new WebCMSEntities();
-                        function.WriteLog(DateTime.Now.ToString() + "\r\n" + data + "\r\n\r\n", "运营中心返额度日志");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + data + "\r\n\r\n", "运营中心返额度日志");
                         JsonData jsonObj = JsonMapper.ToObject(data);
                         int UserId = int.Parse(function.CheckInt(jsonObj["UserId"].ToString())); //运营中心所属人创客Id
                         int DataId = int.Parse(function.CheckInt(jsonObj["DataId"].ToString())); //机具Id或机具券Id
@@ -70,7 +70,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

+ 1 - 1
AppStart/Helper/Operate/OperateStockService.cs

@@ -39,7 +39,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(), "运营中心返额度异常");
                 }
                 Thread.Sleep(600000);
             }

+ 1 - 1
AppStart/Helper/OperatePrizeService.cs

@@ -100,7 +100,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(), "运营中心奖励异常");
                     }
                     Thread.Sleep(100);
                 }

+ 1 - 1
AppStart/Helper/OperateService.cs

@@ -71,7 +71,7 @@
 //                     }
 //                     catch (Exception ex)
 //                     {
-//                         function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "运营中心重置本月发货量异常");
+//                         LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "运营中心重置本月发货量异常");
 //                     }
 //                 }
 //                 Thread.Sleep(800000);

+ 3 - 3
AppStart/Helper/Profit/ActiveService.cs

@@ -30,11 +30,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), "activeback_err");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "activeback_err");
                 }
                 else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "activeback_service");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "activeback_service");
                 }
             }
         }
@@ -111,7 +111,7 @@ namespace MySystem
                         Time = DateTime.Now,
                         ErrorContent = ex.ToString(),
                     };
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "ActiveServiceError");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "ActiveServiceError");
                 }
             }
             db.Dispose();

+ 3 - 3
AppStart/Helper/Profit/DiviService.cs

@@ -30,11 +30,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), "diviback_err");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "diviback_err");
                 }
                 else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "diviback_service");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "diviback_service");
                 }
             }
         }
@@ -120,7 +120,7 @@ namespace MySystem
                         Time = DateTime.Now,
                         ErrorContent = ex.ToString(),
                     };
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "DiviServiceError");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "DiviServiceError");
                 }
             }
             db.Dispose();

+ 3 - 3
AppStart/Helper/Profit/FluxService.cs

@@ -30,11 +30,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), "fluxback_err");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "fluxback_err");
                 }
                 else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "fluxback_service");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "fluxback_service");
                 }
             }
         }
@@ -154,7 +154,7 @@ namespace MySystem
                         Time = DateTime.Now,
                         ErrorContent = ex.ToString(),
                     };
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "ProfitServiceError");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "ProfitServiceError");
                 }
             }
             db.Dispose();

+ 8 - 8
AppStart/Helper/Profit/HelpProfitHelper.cs

@@ -51,8 +51,8 @@ namespace MySystem
         //         List<HelpProfitMerTradeSummay> list = db.HelpProfitMerTradeSummay.Where(m => m.Id > StartId && m.TradeMonth == Month).OrderBy(m => m.Id).Take(50).ToList();
         //         if(list.Count > 0)
         //         {
-        //             function.WriteLog("开始:" + DateTime.Now.ToString(), "助利宝分润日志");
-        //             function.WriteLog("总数:" + list.Count(), "助利宝分润日志");
+        //             LogHelper.Instance.WriteLog("开始:" + DateTime.Now.ToString(), "助利宝分润日志");
+        //             LogHelper.Instance.WriteLog("总数:" + list.Count(), "助利宝分润日志");
         //             int index = 0;
         //             foreach(HelpProfitMerTradeSummay sub in list)
         //             {
@@ -99,7 +99,7 @@ namespace MySystem
         //                         }
         //                     }
         //                 }
-        //                 function.WriteLog(index + "--Id:" + sub.Id + ";MerchantId:" + sub.MerchantId + ";" + DateTime.Now.ToString(), "助利宝分润日志");
+        //                 LogHelper.Instance.WriteLog(index + "--Id:" + sub.Id + ";MerchantId:" + sub.MerchantId + ";" + DateTime.Now.ToString(), "助利宝分润日志");
         //             }
         //         }
         //         else
@@ -108,7 +108,7 @@ namespace MySystem
         //         }
         //     }
         //     db.Dispose();
-        //     function.WriteLog("结束:" + DateTime.Now.ToString(), "助利宝分润日志");
+        //     LogHelper.Instance.WriteLog("结束:" + DateTime.Now.ToString(), "助利宝分润日志");
         // }
 
         // private void AddProfitRecord(WebCMSEntities db, Users puser, PosMachinesTwo pos, PosMerchantInfo merchant, decimal TradeAmount, decimal Prize, string TradeDate, int RewardType)
@@ -173,8 +173,8 @@ namespace MySystem
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             var orders = db.Orders.Select(m => new { m.UserId, m.Status, m.ProductId }).Where(m => m.Status > 0 && m.ProductId == 34).ToList();
             DataTable list = OtherMySqlConn.dtable("select UserId,sum(TradeAmount) from HelpProfitMerchantForUser u,HelpProfitMerTradeSummay s where u.MerchantId=s.MerchantId and TradeMonth='" + Month + "' group by UserId");
-            function.WriteLog("开始:" + DateTime.Now.ToString(), "助利宝分润日志");
-            function.WriteLog("总数:" + list.Rows.Count, "助利宝分润日志");
+            LogHelper.Instance.WriteLog("开始:" + DateTime.Now.ToString(), "助利宝分润日志");
+            LogHelper.Instance.WriteLog("总数:" + list.Rows.Count, "助利宝分润日志");
             int index = 0;
             foreach (DataRow sub in list.Rows)
             {
@@ -212,10 +212,10 @@ namespace MySystem
                         ParentUserId = 0;
                     }
                 }
-                function.WriteLog(index + "--UserId:" + UserId + ";TradeAmount:" + TradeAmount + ";" + DateTime.Now.ToString(), "助利宝分润日志");
+                LogHelper.Instance.WriteLog(index + "--UserId:" + UserId + ";TradeAmount:" + TradeAmount + ";" + DateTime.Now.ToString(), "助利宝分润日志");
             }
             db.Dispose();
-            function.WriteLog("结束:" + DateTime.Now.ToString(), "助利宝分润日志");
+            LogHelper.Instance.WriteLog("结束:" + DateTime.Now.ToString(), "助利宝分润日志");
         }
 
         private void AddProfitRecord(WebCMSEntities db, Users puser, decimal TradeAmount, decimal Prize, string TradeMonth, int RewardType)

+ 3 - 3
AppStart/Helper/Profit/OpenService.cs

@@ -30,11 +30,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), "openback_err");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "openback_err");
                 }
                 else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "openback_service");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "openback_service");
                 }
             }
         }
@@ -111,7 +111,7 @@ namespace MySystem
                         Time = DateTime.Now,
                         ErrorContent = ex.ToString(),
                     };
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "StandardServiceError");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "StandardServiceError");
                 }
             }
             db.Dispose();

+ 12 - 12
AppStart/Helper/Profit/ProfitCheckHelper.cs

@@ -18,19 +18,19 @@ namespace MySystem
         {
             try
             {
-                function.WriteLog("导出分润:" + DateTime.Now.ToString(), "分润结果检查");
+                LogHelper.Instance.WriteLog("导出分润:" + DateTime.Now.ToString(), "分润结果检查");
                 ExportProfitData(); //导出分润
-                function.WriteLog("导出补贴:" + DateTime.Now.ToString(), "分润结果检查");
+                LogHelper.Instance.WriteLog("导出补贴:" + DateTime.Now.ToString(), "分润结果检查");
                 ExportSubsidyData(); //导出补贴
-                function.WriteLog("检查分润:" + DateTime.Now.ToString(), "分润结果检查");
+                LogHelper.Instance.WriteLog("检查分润:" + DateTime.Now.ToString(), "分润结果检查");
                 CheckProfit(); //检查分润
-                function.WriteLog("检查补贴:" + DateTime.Now.ToString(), "分润结果检查");
+                LogHelper.Instance.WriteLog("检查补贴:" + DateTime.Now.ToString(), "分润结果检查");
                 CheckSubsidy(); //检查补贴
-                function.WriteLog("结束:" + DateTime.Now.ToString(), "分润结果检查");
+                LogHelper.Instance.WriteLog("结束:" + DateTime.Now.ToString(), "分润结果检查");
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "分润结果检查异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "分润结果检查异常");
             }
         }
 
@@ -41,7 +41,7 @@ namespace MySystem
             string StartId = function.CheckInt(function.ReadInstance("/PublicParam/ProfitRewardRecordId/" + Month + ".txt"));
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             DataTable dt = OtherMySqlConn.dtable("select u.MakerCode,u.RealName,u.UserLevel,r.Rank,(case when ProfitType=1 then '直营' else '团队' end) as DirectFlag,k.Name,BrandId,CreditTradeAmt,CreditTradeProfit,QrCreditTradeAmt,QrCreditTradeProfit,NonQrCreditTradeAmt,NonQrCreditTradeProfit,HelpCreditTradeAmt,HelpCreditTradeProfit,NotHelpCreditTradeAmt,NotHelpCreditTradeProfit,ProfitCreditTradeAmt,ProfitCreditTradeProfit,DebitTradeAmt,DebitTradeProfit from (select UserId,ProfitType,BrandId,sum(CreditTradeAmt) as CreditTradeAmt,sum(CreditTradeProfit) as CreditTradeProfit,sum(QrCreditTradeAmt) as QrCreditTradeAmt,sum(QrCreditTradeProfit) as QrCreditTradeProfit,sum(NonQrCreditTradeAmt) as NonQrCreditTradeAmt,sum(NonQrCreditTradeProfit) as NonQrCreditTradeProfit,sum(HelpCreditTradeAmt) as HelpCreditTradeAmt,sum(HelpCreditTradeProfit) as HelpCreditTradeProfit,sum(NotHelpCreditTradeAmt) as NotHelpCreditTradeAmt,sum(NotHelpCreditTradeProfit) as NotHelpCreditTradeProfit,sum(ProfitCreditTradeAmt) as ProfitCreditTradeAmt,sum(ProfitCreditTradeProfit) as ProfitCreditTradeProfit,sum(DebitNonCapTradeAmt+DebitCapTradeAmt) as DebitTradeAmt,sum(DebitNonTradeCapProfit+DebitTradeCapProfit) as DebitTradeProfit from ProfitRewardRecord where Id>=" + StartId + " and TradeMonth='" + Month + "' GROUP BY UserId,ProfitType,BrandId) tb left join Users u on tb.UserId=u.Id LEFT JOIN KqProducts k ON k.Id=tb.BrandId left join UserRankWhite r on u.Id=r.Id and r.CreateDate<'" + DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00' and r.UpdateDate>'" + DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00' ORDER BY u.MakerCode");
-            function.WriteLog(DateTime.Now.ToString() + ":" + dt.Rows.Count, "分润结果检查");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + dt.Rows.Count, "分润结果检查");
             int index = 0;
             foreach(DataRow dr in dt.Rows)
             {
@@ -97,7 +97,7 @@ namespace MySystem
                 {
                     db.SaveChanges();
                 }
-                function.WriteLog(DateTime.Now.ToString() + ":" + index, "分润结果检查");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + index, "分润结果检查");
             }
             db.SaveChanges();
             db.Dispose();
@@ -110,7 +110,7 @@ namespace MySystem
             string StartId = function.CheckInt(function.ReadInstance("/PublicParam/ProfitSubsidyDetailId/" + Month + ".txt"));
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             DataTable dt = OtherMySqlConn.dtable("select u.MakerCode,u.RealName,u.UserLevel,r.Rank,m.KqSnNo,m.MerchantName,(case when SubsidyType=1 then '直营' else '团队' end) as DirectFlag,k.Name,tb.BrandId,CreditTradeAmt,SubsidyProfit from (select SubsidyUserId,MerchantId,BrandId,SubsidyType,sum(CreditTradeAmt) as CreditTradeAmt,sum(SubsidyProfitRate) as SubsidyProfit from ProfitSubsidyDetail where Id>=" + StartId + " and TradeMonth='" + Month + "' GROUP BY SubsidyUserId,MerchantId,BrandId,SubsidyType) tb left join Users u on tb.SubsidyUserId=u.Id LEFT JOIN KqProducts k ON k.Id=tb.BrandId left join PosMerchantInfo m on tb.MerchantId=m.Id left join UserRankWhite r on u.Id=r.Id and r.CreateDate<'" + DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00' and r.UpdateDate>'" + DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00'");
-            function.WriteLog(DateTime.Now.ToString() + ":" + dt.Rows.Count, "分润结果检查");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + dt.Rows.Count, "分润结果检查");
             int index = 0;
             foreach(DataRow dr in dt.Rows)
             {
@@ -146,7 +146,7 @@ namespace MySystem
                 {
                     db.SaveChanges();
                 }
-                function.WriteLog(DateTime.Now.ToString() + ":" + index, "分润结果检查");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + index, "分润结果检查");
             }
             db.SaveChanges();
             db.Dispose();
@@ -163,7 +163,7 @@ namespace MySystem
             {
                 List<int> ids = new List<int>();
                 List<ProfitRewardExport> list = db.ProfitRewardExport.Where(m => m.SeoTitle == Month && m.Id > StartId && m.Status == 0).OrderBy(m => m.MakerCode).ThenBy(m => m.DirectFlag).ThenBy(m => m.BrandName).ThenBy(m => m.Id).Take(50).ToList();
-                function.WriteLog(DateTime.Now.ToString() + ":" + list.Count, "分润结果检查");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + list.Count, "分润结果检查");
                 if(list.Count > 0)
                 {
                     int index = 0;
@@ -417,7 +417,7 @@ namespace MySystem
                             db.SaveChanges();
                         }
                         StartId = sub.Id;
-                        function.WriteLog(DateTime.Now.ToString() + "-" + index, "分润结果检查");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "-" + index, "分润结果检查");
                     }
                 }
                 else

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

@@ -110,7 +110,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "激活奖励服务异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "激活奖励服务异常");
             }
         }
         #endregion
@@ -219,9 +219,9 @@ namespace MySystem
                                     // List<ConsumerOrders> orders = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrders:Divi:" + PayMode + ":" + MerchantId);
                                     // foreach(ConsumerOrders sub in orders)
                                     // {
-                                    //     function.WriteLog(sub.Id.ToString(), "返现队列");
+                                    //     LogHelper.Instance.WriteLog(sub.Id.ToString(), "返现队列");
                                     // }
-                                    // function.WriteLog("\n\n", "返现队列");
+                                    // LogHelper.Instance.WriteLog("\n\n", "返现队列");
 
                                     // 减去自己付的订单
                                     // CurDiviPersons = CurDiviPersons - 1;
@@ -306,7 +306,7 @@ namespace MySystem
                                     // decimal MerchantGetMoney = PayMoney * GetPercent;
                                     // decimal DoMoney = DoCount * DiviMoney;
                                     // TotalActual = PayMoney * GetPercent + DoCount * DiviMoney + OtherMoney;
-                                    // function.WriteLog("返现金额:" + DiviMoney + ";返现人数:" + DiviPersons + ";返现商户:" + TotalActual + ";返现溢出:" + OtherMoney + ";商户应得金额:" + MerchantGetMoney + ";返现差额:" + DoMoney + ";", "消费者返现日志");
+                                    // LogHelper.Instance.WriteLog("返现金额:" + DiviMoney + ";返现人数:" + DiviPersons + ";返现商户:" + TotalActual + ";返现溢出:" + OtherMoney + ";商户应得金额:" + MerchantGetMoney + ";返现差额:" + DoMoney + ";", "消费者返现日志");
 
 
                                     //代理商分润
@@ -319,7 +319,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
                     tran.Rollback();
                 }
             }
@@ -443,7 +443,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 { 
-                    function.WriteLog(ex.ToString(), "分润异常");
+                    LogHelper.Instance.WriteLog(ex.ToString(), "分润异常");
                 }
             }
             dbnew.Dispose();
@@ -717,7 +717,7 @@ namespace MySystem
         #region 分润算法
         public List<ProfitResult> StartProft(decimal TotalAmount, int LevelKindId, List<ProfitUsers> users, bool IsActive = true)
         {
-            function.WriteLog("\n\nTotalAmount:" + TotalAmount + ";", "来客吧分润日志");
+            LogHelper.Instance.WriteLog("\n\nTotalAmount:" + TotalAmount + ";", "来客吧分润日志");
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             WebCMSEntities db = new WebCMSEntities();
             List<UserLevelSet> levels = db.UserLevelSet.ToList();
@@ -730,11 +730,11 @@ namespace MySystem
                 decimal diffLevelProfit = 0;  //等级级差
                 ProfitObjectLevels maxlevel = db.ProfitObjectLevels.FirstOrDefault(m => m.Id == 9) ?? new ProfitObjectLevels(); //获取最高等级参数
                 decimal maxPercent = IsActive ? maxlevel.DebitPercents : maxlevel.Percents;
-                function.WriteLog("maxPercent:" + maxPercent + ";", "来客吧分润日志");
+                LogHelper.Instance.WriteLog("maxPercent:" + maxPercent + ";", "来客吧分润日志");
                 decimal maxLevelProfit = TotalAmount * maxPercent;
-                function.WriteLog("maxLevelProfit:" + maxLevelProfit + ";", "来客吧分润日志");
+                LogHelper.Instance.WriteLog("maxLevelProfit:" + maxLevelProfit + ";", "来客吧分润日志");
                 maxLevelProfit = PublicFunction.NumberFormat(maxLevelProfit);
-                function.WriteLog("maxLevelProfit:" + maxLevelProfit + ";", "来客吧分润日志");
+                LogHelper.Instance.WriteLog("maxLevelProfit:" + maxLevelProfit + ";", "来客吧分润日志");
                 // decimal diffDiviProfit = 0; //分红级差
                 int curLevel = 0; //当前层级的会员等级
                 for (int curFloor = 1; curFloor <= users.Count; curFloor++)
@@ -759,12 +759,12 @@ namespace MySystem
                             decimal getLevelProfit = 0;  //等级分润
                             UserProfitSet profitSet = new UserProfitSet();
                             decimal profitPercent = IsActive ? objlevel.DebitPercents : objlevel.Percents;
-                            function.WriteLog("money:" + UserLevel + ":" + profitPercent + ";", "来客吧分润日志");
+                            LogHelper.Instance.WriteLog("money:" + UserLevel + ":" + profitPercent + ";", "来客吧分润日志");
                             if (profitPercent > 0)
                             {
                                 decimal profitTmp = TotalAmount * profitPercent;
                                 getLevelProfit += profitTmp;
-                                function.WriteLog("money:" + UserLevel + ":" + profitTmp + ";", "来客吧分润日志");
+                                LogHelper.Instance.WriteLog("money:" + UserLevel + ":" + profitTmp + ";", "来客吧分润日志");
                             }
                             decimal money = getLevelProfit;
                             getLevelProfit -= diffLevelProfit;
@@ -784,7 +784,7 @@ namespace MySystem
                                     AddOrSubRate = profitSet.AddOrSubRate,
                                     ProfitRateBase = profitSet.ProfitRateBase,
                                 });
-                                function.WriteLog("money:" + UserLevel + ":" + PublicFunction.NumberFormat(getLevelProfit) + ";", "来客吧分润日志");
+                                LogHelper.Instance.WriteLog("money:" + UserLevel + ":" + PublicFunction.NumberFormat(getLevelProfit) + ";", "来客吧分润日志");
                             }
                         }
                     }
@@ -1324,7 +1324,7 @@ namespace MySystem
                         }
                         catch (Exception ex)
                         {
-                            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
+                            LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
                             tran.Rollback();
                         }
                     }
@@ -1333,7 +1333,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
             }
         }
 
@@ -1520,7 +1520,7 @@ namespace MySystem
                 catch (Exception ex)
                 { 
                     tran.Rollback();
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "POS分润异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "POS分润异常");
                 }
             }
         }
@@ -1888,9 +1888,9 @@ namespace MySystem
             {
                 LimitString = " limit " + SkipNum + "," + PageSize;
             }
-            function.WriteLog(DateTime.Now.ToString(), "老规则分润日志");
-            function.WriteLog(BankCardType.ToString(), "老规则分润日志");
-            function.WriteLog(BrandId.ToString(), "老规则分润日志");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "老规则分润日志");
+            LogHelper.Instance.WriteLog(BankCardType.ToString(), "老规则分润日志");
+            LogHelper.Instance.WriteLog(BrandId.ToString(), "老规则分润日志");
             List<ProfitResult> result = new List<ProfitResult>();
             ProfitObjects obj = RedisDbconn.Instance.Get<ProfitObjects>("pobj" + BrandId);
             if (obj.Status == 1) //判断分润是否开启
@@ -1902,8 +1902,8 @@ namespace MySystem
                 {
                     dt = ProfitHelperV2.Instance.GetDataTable("select SnNo,UserId,QrPayFlag,MerHelpFlag,TradeAmount,Version from TradeRecord" + Month + " where MerHelpFlag=1 and Version=0 and BrandId=" + BrandId + LimitString);
                 }
-                function.WriteLog("记录页数:" + PageNum.ToString(), "老规则分润日志");
-                function.WriteLog("记录条数:" + dt.Rows.Count.ToString(), "老规则分润日志");
+                LogHelper.Instance.WriteLog("记录页数:" + PageNum.ToString(), "老规则分润日志");
+                LogHelper.Instance.WriteLog("记录条数:" + dt.Rows.Count.ToString(), "老规则分润日志");
                 foreach (DataRow dr in dt.Rows)
                 {
                     WebCMSEntities dbnew = new WebCMSEntities();
@@ -1912,15 +1912,15 @@ namespace MySystem
                         string SnNo = dr["SnNo"].ToString();
                         int UserId = int.Parse(dr["UserId"].ToString());
                         int HelpTime = int.Parse(dr["Version"].ToString()) == 1 ? 2 : int.Parse(dr["MerHelpFlag"].ToString());
-                        function.WriteLog("SnNo:" + SnNo, "老规则分润日志");
-                        function.WriteLog("UserId:" + UserId, "老规则分润日志");
-                        function.WriteLog("HelpTime:" + HelpTime, "老规则分润日志");
+                        LogHelper.Instance.WriteLog("SnNo:" + SnNo, "老规则分润日志");
+                        LogHelper.Instance.WriteLog("UserId:" + UserId, "老规则分润日志");
+                        LogHelper.Instance.WriteLog("HelpTime:" + HelpTime, "老规则分润日志");
                         MachineForSnNo forSnNo = dbnew.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
                         PosMachinesTwo pos = dbnew.PosMachinesTwo.FirstOrDefault(m => m.Id == forSnNo.SnId) ?? new PosMachinesTwo();
                         decimal Deposit = decimal.Parse(function.CheckNum(pos.SeoKeyword));
                         if (pos.BindingState == 1)
                         {
-                            function.WriteLog("BindingState:" + pos.BindingState, "老规则分润日志");
+                            LogHelper.Instance.WriteLog("BindingState:" + pos.BindingState, "老规则分润日志");
                             int QrPayFlag = int.Parse(dr["QrPayFlag"].ToString());
                             decimal TradeAmt = decimal.Parse(dr[4].ToString());
                             List<UserLevelSet> levels = dbnew.UserLevelSet.ToList();
@@ -1959,8 +1959,8 @@ namespace MySystem
                                         }
                                         if (UserLevel <= maxLevel && UserLevel > curLevel)
                                         {
-                                            function.WriteLog("UserLevel:" + UserLevel, "老规则分润日志");
-                                            function.WriteLog("curLevel:" + curLevel, "老规则分润日志");
+                                            LogHelper.Instance.WriteLog("UserLevel:" + UserLevel, "老规则分润日志");
+                                            LogHelper.Instance.WriteLog("curLevel:" + curLevel, "老规则分润日志");
                                             int LevelKindId = GetLevelKindId(BrandId, HelpTime, 1);
                                             ProfitObjectLevels objlevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + UserLevel); //获取当前等级参数
                                             if (objlevel != null)
@@ -1985,24 +1985,24 @@ namespace MySystem
                                                 // 分润补贴
                                                 if (HelpTime == 1 && level == 1)
                                                 {
-                                                    function.WriteLog("ok", "老规则分润日志");
+                                                    LogHelper.Instance.WriteLog("ok", "老规则分润日志");
                                                     int SubsidyUserId = pos.BuyUserId;
                                                     SubUser subuser = ProfitHelperV2.Instance.GetUser(SubsidyUserId, Month) ?? new SubUser();
                                                     int subUserLevel = subuser.PreUserLevel > subuser.UserLevel ? subuser.PreUserLevel : subuser.UserLevel;
-                                                    function.WriteLog("subUserLevel:" + subUserLevel, "老规则分润日志");
+                                                    LogHelper.Instance.WriteLog("subUserLevel:" + subUserLevel, "老规则分润日志");
                                                     if(subUserLevel < 5)
                                                     {
-                                                        function.WriteLog("sub:ok:", "老规则分润日志");
+                                                        LogHelper.Instance.WriteLog("sub:ok:", "老规则分润日志");
                                                         ProfitObjectLevels sublevel = RedisDbconn.Instance.Get<ProfitObjectLevels>("pobjlv" + LevelKindId + ":" + subUserLevel); //获取当前等级参数
                                                         if (sublevel != null)
                                                         {
                                                             decimal otherPercent = 0.001M - sublevel.Percents;
                                                             decimal otherMoney = TradeAmt * otherPercent;
-                                                            function.WriteLog("otherPercent:" + otherPercent, "老规则分润日志");
-                                                            function.WriteLog("otherMoney:" + otherMoney, "老规则分润日志");
+                                                            LogHelper.Instance.WriteLog("otherPercent:" + otherPercent, "老规则分润日志");
+                                                            LogHelper.Instance.WriteLog("otherMoney:" + otherMoney, "老规则分润日志");
                                                             if (otherMoney >= obj.MinProfitVal)
                                                             {
-                                                                function.WriteLog("finish:" + SnNo, "老规则分润日志");
+                                                                LogHelper.Instance.WriteLog("finish:" + SnNo, "老规则分润日志");
                                                                 result.Add(new ProfitResult()
                                                                 {
                                                                     UserId = subuser.Id,
@@ -2031,17 +2031,17 @@ namespace MySystem
                                 }
                             }
                         }
-                        function.WriteLog("\n\n", "老规则分润日志");
+                        LogHelper.Instance.WriteLog("\n\n", "老规则分润日志");
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计分润异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计分润异常");
                     }
                     dbnew.Dispose();
                 }
             }
-            function.WriteLog(DateTime.Now.ToString(), "老规则分润日志");
-            function.WriteLog("\r\n\r\n", "老规则分润日志");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "老规则分润日志");
+            LogHelper.Instance.WriteLog("\r\n\r\n", "老规则分润日志");
             return result;
         }
         #endregion

+ 18 - 18
AppStart/Helper/Profit/ProfitHelperV2.cs

@@ -68,10 +68,10 @@ namespace MySystem
                         bool op = true;
                         while(op)
                         {
-                            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + "BrandId:" + i + ",BankCardType:" + j + ",Month:" + Month + ",PageNum:" + PageNum, "分润监控日志");
+                            LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + "BrandId:" + i + ",BankCardType:" + j + ",Month:" + Month + ",PageNum:" + PageNum, "分润监控日志");
                             List<ProfitResult> result = StartProftForPosByDate(i, j, Month, PageNum);
-                            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + "result:" + result.Count, "分润监控日志");
-                            function.WriteLog("\r\n", "分润监控日志");
+                            LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + "result:" + result.Count, "分润监控日志");
+                            LogHelper.Instance.WriteLog("\r\n", "分润监控日志");
                             if(result.Count > 0)
                             {
                                 foreach (ProfitResult sub in result)
@@ -315,7 +315,7 @@ namespace MySystem
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "分润监控异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "分润监控异常");
             }
 
             ProfitHelper.Instance.StatProfit();
@@ -409,9 +409,9 @@ namespace MySystem
                 {
                     sqlstr = "select UserId,QrPayFlag,HelpDirectDebitTradeAmt,NotHelpDirectDebitTradeAmt,HelpDirectDebitCapTradeAmt,NotHelpDirectDebitCapTradeAmt,HelpDirectDebitCapNum,NotHelpDirectDebitCapNum,ProfitDirectDebitTradeAmt,ProfitDirectDebitCapTradeAmt,ProfitDirectDebitCapNum from DebitTradeDaySummary" + Month + " where BrandId=" + BrandId + LimitString;
                 }
-                function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + sqlstr, "分润监控日志");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + sqlstr, "分润监控日志");
                 DataTable dt = GetDataTable(sqlstr);
-                function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + dt.Rows.Count.ToString(), "分润监控日志");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + dt.Rows.Count.ToString(), "分润监控日志");
                 if(dt.Rows.Count > 0)
                 {
                     foreach (DataRow dr in dt.Rows)
@@ -426,7 +426,7 @@ namespace MySystem
                             int Days = int.Parse(RedisDbconn.Instance.Get<string>("pobjrule:" + BrandId + ":HelpPolicy:Days")); //天数
                             if (BankCardType == 0)
                             {
-                                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") + ":借记卡", "分润监控日志");
                                 decimal HelpDirectDebitTradeAmt = decimal.Parse(dr[2].ToString()); //借记卡扶持期交易额
                                 decimal NotHelpDirectDebitTradeAmt = decimal.Parse(dr[3].ToString()); //借记卡稳定期交易额
                                 decimal ProfitDirectDebitTradeAmt = decimal.Parse(dr[8].ToString()); //借记卡扶持期交易额
@@ -455,7 +455,7 @@ namespace MySystem
                             }
                             else
                             {
-                                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") + ":贷记卡", "分润监控日志");
                                 decimal HelpDirectTradeAmt = decimal.Parse(dr[2].ToString()); //贷记卡扶持期交易额
                                 decimal NotHelpDirectTradeAmt = decimal.Parse(dr[3].ToString()); //贷记卡稳定期交易额
                                 decimal ProfitDirectTradeAmt = decimal.Parse(dr[4].ToString()); //贷记卡盈利期期交易额
@@ -467,7 +467,7 @@ namespace MySystem
                                 {
                                     ParentNav = ",0,";
                                 }
-                                function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + ParentNav, "分润监控日志");
+                                LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":" + ParentNav, "分润监控日志");
                                 if (!string.IsNullOrEmpty(ParentNav))
                                 {
                                     ParentNav += "," + UserId + ",";
@@ -476,7 +476,7 @@ namespace MySystem
                                     int level = 0;
                                     DateTime now = DateTime.Now;
                                     DateTime ThisMonth = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01 00:00:00");
-                                    function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":扶持期:" + HelpDirectTradeAmt, "分润监控日志");
+                                    LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":扶持期:" + HelpDirectTradeAmt, "分润监控日志");
                                     if (HelpDirectTradeAmt > 0)
                                     {
                                         level = 0;
@@ -535,7 +535,7 @@ namespace MySystem
                                                             HelpFlag = 1,
                                                         });
                                                         curProfit += getLevelProfit;
-                                                        function.WriteLog(user.Id + "-" + UserLevel + "-" + HelpDirectTradeAmt + "-" + DirectFlag + "-扶持期分润:" + getLevelProfit, "分润监控日志");
+                                                        LogHelper.Instance.WriteLog(user.Id + "-" + UserLevel + "-" + HelpDirectTradeAmt + "-" + DirectFlag + "-扶持期分润:" + getLevelProfit, "分润监控日志");
                                                     }
                                                 }
                                             }
@@ -547,11 +547,11 @@ namespace MySystem
                                         if(curProfit > checkProfit)
                                         {
                                             decimal more = curProfit - checkProfit;
-                                            function.WriteLog("超标了:" + more, "分润监控日志");
+                                            LogHelper.Instance.WriteLog("超标了:" + more, "分润监控日志");
                                         }
                                     }
-                                    function.WriteLog("------------------------", "分润监控日志");
-                                    function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":稳定期:" + NotHelpDirectTradeAmt, "分润监控日志");
+                                    LogHelper.Instance.WriteLog("------------------------", "分润监控日志");
+                                    LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":稳定期:" + NotHelpDirectTradeAmt, "分润监控日志");
                                     if (NotHelpDirectTradeAmt > 0)
                                     {
                                         level = 0;
@@ -615,8 +615,8 @@ namespace MySystem
                                             }
                                         }
                                     }
-                                    function.WriteLog("------------------------", "分润监控日志");
-                                    function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":盈利期:" + ProfitDirectTradeAmt, "分润监控日志");
+                                    LogHelper.Instance.WriteLog("------------------------", "分润监控日志");
+                                    LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":盈利期:" + ProfitDirectTradeAmt, "分润监控日志");
                                     if (ProfitDirectTradeAmt > 0)
                                     {
                                         level = 0;
@@ -681,11 +681,11 @@ namespace MySystem
                                     }
                                 }
                             }
-                            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":over", "分润监控日志");
+                            LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + ":over", "分润监控日志");
                         }
                         catch (Exception ex)
                         {
-                            function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计分润异常");
+                            LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月统计分润异常");
                         }
                         dbnew.Dispose();
                     }

+ 3 - 3
AppStart/Helper/Profit/ProfitService.cs

@@ -30,11 +30,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), "profitback_err");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "profitback_err");
                 }
                 else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "profitback_service");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "profitback_service");
                 }
             }
         }
@@ -168,7 +168,7 @@ namespace MySystem
                         Time = DateTime.Now,
                         ErrorContent = ex.ToString(),
                     };
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "ProfitServiceError");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "ProfitServiceError");
                 }
             }
             db.Dispose();

+ 3 - 3
AppStart/Helper/Profit/StandardService.cs

@@ -30,11 +30,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), "standardback_err");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(data), "standardback_err");
                 }
                 else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "standardback_service");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "standardback_service");
                 }
             }
         }
@@ -118,7 +118,7 @@ namespace MySystem
                         Time = DateTime.Now,
                         ErrorContent = ex.ToString(),
                     };
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "StandardServiceError");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "StandardServiceError");
                 }
             }
             db.Dispose();

+ 1 - 1
AppStart/Helper/ProfitShareService.cs

@@ -70,7 +70,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "分账队列异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "分账队列异常");
             }
         }
     }

+ 2 - 2
AppStart/Helper/ReceiveProfitService.cs

@@ -35,11 +35,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");
                 }
             }
         }

+ 2 - 2
AppStart/Helper/ReceiveTaskService.cs

@@ -35,11 +35,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");
                 }
             }
         }

+ 1 - 1
AppStart/Helper/RecommendActStatService.cs

@@ -147,7 +147,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(), "推荐王数据统计异常");
                     }
                     Thread.Sleep(100);
                 }

+ 1 - 1
AppStart/Helper/ReservePayBackService.cs

@@ -40,7 +40,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "商城订单余额支付异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "商城订单余额支付异常");
                     Thread.Sleep(2000);
                 }
             }

+ 41 - 41
AppStart/Helper/SetDepositPostService.cs

@@ -328,7 +328,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
@@ -395,7 +395,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(), "开店宝费率异步获取结果异常");
                 }
                 Thread.Sleep(5000);
             }
@@ -441,14 +441,14 @@ namespace MySystem
             obj.Add("batchUpdateType", 2);
             obj.Add("rateDOs", rateDOs);
             string content = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
-            function.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
-            function.WriteLog(content, "设置金控机具费率");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "设置金控机具费率");
+            LogHelper.Instance.WriteLog(content, "设置金控机具费率");
             content = Encrypt(content);
             string signstr = Sign(content);
             headers.Add("X-Sign", signstr);
             string req = "{\"param\":\"" + content + "\"}";
             string result = function.PostWebRequest(reqUrl, req, headers, "application/json");
-            function.WriteLog(result, "设置金控机具费率");
+            LogHelper.Instance.WriteLog(result, "设置金控机具费率");
             return result;
         }
 
@@ -571,9 +571,9 @@ namespace MySystem
             string ret = string.Empty;
             try
             {
-                function.WriteLog(DateTime.Now.ToString(), "请求开店宝API日志");
-                function.WriteLog(postUrl, "请求开店宝API日志");
-                function.WriteLog(paramData, "请求开店宝API日志");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "请求开店宝API日志");
+                LogHelper.Instance.WriteLog(postUrl, "请求开店宝API日志");
+                LogHelper.Instance.WriteLog(paramData, "请求开店宝API日志");
                 byte[] postData = System.Text.Encoding.UTF8.GetBytes(paramData);
                 // 设置提交的相关参数 
                 System.Net.HttpWebRequest request = System.Net.WebRequest.Create(postUrl) as System.Net.HttpWebRequest;
@@ -604,7 +604,7 @@ namespace MySystem
                 srcString = reader.ReadToEnd();
                 ret = srcString;   //返回值赋值
                 reader.Close();
-                function.WriteLog(srcString, "请求开店宝API日志");
+                LogHelper.Instance.WriteLog(srcString, "请求开店宝API日志");
             }
             catch (System.Net.WebException ex)
             {
@@ -621,7 +621,7 @@ namespace MySystem
             catch (Exception ex)
             {
                 ret = "fail";
-                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求开店宝API异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求开店宝API异常");
             }
             return ret;
         }
@@ -714,8 +714,8 @@ namespace MySystem
 
         public string LSReqFunc(string apiPath, string data, int BrandId)
         {
-            function.WriteLog(DateTime.Now.ToString(), "设置乐刷机具费率");
-            function.WriteLog(data, "设置乐刷机具费率");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "设置乐刷机具费率");
+            LogHelper.Instance.WriteLog(data, "设置乐刷机具费率");
             string aeskey = function.MD5_16(Guid.NewGuid().ToString());
             string req = "{";
             if (BrandId == 4)
@@ -732,9 +732,9 @@ namespace MySystem
             req += "\"data\":\"" + LSAesEncrypt(data, aeskey) + "\",";
             req += "\"sign\":\"" + LSEncrypt(aeskey) + "\"";
             req += "}";
-            function.WriteLog(req, "设置乐刷机具费率");
+            LogHelper.Instance.WriteLog(req, "设置乐刷机具费率");
             string result = function.PostWebRequest(LSReqUrl + apiPath, req, "application/json");
-            function.WriteLog(result + "\n\n", "设置乐刷机具费率");
+            LogHelper.Instance.WriteLog(result + "\n\n", "设置乐刷机具费率");
             return result;
         }
 
@@ -775,11 +775,11 @@ namespace MySystem
             string signstr = LiSSign(content);
             dic.Add("signData", signstr);
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(dic);
-            function.WriteLog(DateTime.Now.ToString(), "设置立刷费率");
-            function.WriteLog(req, "设置立刷费率");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "设置立刷费率");
+            LogHelper.Instance.WriteLog(req, "设置立刷费率");
             string result = PostWebRequest(LiSReqUrl + "FEE003", req, new Dictionary<string, string>());
-            function.WriteLog(result, "设置立刷费率");
-            function.WriteLog("\n\n", "设置立刷费率");
+            LogHelper.Instance.WriteLog(result, "设置立刷费率");
+            LogHelper.Instance.WriteLog("\n\n", "设置立刷费率");
             return result;
         }
 
@@ -803,9 +803,9 @@ namespace MySystem
             string ret = string.Empty;
             try
             {
-                function.WriteLog(DateTime.Now.ToString(), "请求立刷API日志");
-                function.WriteLog(postUrl, "请求立刷API日志");
-                function.WriteLog(paramData, "请求立刷API日志");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "请求立刷API日志");
+                LogHelper.Instance.WriteLog(postUrl, "请求立刷API日志");
+                LogHelper.Instance.WriteLog(paramData, "请求立刷API日志");
                 byte[] postData = System.Text.Encoding.UTF8.GetBytes(paramData);
                 // 设置提交的相关参数 
                 System.Net.HttpWebRequest request = System.Net.WebRequest.Create(postUrl) as System.Net.HttpWebRequest;
@@ -836,12 +836,12 @@ namespace MySystem
                 srcString = reader.ReadToEnd();
                 ret = srcString;   //返回值赋值
                 reader.Close();
-                function.WriteLog(srcString, "请求立刷API日志");
+                LogHelper.Instance.WriteLog(srcString, "请求立刷API日志");
             }
             catch (Exception ex)
             {
                 ret = "fail";
-                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求立刷API异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求立刷API异常");
             }
             return ret;
         }
@@ -907,9 +907,9 @@ namespace MySystem
             }
             signString = signString.TrimEnd('&');
             req.Add("mac", SftEncrypt(signString));
-            function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(req), "设置盛付通机具费率");
+            LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(req), "设置盛付通机具费率");
             string result = function.PostWebRequest(SftReqUrl + "batchChangeMerchantFee", Newtonsoft.Json.JsonConvert.SerializeObject(req), "application/json");
-            function.WriteLog(result + "\n\n", "设置盛付通机具费率");
+            LogHelper.Instance.WriteLog(result + "\n\n", "设置盛付通机具费率");
             return result;
         }
 
@@ -996,8 +996,8 @@ namespace MySystem
 
         public string HKReqFunc(string apiPath, string data, int BrandId)
         {
-            function.WriteLog(DateTime.Now.ToString(), "设置海科机具费率");
-            function.WriteLog(data, "设置海科机具费率");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "设置海科机具费率");
+            LogHelper.Instance.WriteLog(data, "设置海科机具费率");
             string aeskey = function.MD5_16(Guid.NewGuid().ToString());
             string req = "{";
             if (BrandId == 8)
@@ -1014,9 +1014,9 @@ namespace MySystem
             req += "\"data\":\"" + HKAesEncrypt(data, aeskey) + "\",";
             req += "\"sign\":\"" + HKEncrypt(aeskey, BrandId) + "\"";
             req += "}";
-            function.WriteLog(req, "设置海科机具费率");
+            LogHelper.Instance.WriteLog(req, "设置海科机具费率");
             string result = function.PostWebRequest(HKReqUrl + apiPath, req, "application/json");
-            function.WriteLog(result + "\n\n", "设置海科机具费率");
+            LogHelper.Instance.WriteLog(result + "\n\n", "设置海科机具费率");
             return result;
         }
 
@@ -1064,8 +1064,8 @@ namespace MySystem
 
         public string LDServiceFee(string SnList, int ServiceFee, int BrandId)
         {
-            function.WriteLog(DateTime.Now.ToString(), "设置联动机具服务费");
-            function.WriteLog(SnList, "设置联动机具服务费");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "设置联动机具服务费");
+            LogHelper.Instance.WriteLog(SnList, "设置联动机具服务费");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             string RequestId = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
             string TerminalModeName = BrandId == 10 ? "DZA" : "DZDA";
@@ -1077,22 +1077,22 @@ namespace MySystem
             reqdic.Add("terminalModeName", TerminalModeName); //终端模式名
             reqdic.Add("fwfRate", ServiceFee); //服务费
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
-            function.WriteLog(req, "设置联动机具服务费");
+            LogHelper.Instance.WriteLog(req, "设置联动机具服务费");
             req = LDEncrypt(req);
-            function.WriteLog(req, "设置联动机具服务费");
+            LogHelper.Instance.WriteLog(req, "设置联动机具服务费");
             Dictionary<string, object> datadic = new Dictionary<string, object>();
             datadic.Add("encryptedData", req);
             string data = Newtonsoft.Json.JsonConvert.SerializeObject(datadic);
-            function.WriteLog("请求地址:" + LDRequestUrl + "terminalSelfDistribute", "设置联动机具服务费");
+            LogHelper.Instance.WriteLog("请求地址:" + LDRequestUrl + "terminalSelfDistribute", "设置联动机具服务费");
             string result = function.PostWebRequest(LDRequestUrl + "terminalSelfDistribute", data, "application/json");
-            function.WriteLog(result + "\n\n", "设置联动机具服务费");
+            LogHelper.Instance.WriteLog(result + "\n\n", "设置联动机具服务费");
             return result;
         }
 
         public string LDFeeRate(string MerNo, string Fee, int BrandId)
         {
-            function.WriteLog(DateTime.Now.ToString(), "设置联动机具费率");
-            function.WriteLog(MerNo, "设置联动机具费率");
+            LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "设置联动机具费率");
+            LogHelper.Instance.WriteLog(MerNo, "设置联动机具费率");
             Dictionary<string, object> reqdic = new Dictionary<string, object>();
             string RequestId = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
             string MercModel = BrandId == 10 ? "DZA" : "DZDA";
@@ -1106,15 +1106,15 @@ namespace MySystem
             reqdic.Add("mercId", MerNo); // 商户编号
             reqdic.Add("cardType", "01"); // 01 贷记卡 02 扫码
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
-            function.WriteLog(req, "设置联动机具费率");
+            LogHelper.Instance.WriteLog(req, "设置联动机具费率");
             req = LDEncrypt(req);
-            function.WriteLog(req, "设置联动机具费率");
+            LogHelper.Instance.WriteLog(req, "设置联动机具费率");
             Dictionary<string, object> datadic = new Dictionary<string, object>();
             datadic.Add("encryptedData", req);
             string data = Newtonsoft.Json.JsonConvert.SerializeObject(datadic);
-            function.WriteLog("请求地址:" + LDRequestUrl + "updateMercRate", "设置联动机具费率");
+            LogHelper.Instance.WriteLog("请求地址:" + LDRequestUrl + "updateMercRate", "设置联动机具费率");
             string result = function.PostWebRequest(LDRequestUrl + "updateMercRate", data, "application/json");
-            function.WriteLog(result + "\n\n", "设置联动机具费率");
+            LogHelper.Instance.WriteLog(result + "\n\n", "设置联动机具费率");
             return result;
         }
 

+ 1 - 1
AppStart/Helper/SetDepositService.cs

@@ -170,7 +170,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

+ 4 - 4
AppStart/Helper/SetFeeFlagService.cs

@@ -54,15 +54,15 @@ namespace MySystem
                             while(op)
                             {
                                 var posList = db.PosMachinesTwo.Select(m => new { m.Id, m.Status, m.BindingState, m.BindingTime, m.UpFeeFlag, m.BrandId }).Where(m => m.Id > StartId && m.Status > -1 && m.BindingTime <= date && m.BindingState == 1 && m.UpFeeFlag == 0 && BrandIds.Contains(m.BrandId)).OrderBy(m => m.Id).Take(100).ToList();
-                                function.WriteLog(DateTime.Now.ToString(), "118天提前通知创客费率调升");
-                                function.WriteLog(posList.Count.ToString(), "118天提前通知创客费率调升");
+                                LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "118天提前通知创客费率调升");
+                                LogHelper.Instance.WriteLog(posList.Count.ToString(), "118天提前通知创客费率调升");
                                 if(posList.Count > 0)
                                 {
                                     //循环修改机具费率调升标记
                                     //统计需要推送消息的用户Id
                                     foreach (var item in posList)
                                     {
-                                        function.WriteLog(item.Id.ToString(), "118天提前通知创客费率调升");
+                                        LogHelper.Instance.WriteLog(item.Id.ToString(), "118天提前通知创客费率调升");
                                         string info = "{\"RecordId\":\"\",\"PosId\":\"" + item.Id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"0\",\"OpMan\": \""+"系统"+"\"}";
                                         RedisDbconn.Instance.AddList("SetDepositQueue", info);
                                         StartId = item.Id;
@@ -78,7 +78,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "机具费率标记设置异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "机具费率标记设置异常");
                     }
                 }
                 Thread.Sleep(800000);

+ 2 - 2
AppStart/Helper/StatDataService.cs

@@ -100,7 +100,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "导数据异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "导数据异常");
                 }
                 Thread.Sleep(200);
             }
@@ -159,7 +159,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "执行上下级异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "执行上下级异常");
                 }
                 Thread.Sleep(200);
             }

+ 67 - 67
AppStart/Helper/StatService.cs

@@ -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", "实时统计收益日志");
         }
 
 

+ 12 - 12
AppStart/Helper/StatServiceTmp.cs

@@ -44,7 +44,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
             {
@@ -59,16 +59,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 TradeRecord where Id>=" + startId + " and Id<=" + endId + " and CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId=7)");
-                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 + " and BrandId=7 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", "临时重置交易额日志");
                     OtherMySqlConn.op("delete from UserTradeDaySummary where UserId=" + UserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=7 and SeoTitle='self'");
                     foreach (DataRow selfDr in selfdt.Rows)
                     {
@@ -110,9 +110,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 + ") and BrandId=7 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", "临时重置交易额日志");
                                 OtherMySqlConn.op("delete from UserTradeDaySummary where UserId=" + NavUserId + " and TradeMonth='" + TradeMonth + "' and TradeDate='" + TradeDate + "' and BrandId=7 and SeoTitle='team'");
                                 foreach (DataRow teamDr in teamDt.Rows)
                                 {
@@ -151,10 +151,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);
         }
@@ -164,7 +164,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"), "执行商户交易额日志");
             try
             {
                 string TradeDate = date.Replace("-", "");
@@ -178,9 +178,9 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "临时重置商户的交易额");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "临时重置商户的交易额");
             }
-            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", "临时重置商户交易额日志");
         }
 
 

+ 1 - 1
AppStart/Helper/StatStoreDataService.cs

@@ -92,7 +92,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "导仓库数据异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "导仓库数据异常");
                 }
                 Thread.Sleep(200);
             // }

+ 1 - 1
AppStart/Helper/StatTimerService.cs

@@ -26,7 +26,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "public_service");
             }
         }
 

+ 1 - 1
AppStart/Helper/SycnMysql/ConsumerOpenIdsHelper.cs

@@ -58,7 +58,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:ConsumerOpenIds:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:ConsumerOpenIds:Error");
                     result = "有异常,请查看Pop:ConsumerOpenIds:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/ConsumersHelper.cs

@@ -58,7 +58,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Consumers:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Consumers:Error");
                     result = "有异常,请查看Pop:Consumers:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/MachineApplyHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:MachineApply:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:MachineApply:Error");
                     result = "有异常,请查看Pop:MachineApply:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/MerchantParamSetHelper.cs

@@ -58,7 +58,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:MerchantParamSet:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:MerchantParamSet:Error");
                     result = "有异常,请查看Pop:MerchantParamSet:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/OrderProductHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:OrderProduct:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:OrderProduct:Error");
                     result = "有异常,请查看Pop:OrderProduct:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/OrdersHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Orders:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Orders:Error");
                     result = "有异常,请查看Pop:Orders:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/PosMachinesHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:PosMachines:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:PosMachines:Error");
                     result = "有异常,请查看Pop:PosMachines:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/ProductsHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Products:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Products:Error");
                     result = "有异常,请查看Pop:Products:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/StoreChangeHistoryHelper.cs

@@ -53,7 +53,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:StoreChangeHistory:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:StoreChangeHistory:Error");
                     result = "有异常,请查看Pop:StoreChangeHistory:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/StoreStockChangeHelper.cs

@@ -57,7 +57,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:StoreStockChange:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:StoreStockChange:Error");
                     result = "有异常,请查看Pop:StoreStockChange:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/TeamApplyHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:TeamApply:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:TeamApply:Error");
                     result = "有异常,请查看Pop:TeamApply:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/TeamOfferApplyHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:TeamOfferApply:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:TeamOfferApply:Error");
                     result = "有异常,请查看Pop:TeamOfferApply:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UserAddressHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserAddress:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserAddress:Error");
                     result = "有异常,请查看Pop:UserAddress:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UserBackHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserBack:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserBack:Error");
                     result = "有异常,请查看Pop:UserBack:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UserCashRecordHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserCashRecord:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserCashRecord:Error");
                     result = "有异常,请查看Pop:UserCashRecord:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UserLoginRecordHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserLoginRecord:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserLoginRecord:Error");
                     result = "有异常,请查看Pop:UserLoginRecord:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UserMachineDataHelper.cs

@@ -63,7 +63,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserMachineData:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserMachineData:Error");
                     result = "有异常,请查看Pop:UserMachineData:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UserStoreChangeHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserStoreChange:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:UserStoreChange:Error");
                     result = "有异常,请查看Pop:UserStoreChange:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/SycnMysql/UsersHelper.cs

@@ -54,7 +54,7 @@ namespace MySystem
                     msg.Obj = PopData;
                     msg.Time = DateTime.Now;
                     msg.ErrorContent = ex.ToString();
-                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Users:Error");
+                    LogHelper.Instance.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "Pop:Users:Error");
                     result = "有异常,请查看Pop:Users:Error队列";
                 }
             }

+ 1 - 1
AppStart/Helper/TimeOutPosChargeReturnService.cs

@@ -65,7 +65,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期兑换机具超过15天激活扣费退还");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期兑换机具超过15天激活扣费退还");
                     }
                 }
                 Thread.Sleep(1000);

+ 1 - 1
AppStart/Helper/TimeOutPosChargeService.cs

@@ -90,7 +90,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具执行扣费异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具执行扣费异常");
                     }
                 }
                 Thread.Sleep(1000);

+ 1 - 1
AppStart/Helper/TimeOutPosSendMessageService.cs

@@ -73,7 +73,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具预扣费消息推送异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具预扣费消息推送异常");
                     }
                 }
                 Thread.Sleep(1000);

+ 2 - 2
AppStart/Helper/WeChatPayBackService.cs

@@ -39,7 +39,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "微信支付回调异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "微信支付回调异常");
                     }
                 }
                 else
@@ -190,7 +190,7 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "微信分账队列异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "微信分账队列异常");
                 }
                 Thread.Sleep(2000);
             }

+ 79 - 0
AppStart/LogHelper.cs

@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading;
+using Library;
+using LitJson;
+using MySystem;
+
+public class LogHelper
+{
+    public readonly static LogHelper Instance = new LogHelper();
+    private LogHelper()
+    { }
+
+    string[] BlackList = { "服务商平台查询申请单状态API", "服务商平台查询分账结果API", "查询签约申请的结果", "支付宝查询分账结果" };
+
+    public void WriteLog(string Content, string FileName, string BrandId = "0")
+    {
+        if(BlackList.Contains(FileName))
+        {
+            string key = function.MD532(Content + FileName);
+            if(!string.IsNullOrEmpty(RedisDbconn.Instance.Get<string>(key)))
+            {
+                return;
+            }
+            RedisDbconn.Instance.Set(key, "1");
+            RedisDbconn.Instance.SetExpire(key, 3600);
+        }
+        function.WriteLog(Content, FileName);
+        // Dictionary<string, string> dic = new Dictionary<string, string>();
+        // dic.Add("Topic", FileName);
+        // dic.Add("Content", Content);
+        // dic.Add("BrandId", BrandId);
+        // RedisDbconn.Instance.AddList("LogQueue", Newtonsoft.Json.JsonConvert.SerializeObject(dic));
+    }
+
+    public void Start()
+    {
+        Thread th = new Thread(DoWorks);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    public void DoWorks()
+    {
+        while (true)
+        {
+            string content = RedisDbconn.Instance.RPop<string>("LogQueue");
+            if (!string.IsNullOrEmpty(content))
+            {
+                try
+                {
+                    DoQueue(content);
+                }
+                catch (Exception ex)
+                {
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content + "\n" + ex, "SLS日志异常");
+                }
+            }
+            else
+            {
+                Thread.Sleep(5000);
+            }
+        }
+    }
+
+    public void DoQueue(string content)
+    { 
+        // JsonData JsonObj = JsonMapper.ToObject(content);
+        // string Topic = JsonObj["Topic"].ToString();
+        // string Cont = JsonObj["Content"].ToString();
+        // string BrandId = JsonObj["BrandId"].ToString();
+        // SLS.WriteLog(DateTime.Now, Topic, Cont, new Dictionary<string, string>()
+        // {
+        //     {"BrandId", BrandId}
+        // });
+    }
+}

+ 4 - 4
AppStart/Timer/RedPackageHelper.cs

@@ -32,7 +32,7 @@ public class RedPackageHelper
                 if (string.IsNullOrEmpty(check))
                 {
                     function.WritePage("/Activity/RedPackage/", ActivityDate + ".txt", DateTime.Now.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
                     {
@@ -232,10 +232,10 @@ public class RedPackageHelper
                     }
                     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);
@@ -361,7 +361,7 @@ public class RedPackageHelper
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(ex.ToString(), "领取红包奖励异常");
+                    LogHelper.Instance.WriteLog(ex.ToString(), "领取红包奖励异常");
                 }
                 Thread.Sleep(200);
             }

+ 5 - 5
AppStart/Timer/RedPackageV2Helper.cs

@@ -32,7 +32,7 @@ public class RedPackageV2Helper
                 if (string.IsNullOrEmpty(check))
                 {
                     function.WritePage("/Activity/RedPackage/", ActivityDate + ".txt", DateTime.Now.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
                     {
@@ -233,10 +233,10 @@ public class RedPackageV2Helper
                     }
                     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", "生成指定未领取红包日志");
                 }
                 redisStock();
             }
@@ -393,7 +393,7 @@ public class RedPackageV2Helper
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(ex.ToString(), "发放红包奖励异常");
+                    LogHelper.Instance.WriteLog(ex.ToString(), "发放红包奖励异常");
                 }
                 Thread.Sleep(200);
             }
@@ -446,7 +446,7 @@ public class RedPackageV2Helper
         }
         catch (Exception ex)
         {
-            function.WriteLog(ex.ToString(), "领取红包奖励异常");
+            LogHelper.Instance.WriteLog(ex.ToString(), "领取红包奖励异常");
         }
     }    
 }

+ 6 - 6
AppStart/Timer/ResetSmallStoreHelper.cs

@@ -27,7 +27,7 @@ public class ResetSmallStoreHelper
     {
         while (true)
         {
-            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", "计算小分仓额度日志");
             WebCMSEntities db = new WebCMSEntities();
             string connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             try
@@ -54,10 +54,10 @@ public class ResetSmallStoreHelper
             }
             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);
         }
     }
@@ -87,7 +87,7 @@ public class ResetSmallStoreHelper
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "重置小分仓额度异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "重置小分仓额度异常");
             }
             db.Dispose();
             Thread.Sleep(60000);
@@ -107,7 +107,7 @@ public class ResetSmallStoreHelper
         }
         string connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         DataTable dt = CustomerSqlConn.dtable(sql, connstr);
-        function.WriteLog("总数" + dt.Rows.Count, "计算小分仓额度日志");
+        LogHelper.Instance.WriteLog("总数" + dt.Rows.Count, "计算小分仓额度日志");
         int index = 0;
         foreach (DataRow dr in dt.Rows)
         {
@@ -159,7 +159,7 @@ public class ResetSmallStoreHelper
             {
                 db.SaveChanges();
             }
-            function.WriteLog(index.ToString(), "计算小分仓额度日志");
+            LogHelper.Instance.WriteLog(index.ToString(), "计算小分仓额度日志");
         }
         db.SaveChanges();
     }

+ 1 - 1
AppStart/Timer/SetDespositHelper.cs

@@ -81,7 +81,7 @@ namespace MySystem
                     }
                     catch (Exception ex)
                     {
-                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "设置预发机超过30天预发押金自动扣减异常");
+                        LogHelper.Instance.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "设置预发机超过30天预发押金自动扣减异常");
                     }
                 }
                 Thread.Sleep(5000);

+ 6 - 6
AppStart/Timer/StoreApplyHelper.cs

@@ -45,10 +45,10 @@ public class StoreApplyHelper
             }
             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);
         }
     }
@@ -80,7 +80,7 @@ public class StoreApplyHelper
             }
             catch(Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "重置分仓额度异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "重置分仓额度异常");
             }
             db.Dispose();
         }
@@ -205,7 +205,7 @@ public class StoreApplyHelper
             }
             account.FixedAmount = Amount;
             account.ValidAmount = Amount + PromissAmount + account.TempAmount + account.TempAmountForBalance - AmountMore;
-            function.WriteLog("UserId:" + UserId + ";FixedAmount:" + account.FixedAmount + ";AmountMore:" + AmountMore + ";ValidAmount:" + account.ValidAmount, "计算分仓申请机具额度日志");
+            LogHelper.Instance.WriteLog("UserId:" + UserId + ";FixedAmount:" + account.FixedAmount + ";AmountMore:" + AmountMore + ";ValidAmount:" + account.ValidAmount, "计算分仓申请机具额度日志");
         }
         db.SaveChanges();
     }
@@ -227,7 +227,7 @@ public class StoreApplyHelper
                 string data = RedisDbconn.Instance.RPop<string>("StoreApplyQueue");
                 if(!string.IsNullOrEmpty(data))
                 {
-                    function.WriteLog("data:" + data, "分仓向总仓申请机具日志");
+                    LogHelper.Instance.WriteLog("data:" + data, "分仓向总仓申请机具日志");
                     JsonData jsonObj = JsonMapper.ToObject(data);
                     if(jsonObj["Kind"].ToString() == "1") // 购买临时额度
                     {
@@ -354,7 +354,7 @@ public class StoreApplyHelper
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "分仓向总仓申请机具线程异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "分仓向总仓申请机具线程异常");
             }
             db.Dispose();
         }

+ 3 - 3
AppStart/Timer/TestHelper.cs

@@ -35,7 +35,7 @@ public class TestHelper
 
     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
         {
@@ -66,10 +66,10 @@ public class TestHelper
         }
         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", "执行商户交易额日志");
     }
 
 }

+ 1 - 1
AppStart/Timer/TradeStatTimer.cs

@@ -99,7 +99,7 @@ public class TradeStatTimer
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + content + "\n" + ex.ToString(), "统计交易额异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content + "\n" + ex.ToString(), "统计交易额异常");
                     tran.Rollback();
                 }
                 tran.Dispose();

+ 1 - 1
AppStart/Timer/TradeStatTimer2.cs

@@ -167,7 +167,7 @@ public class TradeStatTimer2
                 }
                 catch (Exception ex)
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + content + "\n" + ex.ToString(), "统计交易额异常2");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content + "\n" + ex.ToString(), "统计交易额异常2");
                     tran.Rollback();
                 }
                 tran.Dispose();

+ 15 - 15
AppStart/WeChatFunction.cs

@@ -230,9 +230,9 @@ namespace MySystem
             // 商户API证书和微信支付平台证书均可以使用第三方的证书解析工具,查看证书内容。或者使用openssl命令行工具查看证书序列号。
             // $ openssl x509 -in 1900009191_20180326_cert.pem -noout -serial
             // serial=1DDE55AD98ED71D6EDD4A4A16996DE7B47773A8C
-            function.WriteLog(req, "服务商平台商户进件提交申请单API");
+            LogHelper.Instance.WriteLog(req, "服务商平台商户进件提交申请单API");
             string resp = postJson("https://api.mch.weixin.qq.com/v3/applyment4sub/applyment/", req);
-            function.WriteLog(resp + "\n\n", "服务商平台商户进件提交申请单API");
+            LogHelper.Instance.WriteLog(resp + "\n\n", "服务商平台商户进件提交申请单API");
             return resp;
         }
 
@@ -265,8 +265,8 @@ namespace MySystem
                 }
                 if(logFlag)
                 {
-                    function.WriteLog(BusinessCode, "服务商平台商户进件提交申请单API");
-                    function.WriteLog(result + "\n\n", "服务商平台查询申请单状态API");
+                    LogHelper.Instance.WriteLog(BusinessCode, "服务商平台查询申请单状态API");
+                    LogHelper.Instance.WriteLog(result + "\n\n", "服务商平台查询申请单状态API");
                 }
                 return_result.Add("applyment_id", jsonObj["applyment_id"].ToString()); //微信支付申请单号
                 return_result.Add("applyment_state", jsonObj["applyment_state"].ToString()); //申请单状态
@@ -297,7 +297,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "服务商平台查询申请单状态API异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "服务商平台查询申请单状态API异常");
             }
             return return_result;
         }
@@ -325,9 +325,9 @@ namespace MySystem
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(par);
             try
             {
-                function.WriteLog(req, "服务商平台申请退款API");
+                LogHelper.Instance.WriteLog(req, "服务商平台申请退款API");
                 string result = postJson("https://api.mch.weixin.qq.com/v3/refund/domestic/refunds", req);
-                function.WriteLog(result + "\n\n", "服务商平台申请退款API");
+                LogHelper.Instance.WriteLog(result + "\n\n", "服务商平台申请退款API");
                 JsonData jsonObj = JsonMapper.ToObject(result);
                 return_result.Add("refund_id", jsonObj["refund_id"].ToString()); //微信支付退款单号
                 return_result.Add("channel", jsonObj["channel"].ToString()); //退款渠道
@@ -341,7 +341,7 @@ namespace MySystem
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "服务商平台申请退款API异常");
+                LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "服务商平台申请退款API异常");
             }
             return return_result;
         }
@@ -359,9 +359,9 @@ namespace MySystem
             result.Add("receivers", Receivers); //分账接收方列表
             result.Add("unfreeze_unsplit", true); //是否解冻剩余未分资金
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(result);
-            function.WriteLog(req, "服务商平台请求分账API");
+            LogHelper.Instance.WriteLog(req, "服务商平台请求分账API");
             string resp = postJson("https://api.mch.weixin.qq.com/v3/profitsharing/orders", req);
-            function.WriteLog(resp + "\n\n", "服务商平台请求分账API");
+            LogHelper.Instance.WriteLog(resp + "\n\n", "服务商平台请求分账API");
             return resp;
             //{"order_id":"30000104462023060249559178531","out_order_no":"2023060210583730173782834","receivers":[{"account":"1611167423","amount":3,"create_time":"2023-06-02T11:34:10+08:00","description":"服务费","detail_id":"36000104462023060269999025889","finish_time":"1970-01-01T08:00:00+08:00","result":"PENDING","type":"MERCHANT_ID"},{"account":"1645266943","amount":7,"create_time":"2023-06-02T11:34:10+08:00","description":"解冻给分账方","detail_id":"36000104462023060269999025890","finish_time":"1970-01-01T08:00:00+08:00","result":"PENDING","type":"MERCHANT_ID"}],"state":"PROCESSING","sub_mchid":"1645266943","transaction_id":"4200001833202306025522158377"}
         }
@@ -382,9 +382,9 @@ namespace MySystem
             }
             result.Add("relation_type", Relation); //与分账方的关系类型 STORE:门店 STAFF:员工 STORE_OWNER:店主 PARTNER:合作伙伴 HEADQUARTER:总部 BRAND:品牌方 DISTRIBUTOR:分销商 USER:用户 SUPPLIER: 供应商 CUSTOM:自定义
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(result);
-            function.WriteLog(req, "服务商平台添加分账接收方API");
+            LogHelper.Instance.WriteLog(req, "服务商平台添加分账接收方API");
             string resp = postJson("https://api.mch.weixin.qq.com/v3/profitsharing/receivers/add", req);
-            function.WriteLog(resp + "\n\n", "服务商平台添加分账接收方API");
+            LogHelper.Instance.WriteLog(resp + "\n\n", "服务商平台添加分账接收方API");
             return resp;
             //{"account":"1611167423","name":"x+8m5jM4x2jSZLDOpN46Js9JyeNgUXkFSmGjCBN45QcSYUNPN86TOheRF64WlwDeO45E/walWPeZSksNN/LfJiB2fZRVun1CJuJ7zxePma8L7iDbKS92i+d38rvOmNTjLhKX64O8oJR4HMtFw1HryxJlUFgM5/ickJ79WGrX3GaVArWisgEzwOyxGBfGSL3ofJhi5TdTnrxHMzqYWv43DRvI9Ja5eMgFbgrGcn+JiJVKQcYj1L8tZ6xQeQCXkY6ubyDiV9wQps2nQA1Oh+UdFcS13Ex4FUSYLCczGFAl4EV8TBJQleZeC1p4ZJquJjje0uMjI2xB6S41yUBoN86gkA==","relation_type":"PARTNER","sub_mchid":"1645266943","type":"MERCHANT_ID"}
         }
@@ -397,9 +397,9 @@ namespace MySystem
             string req = "";
             req += "sub_mchid=" + SubMchId + "&"; //子商户号
             req += "transaction_id=" + TradeNo + "&"; //微信订单号
-            function.WriteLog(req, "服务商平台查询分账结果API");
+            LogHelper.Instance.WriteLog(req, "服务商平台查询分账结果API");
             string resp = postJson("https://api.mch.weixin.qq.com/v3/profitsharing/orders/" + OrderNo + "?" + req, "", "GET");
-            function.WriteLog(resp + "\n\n", "服务商平台查询分账结果API");
+            LogHelper.Instance.WriteLog(resp + "\n\n", "服务商平台查询分账结果API");
             return resp;
             //{"order_id":"30000404702023060849818491190","out_order_no":"2023060816062365164446474","receivers":[{"account":"1611167423","amount":3,"create_time":"2023-06-08T17:55:45+08:00","description":"服务费","detail_id":"36000404702023060870422622364","finish_time":"2023-06-08T17:56:16+08:00","result":"SUCCESS","type":"MERCHANT_ID"},{"account":"1646405429","amount":151,"create_time":"2023-06-08T17:55:45+08:00","description":"解冻给分账方","detail_id":"36000404702023060870422622365","finish_time":"2023-06-08T17:56:16+08:00","result":"SUCCESS","type":"MERCHANT_ID"}],"state":"FINISHED","sub_mchid":"1646405429","transaction_id":"4200001821202306083551994076"}
         }
@@ -495,7 +495,7 @@ namespace MySystem
                 catch (Exception ex)
                 {
                     writer = null;
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "http请求异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "http请求异常");
                 }
                 writer.Write(paramJsonBytes, 0, paramJsonBytes.Length);
                 writer.Close();

+ 4 - 4
AppStart/WeChatFunctionForHD.cs

@@ -123,9 +123,9 @@ namespace MySystem
             // 商户API证书和微信支付平台证书均可以使用第三方的证书解析工具,查看证书内容。或者使用openssl命令行工具查看证书序列号。
             // $ openssl x509 -in 1900009191_20180326_cert.pem -noout -serial
             // serial=1DDE55AD98ED71D6EDD4A4A16996DE7B47773A8C
-            function.WriteLog(req, "间连商户开户意愿确认");
+            LogHelper.Instance.WriteLog(req, "间连商户开户意愿确认");
             string resp = postJson("https://api.mch.weixin.qq.com/v3/apply4subject/applyment", req);
-            function.WriteLog(resp + "\n\n", "间连商户开户意愿确认");
+            LogHelper.Instance.WriteLog(resp + "\n\n", "间连商户开户意愿确认");
             return resp;
         }
 
@@ -146,7 +146,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(), "间连商户开户意愿确认(提交申请单)查询申请单状态异常");
             }
             return result;
         }
@@ -248,7 +248,7 @@ namespace MySystem
                 catch (Exception ex)
                 {
                     writer = null;
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "http请求异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "http请求异常");
                 }
                 writer.Write(paramJsonBytes, 0, paramJsonBytes.Length);
                 writer.Close();

+ 1 - 1
Areas/Api/Controllers/v1/PublicMethodController.cs

@@ -43,7 +43,7 @@ namespace MySystem.Areas.Api.Controllers
             }
             catch (Exception ex)
             {
-                function.WriteLog(DateTime.Now + ":" + ex.ToString(), "系统上传图片异常");
+                LogHelper.Instance.WriteLog(DateTime.Now + ":" + ex.ToString(), "系统上传图片异常");
                 return Json(new AppResultJson() { Status = "1", Info = "", Data = "" });
             }
         }

+ 1 - 1
Controllers/HomeController.cs

@@ -122,7 +122,7 @@ namespace MySystem.Controllers
                     // if(merchantAdd.Sort == 0)
                     // {
                     //     string content = AlipayFunction.Instance.BindSettleRelation(DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), AlipayFunction.Instance.Pid, merchantAdd.AlipayAuthToken);
-                    //     function.WriteLog(DateTime.Now.ToString() + "\n" + content, "支付宝添加分账方");
+                    //     LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content, "支付宝添加分账方");
                     //     merchantAdd.Sort = 1;
                     //     db.SaveChanges();
                     // }