diff --git a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SECoursewearlibrary.cs b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SECoursewearlibrary.cs index d6a1ad0..cb7ee54 100644 --- a/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SECoursewearlibrary.cs +++ b/APT.MicroApi/APT.SC.WebApi/Controllers/Api/SEController/SECoursewearlibrary.cs @@ -515,6 +515,7 @@ namespace APT.SE.WebApi.Controllers.Api T_FM_USER_POST modelPost = null; List listPostNameEmpty = new List(); + List listAnswerNullIndex = new List(); List listAnswerErrorIndex = new List(); List listAnswerError = new List(); string strANSWER = string.Empty; @@ -709,6 +710,10 @@ namespace APT.SE.WebApi.Controllers.Api } listAnswerErrorIndex.Add((i + rowIndex).ToString()); } + if (mainTable.ANSWER == 0) + { + listAnswerNullIndex.Add((i + rowIndex).ToString()); + } if (!string.IsNullOrEmpty(dtSource.Rows[i][8].ToString().Trim())) { int k = 0; @@ -830,7 +835,7 @@ namespace APT.SE.WebApi.Controllers.Api #region 提示 string strEmptyError = string.Empty; - if (listPostNameEmpty.Count > 0 || dicIndexEmpty.Count > 0 || listPointNameEmpty.Count > 0 || listRepeatDataIndex.Count > 0 || listRepeatExcelIndex.Count > 0) + if (listPostNameEmpty.Count > 0 || dicIndexEmpty.Count > 0 || listPointNameEmpty.Count > 0 || listRepeatDataIndex.Count > 0 || listAnswerErrorIndex.Count > 0 || listRepeatExcelIndex.Count > 0 || listAnswerNullIndex.Count > 0) { if (dicIndexEmpty.Count > 0) { @@ -861,6 +866,10 @@ namespace APT.SE.WebApi.Controllers.Api { throw new Exception("答案有误,行:【" + string.Join(",", listAnswerErrorIndex) + "】值:" + string.Join(",", listAnswerError)); } + if (listAnswerNullIndex.Count > 0) + { + throw new Exception("获取答案有误,行:【" + string.Join(",", listAnswerNullIndex) + "】"); + } if (listRepeatDataIndex.Count > 0) { throw new Exception("与现有题库重复,行:【" + string.Join(",", listRepeatDataIndex) + "】值:" + string.Join(",", listNameTypeError));