Commit 57d3eaa9 by wyc

二次绩效工作量添加类型 bug修改

parent 2f43415e
......@@ -1145,10 +1145,10 @@ public ag_workload_type SaveWorkType(SecondWorkloadTypeDto request, int secondId
var second = agsecondallotRepository.GetEntity(t => t.Id == secondId) ?? throw new PerformanceException("参数错误");
var entities = agworkloadtypeRepository
.GetEntities(t => request.HospitalId == t.HospitalId && t.Department == second.Department && t.TypeName == request.TypeName)
.GetEntities(t => request.HospitalId == t.HospitalId && t.Department == second.Department )
?.Where(w => UnitTypeUtil.Is(w.UnitType, second.UnitType)).ToList() ?? new List<ag_workload_type>();
if (request.Id > 0 && entities.Any(w => w.Id != request.Id))
if (request.Id > 0 && entities.Any(w => w.Id != request.Id && w.TypeName == request.TypeName))
{
throw new PerformanceException("类型信息重复,已存在相同的工作量类型信息");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment