Commit 5a0e2b4a by 钟博

重新加载人员字典,费用类别配置新增序号,绩效发放页面新增审核时间

parent c2c1a74f
......@@ -269,5 +269,19 @@ public ApiResponse SaveDeptHands(int hospitalId, SaveCollectData request)
personService.SaveDeptDicHands(hospitalId, request);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 重新加载人员字典
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="allotId"></param>
/// <returns></returns>
[HttpPost]
[Route("peson/{hospitalId}/reloadPersonnel/{allotId}")]
public ApiResponse ReloadPersonnel(int hospitalId,int allotId)
{
personService.ReloadPersonnel(hospitalId, allotId);
return new ApiResponse(ResponseType.OK);
}
}
}
......@@ -126,7 +126,10 @@ public ComputeResponse(string source, string accountingUnit, string employeeName
/// </summary>
public string TitlePosition { get; set; }
/// <summary>
/// 审核时间
/// </summary>
public Nullable<DateTime> AuditTime { get; set; }
}
......
......@@ -866,6 +866,7 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
if (response != null)
{
var types = new string[] { UnitType.行政高层.ToString(), UnitType.行政中层.ToString(), UnitType.行政后勤.ToString(), "行政工勤" };
var agSecond = _perforAgsecondallotRepository.GetEntities(t => t.AllotId == allotId);
foreach (var item in response)
{
// 二次分配默认 调节系数100%
......@@ -902,12 +903,14 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
item.JobCategory = emps?.JobCategory ?? "";
item.Duty = emps?.Duty ?? "";
item.TitlePosition = emps?.JobTitle ?? "";
// 人员信息使用人员字典中数据
if (isEmpDic)
{
item.AccountingUnit = employees?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.AccountingUnit ?? "";
item.UnitType = employees?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.UnitType ?? "";
}
item.AuditTime =agSecond.FirstOrDefault(t=>t.Department == item.AccountingUnit)?.AuditTime;
}
}
response.RemoveAll(w => w.PerforSumFee == 0 && w.PerforManagementFee == 0 && w.ShouldGiveFee == 0 && w.OthePerfor == 0 && w.HideOtherPerfor == 0 && w.RealGiveFee == 0);
......
......@@ -1000,5 +1000,53 @@ public string GetPersonDictFile(int allotId, int userId)
}
return filepath;
}
public void ReloadPersonnel(int hospitalId, int allotId)
{
var allotList = perallotRepository.GetEntities(w => w.HospitalId == hospitalId)?.OrderBy(s => s.Year).ThenBy(s => s.Month).ToList();
if (allotList == null || !allotList.Any()) return;
var allot = allotList.FirstOrDefault(w => w.ID == allotId);
if (allot == null) return;
var index = allotList.IndexOf(allot);
if (index == 0) return;
var prevAllot = allotList[index - 1];
if (prevAllot == null) prevAllot.ID = -1;
var persons = peremployeeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotId == prevAllot.ID);
if (persons == null || !persons.Any()) return;
var i = peremployeeRepository.Execute($@"DELETE FROM per_employee WHERE HospitalId=@HospitalId and AllotId=@AllotId;", new { hospitalId, allotId });
if (i <= 0) return;
int day = DateTime.DaysInMonth(allot.Year, allot.Month);
var data = persons.Select(t => new per_employee
{
HospitalId = t.HospitalId,
AllotId = allotId,
AccountingUnit = t.AccountingUnit,
Department = t.Department,
DoctorName = t.DoctorName,
JobCategory = t.JobCategory,
Duty = t.Duty,
JobTitle = t.JobTitle,
UnitType = t.UnitType,
AttendanceDay = day,
Attendance = 1,
PermanentStaff = t.PermanentStaff,
EfficiencyNumber = t.EfficiencyNumber,
WorkTime = t.WorkTime,
BirthDate = t.BirthDate,
Age = t.Age,
ReservedRatio = t.ReservedRatio,
BankCard = t.BankCard,
Remark = t.Remark,
CreateTime = DateTime.Now,
}).ToList();
SaveAllotPersons(data);
}
}
}
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