Uat_Study
hang 2022-07-26 16:16:50 +08:00
parent 929dfe287e
commit b71732c623
1 changed files with 12 additions and 5 deletions

View File

@ -56,18 +56,25 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
{
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
{
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId == addOrEditTaskAllocationRule.TrialId,
VerifyMsg = "已有该医生配置,不允许继续增加"
};
//冗余 存
var enrollId = _repository.Where<Enroll>(t => t.TrialId == addOrEditTaskAllocationRule.TrialId && t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId).Select(t => t.Id).FirstOrDefault();
if (enrollId == Guid.Empty)
{
return ResponseOutput.NotOk("错误未在入组表中找到该医生得账号Id");
}
addOrEditTaskAllocationRule.EnrollId = enrollId;
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
{
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId == addOrEditTaskAllocationRule.TrialId,
VerifyMsg = "已有该医生配置,不允许继续增加"
};
var entity = await _taskAllocationRuleRepository.InsertOrUpdateAsync(addOrEditTaskAllocationRule, true, verifyExp1);
return ResponseOutput.Ok(entity.Id.ToString());