Commit c20a181b by 纪旭 韦

Merge branch 'develop' into 手工录入_

parents 4029533d 06e22d87
...@@ -846,7 +846,7 @@ public ApiResponse CopyDropDown() ...@@ -846,7 +846,7 @@ public ApiResponse CopyDropDown()
new CopyDrop{Label="收入费用类别",Value="drugTypes"}, new CopyDrop{Label="收入费用类别",Value="drugTypes"},
new CopyDrop{Label="支出费用类别",Value="drugTypeDisburses"}, new CopyDrop{Label="支出费用类别",Value="drugTypeDisburses"},
new CopyDrop{Label="费用类别系数",Value="drugTypeFactors"}, new CopyDrop{Label="费用类别系数",Value="drugTypeFactors"},
new CopyDrop{Label="科室类型",Value="deptTypes"}, /* new CopyDrop{Label="科室类型",Value="deptTypes"},*/
new CopyDrop{Label="二次绩效配置",Value="agains"}, new CopyDrop{Label="二次绩效配置",Value="agains"},
new CopyDrop{Label="核算单元及组别",Value="accountings"}, new CopyDrop{Label="核算单元及组别",Value="accountings"},
}; ; }; ;
......
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>D:\publish</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
</PropertyGroup>
</Project>
\ No newline at end of file
...@@ -1091,47 +1091,55 @@ public void NewCopy(CopyRequest request) ...@@ -1091,47 +1091,55 @@ public void NewCopy(CopyRequest request)
case "workItems": case "workItems":
logger.LogInformation($"copy workItems"); logger.LogInformation($"copy workItems");
var workItems = _workitemRepository.GetEntities(t => t.AllotID == allot.ID); var workItems = _workitemRepository.GetEntities(t => t.AllotID == allot.ID);
if (workItems == null || !workItems.Any()) //先判断是否为空,不为空删除再执行下面的代码
if (workItems!=null)
{ {
_workitemRepository.RemoveRange(workItems.ToArray());
}
workItems = _workitemRepository.GetEntities(t => t.AllotID == allotId) ?? _workitemRepository.GetEntities(t => t.AllotID == -1); workItems = _workitemRepository.GetEntities(t => t.AllotID == allotId) ?? _workitemRepository.GetEntities(t => t.AllotID == -1);
if (workItems != null && workItems.Any()) if (workItems != null && workItems.Any())
{ {
var newWorkItems = workItems.Select(t => new cof_workitem { AllotID = allot.ID, Type = t.Type, Item = t.Item }); var newWorkItems = workItems.Select(t => new cof_workitem { AllotID = allot.ID, Type = t.Type, Item = t.Item });
_workitemRepository.AddRange(newWorkItems.ToArray()); _workitemRepository.AddRange(newWorkItems.ToArray());
} }
}
break; break;
case "drugTypes": case "drugTypes":
logger.LogInformation($"copy drugTypes"); logger.LogInformation($"copy drugTypes");
var drugTypes = _drugtypeRepository.GetEntities(t => t.AllotID == allot.ID && t.HospitalId == allot.HospitalId); var drugTypes = _drugtypeRepository.GetEntities(t => t.AllotID == allot.ID && t.HospitalId == allot.HospitalId);
if (drugTypes == null || !drugTypes.Any()) if (drugTypes!=null)
{ {
_drugtypeRepository.RemoveRange(drugTypes.ToArray());
}
var Types = _drugtypeRepository.GetEntities(t => t.AllotID == allot.ID && t.HospitalId == allot.HospitalId);
drugTypes = _drugtypeRepository.GetEntities(t => t.AllotID == allotId) ?? _drugtypeRepository.GetEntities(t => t.AllotID == -1); drugTypes = _drugtypeRepository.GetEntities(t => t.AllotID == allotId) ?? _drugtypeRepository.GetEntities(t => t.AllotID == -1);
if (drugTypes != null && drugTypes.Any()) if (drugTypes != null && drugTypes.Any())
{ {
var newDrugTypes = drugTypes.Select(t => new cof_drugtype { HospitalId = allot.HospitalId, AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType }); var newDrugTypes = drugTypes.Select(t => new cof_drugtype { HospitalId = allot.HospitalId, AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType });
_drugtypeRepository.AddRange(newDrugTypes.ToArray()); _drugtypeRepository.AddRange(newDrugTypes.ToArray());
} }
}
break; break;
case "drugTypeDisburses": case "drugTypeDisburses":
logger.LogInformation($"copy drugTypeDisburses"); logger.LogInformation($"copy drugTypeDisburses");
var drugTypeDisburses = drugtypeDisburseRepository.GetEntities(t => t.AllotID == allot.ID && t.HospitalId == allot.HospitalId); var drugTypeDisburses = drugtypeDisburseRepository.GetEntities(t => t.AllotID == allot.ID && t.HospitalId == allot.HospitalId);
if (drugTypeDisburses == null || !drugTypeDisburses.Any()) if (drugTypeDisburses!=null)
{ {
drugtypeDisburseRepository.RemoveRange(drugTypeDisburses.ToArray());
}
drugTypeDisburses = drugtypeDisburseRepository.GetEntities(t => t.AllotID == allotId) ?? drugtypeDisburseRepository.GetEntities(t => t.AllotID == -1); drugTypeDisburses = drugtypeDisburseRepository.GetEntities(t => t.AllotID == allotId) ?? drugtypeDisburseRepository.GetEntities(t => t.AllotID == -1);
if (drugTypeDisburses != null && drugTypeDisburses.Any()) if (drugTypeDisburses != null && drugTypeDisburses.Any())
{ {
var newDrugTypeDisburses = drugTypeDisburses.Select(t => new cof_drugtype_disburse { HospitalId = allot.HospitalId, AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType }); var newDrugTypeDisburses = drugTypeDisburses.Select(t => new cof_drugtype_disburse { HospitalId = allot.HospitalId, AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType });
drugtypeDisburseRepository.AddRange(newDrugTypeDisburses.ToArray()); drugtypeDisburseRepository.AddRange(newDrugTypeDisburses.ToArray());
} }
}
break; break;
case "drugTypeFactors": case "drugTypeFactors":
logger.LogInformation($"copy drugTypeFactors"); logger.LogInformation($"copy drugTypeFactors");
var drugTypeFactors = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allot.ID); var drugTypeFactors = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allot.ID);
if (drugTypeFactors == null || !drugTypeFactors.Any()) if (drugTypeFactors!=null)
{ {
cofdrugtypefactorRepository.RemoveRange(drugTypeFactors.ToArray());
}
drugTypeFactors = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allotId) ?? cofdrugtypefactorRepository.GetEntities(t => t.AllotID == -1); drugTypeFactors = cofdrugtypefactorRepository.GetEntities(t => t.AllotID == allotId) ?? cofdrugtypefactorRepository.GetEntities(t => t.AllotID == -1);
if (drugTypeFactors != null && drugTypeFactors.Any()) if (drugTypeFactors != null && drugTypeFactors.Any())
{ {
...@@ -1147,26 +1155,28 @@ public void NewCopy(CopyRequest request) ...@@ -1147,26 +1155,28 @@ public void NewCopy(CopyRequest request)
}); });
cofdrugtypefactorRepository.AddRange(newDrugtypeFactors.ToArray()); cofdrugtypefactorRepository.AddRange(newDrugtypeFactors.ToArray());
} }
}
break; break;
case "deptTypes": case "deptTypes":
logger.LogInformation($"copy deptTypes"); logger.LogInformation($"copy deptTypes");
var deptTypes = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allot.ID); var deptTypes = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allot.ID);
if (deptTypes == null || !deptTypes.Any()) if (deptTypes!=null)
{ {
perforCofdepttypeRepository.RemoveRange(deptTypes.ToArray());
}
deptTypes = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allotId) ?? perforCofdepttypeRepository.GetEntities(t => t.AllotID == -1); deptTypes = perforCofdepttypeRepository.GetEntities(t => t.AllotID == allotId) ?? perforCofdepttypeRepository.GetEntities(t => t.AllotID == -1);
if (deptTypes != null && deptTypes.Any()) if (deptTypes != null && deptTypes.Any())
{ {
var newDeptTypes = deptTypes.Select(t => new cof_depttype { AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType }); var newDeptTypes = deptTypes.Select(t => new cof_depttype { AllotID = allot.ID, Charge = t.Charge, ChargeType = t.ChargeType });
perforCofdepttypeRepository.AddRange(newDeptTypes.ToArray()); perforCofdepttypeRepository.AddRange(newDeptTypes.ToArray());
} }
}
break; break;
case "agains": case "agains":
logger.LogInformation($"copy agains"); logger.LogInformation($"copy agains");
var agains = _againRepository.GetEntities(t => t.AllotID == allot.ID); var agains = _againRepository.GetEntities(t => t.AllotID == allot.ID);
if (agains == null || !agains.Any()) if (agains!=null)
{ {
_againRepository.RemoveRange(agains.ToArray());
}
agains = _againRepository.GetEntities(t => t.AllotID == allotId) ?? _againRepository.GetEntities(t => t.AllotID == -1); agains = _againRepository.GetEntities(t => t.AllotID == allotId) ?? _againRepository.GetEntities(t => t.AllotID == -1);
if (agains != null && agains.Any()) if (agains != null && agains.Any())
{ {
...@@ -1174,20 +1184,20 @@ public void NewCopy(CopyRequest request) ...@@ -1174,20 +1184,20 @@ public void NewCopy(CopyRequest request)
var newAgains = agains.Select(t => new cof_again { AllotID = allot.ID, Type = t.Type, Department = t.Department, TypeName = t.TypeName, Value = t.TypeName == "满勤天数" ? days : t.Value }); var newAgains = agains.Select(t => new cof_again { AllotID = allot.ID, Type = t.Type, Department = t.Department, TypeName = t.TypeName, Value = t.TypeName == "满勤天数" ? days : t.Value });
_againRepository.AddRange(newAgains.ToArray()); _againRepository.AddRange(newAgains.ToArray());
} }
}
break; break;
case "accountings": case "accountings":
logger.LogInformation($"copy accountings"); logger.LogInformation($"copy accountings");
var accountings = cofaccountingRepository.GetEntities(t => t.AllotId == allot.ID); var accountings = cofaccountingRepository.GetEntities(t => t.AllotId == allot.ID);
if (accountings == null || !accountings.Any()) if (accountings!=null)
{ {
cofaccountingRepository.RemoveRange(accountings.ToArray());
}
accountings = cofaccountingRepository.GetEntities(t => t.AllotId == allotId) ?? cofaccountingRepository.GetEntities(t => t.AllotId == -1); accountings = cofaccountingRepository.GetEntities(t => t.AllotId == allotId) ?? cofaccountingRepository.GetEntities(t => t.AllotId == -1);
if (accountings != null && accountings.Any()) if (accountings != null && accountings.Any())
{ {
var newAccountings = accountings.Select(t => new cof_accounting { AllotId = allot.ID, UnitType = t.UnitType, AccountingUnit = t.AccountingUnit }); var newAccountings = accountings.Select(t => new cof_accounting { AllotId = allot.ID, UnitType = t.UnitType, AccountingUnit = t.AccountingUnit });
cofaccountingRepository.AddRange(newAccountings.ToArray()); cofaccountingRepository.AddRange(newAccountings.ToArray());
} }
}
break; break;
default: default:
break; break;
......
...@@ -134,7 +134,7 @@ private void Employee(per_allot allot, List<sys_hospitalconfig> configs, IEnumer ...@@ -134,7 +134,7 @@ private void Employee(per_allot allot, List<sys_hospitalconfig> configs, IEnumer
{ {
data = data.GroupJoin(hrpDepartments, outer => new { department = outer.Department }, inner => new { department = inner.HRPDepartment }, (outer, inner) => new { outer, inner }).Select(t => data = data.GroupJoin(hrpDepartments, outer => new { department = outer.Department }, inner => new { department = inner.HRPDepartment }, (outer, inner) => new { outer, inner }).Select(t =>
{ {
t.outer.AccountingUnit = t.inner?.FirstOrDefault()?.AccountingUnit; t.outer.AccountingUnit = t.inner?.FirstOrDefault()?.AccountingUnit ?? t.outer.AccountingUnit;
return t.outer; return t.outer;
}).ToList(); }).ToList();
} }
...@@ -191,7 +191,8 @@ private void JudgeDataEqual(List<string> columns, List<per_employee> emps, List< ...@@ -191,7 +191,8 @@ private void JudgeDataEqual(List<string> columns, List<per_employee> emps, List<
{ nameof(per_employee.BankCard), (t) => t.BankCard }, { nameof(per_employee.BankCard), (t) => t.BankCard },
}; };
if (columns.Contains(nameof(per_employee.PersonnelNumber))) columns.Remove(nameof(per_employee.PersonnelNumber)); if (columns.Contains(nameof(per_employee.PersonnelNumber).ToLower())) columns.Remove(nameof(per_employee.PersonnelNumber).ToLower());
if (!columns.Contains(nameof(per_employee.AccountingUnit).ToLower())) columns.Add(nameof(per_employee.AccountingUnit).ToLower());
List<per_employee> updateData = new List<per_employee>(); List<per_employee> updateData = new List<per_employee>();
foreach (var emp in emps) foreach (var emp in emps)
......
...@@ -87,9 +87,11 @@ public void CreateAllotPersons(int hospitalId, int allotId, int prevAllotId = -1 ...@@ -87,9 +87,11 @@ public void CreateAllotPersons(int hospitalId, int allotId, int prevAllotId = -1
{ {
var allot = perallotRepository.GetEntity(t => t.ID == allotId); var allot = perallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null) throw new PerformanceException("绩效信息错误!"); if (allot == null) throw new PerformanceException("绩效信息错误!");
var isExist = (peremployeeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotId == allotId)?.Count ?? 0) > 0; var isExist = (peremployeeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotId == allotId)?.Count ?? 0) > 0;
if (isExist) return; //如果为空则先删除在执行下面的代码
if (isExist) { peremployeeRepository.DeleteFromQuery(u => u.HospitalId == hospitalId && u.AllotId == allotId);}
List<per_employee> persons = new List<per_employee>(); List<per_employee> persons = new List<per_employee>();
if (!new int[] { -1, 0 }.Contains(prevAllotId)) if (!new int[] { -1, 0 }.Contains(prevAllotId))
......
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