Skip to content

Commit 572a79a

Browse files
committed
增加导入excel时,后台对非空数据源的值判断
1 parent 2f487eb commit 572a79a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Vue.Net/VOL.Core/Utilities/EPPlusHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public static WebResponseContent ReadToDataTable<T>(string path, Expression<Func
101101
}
102102

103103
//验证字典数据
104-
if (!string.IsNullOrEmpty(options.DropNo))
104+
//2020.09.20增加判断数据源是否有值
105+
if (!string.IsNullOrEmpty(options.DropNo) && !string.IsNullOrEmpty(value))
105106
{
106107
string key = options.KeyValues.Where(x => x.Value == value)
107108
.Select(s => s.Key)

开发版dev/Vue.NetCore/Vue.Net/VOL.Core/Utilities/EPPlusHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static WebResponseContent ReadToDataTable<T>(string path, Expression<Func
3939
if (package.Workbook.Worksheets.Count == 0 ||
4040
package.Workbook.Worksheets.FirstOrDefault().Dimension.End.Row <= 1)
4141
return responseContent.Error("未导入数据");
42-
//2020.08.11修复获取表结构信息时,表为别名时查不到数据的问题
42+
//2020.08.11修复获取表结构信息时,表为别名时查不到数据的问题
4343
//typeof(T).GetEntityTableName()
4444
List<CellOptions> cellOptions = GetExportColumnInfo(typeof(T).Name, false, false);
4545
//设置忽略的列
@@ -101,7 +101,8 @@ public static WebResponseContent ReadToDataTable<T>(string path, Expression<Func
101101
}
102102

103103
//验证字典数据
104-
if (!string.IsNullOrEmpty(options.DropNo))
104+
//2020.09.20增加判断数据源是否有值
105+
if (!string.IsNullOrEmpty(options.DropNo) && !string.IsNullOrEmpty(value))
105106
{
106107
string key = options.KeyValues.Where(x => x.Value == value)
107108
.Select(s => s.Key)

0 commit comments

Comments
 (0)