Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
2b1b5dce52
|
@ -1571,13 +1571,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public bool IsJudgeQuestion { get; set; }
|
public bool IsJudgeQuestion { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetCalculateQuestionsOutDto
|
public class GetCalculateQuestionsOutDto: ReadingQuestionSystemView
|
||||||
{
|
{
|
||||||
public Guid QuestionId { get; set; }
|
|
||||||
|
|
||||||
public string QuestionName { get; set; }
|
public List<ReadingTableQuestionTrial> TableQuestions { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public List<CalculateQuestion> TableQuestions { get; set; }
|
|
||||||
|
public class GetSystemCalculateQuestionsOutDto : ReadingQuestionSystemView
|
||||||
|
{
|
||||||
|
|
||||||
|
public List<ReadingTableQuestionSystem> TableQuestions { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1620,7 +1624,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public Guid SystemCriterionId { get; set; }
|
public Guid SystemCriterionId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public string Type { get; set; }
|
public string Type { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public List<string> TypeList { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1630,7 +1638,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public Guid TrialCriterionId { get; set; }
|
public Guid TrialCriterionId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public string Type { get; set; }
|
public string Type { get; set; } = string.Empty;
|
||||||
|
|
||||||
public List<string> TypeList { get; set; } = new List<string>();
|
public List<string> TypeList { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<GetCalculateQuestionsOutDto>> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
|
public async Task<(List<GetCalculateQuestionsOutDto>,bool)> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
|
||||||
{
|
{
|
||||||
var result = await _readingQuestionTrialRepository
|
var result = await _readingQuestionTrialRepository
|
||||||
|
|
||||||
|
@ -96,35 +96,17 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
||||||
.WhereIf(inDto.TypeList.Count()>0, x => inDto.TypeList.Contains(x.Type))
|
.WhereIf(inDto.TypeList.Count()>0, x => inDto.TypeList.Contains(x.Type))
|
||||||
.OrderBy(x => x.ShowOrder)
|
.OrderBy(x => x.ShowOrder)
|
||||||
.Select(x => new GetCalculateQuestionsOutDto
|
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
()
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
var tablequestion = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == inDto.TrialCriterionId && x.Type == "number").Select(x =>
|
|
||||||
new
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
x.ReadingQuestionId,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
|
var tablequestion=await _readingTableQuestionTrialRepository.Where(x=>x.TrialCriterionId==inDto.TrialCriterionId).ToListAsync();
|
||||||
|
|
||||||
result.ForEach(x =>
|
result.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
|
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
|
||||||
{
|
|
||||||
|
|
||||||
QuestionId = y.QuestionId,
|
|
||||||
QuestionName = y.QuestionName
|
|
||||||
|
|
||||||
}).ToList();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return (result,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -133,39 +115,23 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<GetCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
|
public async Task<List<GetSystemCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
|
||||||
{
|
{
|
||||||
var result = await _readingQuestionSystemRepository
|
var result = await _readingQuestionSystemRepository
|
||||||
|
|
||||||
.Where(x => x.ReadingQuestionCriterionSystemId == inDto.SystemCriterionId)
|
.Where(x => x.ReadingQuestionCriterionSystemId == inDto.SystemCriterionId)
|
||||||
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
|
||||||
|
.WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type))
|
||||||
.OrderBy(x => x.ShowOrder)
|
.OrderBy(x => x.ShowOrder)
|
||||||
.Select(x => new GetCalculateQuestionsOutDto
|
.ProjectTo<GetSystemCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync() ;
|
||||||
()
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
var tablequestion = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId && x.Type == "number").Select(x =>
|
|
||||||
new
|
|
||||||
{
|
|
||||||
QuestionId = x.Id,
|
|
||||||
x.ReadingQuestionId,
|
|
||||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
|
||||||
}).ToListAsync();
|
|
||||||
|
|
||||||
|
var tablequestion = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync();
|
||||||
|
|
||||||
result.ForEach(x =>
|
result.ForEach(x =>
|
||||||
{
|
{
|
||||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
|
|
||||||
{
|
|
||||||
|
|
||||||
QuestionId = y.QuestionId,
|
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
|
||||||
QuestionName = y.QuestionName
|
|
||||||
|
|
||||||
}).ToList();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -220,6 +220,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
|
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionSystemView>()
|
||||||
|
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
||||||
|
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder));
|
||||||
|
|
||||||
|
CreateMap<ReadingQuestionTrial, GetCalculateQuestionsOutDto>();
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<ReadingQuestionSystem, GetCalculateQuestionsOutDto>();
|
||||||
|
|
||||||
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
|
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
|
||||||
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
|
||||||
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder))
|
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder))
|
||||||
|
|
|
@ -15,6 +15,9 @@ public class ReadingQuestionSystem : BaseAddAuditEntity
|
||||||
[ForeignKey("ReadingQuestionCriterionSystemId")]
|
[ForeignKey("ReadingQuestionCriterionSystemId")]
|
||||||
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
|
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<ReadingTableQuestionSystem> ReadingTableQuestionTrialList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("ParentId")]
|
[ForeignKey("ParentId")]
|
||||||
public ReadingQuestionSystem ParentReadingQuestionSystem { get; set; }
|
public ReadingQuestionSystem ParentReadingQuestionSystem { get; set; }
|
||||||
|
|
|
@ -12,6 +12,11 @@ public class ReadingTableQuestionSystem : BaseAddAuditEntity
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public ReadingTableQuestionSystem DependParentQuestion { get; set; }
|
public ReadingTableQuestionSystem DependParentQuestion { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("ReadingQuestionId")]
|
||||||
|
public ReadingQuestionSystem ReadingQuestionSystem { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public List<string> ParentTriggerValueList
|
public List<string> ParentTriggerValueList
|
||||||
{
|
{
|
||||||
|
|
17974
IRaCIS.Core.Infra.EFCore/Migrations/20241024011550_question202410240915.Designer.cs
generated
Normal file
17974
IRaCIS.Core.Infra.EFCore/Migrations/20241024011550_question202410240915.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,62 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class question202410240915 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingTableQuestionTrial",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "分类类型");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingTableQuestionSystem",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "分类类型");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingQuestionTrial",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "分类类型");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingQuestionSystem",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "分类类型");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingTableQuestionTrial");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingTableQuestionSystem");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingQuestionTrial");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ClassifyType",
|
||||||
|
table: "ReadingQuestionSystem");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -5479,6 +5479,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasComment("分类问题Id");
|
.HasComment("分类问题Id");
|
||||||
|
|
||||||
|
b.Property<int?>("ClassifyType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("分类类型");
|
||||||
|
|
||||||
b.Property<int>("ConvertShowType")
|
b.Property<int>("ConvertShowType")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasComment("转化显示类型");
|
.HasComment("转化显示类型");
|
||||||
|
@ -5729,6 +5733,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasComment("分类问题Id");
|
.HasComment("分类问题Id");
|
||||||
|
|
||||||
|
b.Property<int?>("ClassifyType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("分类类型");
|
||||||
|
|
||||||
b.Property<int>("ConvertShowType")
|
b.Property<int>("ConvertShowType")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasComment("转化显示类型");
|
.HasComment("转化显示类型");
|
||||||
|
@ -6318,6 +6326,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasComment("分类问题表格Id");
|
.HasComment("分类问题表格Id");
|
||||||
|
|
||||||
|
b.Property<int?>("ClassifyType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("分类类型");
|
||||||
|
|
||||||
b.Property<DateTime>("CreateTime")
|
b.Property<DateTime>("CreateTime")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
@ -6512,6 +6524,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasComment("分类问题表格Id");
|
.HasComment("分类问题表格Id");
|
||||||
|
|
||||||
|
b.Property<int?>("ClassifyType")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("分类类型");
|
||||||
|
|
||||||
b.Property<DateTime>("CreateTime")
|
b.Property<DateTime>("CreateTime")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue