Uat_Study
parent
929dfe287e
commit
b71732c623
|
@ -56,18 +56,25 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
public async Task<IResponseOutput> AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule)
|
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();
|
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;
|
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);
|
var entity = await _taskAllocationRuleRepository.InsertOrUpdateAsync(addOrEditTaskAllocationRule, true, verifyExp1);
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
Loading…
Reference in New Issue