Quellcode durchsuchen

换主数据库连接对象变量

lcl vor 1 Jahr
Ursprung
Commit
b07b07c530

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

@@ -20,7 +20,7 @@ namespace MySystem
                 int Id = int.Parse(function.CheckInt(data[1]));
                 string Table = data[0];
                 dbconn.op("delete from " + Table + " where Id=" + Id);
-                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
                 OtherMySqlConn.op("delete from " + Table + " where Id=" + Id);
                 // OtherMySqlConn.connstr = ;
             }

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

@@ -29,7 +29,7 @@ namespace MySystem
                 try
                 {
                     string sql = "";
-                    string conn = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+                    string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
                     DataTable dt = CustomerSqlConn.dtable("select UserId,sum(LaveNum)+(select count(Id) from PreSendStockDetail where FromUserId=s.UserId and `Status`>=0 and `Status`<=1 and ApplyFlag=0) from StoreHouse s where `Status`>-1 group by UserId", conn);
                     foreach(DataRow dr in dt.Rows)
                     {

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

@@ -170,7 +170,7 @@ namespace MySystem
             }
             function.WritePage("/HelpProfitStat/", Month + ".txt", DateTime.Now.ToString());
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            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(), "助利宝分润日志");

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

@@ -52,7 +52,7 @@ namespace MySystem
             string Month1 = start.AddMonths(-1).ToString("yyyyMM");
             string Month2 = start.AddMonths(-2).ToString("yyyyMM");
             string Month3 = start.AddMonths(-3).ToString("yyyyMM");
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             HelpProfitRelease obj = new HelpProfitRelease();
             string JsonParam = function.ReadInstance("/PublicParam/HelpProfitRelease.txt"); //json参数文件
             if(string.IsNullOrEmpty(JsonParam))

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

@@ -39,7 +39,7 @@ namespace MySystem
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             WebCMSEntities db = new WebCMSEntities();
             string StartId = function.CheckInt(function.ReadInstance("/PublicParam/ProfitRewardRecordId/" + Month + ".txt"));
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            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, "分润结果检查");
             int index = 0;
@@ -108,7 +108,7 @@ namespace MySystem
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             WebCMSEntities db = new WebCMSEntities();
             string StartId = function.CheckInt(function.ReadInstance("/PublicParam/ProfitSubsidyDetailId/" + Month + ".txt"));
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            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, "分润结果检查");
             int index = 0;

+ 6 - 6
AppStart/Helper/StatService.cs

@@ -1695,7 +1695,7 @@ namespace MySystem
             WebCMSEntities db = new WebCMSEntities();
             try
             {
-                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
                 function.WriteLog(DateTime.Now.ToString(), "创客升级日志");
                 DateTime start = DateTime.Parse(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00");
                 DateTime end = start.AddDays(1);
@@ -1985,7 +1985,7 @@ namespace MySystem
         }
         public void StartPosActNumEverTime()
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行创客激活数日志");
             WebCMSEntities db = new WebCMSEntities();
             try
@@ -2095,7 +2095,7 @@ namespace MySystem
         }
         public void StartNewUserNumDo(object sender)
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             string date = sender.ToString();
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行新增创客数日志");
             WebCMSEntities db = new WebCMSEntities();
@@ -2180,7 +2180,7 @@ namespace MySystem
         }
         public void StartNewUserNumEverTime()
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行新增创客数日志");
             WebCMSEntities db = new WebCMSEntities();
             try
@@ -2287,7 +2287,7 @@ namespace MySystem
         }
         public void StatProfitEverDay(object sender)
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             string date = sender.ToString();
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "执行昨天收益日志");
             WebCMSEntities db = new WebCMSEntities();
@@ -2386,7 +2386,7 @@ namespace MySystem
 
         public void StatProfitEverDayEverTime()
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时统计收益日志");
             WebCMSEntities db = new WebCMSEntities();
             try

+ 1 - 1
AppStart/Helper/StatServiceTmp.cs

@@ -30,7 +30,7 @@ namespace MySystem
             if(string.IsNullOrEmpty(chk))
             {
                 function.WritePage("/log/", "临时重置盛付通交易额.txt", DateTime.Now.ToString());
-                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
                 DateTime end = DateTime.Parse("2022-06-23 00:00:00");
                 DateTime check = DateTime.Parse("2022-06-14");
                 while (check <= end)

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

@@ -14,7 +14,7 @@ namespace MySystem
         public string Start(string table)
         {
             bool op = true;
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             string result = "success";
             int startId = 0; //RedisDbconn.Instance.Get<int>("Start" + table + "Id");
             // int total = 0;

+ 1 - 1
AppStart/Timer/RedPackageHelper.cs

@@ -257,7 +257,7 @@ public class RedPackageHelper
     {
         while (true)
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             OtherMySqlConn.op("delete from ActivityRedPackageTop10");
             using (WebCMSEntities db = new WebCMSEntities())
             {

+ 1 - 1
AppStart/Timer/RedPackageV2Helper.cs

@@ -309,7 +309,7 @@ public class RedPackageV2Helper
         {
             if(DateTime.Now.Hour >= 7 && DateTime.Now.Hour <= 10)
             {
-                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+                OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
                 OtherMySqlConn.op("delete from ActivityRedPackageTop10");
                 using (WebCMSEntities db = new WebCMSEntities())
                 {

+ 2 - 2
AppStart/Timer/ResetSmallStoreHelper.cs

@@ -29,7 +29,7 @@ public class ResetSmallStoreHelper
         {
             function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "计算小分仓额度日志");
             WebCMSEntities db = new WebCMSEntities();
-            string connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+            string connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             try
             {
                 string content = RedisDbconn.Instance.RPop<string>("ResetSmallStoreQueue");
@@ -105,7 +105,7 @@ public class ResetSmallStoreHelper
         {
             sql = "select UserId,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord where UserId=" + UId + " and TradeMonth='" + PreMonth + "' group by UserId";
         }
-        string connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+        string connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         DataTable dt = CustomerSqlConn.dtable(sql, connstr);
         function.WriteLog("总数" + dt.Rows.Count, "计算小分仓额度日志");
         int index = 0;

+ 1 - 1
AppStart/Timer/StoreApplyHelper.cs

@@ -88,7 +88,7 @@ public class StoreApplyHelper
 
     public void DoSomething(WebCMSEntities db, int UId = 0)
     {
-        string connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+        string connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         Dictionary<int, decimal> dataDic = new Dictionary<int, decimal>();
         string pre = DateTime.Now.AddMonths(-2).ToString("yyyy-MM") + "-01 00:00:00";
         string start = DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00";

+ 1 - 1
AppStart/Timer/TestHelper.cs

@@ -23,7 +23,7 @@ public class TestHelper
 
     public void StartEverDay()
     { 
-        OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString();
+        OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         DateTime end = DateTime.Parse("2022-04-19 00:00:00");
         DateTime check = DateTime.Parse("2022-03-11");
         while (check <= end)

+ 1 - 1
PxcModels/WebCMSEntities.cs

@@ -266,7 +266,7 @@ namespace MySystem.PxcModels
         {
             if (!optionsBuilder.IsConfigured)
             {
-                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql"));
+                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql"));
             }
         }