|
|
@@ -148,15 +148,15 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if(!string.IsNullOrEmpty(sub.DataKey))
|
|
|
{
|
|
|
string[] TextFields = sub.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(sub.Alias + "." + dr[sub.DataKey].ToString(), vals);
|
|
|
}
|
|
|
- dicValsJson.Add(sub.Alias + "." + sub.DataKey, vals);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -208,13 +208,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
foreach(Match m in mc)
|
|
|
{
|
|
|
string fieldName = m.Value.Replace("#{", "").Replace("}#", "");
|
|
|
- if(dicVals.ContainsKey(fieldName))
|
|
|
+ if(!fieldName.Contains("."))
|
|
|
{
|
|
|
- sql = sql.Replace(m.Value, dicVals[fieldName]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sql = sql.Replace(m.Value, "");
|
|
|
+ if(dicVals.ContainsKey(fieldName))
|
|
|
+ {
|
|
|
+ sql = sql.Replace(m.Value, dicVals[fieldName]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql = sql.Replace(m.Value, "");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
mc = Regex.Matches(sql, @"\$\replace{.*?\}\$");
|
|
|
@@ -284,7 +287,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Dictionary<string, string> row = new Dictionary<string, string>();
|
|
|
foreach(string ColumnName in dr.Keys)
|
|
|
{
|
|
|
- Match m = Regex.Match(dr[ColumnName], @"\#\{.*?\}\#");
|
|
|
+ Match m = Regex.Match(function.CheckNull(dr[ColumnName]), @"\#\{.*?\}\#");
|
|
|
if(m.Success)
|
|
|
{
|
|
|
string fieldName = m.Value.Replace("#{", "").Replace("}#", "");
|
|
|
@@ -328,7 +331,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
else if (kind == "get")
|
|
|
{
|
|
|
Dictionary<string, string> row = new Dictionary<string, string>();
|
|
|
- row.Add("值", new CustomRedisDbconn(ConnectStr).Get<string>(key));
|
|
|
+ row.Add("值", function.CheckNull(new CustomRedisDbconn(ConnectStr).Get<string>(key)));
|
|
|
diclist.Add(row);
|
|
|
}
|
|
|
}
|
|
|
@@ -443,7 +446,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
SubSqlString = ",\"SubSqlString\":" + Newtonsoft.Json.JsonConvert.SerializeObject(subJson);
|
|
|
}
|
|
|
- string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"" + SubSqlString + "}";
|
|
|
+ string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + sql + "\",\"ConnectStr\":\"" + item.DatabaseConnect + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"" + SubSqlString + "}";
|
|
|
RedisDbconn.Instance.AddList("ExportQueue", SendData);
|
|
|
return "success";
|
|
|
}
|