bug修复

parent efd0ac30
...@@ -156,8 +156,8 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al ...@@ -156,8 +156,8 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
if (null == allot || string.IsNullOrEmpty(allot.Path)) if (null == allot || string.IsNullOrEmpty(allot.Path))
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件"); throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
var user = _claim.At(request); var user = _claim.At(request);
_allotService.Generate(allot, user); //_allotService.Generate(allot, user);
//BackgroundJob.Enqueue(() => _allotService.Generate(allot, user)); BackgroundJob.Enqueue(() => _allotService.Generate(allot, user));
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
} }
......
...@@ -301,21 +301,37 @@ public void Copy(per_allot allot) ...@@ -301,21 +301,37 @@ public void Copy(per_allot allot)
if (list[i].ID == allot.ID && (i - 1) >= 0) if (list[i].ID == allot.ID && (i - 1) >= 0)
allotId = list[i - 1].ID; allotId = list[i - 1].ID;
} }
var orgDirector = _directorRepository.GetEntities(t => t.AllotID == allot.ID);
if (orgDirector == null || orgDirector.Count == 0)
{
var director = _directorRepository.GetEntities(t => t.AllotID == allotId) ?? _directorRepository.GetEntities(t => t.AllotID == -1); var director = _directorRepository.GetEntities(t => t.AllotID == allotId) ?? _directorRepository.GetEntities(t => t.AllotID == -1);
var newDirectors = director.Select(t => new cof_director { AllotID = allot.ID, JobTitle = t.JobTitle, TypeName = t.TypeName, Value = t.Value }); var newDirectors = director.Select(t => new cof_director { AllotID = allot.ID, JobTitle = t.JobTitle, TypeName = t.TypeName, Value = t.Value });
_directorRepository.AddRange(newDirectors.ToArray()); _directorRepository.AddRange(newDirectors.ToArray());
}
var orgDurgprop = _drugpropRepository.GetEntities(t => t.AllotID == allot.ID);
if (orgDurgprop == null || orgDurgprop.Count == 0)
{
var durgprop = _drugpropRepository.GetEntities(t => t.AllotID == allotId) ?? _drugpropRepository.GetEntities(t => t.AllotID == -1); var durgprop = _drugpropRepository.GetEntities(t => t.AllotID == allotId) ?? _drugpropRepository.GetEntities(t => t.AllotID == -1);
var newDurgprops = durgprop.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value }); var newDurgprops = durgprop.Select(t => new cof_drugprop { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_drugpropRepository.AddRange(newDurgprops.ToArray()); _drugpropRepository.AddRange(newDurgprops.ToArray());
}
var orgIncome = _incomeRepository.GetEntities(t => t.AllotID == allot.ID);
if (orgIncome == null || orgIncome.Count == 0)
{
var income = _incomeRepository.GetEntities(t => t.AllotID == allotId) ?? _incomeRepository.GetEntities(t => t.AllotID == -1); var income = _incomeRepository.GetEntities(t => t.AllotID == allotId) ?? _incomeRepository.GetEntities(t => t.AllotID == -1);
var newIncomes = income.Select(t => new cof_income { AllotID = allot.ID, SheetNameKeyword = t.SheetNameKeyword, UnitName = t.UnitName, Value = t.Value }); var newIncomes = income.Select(t => new cof_income { AllotID = allot.ID, SheetNameKeyword = t.SheetNameKeyword, UnitName = t.UnitName, Value = t.Value });
_incomeRepository.AddRange(newIncomes.ToArray()); _incomeRepository.AddRange(newIncomes.ToArray());
}
var orgWorkyear = _workyearRepository.GetEntities(t => t.AllotID == allot.ID);
if (orgWorkyear == null || orgWorkyear.Count == 0)
{
var workyear = _workyearRepository.GetEntities(t => t.AllotID == allotId) ?? _workyearRepository.GetEntities(t => t.AllotID == -1); var workyear = _workyearRepository.GetEntities(t => t.AllotID == allotId) ?? _workyearRepository.GetEntities(t => t.AllotID == -1);
var newWorkyears = workyear.Select(t => new cof_workyear { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value }); var newWorkyears = workyear.Select(t => new cof_workyear { AllotID = allot.ID, MaxRange = t.MaxRange, MinRange = t.MinRange, Value = t.Value });
_workyearRepository.AddRange(newWorkyears.ToArray()); _workyearRepository.AddRange(newWorkyears.ToArray());
} }
} }
}
} }
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