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

This commit is contained in:
2024-10-24 14:12:01 +08:00
11 changed files with 522 additions and 60 deletions
@@ -2,6 +2,7 @@
using AutoMapper.EquivalencyExpression;
using IRaCIS.Application.Contracts;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
namespace IRaCIS.Core.Application.Service
@@ -15,8 +16,6 @@ namespace IRaCIS.Core.Application.Service
CreateMap<UserCommand, User>().ForMember(d => d.UserCode, x => x.Ignore());
CreateMap<UserType, UserTypeMenuAddOrEdit>().ReverseMap()
.ForMember(t => t.UserTypeMenuList, u => u.MapFrom(c => c.MenuIds))
@@ -1598,6 +1598,165 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid QuestionId { get; set; }
public string QuestionName { get; set; }
[NotMapped]
public List<string> ParentTriggerValueList
{
get
{
try
{
return this.ParentTriggerValue.Split(',').ToList();
}
catch (Exception)
{
return new List<string>();
}
}
}
[NotMapped]
public List<string> RelevanceValueList
{
get
{
try
{
return this.RelevanceValue.Split(',').ToList();
}
catch (Exception)
{
return new List<string>();
}
}
}
[Comment("系统表的问题Id ReadingQuestionSystem的Id")]
public Guid ReadingQuestionId { get; set; }
public string Type { get; set; } = string.Empty;
public Guid? ParentId { get; set; }
[Comment("父问题触发值")]
public string ParentTriggerValue { get; set; } = string.Empty;
public IsRequired IsRequired { get; set; }
[Comment("排序号")]
public int ShowOrder { get; set; }
[Comment("值")]
public string TypeValue { get; set; } = string.Empty;
[Comment("是否启用")]
public bool IsEnable { get; set; }
[Comment("备注")]
public string Remark { get; set; } = string.Empty;
[Comment("显示父问题")]
public Guid? RelevanceId { get; set; }
[Comment("显示父问题的值")]
public string RelevanceValue { get; set; } = string.Empty;
[Comment("是否显示")]
public int ShowQuestion { get; set; }
[Comment("最大问题数")]
public int? MaxRowCount { get; set; }
[Comment("图片数量")]
public int? ImageCount { get; set; }
[Comment("数据表名称")]
public string DataTableName { get; set; } = string.Empty;
[Comment("数据列")]
public string DataTableColumn { get; set; } = string.Empty;
[Comment("关联父问题")]
public Guid? DependParentId { get; set; }
[Comment("是否关联")]
public IsDepend IsDepend { get; set; }
[Comment("表格问题类型")]
public TableQuestionType? TableQuestionType { get; set; }
[Comment("系统标准Id")]
public Guid SystemCriterionId { get; set; }
[Comment("问题标识")]
public QuestionMark? QuestionMark { get; set; }
[Comment("字典code")]
public string DictionaryCode { get; set; } = string.Empty;
[Comment("数值类型")]
public ValueOfType? ValueType { get; set; }
[Comment("单位")]
public ValueUnit? Unit { get; set; }
[Comment("问题英文名称")]
public string QuestionEnName { get; set; } = string.Empty;
[Comment("数据来源")]
public DataSources DataSource { get; set; } = DataSources.ManualEntry;
[Comment("限制编辑")]
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
[Comment("最大答案长度")]
public int? MaxAnswerLength { get; set; }
[Comment("文件类型")]
public string? FileType { get; set; } = string.Empty;
[Comment("问题分类")]
public QuestionClassify? QuestionClassify { get; set; }
[Comment("复制病灶的时候 是否复制这个问题")]
public bool IsCopy { get; set; } = false;
[Comment("分类问题表格Id")]
public Guid? ClassifyTableQuestionId { get; set; }
[Comment("分类类型")]
public ClassifyType? ClassifyType { get; set; }
[Comment("分类算法")]
public string ClassifyAlgorithms { get; set; } = string.Empty;
[Comment("导出标识")]
public ExportIdentification? ExportIdentification { get; set; }
[Comment("导出结果")]
public string ExportResultStr { get; set; } = "[]";
[NotMapped]
public List<ExportResult> ExportResult
{
get
{
try
{
var result = JsonConvert.DeserializeObject<List<ExportResult>>(this.ExportResultStr);
return result == null ? new List<ExportResult>() : result;
}
catch (Exception)
{
return new List<ExportResult>();
}
}
}
}
@@ -152,13 +152,10 @@ namespace IRaCIS.Core.Application.Service
.Where(x => x.ReadingQuestionId == inDto.QuestionId)
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
.OrderBy(x => x.ShowOrder)
.Select(x => new GetCalculateTableQuestionsOutDto
()
{
QuestionId = x.Id,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
}).ToListAsync();
.ProjectTo<GetCalculateTableQuestionsOutDto>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us,
}).ToListAsync();
return result;
}
@@ -177,13 +174,10 @@ namespace IRaCIS.Core.Application.Service
.Where(x => x.ReadingQuestionId == inDto.QuestionId)
.WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type)
.OrderBy(x => x.ShowOrder)
.Select(x => new GetCalculateTableQuestionsOutDto
()
{
QuestionId = x.Id,
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
}).ToListAsync();
.ProjectTo<GetCalculateTableQuestionsOutDto>(_mapper.ConfigurationProvider, new
{
isEn_Us = _userInfo.IsEn_Us,
}).ToListAsync();
return result;
}
@@ -228,7 +228,15 @@ namespace IRaCIS.Core.Application.Service
CreateMap<ReadingQuestionTrial, GetCalculateQuestionsOutDto>();
CreateMap<ReadingQuestionSystem, GetCalculateQuestionsOutDto>();
CreateMap<ReadingQuestionSystem, GetSystemCalculateQuestionsOutDto>();
CreateMap<ReadingTableQuestionSystem, GetCalculateTableQuestionsOutDto>()
.ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName));
CreateMap<ReadingTableQuestionTrial, GetCalculateTableQuestionsOutDto>()
.ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName));
CreateMap<ReadingTableQuestionTrial, ReadingTableQuestionTrialView>()
.ForMember(dest => dest.CreateUser, opt => opt.Ignore())
@@ -229,6 +229,20 @@ namespace IRaCIS.Core.Application.Contracts
public string EmailOrPhone { get; set; }
}
/// <summary>
///
/// </summary>
public class UseUserIDGetDoctorIDOutDto
{
public Guid? DoctorID { get; set; }
}
public class UseUserIDGetDoctorIDInDto
{
public Guid UserID { get; set; }
}
public class VerifyEmialGetDoctorInfoOutDto
{
public Guid? DoctorId { get; set; }
@@ -18,6 +18,8 @@ using Microsoft.VisualBasic;
using MimeKit;
using Newtonsoft.Json;
using System.Text.RegularExpressions;
using static MassTransit.ValidationResultExtensions;
using DocumentFormat.OpenXml.Vml.Spreadsheet;
namespace IRaCIS.Core.Application.Contracts
{
@@ -68,6 +70,50 @@ namespace IRaCIS.Core.Application.Contracts
return ResponseOutput.Ok();
}
/// <summary>
/// 通过UserId获取Doctorid
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<UseUserIDGetDoctorIDOutDto> UseUserIDGetDoctorID(UseUserIDGetDoctorIDInDto inDto)
{
var userinfo = await _userRepository.Where(x => x.Id == inDto.UserID).FirstOrDefaultAsync();
if (userinfo != null && userinfo.DoctorId != null)
{
return new UseUserIDGetDoctorIDOutDto()
{
DoctorID = userinfo.DoctorId
};
}
else
{
Doctor doctor = new Doctor()
{
};
var info = await _doctorRepository.AddAsync(doctor, true);
await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.UserID, x => new User()
{
DoctorId = info.Id
});
return new UseUserIDGetDoctorIDOutDto()
{
DoctorID = info.Id
};
}
}
/// <summary>
/// 验证邮箱验证码 获取医生信息Id
/// </summary>
@@ -107,6 +153,18 @@ namespace IRaCIS.Core.Application.Contracts
result.DoctorId = dockerInfo.Id;
result.ReviewStatus = dockerInfo.ReviewStatus;
}
else
{
Doctor doctor = new Doctor()
{
EMail = inDto.EmailOrPhone
};
var info=await _doctorRepository.AddAsync(doctor,true);
result.DoctorId = info.Id;
result.ReviewStatus = info.ReviewStatus;
}
result.Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()));
}