Commit 979425df by lcx

添加绩效时copy数据,接口异常

parent 2c25e2a1
...@@ -989,8 +989,8 @@ public void Copy(per_allot allot) ...@@ -989,8 +989,8 @@ public void Copy(per_allot allot)
var cofDrugtypeFactor = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allot.ID); var cofDrugtypeFactor = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allot.ID);
if (cofDrugtypeFactor == null || cofDrugtypeFactor.Count == 0) if (cofDrugtypeFactor == null || cofDrugtypeFactor.Count == 0)
{ {
var drugtypefactoe = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allotId) ?? cofdrugtypefactorRepository.GetEntities(t => t.AllotID == -1); var drugtypefactor = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allotId) ?? cofdrugtypefactorRepository.GetEntities(t => t.AllotID == -1);
var newAgains = drugtypefactoe.Select(t => new cof_drugtype_factor var newdrugtypefactor = drugtypefactor?.Select(t => new cof_drugtype_factor
{ {
HospitalId = allot.HospitalId, HospitalId = allot.HospitalId,
AllotID = allot.ID, AllotID = allot.ID,
...@@ -1000,7 +1000,8 @@ public void Copy(per_allot allot) ...@@ -1000,7 +1000,8 @@ public void Copy(per_allot allot)
HLZ = t.HLZ, HLZ = t.HLZ,
YJZ = t.YJZ, YJZ = t.YJZ,
}); });
cofdrugtypefactorRepository.AddRange(newAgains.ToArray()); if (newdrugtypefactor != null && newdrugtypefactor.Any())
cofdrugtypefactorRepository.AddRange(newdrugtypefactor.ToArray());
} }
logger.LogInformation($"cofDepttype"); logger.LogInformation($"cofDepttype");
......
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