代码优化

master
xiaochanghai 11 months ago
parent e67a52fd21
commit 6a7bb54986
  1. 4
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs

@ -1000,6 +1000,8 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
{ {
for (int ii = 1; ii < 11; ii++) for (int ii = 1; ii < 11; ii++)
{ {
if (!dt.Columns.Contains("关键词" + ii))
continue;
var answer = dt.Rows[i]["关键词" + ii].ToString(); var answer = dt.Rows[i]["关键词" + ii].ToString();
if (!string.IsNullOrWhiteSpace(answer)) if (!string.IsNullOrWhiteSpace(answer))
{ {
@ -1118,7 +1120,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
var physicsPath1 = physicsPath + path + fileName; var physicsPath1 = physicsPath + path + fileName;
if (dataSourceLists.Any()) if (dataSourceLists.Any())
physicsPath1 = physicsPath + path + newFileName; physicsPath1 = physicsPath + path + newFileName;
var result = ServiceResult<string>.OprateSuccess(fileName, physicsPath1); var result = ServiceResult<string>.OprateSuccess("题库.xlsx", physicsPath1);
return result; return result;
} }

Loading…
Cancel
Save