Uat_Study
he 2023-05-18 15:46:13 +08:00
parent 73035a4369
commit 1461240f27
4 changed files with 15 additions and 0 deletions

View File

@ -125,6 +125,8 @@
"ReadModule_SignedDataCannotDelete": "Clinical data has been signed and cannot be deleted.", "ReadModule_SignedDataCannotDelete": "Clinical data has been signed and cannot be deleted.",
"ReadModule_TumorExists": "The current visit has a tumor review, please delete the tumor review first.", "ReadModule_TumorExists": "The current visit has a tumor review, please delete the tumor review first.",
"ReadModule_TaskGenerated": "The current review has generated tasks, operation failed.", "ReadModule_TaskGenerated": "The current review has generated tasks, operation failed.",
//UserWLTemplateService
"UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.",
// ------------------------------------------------------------Allocation-------------------------------------------------------------------- // ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService //TaskAllocationRuleService

View File

@ -125,6 +125,8 @@
"ReadModule_SignedDataCannotDelete": "临床资料已签名,不允许删除", "ReadModule_SignedDataCannotDelete": "临床资料已签名,不允许删除",
"ReadModule_TumorExists": "当前访视存在肿瘤学阅片,请先删除肿瘤学阅片", "ReadModule_TumorExists": "当前访视存在肿瘤学阅片,请先删除肿瘤学阅片",
"ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。", "ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。",
//UserWLTemplateService
"UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板",
// ------------------------------------------------------------Allocation-------------------------------------------------------------------- // ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService //TaskAllocationRuleService

View File

@ -8,6 +8,8 @@ using IRaCIS.Core.Domain.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure;
namespace IRaCIS.Core.Application.Service namespace IRaCIS.Core.Application.Service
{ {
/// <summary> /// <summary>
@ -49,6 +51,15 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate) public async Task<IResponseOutput> AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate)
{ {
addOrEditUserWLTemplate.UserId = _userInfo.Id; addOrEditUserWLTemplate.UserId = _userInfo.Id;
if (addOrEditUserWLTemplate.Id == null)
{
var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.Id).CountAsync();
if (count >= 10)
{
throw new BusinessValidationFailedException(_localizer["UserWLTS_MaxTemplate"]);
}
}
var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true);
return ResponseOutput.Ok(entity.Id.ToString()); return ResponseOutput.Ok(entity.Id.ToString());
} }

Binary file not shown.