修改一版
This commit is contained in:
@@ -76,6 +76,17 @@ namespace IRaCIS.Application.Services
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetTrialJudgyInfo(SetTrialJudgyInfoInDto inDto)
|
||||
{
|
||||
|
||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
|
||||
|
||||
var judgeCount = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id && x.IsJudgeQuestion)
|
||||
.WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null)
|
||||
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null).CountAsync();
|
||||
|
||||
if (judgeCount == 0&&(inDto.ArbitrationRule== ArbitrationRule.Visit|| inDto.ArbitrationRule == ArbitrationRule.Reading))
|
||||
{
|
||||
throw new BusinessValidationFailedException("无裁判问题却有仲裁对象,操作失败");
|
||||
}
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(inDto.TrialId, x => new Trial()
|
||||
{
|
||||
ArbitrationRule = inDto.ArbitrationRule,
|
||||
|
||||
@@ -54,6 +54,18 @@ namespace IRaCIS.Core.Application
|
||||
[NonDynamicMethod]
|
||||
public async Task<IResponseOutput> TrialReadingInfoSign(TrialReadingInfoSignInDto inDto)
|
||||
{
|
||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm).FirstOrDefaultAsync();
|
||||
|
||||
var existsJudge = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id && x.IsJudgeQuestion && x.JudgeType == JudgeTypeEnum.None)
|
||||
.WhereIf(trialCriterion.FormType == FormType.SinglePage, x => x.ReadingCriterionPageId == null)
|
||||
.WhereIf(trialCriterion.FormType == FormType.MultiplePage, x => x.ReadingCriterionPageId != null)
|
||||
.AnyAsync();
|
||||
|
||||
if (existsJudge)
|
||||
{
|
||||
throw new BusinessValidationFailedException("配置了裁判问题但未配置裁判规则,操作失败");
|
||||
}
|
||||
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialId, x => new Trial()
|
||||
{
|
||||
ReadingInfoSignTime = DateTime.Now
|
||||
|
||||
Reference in New Issue
Block a user