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

IRC_NewDev
hang 2024-10-24 10:29:43 +08:00
commit 2b1b5dce52
8 changed files with 18095 additions and 51 deletions

View File

@ -1571,13 +1571,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
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 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 string Type { get; set; }
public string Type { get; set; } = string.Empty;
public List<string> TypeList { get; set; } = new List<string>();

View File

@ -88,7 +88,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetCalculateQuestionsOutDto>> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
public async Task<(List<GetCalculateQuestionsOutDto>,bool)> GetCalculateQuestions(GetCalculateQuestionsInDto inDto)
{
var result = await _readingQuestionTrialRepository
@ -96,35 +96,17 @@ namespace IRaCIS.Core.Application.Service
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
.WhereIf(inDto.TypeList.Count()>0, x => inDto.TypeList.Contains(x.Type))
.OrderBy(x => x.ShowOrder)
.Select(x => new GetCalculateQuestionsOutDto
()
{
QuestionId = x.Id,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
.ProjectTo<GetCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync();
}).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 =>
{
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
{
QuestionId = y.QuestionId,
QuestionName = y.QuestionName
}).ToList();
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
});
return result;
return (result,true);
}
/// <summary>
@ -133,39 +115,23 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
public async Task<List<GetSystemCalculateQuestionsOutDto>> GetSystemCalculateQuestions(GetSystemCalculateQuestionsInDto inDto)
{
var result = await _readingQuestionSystemRepository
.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)
.Select(x => new GetCalculateQuestionsOutDto
()
{
QuestionId = x.Id,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
.ProjectTo<GetSystemCalculateQuestionsOutDto>(_mapper.ConfigurationProvider).ToListAsync() ;
}).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 =>
{
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.ReadingQuestionId).Select(y => new CalculateQuestion()
{
QuestionId = y.QuestionId,
QuestionName = y.QuestionName
}).ToList();
x.TableQuestions = tablequestion.Where(y => y.ReadingQuestionId == x.Id).ToList();
});
return result;

View File

@ -220,6 +220,16 @@ namespace IRaCIS.Core.Application.Service
.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>()
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
.ForMember(d => d.DependShowOrder, u => u.MapFrom(s => s.DependParentQuestion.ShowOrder))

View File

@ -15,6 +15,9 @@ public class ReadingQuestionSystem : BaseAddAuditEntity
[ForeignKey("ReadingQuestionCriterionSystemId")]
public ReadingQuestionCriterionSystem ReadingQuestionCriterionSystem { get; set; }
[JsonIgnore]
public List<ReadingTableQuestionSystem> ReadingTableQuestionTrialList { get; set; }
[JsonIgnore]
[ForeignKey("ParentId")]
public ReadingQuestionSystem ParentReadingQuestionSystem { get; set; }

View File

@ -12,6 +12,11 @@ public class ReadingTableQuestionSystem : BaseAddAuditEntity
[JsonIgnore]
public ReadingTableQuestionSystem DependParentQuestion { get; set; }
[JsonIgnore]
[ForeignKey("ReadingQuestionId")]
public ReadingQuestionSystem ReadingQuestionSystem { get; set; }
[NotMapped]
public List<string> ParentTriggerValueList
{

File diff suppressed because it is too large Load Diff

View File

@ -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");
}
}
}

View File

@ -5479,6 +5479,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("uniqueidentifier")
.HasComment("分类问题Id");
b.Property<int?>("ClassifyType")
.HasColumnType("int")
.HasComment("分类类型");
b.Property<int>("ConvertShowType")
.HasColumnType("int")
.HasComment("转化显示类型");
@ -5729,6 +5733,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("uniqueidentifier")
.HasComment("分类问题Id");
b.Property<int?>("ClassifyType")
.HasColumnType("int")
.HasComment("分类类型");
b.Property<int>("ConvertShowType")
.HasColumnType("int")
.HasComment("转化显示类型");
@ -6318,6 +6326,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("uniqueidentifier")
.HasComment("分类问题表格Id");
b.Property<int?>("ClassifyType")
.HasColumnType("int")
.HasComment("分类类型");
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime2");
@ -6512,6 +6524,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("uniqueidentifier")
.HasComment("分类问题表格Id");
b.Property<int?>("ClassifyType")
.HasColumnType("int")
.HasComment("分类类型");
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime2");