This commit is contained in:
wyw 2026-04-08 16:25:34 +08:00
parent 2c43cc8a88
commit 6733620181

View File

@ -515,6 +515,7 @@ namespace APT.SE.WebApi.Controllers.Api
T_FM_USER_POST modelPost = null;
List<string> listPostNameEmpty = new List<string>();
List<string> listAnswerNullIndex = new List<string>();
List<string> listAnswerErrorIndex = new List<string>();
List<string> listAnswerError = new List<string>();
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));