Commit 679fdeda LN

增加其他数据源匹配功能。

1 个父辈 53b5e2bb
......@@ -342,6 +342,10 @@ namespace BLL
public static MyConfig<string> DataSource_Encoding;
[MyConfigComment("数据源匹配Key")]
public static MyConfig<string> DataSource_DataKey;
[MyConfigComment("数据源匹配Key_其他项")]
public static MyConfig<string[]> DataSource_DataKey_Others= new string[] { };
[MyConfigComment("数据源列标题")]
public static MyConfig<string> DataSource_DataTitle;
public static MyConfig<bool> DataSource_ShowBox = false;
......
......@@ -296,12 +296,14 @@ namespace BLL
{
//使用key填充时,请处理字段开头的<OCR>字段
//查询excel数据填充
bool findOk = false;
if (key.ContainsKey(Config.DataSource_DataKey))
{
string CleanData = key[Config.DataSource_DataKey].Replace("<OCR>", "");
if (key.ContainsKey(Config.DataSource_DataKey) && ExtraFileData.AllData.ContainsKey(CleanData))
{
var extraData = ExtraFileData.AllData[CleanData];
findOk = true;
foreach (var d in extraData)
{
if (!string.IsNullOrEmpty(d.Value))
......@@ -309,6 +311,28 @@ namespace BLL
}
}
}
if (!findOk && Config.DataSource_DataKey_Others.Val != null && Config.DataSource_DataKey_Others.Val.Length > 0)
{
string[] otherKeys = Config.DataSource_DataKey_Others.Val;
foreach (string oKey in otherKeys)
{
if (key.ContainsKey(oKey))
{
string CleanData = key[oKey].Replace("<OCR>", "");
if (key.ContainsKey(oKey) && ExtraFileData.AllData.ContainsKey(CleanData))
{
var extraData = ExtraFileData.AllData[CleanData];
findOk = true;
foreach (var d in extraData)
{
if (!string.IsNullOrEmpty(d.Value))
key[d.Key] = d.Value;
}
break;
}
}
}
}
lastkey = key;
islast = false;
if (lastKeys != null)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!