|
@@ -38,10 +38,11 @@ using Hotline.Repository.SqlSugar.Exam.Repositories;
|
|
|
using Hotline.Share.Dtos.TestPapers;
|
|
|
using Hotline.Repository.SqlSugar.Exam.Service;
|
|
|
using Hotline.Repository.SqlSugar.Exam.Extensions;
|
|
|
+using XF.Domain.Exceptions;
|
|
|
|
|
|
namespace Hotline.Application.Exam.Service.Questions
|
|
|
{
|
|
|
- public class QuestionService : ApiService<ExamQuestion, AddQuestionDto,UpdateQuestionDto, HotlineDbContext>, IQuestionService, IScopeDependency
|
|
|
+ public class QuestionService : ApiService<ExamQuestion, AddQuestionDto, UpdateQuestionDto, HotlineDbContext>, IQuestionService, IScopeDependency
|
|
|
{
|
|
|
#region ctor
|
|
|
private readonly IQuestionRepository _repository;
|
|
@@ -65,7 +66,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
IDataPermissionFilterBuilder dataPermissionFilterBuilder, IServiceProvider serviceProvider,
|
|
|
IMapper mapper,
|
|
|
ISessionContext sessionContext
|
|
|
- ) : base(repository,mapper)
|
|
|
+ ) : base(repository, mapper)
|
|
|
{
|
|
|
_repository = repository;
|
|
|
_questionTagRepository = questionTagRepository;
|
|
@@ -98,7 +99,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
questionDto.QuestionOptionsDtos = await GetQuestionOptions(entityQueryRequest);
|
|
|
|
|
|
questionDto.QuestionSourcewareDtos = await GetQuestionSourcewares(entityQueryRequest);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
return questionDto;
|
|
|
}
|
|
@@ -116,7 +117,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
DifficultyLevel = q.DifficultyLevel,
|
|
|
Title = q.Title,
|
|
|
QuestionType = q.QuestionType,
|
|
|
- Id= q.Id
|
|
|
+ Id = q.Id
|
|
|
});
|
|
|
|
|
|
var result = await queryable.ToListAsync();
|
|
@@ -146,8 +147,8 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
var questionKnowladgeTable = new ExamRepository<ExamQuestionKnowladge>(_uow, _dataPermissionFilterBuilder, _serviceProvider).Queryable().Where(questionKnowladgeExpression);
|
|
|
|
|
|
|
|
|
- var queryable = questionTable.InnerJoin(questionTagTable, (s, d) => s.Id == d.QuestionId).InnerJoin(examTagTable, (s,d, t) => d.TagId == t.Id)
|
|
|
- //.InnerJoin(questionKnowladgeTable, (s, d, t,k) => s.Id == k.QuestionId)
|
|
|
+ var queryable = questionTable.InnerJoin(questionTagTable, (s, d) => s.Id == d.QuestionId).InnerJoin(examTagTable, (s, d, t) => d.TagId == t.Id)
|
|
|
+ //.InnerJoin(questionKnowladgeTable, (s, d, t,k) => s.Id == k.QuestionId)
|
|
|
.Distinct()
|
|
|
.Select((s, d, t) => new QuestionViewResponse
|
|
|
{
|
|
@@ -155,7 +156,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
FormalEnable = s.FormalEnable,
|
|
|
SimulateEnable = s.SimulateEnable,
|
|
|
SortIndex = s.SortIndex,
|
|
|
- Status =s.Status,
|
|
|
+ Status = s.Status,
|
|
|
QuestionType = s.QuestionType,
|
|
|
Title = s.Title,
|
|
|
Id = s.Id
|
|
@@ -163,20 +164,20 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
if (queryRequest.KnowladgeIds != null && queryRequest.KnowladgeIds.Any())
|
|
|
{
|
|
|
- queryable = questionTable.InnerJoin(questionTagTable, (s, d) => s.Id == d.QuestionId).InnerJoin(examTagTable, (s, d, t) => d.TagId == t.Id)
|
|
|
- .InnerJoin(questionKnowladgeTable, (s, d, t, k) => s.Id == k.QuestionId)
|
|
|
- .Distinct()
|
|
|
- .Select((s, d, t) => new QuestionViewResponse
|
|
|
- {
|
|
|
- DifficultyLevel = s.DifficultyLevel,
|
|
|
- FormalEnable = s.FormalEnable,
|
|
|
- SimulateEnable = s.SimulateEnable,
|
|
|
- SortIndex = s.SortIndex,
|
|
|
- Status = s.Status,
|
|
|
- QuestionType = s.QuestionType,
|
|
|
- Title = s.Title,
|
|
|
- Id = s.Id
|
|
|
- });
|
|
|
+ queryable = questionTable.InnerJoin(questionTagTable, (s, d) => s.Id == d.QuestionId).InnerJoin(examTagTable, (s, d, t) => d.TagId == t.Id)
|
|
|
+ .InnerJoin(questionKnowladgeTable, (s, d, t, k) => s.Id == k.QuestionId)
|
|
|
+ .Distinct()
|
|
|
+ .Select((s, d, t) => new QuestionViewResponse
|
|
|
+ {
|
|
|
+ DifficultyLevel = s.DifficultyLevel,
|
|
|
+ FormalEnable = s.FormalEnable,
|
|
|
+ SimulateEnable = s.SimulateEnable,
|
|
|
+ SortIndex = s.SortIndex,
|
|
|
+ Status = s.Status,
|
|
|
+ QuestionType = s.QuestionType,
|
|
|
+ Title = s.Title,
|
|
|
+ Id = s.Id
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
var list = await queryable.ToPageListAsync(queryRequest.PageIndex, queryRequest.PageSize);
|
|
@@ -212,7 +213,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
{
|
|
|
base.StartTran();
|
|
|
|
|
|
- base.Entity= await AddQuestion(actionRequest, cancellationToken);
|
|
|
+ base.Entity = await AddQuestion(actionRequest, cancellationToken);
|
|
|
|
|
|
await base.Complete(base.Entity, OperationConstant.Create);
|
|
|
|
|
@@ -229,17 +230,17 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
_addQuestionDto = _mapper.Map<AddQuestionDto>(actionRequest);
|
|
|
|
|
|
- base.Entity.QuestionTags = await ModifyQuestionTags(actionRequest, cancellationToken);
|
|
|
+ base.Entity.QuestionTags = await ModifyQuestionTags(actionRequest, cancellationToken);
|
|
|
|
|
|
- base.Entity.QuestionOptionses = await ModifyQuestionOptions(actionRequest, cancellationToken);
|
|
|
+ base.Entity.QuestionOptionses = await ModifyQuestionOptions(actionRequest, cancellationToken);
|
|
|
|
|
|
base.Entity.QuestionAnswers = await ModifyQuestionAnswer(actionRequest, cancellationToken);
|
|
|
|
|
|
- base.Entity.QuestionKnowladges = await ModifyKnowladges(actionRequest, cancellationToken);
|
|
|
+ base.Entity.QuestionKnowladges = await ModifyKnowladges(actionRequest, cancellationToken);
|
|
|
|
|
|
- base.Entity.QuestionSourcewares = await ModifySourcewares(actionRequest, cancellationToken);
|
|
|
+ base.Entity.QuestionSourcewares = await ModifySourcewares(actionRequest, cancellationToken);
|
|
|
|
|
|
- await base.Complete(base.Entity,OperationConstant.Update);
|
|
|
+ await base.Complete(base.Entity, OperationConstant.Update);
|
|
|
}
|
|
|
|
|
|
public override async Task DeleteAsync(EntityQueryRequest entityQueryRequest, CancellationToken cancellationToken)
|
|
@@ -284,30 +285,39 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
public async Task ImportExcel(IFormFile files, CancellationToken cancellationToken)
|
|
|
{
|
|
|
- using (var stream = files.OpenReadStream())
|
|
|
+ var stream = files.OpenReadStream();
|
|
|
+ var contents = ExcelHelper.Read(stream, true);
|
|
|
+
|
|
|
+ var questions = new List<ExamQuestion>();
|
|
|
+ var examTags = await GetExamTags(contents);
|
|
|
+
|
|
|
+ base.StartTran();
|
|
|
+
|
|
|
+ var isEmptyValue = false;
|
|
|
+
|
|
|
+ contents.ForEach(async item =>
|
|
|
{
|
|
|
- var contents = ExcelHelper.Read(stream, true);
|
|
|
+ var value = (item as ExpandoObject).GetValueOrDefault(ExamSystemConstants.ColumnNames[16]);
|
|
|
|
|
|
- var questions = new List<ExamQuestion>();
|
|
|
- var examTags = await GetExamTags(contents);
|
|
|
+ if (value == null)
|
|
|
+ return;
|
|
|
|
|
|
- base.StartTran();
|
|
|
- contents.ForEach(async item =>
|
|
|
- {
|
|
|
- var questionDto = BuildQuestion(item as ExpandoObject, examTags);
|
|
|
+ var questionDto = BuildQuestion(item as ExpandoObject, examTags);
|
|
|
|
|
|
- var question = await AddQuestion(questionDto, cancellationToken);
|
|
|
- if (question != null)
|
|
|
- questions.Add(question);
|
|
|
- });
|
|
|
+ var question = await AddQuestion(questionDto, cancellationToken);
|
|
|
+ if (question != null)
|
|
|
+ questions.Add(question);
|
|
|
+ });
|
|
|
|
|
|
- await _repository.AddNav(questions)
|
|
|
- .Include(x => x.QuestionTags)
|
|
|
- .Include(x => x.QuestionOptionses)
|
|
|
- .Include(x => x.QuestionSourcewares)
|
|
|
- .Include(x => x.QuestionAnswers)
|
|
|
- .Include(x => x.QuestionKnowladges).ExecuteCommandAsync();
|
|
|
- }
|
|
|
+ if(isEmptyValue) throw new Exception("答案不能为空");
|
|
|
+
|
|
|
+ await _repository.AddNav(questions)
|
|
|
+ .Include(x => x.QuestionTags)
|
|
|
+ .Include(x => x.QuestionOptionses)
|
|
|
+ .Include(x => x.QuestionSourcewares)
|
|
|
+ .Include(x => x.QuestionAnswers)
|
|
|
+ .Include(x => x.QuestionKnowladges).ExecuteCommandAsync();
|
|
|
+ stream.Close();
|
|
|
}
|
|
|
|
|
|
private async Task<List<ExamTag>> GetExamTags(List<object> contents)
|
|
@@ -331,7 +341,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
tagNames.Add(name);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -342,37 +352,42 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
return examTags;
|
|
|
}
|
|
|
|
|
|
- private AddQuestionDto BuildQuestion(ExpandoObject item,List<ExamTag> examTags)
|
|
|
+ private AddQuestionDto BuildQuestion(ExpandoObject item, List<ExamTag> examTags)
|
|
|
{
|
|
|
- if (item != null) {
|
|
|
+ if (item != null)
|
|
|
+ {
|
|
|
var options = new List<string>();
|
|
|
|
|
|
- ResolveOptions(options,item,6,15);
|
|
|
+ ResolveOptions(options, item, 6, 15);
|
|
|
|
|
|
- var answer = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[16]).ToString();
|
|
|
+ var value = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[16]);
|
|
|
|
|
|
- var questionDto = new AddQuestionDto
|
|
|
- {
|
|
|
- Title = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[2]) != null ? item.GetValueOrDefault(ExamSystemConstants.ColumnNames[5]).ToString() : string.Empty,
|
|
|
- QuestionTagDtos = BuildQuestionTags(item.GetValueOrDefault(ExamSystemConstants.ColumnNames[1]).ToString(), examTags),
|
|
|
- DifficultyLevel = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[2]).ToString().ToEnumByDesc<EDifficultyLevel>(),
|
|
|
- QuestionType = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[0]).ToString().ToEnumByDesc<EQuestionType>(),
|
|
|
- FormalEnable = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[4]).ToString().ToEnumByDesc<ECheck>() == ECheck.Yes,
|
|
|
- SimulateEnable = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[5]).ToString().ToEnumByDesc<ECheck>() == ECheck.Yes,
|
|
|
- };
|
|
|
- questionDto.QuestionAnswerDto = BuildQuestionAnswer(answer, questionDto.QuestionType);
|
|
|
+ if (value != null) {
|
|
|
+ var answer = value.ToString();
|
|
|
|
|
|
- questionDto.QuestionOptionsDtos = BuildQuestionOptions(options, questionDto.QuestionType, answer);
|
|
|
+ var questionDto = new AddQuestionDto
|
|
|
+ {
|
|
|
+ Title = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[2]) != null ? item.GetValueOrDefault(ExamSystemConstants.ColumnNames[5]).ToString() : string.Empty,
|
|
|
+ QuestionTagDtos = BuildQuestionTags(item.GetValueOrDefault(ExamSystemConstants.ColumnNames[1]).ToString(), examTags),
|
|
|
+ DifficultyLevel = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[2]).ToString().ToEnumByDesc<EDifficultyLevel>(),
|
|
|
+ QuestionType = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[0]).ToString().ToEnumByDesc<EQuestionType>(),
|
|
|
+ FormalEnable = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[4]).ToString().ToEnumByDesc<ECheck>() == ECheck.Yes,
|
|
|
+ SimulateEnable = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[5]).ToString().ToEnumByDesc<ECheck>() == ECheck.Yes,
|
|
|
+ };
|
|
|
+ questionDto.QuestionAnswerDto = BuildQuestionAnswer(answer, questionDto.QuestionType);
|
|
|
|
|
|
+ questionDto.QuestionOptionsDtos = BuildQuestionOptions(options, questionDto.QuestionType, answer);
|
|
|
|
|
|
+ return questionDto;
|
|
|
+ }
|
|
|
|
|
|
- return questionDto;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private List<AddQuestionOptionsDto> BuildQuestionOptions(List<string> options,EQuestionType questionType,string answer)
|
|
|
+ private List<AddQuestionOptionsDto> BuildQuestionOptions(List<string> options, EQuestionType questionType, string answer)
|
|
|
{
|
|
|
if (questionType.CheckSelectType())
|
|
|
{
|
|
@@ -400,7 +415,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
private void ResolveOptions(List<string> options, ExpandoObject item, int start, int end)
|
|
|
{
|
|
|
- for(int i = start; i <= end; i++)
|
|
|
+ for (int i = start; i <= end; i++)
|
|
|
{
|
|
|
var option = item.GetValueOrDefault(ExamSystemConstants.ColumnNames[i])?.ToString();
|
|
|
if (option.IsNotNullOrEmpty())
|
|
@@ -424,7 +439,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private List<AddQuestionTagDto> BuildQuestionTags(string content,List<ExamTag> examTags)
|
|
|
+ private List<AddQuestionTagDto> BuildQuestionTags(string content, List<ExamTag> examTags)
|
|
|
{
|
|
|
if (content.IsNotNullOrEmpty())
|
|
|
{
|
|
@@ -442,7 +457,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
{
|
|
|
TagId = examTag.Id
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
return addQuestionTagDtos;
|
|
@@ -454,7 +469,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
#region private method
|
|
|
|
|
|
- private void ResolveQuestionId(AddQuestionDto actionRequest,string id)
|
|
|
+ private void ResolveQuestionId(AddQuestionDto actionRequest, string id)
|
|
|
{
|
|
|
actionRequest.QuestionKnowladgeDtos?.ForEach(x => x.QuestionId = id);
|
|
|
|
|
@@ -514,7 +529,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
var questionOptionseDtos = actionRequest.QuestionOptionsDtos.Where(x => x.OperationStatus == EEOperationStatus.Add).ToList();
|
|
|
|
|
|
-
|
|
|
+
|
|
|
var questionOptionses = _mapper.Map<List<ExamQuestionOptions>>(questionOptionseDtos);
|
|
|
|
|
|
var sortIndex = 0;
|
|
@@ -563,7 +578,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
var questionSourcewareDtos = actionRequest.QuestionSourcewareDtos.Where(x => x.OperationStatus == EEOperationStatus.Add).ToList();
|
|
|
|
|
|
var questionSourcewares = _mapper.Map<List<ExamQuestionSourceware>>(questionSourcewareDtos);
|
|
|
-
|
|
|
+
|
|
|
questionSourcewares.ToInsert(_sessionContext);
|
|
|
|
|
|
await _questionSourcewareRepository.ValidateAddAsync(questionSourcewares, cancellationToken);
|
|
@@ -642,7 +657,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
entity.QuestionId = actionRequest.Id;
|
|
|
entitys.Add(_mapper.Map<UpdateQuestionKnowladgeDto, ExamQuestionKnowladge>(questionKnowladgeDto, entity));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -665,9 +680,9 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
var questionAnswer = await _questionAnswerRepository.GetAsync(actionRequest.QuestionAnswerDto.Id);
|
|
|
|
|
|
- questionAnswer = _mapper.Map<UpdateQuestionAnswerDto, ExamQuestionAnswer>(actionRequest.QuestionAnswerDto, questionAnswer);
|
|
|
+ questionAnswer = _mapper.Map<UpdateQuestionAnswerDto, ExamQuestionAnswer>(actionRequest.QuestionAnswerDto, questionAnswer);
|
|
|
|
|
|
- questionAnswer.QuestionId = actionRequest.Id;
|
|
|
+ questionAnswer.QuestionId = actionRequest.Id;
|
|
|
|
|
|
questionAnswer.ToUpdate(_sessionContext);
|
|
|
|
|
@@ -675,7 +690,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
return questionAnswer;
|
|
|
}
|
|
|
- private async Task<List<ExamQuestionOptions>> UpdateQuestionOptions(UpdateQuestionDto actionRequest,List<ExamQuestionOptions> all, CancellationToken cancellationToken)
|
|
|
+ private async Task<List<ExamQuestionOptions>> UpdateQuestionOptions(UpdateQuestionDto actionRequest, List<ExamQuestionOptions> all, CancellationToken cancellationToken)
|
|
|
{
|
|
|
if (actionRequest.QuestionOptionsDtos == null) return null;
|
|
|
|
|
@@ -690,14 +705,14 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
var questionOptionses = all.Where(x => ids.Contains(x.Id)).ToList();
|
|
|
|
|
|
var entitys = new List<ExamQuestionOptions>();
|
|
|
- foreach(var questionOptionsDto in questionOptionsDtos)
|
|
|
+ foreach (var questionOptionsDto in questionOptionsDtos)
|
|
|
{
|
|
|
var entity = questionOptionses.FirstOrDefault(x => x.Id == questionOptionsDto.Id);
|
|
|
if (entity != null)
|
|
|
{
|
|
|
entity.QuestionId = actionRequest.Id;
|
|
|
entitys.Add(_mapper.Map<UpdateQuestionOptionsDto, ExamQuestionOptions>(questionOptionsDto, entity));
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//questionOptionses = _mapper.Map<List<QuestionOptionsDto>, List<QuestionOptions>>(questionOptionsDtos,questionOptionses);
|
|
@@ -711,7 +726,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
return entitys;
|
|
|
}
|
|
|
|
|
|
- private async Task<List<ExamQuestionTag>> UpdateQuestionTags(UpdateQuestionDto actionRequest,List<ExamQuestionTag> all, CancellationToken cancellationToken)
|
|
|
+ private async Task<List<ExamQuestionTag>> UpdateQuestionTags(UpdateQuestionDto actionRequest, List<ExamQuestionTag> all, CancellationToken cancellationToken)
|
|
|
{
|
|
|
if (actionRequest.QuestionTagDtos == null) return null;
|
|
|
|
|
@@ -730,7 +745,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
entity.QuestionId = actionRequest.Id;
|
|
|
entitys.Add(_mapper.Map<UpdateQuestionTagDto, ExamQuestionTag>(questionOptionsDto, entity));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
//questionTags = _mapper.Map<List<UpdateQuestionTagDto>, List<QuestionTag>>(questionTagDtos,questionTags);
|
|
|
|
|
@@ -822,7 +837,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
if (actionRequest.QuestionAnswerDto == null)
|
|
|
{
|
|
|
- if (all == null)
|
|
|
+ if (all == null)
|
|
|
return null;
|
|
|
else
|
|
|
{
|
|
@@ -859,7 +874,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
{
|
|
|
questionAnswers.AddRange(add);
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
if (actionRequest.QuestionAnswerDto != null && actionRequest.QuestionAnswerDto.OperationStatus == EEOperationStatus.Delete)
|
|
|
{
|
|
@@ -881,7 +896,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
var questionOptions = new List<ExamQuestionOptions>();
|
|
|
|
|
|
- var all = await _questionOptionRepository.Queryable().Where(x=>x.QuestionId == actionRequest.Id).ToListAsync();
|
|
|
+ var all = await _questionOptionRepository.Queryable().Where(x => x.QuestionId == actionRequest.Id).ToListAsync();
|
|
|
|
|
|
actionRequest.QuestionOptionsDtos.ResolveOperationStatus(all);
|
|
|
|
|
@@ -927,7 +942,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
return questionTags;
|
|
|
}
|
|
|
|
|
|
- private EntityQueryRequest ResovleDelete<T>(IEnumerable<string> ids) where T:class,IEntity<string>,new()
|
|
|
+ private EntityQueryRequest ResovleDelete<T>(IEnumerable<string> ids) where T : class, IEntity<string>, new()
|
|
|
{
|
|
|
Expressionable<T> expressionable = ExpressionableUtility.CreateExpression<T>();
|
|
|
expressionable.AndIF(ids.Any(), x => ids.Contains(x.Id));
|
|
@@ -976,7 +991,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
|
|
|
private async Task<QuestionAnswerDto> GetQuestionAnswer(EntityQueryRequest entityQueryRequest)
|
|
|
{
|
|
|
- var questionAnswer = await _questionAnswerRepository.GetAsync(x=>x.QuestionId == entityQueryRequest.Id);
|
|
|
+ var questionAnswer = await _questionAnswerRepository.GetAsync(x => x.QuestionId == entityQueryRequest.Id);
|
|
|
|
|
|
var questionAnswerDto = _mapper.Map<QuestionAnswerDto>(questionAnswer);
|
|
|
|
|
@@ -1015,7 +1030,7 @@ namespace Hotline.Application.Exam.Service.Questions
|
|
|
base.Entity.QuestionKnowladges = await AddKnowladges(actionRequest, cancellationToken);
|
|
|
|
|
|
base.Entity.QuestionSourcewares = await AddSourcewares(actionRequest, cancellationToken);
|
|
|
-
|
|
|
+
|
|
|
return base.Entity;
|
|
|
}
|
|
|
#endregion
|