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-22 13:45:17 +08:00
commit 773c657b67
9 changed files with 331 additions and 75 deletions

View File

@ -62,7 +62,8 @@ namespace IRaCIS.Api.Controllers
BasicInfoView = await _doctorService.GetBasicInfo(doctorId),
EmploymentView = await _doctorService.GetEmploymentInfo(doctorId),
AttachmentList = await attachmentService.GetAttachments(doctorId),
SummarizeInfo = await _doctorService.GetSummarizeInfo(doctorId),
PaymentModeInfo = await _doctorService.GetPaymentMode(doctorId),
EducationList = education.EducationList,
PostgraduateList = education.PostgraduateList,

View File

@ -1171,6 +1171,20 @@
<param name="indto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdateGneralSituation(IRaCIS.Application.Contracts.UpdateGneralSituationDto)">
<summary>
修改概述
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.GetSummarizeInfo(System.Guid)">
<summary>
获取概述
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.GetBasicInfo(System.Guid)">
<summary>
详情、编辑-获取 医生基本信息 BasicInfo
@ -16821,14 +16835,14 @@
工作兼职En
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.BasicInfoAndEmploymentDto.WorkPartTime">
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.Summarize">
<summary>
工作兼职
概述
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.BasicInfoAndEmploymentDto.WorkPartTimeEn">
<member name="P:IRaCIS.Application.Contracts.UpdateGneralSituationDto.SummarizeEn">
<summary>
工作兼职En
概述
</summary>
</member>
<member name="P:IRaCIS.Application.Contracts.EmploymentInfo.WorkPartTime">
@ -17089,6 +17103,13 @@
<param name="doctorId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Interfaces.IDoctorService.GetSummarizeInfo(System.Guid)">
<summary>
获取概述
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Application.Interfaces.IDoctorService.UpdateEmploymentInfo(IRaCIS.Application.Contracts.EmploymentCommand)">
<summary>
更新医生 工作信息

View File

@ -1,4 +1,5 @@
using IRaCIS.Core.Application.MassTransit.Command;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.MassTransit.Command;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain;
using IRaCIS.Core.Domain.BaseModel;
@ -33,77 +34,75 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
public async Task Consume(ConsumeContext<CRCSubmitedAndQCToAuditEvent> context)
{
//Console.WriteLine("发送(005,006) 【加急项目所有IQC待领取质控任务】邮件");
//var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
Console.WriteLine("发送(005,006) 【加急项目所有IQC待领取质控任务】邮件");
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
//var subjectVisitId = context.Message.SubjectVisitId;
var subjectVisitId = context.Message.SubjectVisitId;
//var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x=>x.Subject).FirstOrDefaultAsync();
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstOrDefaultAsync();
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
var auditStateCode = "AuditStatePE";
if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit)
{
auditStateCode = "AuditStateRC";
}
foreach (var userinfo in userinfoList)
{
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
//var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
{
//var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
DictionaryRepository = _dictionaryRepository,
IsEn_US = isEn_US,
DictionaryList = new List<DictionaryDto>()
{
new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
}
});
//var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
var subjectCode = subjectVisit.Subject.Code;
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
var htmlBodyStr = string.Format(
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
userinfo.FullName, // 用户名 {0}
trialInfo.ExperimentName, // 项目 {1}
subjectCode, // 受试者 {2}
subjectVisit.VisitName, // 访视 {3}
dictionValue[0], // 审核状态 {4}
_systemEmailConfig.SiteUrl // 链接 {5}
);
//foreach (var userinfo in userinfoList)
//{
// var messageToSend = new MimeMessage();
// //发件地址
// messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
// messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
return (topicStr, htmlBodyStr);
};
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
// var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQCClaim : EmailBusinessScenario.EligibilityVerification_PendingClaim,
messageToSend, emailConfigFunc);
// var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
// {
// DictionaryRepository = _dictionaryRepository,
// IsEn_US = isEn_US,
// DictionaryList = new List<DictionaryDto>()
// {
// new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
// }
// });
// Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
// {
// var subjectCode = subjectVisit.Subject.Code;
// var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, taskInfo.TaskBlindName);
// var htmlBodyStr = string.Format(
// CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
// userinfo.FullName, // 用户名 {0}
// trialInfo.ExperimentName, // 项目 {1}
// subjectCode, // 受试者 {2}
// subjectVisit.VisitName, // 访视 {3}
// dictionValue[0], // 审核状态 {4}
// _systemEmailConfig.SiteUrl // 链接 {5}
// );
// return (topicStr, htmlBodyStr);
// };
// await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
// context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed ? EmailBusinessScenario.ReReadFromPMApproval : EmailBusinessScenario.ReReadFromIRApproval,
// messageToSend, emailConfigFunc);
// await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
//}
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
}
}

View File

@ -247,6 +247,10 @@ namespace IRaCIS.Application.Contracts
public ResearchPublicationDTO ResearchPublicationView { get; set; }
public TrialExperienceModel TrialExperienceView { get; set; }
public ResumeConfirmDTO AuditView { get; set; }
public UpdateGneralSituationDto SummarizeInfo { get; set; }
public PaymentModeDto PaymentModeInfo { get; set; }
public IEnumerable<AttachmentDTO> AttachmentList { get; set; }
public List<SowDTO> SowList { get; set; }
@ -311,6 +315,53 @@ namespace IRaCIS.Application.Contracts
}
public class PaymentModeDto
{
public Guid Id { get; set; }
/// <summary>
/// 银行卡号
/// </summary>
public string BankNum { get; set; } = string.Empty;
/// <summary>
/// 银行名称
/// </summary>
public string BankName { get; set; } = string.Empty;
/// <summary>
/// 开户行
/// </summary>
public string OpeningBank { get; set; } = string.Empty;
/// <summary>
/// 身份证号
/// </summary>
public string IdCard { get; set; } = string.Empty;
/// <summary>
/// 银行手机号
/// </summary>
public string BankPhoneNum { get; set; } = string.Empty;
}
public class UpdateGneralSituationDto
{
public Guid Id { get; set; }
/// <summary>
/// 概述
/// </summary>
public string Summarize { get; set; } = string.Empty;
/// <summary>
/// 概述
/// </summary>
public string SummarizeEn { get; set; } = string.Empty;
}
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
{
//部门
@ -331,16 +382,6 @@ namespace IRaCIS.Application.Contracts
public Guid? PhysicianId { get; set; }
public string Physician { get; set; } = string.Empty;
public string PhysicianCN { get; set; } = string.Empty;
/// <summary>
/// 工作兼职
/// </summary>
public string WorkPartTime { get; set; } = string.Empty;
/// <summary>
/// 工作兼职En
/// </summary>
public string WorkPartTimeEn { get; set; } = string.Empty;
}
public class DoctorBasicInfoCommand : DoctorBasicInfo
{

View File

@ -118,12 +118,149 @@ namespace IRaCIS.Core.Application.Service
/// <param name="indto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput<DoctorBasicInfoCommand>> AddOrUpdateDoctorBasicInfoAndEmployment(BasicInfoAndEmploymentDto indto)
public async Task<IResponseOutput<BasicInfoAndEmploymentDto>> AddOrUpdateDoctorBasicInfoAndEmployment(BasicInfoAndEmploymentDto indto)
{
return await AddOrUpdateDoctorBasicInfo(indto);
Expression<Func<Doctor, bool>> verifyExp = t => t.Phone == indto.Phone || t.EMail == indto.EMail;
//---current phone or email number already existed
var verifyPair = new KeyValuePair<Expression<Func<Doctor, bool>>, string>(verifyExp, _localizer["Doctor_DupPhoneOrEmail"]);
if (indto.Id == Guid.Empty || indto.Id == null)
{
var doctor = _mapper.Map<Doctor>(indto);
//验证用户手机号
if (await _doctorRepository.AnyAsync(t => t.Phone == doctor.Phone))
{
//---The current phone number already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupPhone"], new BasicInfoAndEmploymentDto());
}
if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail))
{
//---The current email already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new BasicInfoAndEmploymentDto());
}
doctor.Code = await _doctorRepository.Select(t => t.Code).DefaultIfEmpty().MaxAsync() + 1;
doctor.ReviewerCode = AppSettings.GetCodeStr(doctor.Code, nameof(Doctor));
doctor.Password = MD5Helper.Md5(doctor.Phone);
//插入中间表
indto.TitleIds.ForEach(titleId => doctor.DoctorDicRelationList.Add(new DoctorDictionary() { DoctorId = doctor.Id, KeyName = StaticData.Title, DictionaryId = titleId }));
await _doctorRepository.AddAsync(doctor);
//_doctorRepository.Add(doctor);
//await _repository.AddAsync(new UserDoctor() { DoctorId = doctor.Id, UserId = _userInfo.Id });
//_userDoctorRepository.Add(new UserDoctor() { DoctorId = doctor.Id, UserId = _userInfo.Id });
var success = await _doctorDictionaryRepository.SaveChangesAsync();
return ResponseOutput.Result(success, _mapper.Map<BasicInfoAndEmploymentDto>(doctor));
}
else
{
var updateModel = indto;
var phone = updateModel.Phone.Trim();
if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id)) != null)
{
//---The current phone number already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupPhone"], new BasicInfoAndEmploymentDto());
}
var email = updateModel.EMail.Trim();
if (await _doctorRepository.AnyAsync(t => t.EMail == email && t.Id != updateModel.Id))
{
//---The current email already existed!
return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new BasicInfoAndEmploymentDto());
}
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == updateModel.Id).IfNullThrowException();
//删除中间表 Title对应的记录
await _doctorDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DoctorId == updateModel.Id && t.KeyName == StaticData.Title);
var adddata = new List<DoctorDictionary>();
//重新插入新的 Title记录
updateModel.TitleIds.ForEach(titleId => adddata.Add(new DoctorDictionary() { DoctorId = updateModel.Id.Value, KeyName = StaticData.Title, DictionaryId = titleId }));
await _doctorDictionaryRepository.AddRangeAsync(adddata);
_mapper.Map(indto, doctor);
var success = await _doctorDictionaryRepository.SaveChangesAsync();
return ResponseOutput.Result(success, indto);
}
}
/// <summary>
/// 修改概述
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task UpdateGneralSituation(UpdateGneralSituationDto inDto)
{
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new Doctor()
{
Summarize = inDto.Summarize,
SummarizeEn = inDto.SummarizeEn,
});
await _doctorRepository.SaveChangesAsync();
}
/// <summary>
/// 获取概述
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public async Task<UpdateGneralSituationDto?> GetSummarizeInfo(Guid Id)
{
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == Id)
.ProjectTo<UpdateGneralSituationDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
return doctorBasicInfo;
}
/// <summary>
/// 修改支付方式
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task UpdatePaymentMode(PaymentModeDto inDto)
{
var doctor = await _doctorRepository.FirstOrDefaultAsync(t => t.Id == inDto.Id).IfNullThrowException();
_mapper.Map(inDto, doctor);
var success = await _doctorDictionaryRepository.SaveChangesAsync();
}
/// <summary>
/// 获取支付方式
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public async Task<PaymentModeDto> GetPaymentMode(Guid Id)
{
var doctorBasicInfo = await _doctorRepository.Where(t => t.Id == Id)
.ProjectTo<PaymentModeDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
return doctorBasicInfo;
}
/// <summary>

View File

@ -30,6 +30,22 @@ namespace IRaCIS.Application.Interfaces
/// <param name="doctorId"></param>
/// <returns></returns>
Task<EmploymentDTO> GetEmploymentInfo(Guid doctorId);
/// <summary>
///获取支付信息
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<PaymentModeDto> GetPaymentMode(Guid Id);
/// <summary>
/// 获取概述
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<UpdateGneralSituationDto?> GetSummarizeInfo(Guid Id);
/// <summary>
/// 更新医生 工作信息
/// </summary>

View File

@ -19,7 +19,6 @@ namespace IRaCIS.Core.Application.Service
{
var doctorScientificResearchInfo = await _researchPublicationRepository.Where(o => o.DoctorId == doctorId)
.ProjectTo<ResearchPublicationDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
return doctorScientificResearchInfo!;
}

View File

@ -61,6 +61,11 @@ namespace IRaCIS.Core.Application.Service
CreateMap<Doctor, ResumeConfirmDTO>();
CreateMap<Doctor, DoctorSelectDTO>();
CreateMap<Doctor, UpdateGneralSituationDto>();
CreateMap<Doctor, PaymentModeDto>();
CreateMap<PaymentModeDto, Doctor>();
CreateMap<Doctor, TrialExperienceModel>();
CreateMap<TrialExperience, TrialExperienceCommand>();

View File

@ -182,6 +182,43 @@ public class Doctor : BaseFullAuditEntity
/// </summary>
public string WorkPartTimeEn { get; set; } = string.Empty;
/// <summary>
/// 概述
/// </summary>
public string Summarize { get; set; } = string.Empty;
/// <summary>
/// 概述
/// </summary>
public string SummarizeEn { get; set; } = string.Empty;
/// <summary>
/// 银行卡号
/// </summary>
public string BankNum { get; set; } = string.Empty;
/// <summary>
/// 银行名称
/// </summary>
public string BankName { get; set; } = string.Empty;
/// <summary>
/// 开户行
/// </summary>
public string OpeningBank { get; set; } = string.Empty;
/// <summary>
/// 身份证号
/// </summary>
public string IdCard { get; set; } = string.Empty;
/// <summary>
/// 银行手机号
/// </summary>
public string BankPhoneNum { get; set; } = string.Empty;
[NotMapped]
public string FullName => LastName + " / " + FirstName;
}