Commit 8557ff6a by 纪旭 韦

批量添加人员字典正确核算组别判断

parent 968e980b
...@@ -383,7 +383,7 @@ public bool DeletePerson(int employeeId) ...@@ -383,7 +383,7 @@ public bool DeletePerson(int employeeId)
if (employee == null) if (employee == null)
throw new PerformanceException($"员工信息错误!"); throw new PerformanceException($"员工信息错误!");
var oldbackup = perforPeremployeeBackupRepository.GetEntity(t=>t.Id == employee.Id); var oldbackup = perforPeremployeeBackupRepository.GetEntity(t => t.Id == employee.Id);
if (oldbackup != null) if (oldbackup != null)
perforPeremployeeBackupRepository.Remove(oldbackup); perforPeremployeeBackupRepository.Remove(oldbackup);
...@@ -402,7 +402,7 @@ public bool DeleteAllPerson(int allotId) ...@@ -402,7 +402,7 @@ public bool DeleteAllPerson(int allotId)
{ {
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allotId) var employees = peremployeeRepository.GetEntities(t => t.AllotId == allotId)
?? new List<per_employee>(); ?? new List<per_employee>();
dapperService.PerEmployeeBackup(allotId); dapperService.PerEmployeeBackup(allotId);
return peremployeeRepository.RemoveRange(employees.ToArray()); return peremployeeRepository.RemoveRange(employees.ToArray());
...@@ -852,7 +852,7 @@ public ApiResponse BathSavePerson(int allotId, int HospitalId, SaveCollectData r ...@@ -852,7 +852,7 @@ public ApiResponse BathSavePerson(int allotId, int HospitalId, SaveCollectData r
var jsons = JsonHelper.Serialize(dicData); var jsons = JsonHelper.Serialize(dicData);
var newEmployees = JsonHelper.Deserialize<List<per_employee>>(jsons); var newEmployees = JsonHelper.Deserialize<List<per_employee>>(jsons);
var oldEmployees = peremployeeRepository.GetEntities(t => t.HospitalId == HospitalId && t.AllotId == allotId); var oldEmployees = peremployeeRepository.GetEntities(t => t.HospitalId == HospitalId && t.AllotId == allotId);
var accountinglist = perforCofaccountingRepository.GetEntities(t => t.AllotId == allotId);
List<Dictionary<string, string>> error = new List<Dictionary<string, string>>(); List<Dictionary<string, string>> error = new List<Dictionary<string, string>>();
for (int i = 0; i < newEmployees.Count; i++) for (int i = 0; i < newEmployees.Count; i++)
...@@ -909,8 +909,8 @@ public ApiResponse BathSavePerson(int allotId, int HospitalId, SaveCollectData r ...@@ -909,8 +909,8 @@ public ApiResponse BathSavePerson(int allotId, int HospitalId, SaveCollectData r
}); });
} }
var accountinglist = perforCofaccountingRepository.GetEntity(w => w.UnitType == newEmployees[i].UnitType && w.AccountingUnit == newEmployees[i].AccountingUnit); var accountingUnit = accountinglist.FirstOrDefault(w => w.UnitType == newEmployees[i].UnitType && w.AccountingUnit == newEmployees[i].AccountingUnit);
if (accountinglist == null) if (accountingUnit == null)
{ {
error.Add(new Dictionary<string, string> error.Add(new Dictionary<string, string>
{ {
...@@ -980,7 +980,7 @@ public ApiResponse BathSavePerson(int allotId, int HospitalId, SaveCollectData r ...@@ -980,7 +980,7 @@ public ApiResponse BathSavePerson(int allotId, int HospitalId, SaveCollectData r
employees.ForEach(e => employees.ForEach(e =>
{ {
var result = backupTab.FirstOrDefault(d => d.PersonnelNumber.Contains(e.PersonnelNumber) && d.AllotId == e.AllotId && d.HospitalId == e.HospitalId); var result = backupTab.FirstOrDefault(d => d.PersonnelNumber.Contains(e.PersonnelNumber) && d.AllotId == e.AllotId && d.HospitalId == e.HospitalId);
if(result!=null) if (result != null)
{ {
e.JobNumber = result.JobNumber; e.JobNumber = result.JobNumber;
e.JobCategory = result.JobCategory; e.JobCategory = result.JobCategory;
......
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