修改中心调研

Uat_Study
hang 2023-07-06 10:23:19 +08:00
parent 0a2a5bdd7a
commit 3ddbd59995
6 changed files with 116 additions and 54 deletions

35
Dockerfile Normal file
View File

@ -0,0 +1,35 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 7050
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["IRaCIS.Core.API/IRaCIS.Core.API.csproj", "IRaCIS.Core.API/"]
COPY ["IRaCIS.Core.Application/IRaCIS.Core.Application.csproj", "IRaCIS.Core.Application/"]
COPY ["IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj", "IRaCIS.Core.Infra.EFCore/"]
COPY ["IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj", "IRaCIS.Core.Domain/"]
COPY ["IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj", "IRaCIS.Core.Domain.Share/"]
COPY ["IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj", "IRaCIS.Core.Infrastructure/"]
RUN dotnet restore "IRaCIS.Core.API/IRaCIS.Core.API.csproj"
COPY . .
WORKDIR "/src/IRaCIS.Core.API"
RUN dotnet build "IRaCIS.Core.API.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "IRaCIS.Core.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_ENVIRONMENT=Development
ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]

35
Dockerfile1 Normal file
View File

@ -0,0 +1,35 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 7050
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["IRaCIS.Core.API/IRaCIS.Core.API.csproj", "IRaCIS.Core.API/"]
COPY ["IRaCIS.Core.Application/IRaCIS.Core.Application.csproj", "IRaCIS.Core.Application/"]
COPY ["IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj", "IRaCIS.Core.Infra.EFCore/"]
COPY ["IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj", "IRaCIS.Core.Domain/"]
COPY ["IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj", "IRaCIS.Core.Domain.Share/"]
COPY ["IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj", "IRaCIS.Core.Infrastructure/"]
RUN dotnet restore "IRaCIS.Core.API/IRaCIS.Core.API.csproj"
COPY . .
WORKDIR "/src/IRaCIS.Core.API"
RUN dotnet build "IRaCIS.Core.API.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "IRaCIS.Core.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_ENVIRONMENT=Development
ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"]

View File

@ -5,7 +5,7 @@
<SignAssembly>false</SignAssembly> <SignAssembly>false</SignAssembly>
<UserSecretsId>354572d4-9e15-4099-807c-63a2d29ff9f2</UserSecretsId> <UserSecretsId>354572d4-9e15-4099-807c-63a2d29ff9f2</UserSecretsId>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
<Version>1.0.1.001</Version> <Version>1.0.1.001</Version>
<Company>上海展影医疗科技有限公司</Company> <Company>上海展影医疗科技有限公司</Company>
<Product>IRC影像系统 (EICS)</Product> <Product>IRC影像系统 (EICS)</Product>
@ -105,9 +105,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\EmailTemplate\AdminAddUser_US.html"> <Content Update="wwwroot\EmailTemplate\AdminAddUser_US.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
@ -170,5 +167,13 @@
<ProjectExtensions><VisualStudio><UserProperties anonymizetagsetting_1json__JsonSchema="http://json.schemastore.org/jovo-language-model" properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties anonymizetagsetting_1json__JsonSchema="http://json.schemastore.org/jovo-language-model" properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
<ItemGroup>
<None Remove="..\.dockerignore" />
</ItemGroup>
<ItemGroup>
<None Remove="..\.dockerignore" />
</ItemGroup>
</Project> </Project>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<variable name="myvar" value="myvalue"/>
<targets>
<target xsi:type="file" name="File" fileName="${basedir}/logs/${shortdate}/${level}.log"
layout="${longdate}||${level}||${logger}||${message}||${exception:format=ToString:innerFormat=ToString:maxInnerExceptionLevel=10:separator=\r\n}||end" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
</rules>
</nlog>

View File

@ -102,7 +102,7 @@ namespace IRaCIS.Core.Application.Contracts
//检查验证码是否失效 //检查验证码是否失效
if (verificationRecord.ExpirationTime < DateTime.Now) if (verificationRecord.ExpirationTime < DateTime.Now)
{ {
//---验证码已经过期。 //---验证码已经过期。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]); throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
} }
else //验证码正确 并且 没有超时 else //验证码正确 并且 没有超时
@ -220,7 +220,7 @@ namespace IRaCIS.Core.Application.Contracts
//检查验证码是否失效 //检查验证码是否失效
if (verificationRecord.ExpirationTime < DateTime.Now) if (verificationRecord.ExpirationTime < DateTime.Now)
{ {
//---验证码已经过期。 //---验证码已经过期。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]); return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
} }
else //验证码正确 并且 没有超时 else //验证码正确 并且 没有超时
@ -323,7 +323,7 @@ namespace IRaCIS.Core.Application.Contracts
//该site 下不存在该邮箱的记录 //该site 下不存在该邮箱的记录
if (!dbEntityList.Any(t => t.Email == userInfo.EmailOrPhone || t.Phone == userInfo.EmailOrPhone)) if (!dbEntityList.Any(t => t.Email == userInfo.EmailOrPhone || t.Phone == userInfo.EmailOrPhone))
{ {
//---该中心下已经有其他用户已填写的调研表,您不被允许继续填写 //---该中心下已经有其他用户已填写的调研表,您不被允许继续填写
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_AlreadyFilledByOtherUsers"]); return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_AlreadyFilledByOtherUsers"]);
} }
@ -407,7 +407,7 @@ namespace IRaCIS.Core.Application.Contracts
{ {
if (await _trialSiteSurveyRepository.AnyAsync(t => t.Id == addOrEditTrialSiteSurvey.Id && t.State == TrialSiteSurveyEnum.PMCreatedAndLock)) if (await _trialSiteSurveyRepository.AnyAsync(t => t.Id == addOrEditTrialSiteSurvey.Id && t.State == TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
//---中心调研已锁定,不允许操作。 //---中心调研已锁定,不允许操作。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]); return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]);
} }
} }
@ -734,39 +734,44 @@ namespace IRaCIS.Core.Application.Contracts
var trialId = siteSurvyeSubmit.TrialId; var trialId = siteSurvyeSubmit.TrialId;
var trialSiteSurveyId = siteSurvyeSubmit.TrialSiteSurveyId; var trialSiteSurveyId = siteSurvyeSubmit.TrialSiteSurveyId;
if (_userInfo.IsAdmin) var trialSiteSurvey = (await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).FirstOrDefaultAsync()).IfNullThrowException();
{
//---不允许管理员操作。 var siteUserList = await _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurvey.SiteId == trialSiteSurvey.SiteId).Select(t => new { t.TrialSiteSurveyId, t.IsGenerateAccount, t.UserTypeId, t.UserTypeRole.UserTypeEnum, t.TrialRoleName.Code }).ToListAsync();
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_NoAdminAcces"]);
}
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.Undefined) if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.Undefined)
{ {
var hasSPMOrCPM = await _trialSiteSurveyRepository.AnyAsync(t => t.TrialId == trialId && t.Trial.TrialUserList.Any(u => u.User.UserTypeEnum == UserTypeEnum.SPM || u.User.UserTypeEnum == UserTypeEnum.CPM)); //是第一次
if(!siteUserList.Any(t=>t.IsGenerateAccount))
if (hasSPMOrCPM)
{ {
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.CRCSubmitted }); var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
}
else
{
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved });
if(!currentUserList.Any(t=>t.Code=="1")|| !currentUserList.Any(t => t.Code == "4"))
{
throw new BusinessValidationFailedException("本次提交必须有CRC和影像负责人信息");
}
} }
} }
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
{ {
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
} //是第一次
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) if (!siteUserList.Any(t => t.IsGenerateAccount))
{ {
var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) ||
!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.SR))
{
throw new BusinessValidationFailedException("本次提交生成账号必须要有CRC 和SR");
}
}
var trialSiteSurvey = (await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).FirstOrDefaultAsync()).IfNullThrowException();
@ -862,7 +867,7 @@ namespace IRaCIS.Core.Application.Contracts
if (userInfo.SystemUserId == null) if (userInfo.SystemUserId == null)
{ {
//---生成账户Id 未取到值,请排查 //---生成账户Id 未取到值,请排查
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_FailedToGenerateAccountId"]); throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_FailedToGenerateAccountId"]);
} }
@ -875,9 +880,9 @@ namespace IRaCIS.Core.Application.Contracts
//判断TrialUser中是否存在 不存在就插入 //判断TrialUser中是否存在 不存在就插入
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true)) if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
{ {
await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now }); await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
} }
if (!await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.UserId == userId && t.SiteId==siteId, true)) if (!await _repository.AnyAsync<TrialSiteUser>(t => t.TrialId == trialId && t.UserId == userId && t.SiteId == siteId, true))
{ {
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId }); await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
} }

View File

@ -170,25 +170,25 @@ namespace IRaCIS.Core.Domain.Models
/// <summary> /// <summary>
/// 仲裁对象 /// 仲裁对象
/// </summary> /// </summary>
public ArbitrationRule ArbitrationRule { get; set; } = ArbitrationRule.Reading; public ArbitrationRule ArbitrationRule { get; set; } = ArbitrationRule.None;
/// <summary> /// <summary>
/// 阅片模式 /// 阅片模式
/// </summary> /// </summary>
public ReadingMethod ReadingType { get; set; } = ReadingMethod.Double; public ReadingMethod ReadingType { get; set; } = ReadingMethod.Single;
/// <summary> /// <summary>
/// 是否有阅片期 /// 是否有阅片期
/// </summary> /// </summary>
public bool IsReadingPeriod { get; set; } = true; public bool IsReadingPeriod { get; set; } = false;
/// <summary> /// <summary>
/// 是否生成全局阅片任务 /// 是否生成全局阅片任务
/// </summary> /// </summary>
public bool IsGlobalReading { get; set; } = true; public bool IsGlobalReading { get; set; } = false;
/// <summary> /// <summary>
/// 是否签名 /// 是否签名
@ -199,7 +199,7 @@ namespace IRaCIS.Core.Domain.Models
/// <summary> /// <summary>
/// 仲裁阅片 /// 仲裁阅片
/// </summary> /// </summary>
public bool IsArbitrationReading { get; set; } = true; public bool IsArbitrationReading { get; set; } = false;
/// <summary> /// <summary>