代码修改

IRC_NewDev
he 2024-11-20 16:10:35 +08:00
parent 26c2e917d9
commit 8eff23a8f2
10 changed files with 18450 additions and 37 deletions

View File

@ -1139,7 +1139,7 @@
<param name="indto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdateGneralSituation(IRaCIS.Application.Contracts.UpdateGneralSituationDto)">
<member name="M:IRaCIS.Core.Application.Service.DoctorService.AddOrUpdateGneralSituation(IRaCIS.Application.Contracts.SummarizeInfoDto)">
<summary>
修改概述
</summary>
@ -17226,16 +17226,41 @@
银行手机号
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.Summarize">
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.DoctorId">
<summary>
医生Id
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.Summarize">
<summary>
概述
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.SummarizeEn">
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.SummarizeEn">
<summary>
概述
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.IsMain">
<summary>
是否是主模板
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.Indication">
<summary>
适应症
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.IndicationEn">
<summary>
适应症
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.SummarizeInfoDto.TrialId">
<summary>
项目Id
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.EmploymentInfo.WorkPartTime">
<summary>
工作兼职

View File

@ -368,11 +368,15 @@ namespace IRaCIS.Application.Contracts
public Guid? TrialId { get; set; }
}
public class UpdateGneralSituationDto
public class SummarizeInfoDto
{
public Guid Id { get; set; }
public Guid? TrialId { get; set; }
public Guid? Id { get; set; }
/// <summary>
/// 医生Id
/// </summary>
public Guid DoctorId { get; set; }
/// <summary>
/// 概述
@ -383,6 +387,31 @@ namespace IRaCIS.Application.Contracts
/// 概述
/// </summary>
public string SummarizeEn { get; set; } = string.Empty;
/// <summary>
/// 是否是主模板
/// </summary>
public bool IsMain { get; set; }
/// <summary>
/// 适应症
/// </summary>
public string Indication { get; set; }
/// <summary>
/// 适应症
/// </summary>
public string IndicationEn { get; set; }
/// <summary>
/// 项目Id
/// </summary>
public Guid? TrialId { get; set; }
}
public class UpdateGneralSituationDto
{
public List<SummarizeInfoDto> SummarizeList { get; set; }
}
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand

View File

@ -1,9 +1,11 @@
using IRaCIS.Application.Contracts;
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.MassTransit.Consumer;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using MimeKit;
@ -13,7 +15,9 @@ namespace IRaCIS.Core.Application.Service
[ApiExplorerSettings(GroupName = "Reviewer")]
public class DoctorService(IRepository<Doctor> _doctorRepository,
IRepository<DoctorDictionary> _doctorDictionaryRepository,
IRepository<DoctorSummarize> _doctorSummarizeRepository,
IRepository<Enroll> _enrollRepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<Attachment> _attachmentRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
@ -218,29 +222,27 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> UpdateGneralSituation(UpdateGneralSituationDto inDto)
public async Task<DoctorSummarize> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
{
if (inDto.TrialId != null)
{
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.DoctorId == inDto.Id&&x.TrialId==inDto.TrialId.Value, x => new Doctor()
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
if (systemCount == 0)
{
Summarize = inDto.Summarize,
SummarizeEn = inDto.SummarizeEn,
});
var trialinfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync();
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
inDto.IndicationEn = dictionery.Value;
inDto.Indication = dictionery.ValueCN;
var system= inDto.Clone();
system.TrialId = null;
system.IsMain = true;
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
}
else
{
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new Doctor()
{
Summarize = inDto.Summarize,
SummarizeEn = inDto.SummarizeEn,
});
}
var success= await _doctorRepository.SaveChangesAsync();
return success;
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
return entity;
}
@ -249,10 +251,10 @@ namespace IRaCIS.Core.Application.Service
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public async Task<UpdateGneralSituationDto?> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
{
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == inDto.DoctorId)
.ProjectTo<UpdateGneralSituationDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
var result = await _doctorSummarizeRepository.Where(t => t.Id == inDto.DoctorId && t.TrialId == inDto.TrialId)
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
if (inDto.TrialId != null)
{
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
@ -261,15 +263,11 @@ namespace IRaCIS.Core.Application.Service
DoctorId = inDto.DoctorId,
});
doctorBasicInfo = new UpdateGneralSituationDto()
{
Summarize = doctorInfo.Summarize,
SummarizeEn = doctorInfo.SummarizeEn,
};
}
return doctorBasicInfo;
return new UpdateGneralSituationDto() {
SummarizeList= result
};
}
/// <summary>

View File

@ -8,6 +8,7 @@ namespace IRaCIS.Core.Application.Service
[ApiExplorerSettings(GroupName = "Reviewer")]
public class TrialExperienceService(IRepository<TrialExperience> _trialExperienceRepository,
IRepository<Doctor> _doctorRepository,
IRepository<DoctorSummarize> _doctorSummarizeRepository,
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
IRepository<Attachment> _attachmentRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialExperienceService
{
@ -85,10 +86,25 @@ namespace IRaCIS.Core.Application.Service
TrialId = inDto.TrialId,
OtherClinicalExperience = systemInfoDcotor.OtherClinicalExperience,
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
Summarize = systemInfoDcotor.Summarize,
SummarizeEn = systemInfoDcotor.SummarizeEn,
};
///没有就加
var summarizeCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).CountAsync();
if (summarizeCount == 0)
{
var main = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.IsMain && x.TrialId == null).ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
if (main != null)
{
main.Id=null;
main.TrialId = inDto.TrialId;
main.IsMain = false;
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(main, true);
}
}
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
}

View File

@ -78,6 +78,9 @@ namespace IRaCIS.Core.Application.Service
CreateMap<Doctor, PaymentModeDto>();
CreateMap<DoctorSummarize, SummarizeInfoDto>();
CreateMap<SummarizeInfoDto, DoctorSummarize>();
CreateMap<PaymentModeDto, Doctor>();
CreateMap<Doctor, TrialExperienceModel>();

View File

@ -0,0 +1,46 @@
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Domain.Models;
[Comment("医生 - 概述")]
[Table("DoctorSummarize")]
public class DoctorSummarize : BaseFullAuditEntity
{
/// <summary>
/// 医生Id
/// </summary>
public Guid DoctorId { get; set; }
/// <summary>
/// 概述
/// </summary>
[MaxLength]
public string Summarize { get; set; } = string.Empty;
/// <summary>
/// 概述
/// </summary>
[MaxLength]
public string SummarizeEn { get; set; } = string.Empty;
/// <summary>
/// 是否是主模板
/// </summary>
public bool IsMain { get; set; }
/// <summary>
/// 适应症
/// </summary>
public string Indication { get; set; }
/// <summary>
/// 适应症
/// </summary>
public string IndicationEn { get; set; }
/// <summary>
/// 项目Id
/// </summary>
public Guid? TrialId { get; set; }
}

View File

@ -230,6 +230,8 @@ public class IRaCISDBContext : DbContext
public virtual DbSet<Dictionary> Dictionary { get; set; }
public virtual DbSet<Doctor> Doctor { get; set; }
public virtual DbSet<DoctorSummarize> DoctorSummarize { get; set; }
public virtual DbSet<DoctorCriterionFile> DoctorCriterionFile { get; set; }
public virtual DbSet<DoctorDictionary> DoctorDictionary { get; set; }
public virtual DbSet<Postgraduate> Postgraduate { get; set; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class doctors : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DoctorSummarize",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
DoctorId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Summarize = table.Column<string>(type: "nvarchar(max)", nullable: false),
SummarizeEn = table.Column<string>(type: "nvarchar(max)", nullable: false),
IsMain = table.Column<bool>(type: "bit", nullable: false),
Indication = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
IndicationEn = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
TrialId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DoctorSummarize", x => x.Id);
table.ForeignKey(
name: "FK_DoctorSummarize_User_CreateUserId",
column: x => x.CreateUserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "医生 - 概述");
migrationBuilder.CreateIndex(
name: "IX_DoctorSummarize_CreateUserId",
table: "DoctorSummarize",
column: "CreateUserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DoctorSummarize");
}
}
}

View File

@ -1706,6 +1706,60 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
});
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DoctorSummarize", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime2");
b.Property<Guid>("CreateUserId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("DoctorId")
.HasColumnType("uniqueidentifier");
b.Property<string>("Indication")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<string>("IndicationEn")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<bool>("IsMain")
.HasColumnType("bit");
b.Property<string>("Summarize")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SummarizeEn")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("TrialId")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime2");
b.Property<Guid>("UpdateUserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("CreateUserId");
b.ToTable("DoctorSummarize", t =>
{
t.HasComment("医生 - 概述");
});
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.Education", b =>
{
b.Property<Guid>("Id")
@ -14164,6 +14218,17 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Navigation("Doctor");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.DoctorSummarize", b =>
{
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")
.WithMany()
.HasForeignKey("CreateUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CreateUser");
});
modelBuilder.Entity("IRaCIS.Core.Domain.Models.Education", b =>
{
b.HasOne("IRaCIS.Core.Domain.Models.User", "CreateUser")