Browse Source

修复连库查询获取链接字符串的问题

lcl 1 year ago
parent
commit
b9ef656572
2 changed files with 5 additions and 5 deletions
  1. BIN
      .DS_Store
  2. 5 5
      AppStart/Helper/ExportService.cs

BIN
.DS_Store


+ 5 - 5
AppStart/Helper/ExportService.cs

@@ -112,7 +112,7 @@ namespace MySystem
             string ConnectStr = "";
             if(content.Contains("\"ConnectStr\""))
             {
-                ConnectStr = jsonObj["ConnectStr"].ToString();
+                ConnectStr = GetConnectStr(jsonObj["ConnectStr"].ToString());
             }
             else
             {
@@ -169,15 +169,15 @@ namespace MySystem
                         if(!string.IsNullOrEmpty(DataKey))
                         {
                             string[] TextFields = DataText.Split(',');
-                            Dictionary<string, string> vals = new Dictionary<string, string>();
                             foreach(DataRow dr in dtsub.Rows)
                             {
-                                foreach(string key in TextFields)
+                                Dictionary<string, string> vals = new Dictionary<string, string>();
+                                foreach (string key in TextFields)
                                 {
                                     vals.Add(key, dr[key].ToString());
                                 }
+                                dicValsJson.Add(Alias + "." + dr[DataKey].ToString(), vals);
                             }
-                            dicValsJson.Add(Alias + "." + DataKey, vals);
                         }
                     }
                 }
@@ -278,7 +278,7 @@ namespace MySystem
             {
                 string FileUrl = MysqlConn.sourceHost + "exportfile/" + FileName + ".xlsx";
                 function.WriteLog(FileUrl, "导出日志");
-                CustomerSqlConn.op("insert into ExportExcels (CreateDate,FileName,FileUrl,SysId) values ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + FileName + "','" + FileUrl + "'," + Operater + ")", ConnectStr);
+                CustomerSqlConn.op("insert into ExportExcels (CreateDate,FileName,FileUrl,SysId) values ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + FileName + "','" + FileUrl + "'," + Operater + ")", MysqlConn.connstr);
                 function.WriteLog("insert into ExportExcels (CreateDate,FileName,FileUrl,SysId) values ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + FileName + "','" + FileUrl + "'," + Operater + ")", "导出日志");
                 function.WriteLog("end", "导出日志");
             }