国际化修改

Uat_Study
he 2023-03-29 15:40:24 +08:00
parent c6b568c17c
commit ba0bed7eef
3 changed files with 54 additions and 29 deletions

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918 // 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2021-12-23 13:20:59 // 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
@ -43,7 +43,8 @@ namespace IRaCIS.Core.Application.Contracts
{ {
if (await _trialSiteEquipmentSurveyRepository.Where(t => t.Id == addOrEditTrialSiteEquipmentSurvey.Id).AnyAsync(t => t.TrialSiteSurvey.State==TrialSiteSurveyEnum.PMCreatedAndLock)) if (await _trialSiteEquipmentSurveyRepository.Where(t => t.Id == addOrEditTrialSiteEquipmentSurvey.Id).AnyAsync(t => t.TrialSiteSurvey.State==TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
return ResponseOutput.NotOk("已锁定,不允许操作"); //---已锁定,不允许操作
return ResponseOutput.NotOk(_localizer["TrialSiteEquipment_Locked"]);
} }
} }
@ -60,7 +61,8 @@ namespace IRaCIS.Core.Application.Contracts
{ {
if (await _trialSiteEquipmentSurveyRepository.Where(t => t.Id == trialSiteEquipmentSurveyId).AnyAsync(t => t.TrialSiteSurvey.State==TrialSiteSurveyEnum.PMCreatedAndLock)) if (await _trialSiteEquipmentSurveyRepository.Where(t => t.Id == trialSiteEquipmentSurveyId).AnyAsync(t => t.TrialSiteSurvey.State==TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
return ResponseOutput.NotOk("已锁定,不允许操作"); //---已锁定,不允许操作
return ResponseOutput.NotOk(_localizer["TrialSiteEquipment_Locked"]);
} }
var success = await _trialSiteEquipmentSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteEquipmentSurveyId); var success = await _trialSiteEquipmentSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteEquipmentSurveyId);

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918 // 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2021-12-23 13:20:59 // 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
@ -62,7 +62,8 @@ namespace IRaCIS.Core.Application.Contracts
//检查手机或者邮箱是否有效 //检查手机或者邮箱是否有效
if (!Regex.IsMatch(userInfo.Email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$")) if (!Regex.IsMatch(userInfo.Email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
{ {
throw new BusinessValidationFailedException("请输入正确的邮箱地址。"); //---请输入正确的邮箱地址。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_InvalidEmail"]);
} }
//邮箱 //邮箱
@ -93,14 +94,16 @@ namespace IRaCIS.Core.Application.Contracts
//检查数据库是否存在该验证码 //检查数据库是否存在该验证码
if (verificationRecord == null) if (verificationRecord == null)
{ {
throw new BusinessValidationFailedException("验证码错误。"); //---验证码错误。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_WrongVerificationCode"]);
} }
else else
{ {
//检查验证码是否失效 //检查验证码是否失效
if (verificationRecord.ExpirationTime < DateTime.Now) if (verificationRecord.ExpirationTime < DateTime.Now)
{ {
throw new BusinessValidationFailedException("验证码已经过期。"); //---验证码已经过期。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
} }
else //验证码正确 并且 没有超时 else //验证码正确 并且 没有超时
{ {
@ -122,7 +125,8 @@ namespace IRaCIS.Core.Application.Contracts
//检查手机或者邮箱是否有效 //检查手机或者邮箱是否有效
if (!Regex.IsMatch(userInfo.Email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$")) if (!Regex.IsMatch(userInfo.Email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"))
{ {
throw new BusinessValidationFailedException("请输入正确的邮箱地址。"); //---请输入正确的邮箱地址。
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_InvalidEmail"]);
} }
//邮箱 //邮箱
@ -158,13 +162,15 @@ namespace IRaCIS.Core.Application.Contracts
if (userInfo.IsUpdate && isReplaceUser && !await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.ReplaceUserEmailOrPhone || t.Phone == userInfo.ReplaceUserEmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId)) if (userInfo.IsUpdate && isReplaceUser && !await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.ReplaceUserEmailOrPhone || t.Phone == userInfo.ReplaceUserEmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId))
{ {
return ResponseOutput.NotOk("该中心不存在该交接人的中心调研记录表,不允许选择更新。"); //---该中心不存在该交接人的中心调研记录表,不允许选择更新。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_NoRecordToUpdate"]);
} }
if (userInfo.IsUpdate && await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.EmailOrPhone || t.Phone == userInfo.EmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State != TrialSiteSurveyEnum.PMCreatedAndLock)) if (userInfo.IsUpdate && await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.EmailOrPhone || t.Phone == userInfo.EmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State != TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
return ResponseOutput.NotOk("您的中心调研记录正在审核中,不允许进行更新操作。若需要更新,请在驳回后进行操作。"); //---您的中心调研记录正在审核中,不允许进行更新操作。若需要更新,请在驳回后进行操作。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_RecordUnderReview"]);
} }
@ -172,7 +178,8 @@ namespace IRaCIS.Core.Application.Contracts
if (userInfo.IsUpdate && userInfo.ReplaceUserEmailOrPhone != userInfo.EmailOrPhone && await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.EmailOrPhone || t.Phone == userInfo.EmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock)) if (userInfo.IsUpdate && userInfo.ReplaceUserEmailOrPhone != userInfo.EmailOrPhone && await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.EmailOrPhone || t.Phone == userInfo.EmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
//自己的锁了 想更新别人的 //自己的锁了 想更新别人的
return ResponseOutput.NotOk("当前中心中,您提交调研记录表已锁定,不允许更新其他人邮箱调研记录。"); //---当前中心中,您提交调研记录表已锁定,不允许更新其他人邮箱调研记录。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_LockedByCurrentUser"]);
} }
//自己的锁定了 如果有其他未锁定的,也不能更新自己的 //自己的锁定了 如果有其他未锁定的,也不能更新自己的
@ -181,7 +188,8 @@ namespace IRaCIS.Core.Application.Contracts
&& await _trialSiteSurveyRepository.AnyAsync(t => (t.Email != userInfo.EmailOrPhone && t.Phone != userInfo.EmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State != TrialSiteSurveyEnum.PMCreatedAndLock)) && await _trialSiteSurveyRepository.AnyAsync(t => (t.Email != userInfo.EmailOrPhone && t.Phone != userInfo.EmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State != TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
return ResponseOutput.NotOk("当前中心,您提交的调研记录表已锁定。当前存在其他人员提交的调研记录表未锁定,不允许更新您之前提交的调研记录。"); //---当前中心,您提交的调研记录表已锁定。当前存在其他人员提交的调研记录表未锁定,不允许更新您之前提交的调研记录。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_LockedByOtherUsers"]);
} }
@ -191,7 +199,8 @@ namespace IRaCIS.Core.Application.Contracts
&& !await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.ReplaceUserEmailOrPhone || t.Phone == userInfo.ReplaceUserEmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State != TrialSiteSurveyEnum.PMCreatedAndLock) && !await _trialSiteSurveyRepository.AnyAsync(t => (t.Email == userInfo.ReplaceUserEmailOrPhone || t.Phone == userInfo.ReplaceUserEmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State != TrialSiteSurveyEnum.PMCreatedAndLock)
) )
{ {
return ResponseOutput.NotOk("当前中心存在未锁定的调研记录,不允许更新已锁定的调研记录。"); //---当前中心存在未锁定的调研记录,不允许更新已锁定的调研记录。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_UnlockedRecordsExist"]);
} }
@ -202,14 +211,16 @@ namespace IRaCIS.Core.Application.Contracts
//检查数据库是否存在该验证码 //检查数据库是否存在该验证码
if (verificationRecord == null) if (verificationRecord == null)
{ {
return ResponseOutput.NotOk("验证码错误。"); //---验证码错误。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_WrongVerificationCode"]);
} }
else else
{ {
//检查验证码是否失效 //检查验证码是否失效
if (verificationRecord.ExpirationTime < DateTime.Now) if (verificationRecord.ExpirationTime < DateTime.Now)
{ {
return ResponseOutput.NotOk("验证码已经过期。"); //---验证码已经过期。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_ExpiredVerificationCode"]);
} }
else //验证码正确 并且 没有超时 else //验证码正确 并且 没有超时
{ {
@ -311,7 +322,8 @@ 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("该中心下已经有其他用户已填写的调研表,您不被允许继续填写"); //---该中心下已经有其他用户已填写的调研表,您不被允许继续填写
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_AlreadyFilledByOtherUsers"]);
} }
@ -394,7 +406,8 @@ 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("中心调研已锁定,不允许操作。"); //---中心调研已锁定,不允许操作。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]);
} }
} }
@ -600,7 +613,8 @@ namespace IRaCIS.Core.Application.Contracts
//主题 //主题
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 关于中心调研审批的提醒"; // $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 关于中心调研审批的提醒";
messageToSend.Subject = _localizer["TrialSiteSurvey_IRCNotification", trialInfo.ResearchProgramNo];
var pathToFile = _hostEnvironment.WebRootPath var pathToFile = _hostEnvironment.WebRootPath
+ Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString()
@ -688,7 +702,8 @@ namespace IRaCIS.Core.Application.Contracts
if (survey.State != TrialSiteSurveyEnum.ToSubmit) if (survey.State != TrialSiteSurveyEnum.ToSubmit)
{ {
return ResponseOutput.NotOk("只允许废除未提交的记录。"); //---只允许废除未提交的记录。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_CancelUnsubmittedRecord"]);
} }
survey.IsDeleted = true; survey.IsDeleted = true;
@ -717,7 +732,8 @@ namespace IRaCIS.Core.Application.Contracts
if (_userInfo.IsAdmin) if (_userInfo.IsAdmin)
{ {
return ResponseOutput.NotOk("不允许管理员操作。"); //---不允许管理员操作。
return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_NoAdminAcces"]);
} }
@ -842,7 +858,8 @@ namespace IRaCIS.Core.Application.Contracts
if (userInfo.SystemUserId == null) if (userInfo.SystemUserId == null)
{ {
throw new BusinessValidationFailedException("生成账户Id 未取到值,请排查"); //---生成账户Id 未取到值,请排查
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_FailedToGenerateAccountId"]);
} }
var trialId = joinCommand.TrialId; var trialId = joinCommand.TrialId;
@ -898,7 +915,8 @@ namespace IRaCIS.Core.Application.Contracts
//收件地址 //收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, item.Email)); messageToSend.To.Add(new MailboxAddress(String.Empty, item.Email));
//主题 //主题
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 邀请信"; //$"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 邀请信";
messageToSend.Subject = _localizer["TrialSiteSurvey_IRCInvitation", trialInfo.ResearchProgramNo];
var builder = new BodyBuilder(); var builder = new BodyBuilder();
@ -946,7 +964,7 @@ namespace IRaCIS.Core.Application.Contracts
{sysUserInfo.LastName + "/" + sysUserInfo.FirstName}: {sysUserInfo.LastName + "/" + sysUserInfo.FirstName}:
</div> </div>
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'> <div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
{trialInfo.ResearchProgramNo} IRCIRC {_localizer["TrialSiteSurvey_IRCInvitationContent", trialInfo.ResearchProgramNo]}
</div> </div>
<a href=' {inviteEmailCommand.RouteUrl + "?Id=" + item.Id + "&IsExternalUser=0"}' style='margin-left:60px;font-size:14px;text-decoration: none;display: inline-block;height: 40px;width: 140px;background: #00D1B2;color:#fff;border-radius: 5px;line-height: 40px;text-align: center;margin-bottom: 100px;'> <a href=' {inviteEmailCommand.RouteUrl + "?Id=" + item.Id + "&IsExternalUser=0"}' style='margin-left:60px;font-size:14px;text-decoration: none;display: inline-block;height: 40px;width: 140px;background: #00D1B2;color:#fff;border-radius: 5px;line-height: 40px;text-align: center;margin-bottom: 100px;'>

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// 此代码由T4模板自动生成 byzhouhang 20210918 // 此代码由T4模板自动生成 byzhouhang 20210918
// 生成时间 2021-12-23 13:20:59 // 生成时间 2021-12-23 13:20:59
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
@ -42,7 +42,8 @@ namespace IRaCIS.Core.Application.Contracts
if (await _trialSiteUserSurveyRepository.Where(t => t.Id == addOrEditTrialSiteUserSurvey.Id).AnyAsync(t => t.TrialSiteSurvey.State == TrialSiteSurveyEnum.PMCreatedAndLock)) if (await _trialSiteUserSurveyRepository.Where(t => t.Id == addOrEditTrialSiteUserSurvey.Id).AnyAsync(t => t.TrialSiteSurvey.State == TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
return ResponseOutput.NotOk("已锁定,不允许操作"); //---已锁定,不允许操作
return ResponseOutput.NotOk(_localizer["TrialSiteUser_Locked"]);
} }
if (addOrEditTrialSiteUserSurvey.UserTypeId != null && ( _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)) if (addOrEditTrialSiteUserSurvey.UserTypeId != null && ( _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM))
@ -54,7 +55,8 @@ namespace IRaCIS.Core.Application.Contracts
{ {
if (existSysUser.LastName != addOrEditTrialSiteUserSurvey.LastName || existSysUser.FirstName != addOrEditTrialSiteUserSurvey.FirstName) if (existSysUser.LastName != addOrEditTrialSiteUserSurvey.LastName || existSysUser.FirstName != addOrEditTrialSiteUserSurvey.FirstName)
{ {
return ResponseOutput.NotOk($"该用户在系统中账户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存", //$"该用户在系统中账户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存"
return ResponseOutput.NotOk(_localizer["TrialSiteUser_InconsistentInfo", existSysUser.LastName + " / " + existSysUser.FirstName],
new { existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone,existSysUser.IsTestUser,existSysUser.IsZhiZhun }, ApiResponseCodeEnum.NeedTips); new { existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone,existSysUser.IsTestUser,existSysUser.IsZhiZhun }, ApiResponseCodeEnum.NeedTips);
} }
@ -82,7 +84,8 @@ namespace IRaCIS.Core.Application.Contracts
if (sysUserInfo.IsTestUser) if (sysUserInfo.IsTestUser)
{ {
throw new BusinessValidationFailedException("正式类型 、培训类型的项目 不允许加入测试用户 "); //---正式类型 、培训类型的项目 不允许加入测试用户
throw new BusinessValidationFailedException(_localizer["TrialSiteUser_NoTestUserForFormal"]);
} }
} }
@ -92,7 +95,8 @@ namespace IRaCIS.Core.Application.Contracts
if (sysUserInfo.IsTestUser == false) if (sysUserInfo.IsTestUser == false)
{ {
throw new BusinessValidationFailedException("测试项目 不允许加入正式用户 "); //---测试项目 不允许加入正式用户
throw new BusinessValidationFailedException(_localizer["TrialSiteUser_NoFormalUserForTest"]);
} }
} }
@ -114,7 +118,8 @@ namespace IRaCIS.Core.Application.Contracts
if (await _trialSiteUserSurveyRepository.Where(t => t.Id == trialSiteUserSurveyId).AnyAsync(t => t.TrialSiteSurvey.State == TrialSiteSurveyEnum.PMCreatedAndLock)) if (await _trialSiteUserSurveyRepository.Where(t => t.Id == trialSiteUserSurveyId).AnyAsync(t => t.TrialSiteSurvey.State == TrialSiteSurveyEnum.PMCreatedAndLock))
{ {
return ResponseOutput.NotOk("已锁定,不允许操作"); //---已锁定,不允许操作
return ResponseOutput.NotOk(_localizer["TrialSiteUser_Locked"]);
} }
var success = await _trialSiteUserSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteUserSurveyId); var success = await _trialSiteUserSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteUserSurveyId);