diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Excel/Import/ExcelImportBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Excel/Import/ExcelImportBLL.cs index 084b50faf..07a76ded6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Excel/Import/ExcelImportBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Excel/Import/ExcelImportBLL.cs @@ -321,7 +321,7 @@ namespace Learun.Application.Excel throw (new Exception("【" + col.F_ColName + "】 此项数据为必填项")); } } - if (dbType == System.Data.DbType.DateTime || dbType == System.Data.DbType.Decimal) + if (dbType == System.Data.DbType.DateTime || dbType == System.Data.DbType.Decimal || dbType == System.Data.DbType.Boolean) { if (string.IsNullOrEmpty(dr[col.F_ColName].ToString())) { @@ -349,7 +349,21 @@ namespace Learun.Application.Excel dataItemMap.Add(col.F_DataItemCode, dataItemList); } dataItemName = FindDataItemValue(dataItemMap[col.F_DataItemCode], dr[col.F_ColName].ToString(), col.F_ColName, col.F_IsMandatory ?? false); - dp.Add(col.F_Name, dataItemName, dbType); + if (dbType == System.Data.DbType.Boolean) + { + if (string.IsNullOrEmpty(dr[col.F_ColName].ToString()) || string.IsNullOrEmpty(dataItemName)) + { + dp.Add(col.F_Name, null, dbType); + } + else + { + dp.Add(col.F_Name, dataItemName, dbType); + } + } + else + { + dp.Add(col.F_Name, dataItemName, dbType); + } IsOnlyOne(col, sqlonly, dataItemName, entity.F_DbId, dbType); break; case 3://数据表