修复二次分配带出BUG

parent fd0708d4
using AutoMapper; using AutoMapper;
using Microsoft.Extensions.Logging;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -11,6 +13,7 @@ namespace Performance.Services ...@@ -11,6 +13,7 @@ namespace Performance.Services
{ {
public class SecondAllotDetails : IAutoInjection public class SecondAllotDetails : IAutoInjection
{ {
private readonly ILogger<SecondAllotDetails> _logger;
private readonly PerforAgsecondallotRepository agsecondallotRepository; private readonly PerforAgsecondallotRepository agsecondallotRepository;
private readonly PerforAgusetempRepository agusetempRepository; private readonly PerforAgusetempRepository agusetempRepository;
private readonly PerforAgtempitemRepository agtempitemRepository; private readonly PerforAgtempitemRepository agtempitemRepository;
...@@ -25,6 +28,7 @@ public class SecondAllotDetails : IAutoInjection ...@@ -25,6 +28,7 @@ public class SecondAllotDetails : IAutoInjection
private readonly PersonService personService; private readonly PersonService personService;
public SecondAllotDetails( public SecondAllotDetails(
ILogger<SecondAllotDetails> logger,
PerforAgsecondallotRepository agsecondallotRepository, PerforAgsecondallotRepository agsecondallotRepository,
PerforAgusetempRepository agusetempRepository, PerforAgusetempRepository agusetempRepository,
PerforAgtempitemRepository agtempitemRepository, PerforAgtempitemRepository agtempitemRepository,
...@@ -39,6 +43,7 @@ public class SecondAllotDetails : IAutoInjection ...@@ -39,6 +43,7 @@ public class SecondAllotDetails : IAutoInjection
PersonService personService PersonService personService
) )
{ {
_logger = logger;
this.agsecondallotRepository = agsecondallotRepository; this.agsecondallotRepository = agsecondallotRepository;
this.agusetempRepository = agusetempRepository; this.agusetempRepository = agusetempRepository;
this.agtempitemRepository = agtempitemRepository; this.agtempitemRepository = agtempitemRepository;
...@@ -401,6 +406,19 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body ...@@ -401,6 +406,19 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body
} }
} }
} }
else if (employeeSource == (int)EmployeeSource.Initial)
{
var savedDataList = agfixatitemRepository.GetEntities(w => w.SecondId == secondAllot.Id && w.RowNumber.HasValue && w.RowNumber == -1);
if (savedDataList != null && savedDataList.Any())
{
foreach (var item in pairs)
{
var savedData = savedDataList.FirstOrDefault(w => w.Type == (int)TempColumnType.TopFixedColumns && w.ItemName == item.Value);
if (!string.IsNullOrEmpty(savedData?.ItemValue) && !keyValue.Keys.Contains(item.Value))
keyValue.Add(item.Value, savedData.ItemValue);
}
}
}
else else
{ {
var configs = cofagainRepository.GetEntities(t => t.AllotID == secondAllot.AllotId); var configs = cofagainRepository.GetEntities(t => t.AllotID == secondAllot.AllotId);
...@@ -418,7 +436,8 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body ...@@ -418,7 +436,8 @@ private void SupplementFixedData(ag_secondallot secondAllot, List<BodyItem> body
foreach (var item in keyValue) foreach (var item in keyValue)
{ {
var field = bodyItems.FirstOrDefault(w => w.RowNumber == -1 && w.FiledName == item.Key); var field = bodyItems.FirstOrDefault(w => w.RowNumber == -1 && w.FiledName == item.Key);
if (field != null && !string.IsNullOrEmpty(item.Value)) field.Value = item.Value; if (field != null && !string.IsNullOrEmpty(item.Value))
field.Value = item.Value;
} }
} }
......
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