BUG修复

parent 9340e303
......@@ -438,6 +438,11 @@
管理绩效发放系数
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeEmployee.NightWorkPerfor">
<summary>
夜班费
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResult.AccountType">
<summary>
科室类别(例如 医技科室 临床科室 其他科室)
......@@ -583,6 +588,11 @@
效率绩效人数
</summary>
</member>
<member name="P:Performance.DtoModels.ComputeResult.NightWorkPerfor">
<summary>
夜班费
</summary>
</member>
<member name="T:Performance.DtoModels.UnitType">
<summary> 核算单元类型 </summary>
</member>
......@@ -1017,6 +1027,11 @@
岗位系数
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataEmployee.NightWorkPerfor">
<summary>
夜班费
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataEmployee.ScoreAverageRate">
<summary>
考核得分率
......@@ -2876,6 +2891,16 @@
效率绩效人数
</summary>
</member>
<member name="P:Performance.DtoModels.ResComputeResponse.NightWorkPerfor">
<summary>
夜班费
</summary>
</member>
<member name="P:Performance.DtoModels.ResComputeResponse.OtherPerformance">
<summary>
医院其他绩效
</summary>
</member>
<member name="P:Performance.DtoModels.RoleResponse.RoleName">
<summary>
角色名称
......
......@@ -2242,6 +2242,11 @@
其他绩效
</summary>
</member>
<member name="P:Performance.EntityModels.im_employee.NightWorkPerfor">
<summary>
夜班费
</summary>
</member>
<member name="P:Performance.EntityModels.im_employee.Punishment">
<summary>
医院奖罚
......@@ -4457,6 +4462,11 @@
其他绩效(来自人员名单)
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.NightWorkPerfor">
<summary>
夜班费
</summary>
</member>
<member name="P:Performance.EntityModels.res_compute.GiveFee">
<summary>
应发绩效(需计算)
......@@ -4727,6 +4737,11 @@
量化指标绩效分值
</summary>
</member>
<member name="P:Performance.EntityModels.res_specialunit.QuantitativeFee">
<summary>
量化指标绩效金额
</summary>
</member>
<member name="P:Performance.EntityModels.res_specialunit.ScoringAverage">
<summary>
考核得分率
......
......@@ -135,5 +135,10 @@ public class ComputeEmployee
/// 管理绩效发放系数
/// </summary>
public Nullable<decimal> Management { get; set; }
/// <summary>
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
}
}
......@@ -168,5 +168,10 @@ public class ComputeResult
/// 效率绩效人数
/// </summary>
public Nullable<decimal> PermanentStaff { get; set; }
/// <summary>
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
}
}
......@@ -97,6 +97,11 @@ public class PerDataClinicEmployee : IPerData
public Nullable<decimal> OthePerfor { get; set; }
///// <summary>
///// 夜班费
///// </summary>
//public Nullable<decimal> NightWorkPerfor { get; set; }
///// <summary>
///// 医院奖罚
///// </summary>
//public Nullable<decimal> Punishment { get; set; }
......
......@@ -62,6 +62,11 @@ public class PerDataEmployee : IPerData
//public Nullable<DateTime> WorkTime { get; set; }
/// <summary>
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 考核得分率
/// </summary>
public Nullable<decimal> ScoreAverageRate { get; set; }
......
......@@ -167,5 +167,15 @@ public class ResComputeResponse
/// 效率绩效人数
/// </summary>
public Nullable<decimal> PermanentStaff { get; set; }
/// <summary>
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public Nullable<decimal> OtherPerformance { get; set; }
}
}
......@@ -115,6 +115,11 @@ public class im_employee
/// 其他绩效
/// </summary>
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 医院奖罚
......
......@@ -7,25 +7,25 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("res_compute")]
public class res_compute
public class res_compute
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
/// sheet页id
/// </summary>
......@@ -40,12 +40,12 @@ public class res_compute
/// 核算单元类型(医技科室、临床科室等)
/// </summary>
public string AccountType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 绩效基数核算参考对象
/// </summary>
......@@ -65,137 +65,142 @@ public class res_compute
/// 人员姓名
/// </summary>
public string EmployeeName { get; set; }
/// <summary>
/// 职称
/// </summary>
public string JobTitle { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 绩效合计(来自科室经济测算表)
/// </summary>
public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 核算单元医生数量(来自科室经济测算表)
/// </summary>
public Nullable<decimal> Number { get; set; }
/// <summary>
/// 人均绩效(来自科室经济测算表)
/// </summary>
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 效率绩效(需计算)
/// </summary>
public Nullable<decimal> Efficiency { get; set; }
/// <summary>
/// 规模绩效(需计算)
/// </summary>
public Nullable<decimal> Scale { get; set; }
/// <summary>
/// 岗位系数
/// </summary>
public Nullable<decimal> PostCoefficient { get; set; }
/// <summary>
/// 发放系数(来自人员名单)
/// </summary>
public Nullable<decimal> Grant { get; set; }
/// <summary>
/// 应发管理绩效(需计算,科主任护士长独有)
/// </summary>
public Nullable<decimal> ShouldGiveFee { get; set; }
/// <summary>
/// 绩效合计(需计算)
/// </summary>
public Nullable<decimal> PerforSumFee { get; set; }
/// <summary>
/// 考核对分率(来自人员名单)
/// </summary>
public Nullable<decimal> ScoreAverageRate { get; set; }
/// <summary>
/// 医院奖罚(来自人员名单)
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
/// 其他绩效(来自人员名单)
/// </summary>
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 夜班费
/// </summary>
public Nullable<decimal> NightWorkPerfor { get; set; }
/// <summary>
/// 应发绩效(需计算)
/// </summary>
public Nullable<decimal> GiveFee { get; set; }
/// <summary>
/// 出勤率(来自人员名单)
/// </summary>
public Nullable<decimal> Attendance { get; set; }
/// <summary>
/// 参加工作时间(来自人员名单)
/// </summary>
public Nullable<DateTime> WorkTime { get; set; }
/// <summary>
/// 绩效基础金额(计算)
/// </summary>
public Nullable<decimal> BaiscNormValue { get; set; }
/// <summary>
/// 年资系数(来自人员名单)
/// </summary>
public Nullable<decimal> WorkYear { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> Adjust { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> Workload { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public Nullable<decimal> RealGiveFee { get; set; }
/// <summary>
/// 变更日志
/// </summary>
public string ChangeLog { get; set; }
/// <summary>
///
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 科主任/护士长人数
/// </summary>
public Nullable<decimal> ManagerNumber { get; set; }
/// <summary>
/// 核算单元人员数量
/// </summary>
public Nullable<decimal> MedicalNumber { get; set; }
/// <summary>
/// 效率绩效人数
/// </summary>
......
......@@ -62,6 +62,11 @@ public class res_specialunit
public Nullable<decimal> QuantitativeIndicatorsValue { get; set; }
/// <summary>
/// 量化指标绩效金额
/// </summary>
public Nullable<decimal> QuantitativeFee { get; set; }
/// <summary>
/// 考核得分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
......
......@@ -170,6 +170,13 @@ public class ResultComputeService : IAutoInjection
var drugExtra = drugExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
var materialsExtra = materialsExtras?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
decimal? headcount = null;
if (typeList.Any(o => o.Description == item.QuantitativeIndicators))
headcount = group.Number;
if (!headcount.HasValue || headcount == 0)
headcount = 1;
//var xxx = item.Quantity * item.QuantitativeIndicatorsValue * headcount;
var res = new res_specialunit
{
AllotID = allot.ID,
......@@ -179,6 +186,7 @@ public class ResultComputeService : IAutoInjection
QuantitativeIndicators = item.QuantitativeIndicators,
Quantity = item.Quantity,
QuantitativeIndicatorsValue = item.QuantitativeIndicatorsValue,
QuantitativeFee = item.Quantity * item.QuantitativeIndicatorsValue * headcount,
ScoringAverage = dept?.ScoringAverage,
//OtherPerfor = dept?.OtherPerfor,
Punishment = (extra ?? 0),
......
......@@ -488,6 +488,10 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
baiscnorm = item.FitPeopleValue ?? baiscNormService.GetBaiscNorm(baiscnormList, perforType);
}
}
// 行政高层 行政中层 夜班费
if (AccountUnitType.行政高层.ToString() == involve || AccountUnitType.行政中层.ToString() == involve)
compute.NightWorkPerfor = item.NightWorkPerfor;
//添加参数计算
compute.BaiscNormValue = baiscnorm * (item.FitPeopleRatio ?? 0);
//绩效合计
......
......@@ -19,6 +19,7 @@ public class ExcelReadConfig
new ColumnInfo(nameof(PerDataEmployee.FitPeopleRatio), "绩效基数核算系数", true),
new ColumnInfo(nameof(PerDataEmployee.AccountType), "人员分类"),
new ColumnInfo(nameof(PerDataEmployee.PostCoefficient), "岗位系数", true),
new ColumnInfo(nameof(PerDataEmployee.NightWorkPerfor), "夜班费"),
new ColumnInfo(nameof(PerDataEmployee.ScoreAverageRate), "考核得分率", true),
new ColumnInfo(nameof(PerDataEmployee.Attendance), "出勤率", true),
new ColumnInfo(nameof(PerDataEmployee.Adjust), "调节系数", true),
......@@ -43,6 +44,7 @@ public class ExcelReadConfig
new ColumnInfo(nameof(PerDataClinicEmployee.Attendance), "出勤率", true),
new ColumnInfo(nameof(PerDataClinicEmployee.OtheManagementPerfor), "其他管理绩效"),
new ColumnInfo(nameof(PerDataClinicEmployee.OthePerfor), "其他绩效"),
//new ColumnInfo(nameof(PerDataClinicEmployee.NightWorkPerfor), "夜班费"),
new ColumnInfo(nameof(PerDataClinicEmployee.Adjust), "调节系数", true),
};
......
......@@ -103,7 +103,7 @@ public List<SecondListResponse> GetSecondList(int userId)
throw new NotImplementedException("人员未选择医院");
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospital.HospitalID && new List<int> { 6, 8 }.Contains(t.States));
if (allotList == null || allotList.Count == 0)
throw new NotImplementedException("该医院未生成绩效");
return new List<SecondListResponse>();
var allotListId = allotList.Select(t => t.ID).ToList();
Expression<Func<ag_secondallot, bool>> exp = t => allotListId.Contains(t.AllotId.Value) && t.Department == user.Department;
......@@ -323,7 +323,7 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
var result = new SecondResponse();
var fixatList = perforAgfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId && t.RowNumber.HasValue);
var fixatList = perforAgfixatitemRepository.GetEntities(t => t.SecondId == request.SecondId && t.RowNumber.HasValue && !string.IsNullOrEmpty(t.ItemName));
//归档 或 等待审核、审核通过时,headItems不会随选择模板改动,带出已填写数据中的headItems
if (request.IsArchive == 1 || new List<int> { 2, 3 }.Contains(second.Status ?? 1))
{
......@@ -331,6 +331,8 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
throw new PerformanceException("提交时未添加数据。");
result = SubmittedData(fixatList, headItems);
// 补充 医院其他绩效
SupplementOtherPerfor(result, second.AllotId ?? -99);
}
else
{
......@@ -340,8 +342,13 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
if (fixatList != null && fixatList.Any())
{
result.BodyItems = GetBodyItems(fixatList, headItems);
// 补充 医院其他绩效
SupplementOtherPerfor(result, second.AllotId ?? -99);
if (fixatList.Where(t => t.RowNumber != -1) == null || !fixatList.Where(t => t.RowNumber != -1).Any())
result.BodyItems.AddRange(GetEmployees(second.AllotId.Value, userId, headItems)); //更换模板时,会自动保存顶部数据
{
//更换模板时,会自动保存顶部数据
result.BodyItems.AddRange(GetEmployees(second.AllotId.Value, userId, headItems));
}
}
else
{
......@@ -367,6 +374,31 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
BodyItems = result.BodyItems.OrderBy(t => t.RowNumber).ThenBy(t => t.Type).ThenBy(t => t.Sort).ToList(),
};
}
/// <summary>
/// 补充 医院其他绩效
/// </summary>
/// <param name="result"></param>
private void SupplementOtherPerfor(SecondResponse result, int allotId)
{
if (result?.BodyItems != null && result.BodyItems.Any())
{
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == allotId);
foreach (var rownum in result.BodyItems.Where(w => w.RowNumber > -1).Select(w => w.RowNumber).Distinct())
{
var rowData = result.BodyItems.Where(w => w.RowNumber == rownum);
var personnelNumber = rowData.FirstOrDefault(w => w.FiledId == "PersonnelNumber")?.Value;
var fullName = rowData.FirstOrDefault(w => w.FiledId == "FullName")?.Value;
var amount = perapramounts
?.Where(w => w.DoctorName?.Trim() == fullName?.Trim() && w.PersonnelNumber?.Trim() == personnelNumber?.Trim())
?.Sum(w => w.Amount);
var otherPerfor = rowData.FirstOrDefault(w => w.FiledId == "OtherPerformance");
if (otherPerfor != null)
otherPerfor.Value = amount?.ToString();
}
}
}
private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> heads, string empName = "", string jobNumber = "")
{
......@@ -651,13 +683,11 @@ public bool SaveValue(List<ag_fixatitem> request)
List<ag_fixatitem> update = new List<ag_fixatitem>(), insert = new List<ag_fixatitem>();
if (fixatitems != null && fixatitems.Any())
{
foreach (var item in request)
foreach (var item in request.Where(w => !string.IsNullOrEmpty(w.ItemName)))
{
if (fixatitems.Any(t => t.RowNumber == item.RowNumber && t.ItemName == item.ItemName))
var cellItem = fixatitems.FirstOrDefault(t => t.RowNumber == item.RowNumber && t.ItemName == item.ItemName);
if (cellItem != null)
{
var cellItem = fixatitems.FirstOrDefault(t => t.RowNumber == item.RowNumber && t.ItemName == item.ItemName);
if (cellItem == null)
continue;
cellItem.ItemValue = item.ItemValue;
cellItem.Sort = item.Sort;
cellItem.SourceType = item.SourceType;
......@@ -1347,35 +1377,46 @@ public List<BodyItem> GetBodyItems(List<HeadItem> headItems, int source, List<co
#region 二次绩效其他来源
public List<ag_othersource> OtherList(int secondId, int userId)
{
var second = perforAgsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) throw new PerformanceException("二次绩效信息无效!");
var employees = personService.GetPersons(second.AllotId.Value, userId);
if (employees == null || !employees.Any()) return new List<ag_othersource>();
List<ag_othersource> result = null;
var otherSecondList = perforAgothersourceRepository.GetEntities(t => t.SecondId == secondId);
if (otherSecondList != null && otherSecondList.Any())
{
return otherSecondList.OrderBy(t => t.Id).ToList();
result = otherSecondList.OrderBy(t => t.Id).ToList();
}
else
{
var second = perforAgsecondallotRepository.GetEntity(t => t.Id == secondId);
if (second == null) throw new PerformanceException("二次绩效信息无效!");
var employees = personService.GetPersons(second.AllotId.Value, userId);
if (employees == null || !employees.Any()) return new List<ag_othersource>();
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.DoctorName?.Trim() == t.DoctorName?.Trim() && w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())
?.Sum(w => w.Amount);
return employees.Select(t => new ag_othersource
result = employees.Select(t => new ag_othersource
{
SecondId = secondId,
WorkNumber = t.PersonnelNumber,
Name = t.DoctorName,
Department = t.Department,
WorkPost = t.JobTitle,
ReservedRatio = t.ReservedRatio,
OtherPerformance = getAprAmount(t)
}).ToList();
}
// 补充医院其他绩效 及 预留比例
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId);
Func<per_employee, decimal?> getAprAmount = (t) => perapramounts
?.Where(w => w.DoctorName?.Trim() == t.DoctorName?.Trim() && w.PersonnelNumber?.Trim() == t.PersonnelNumber?.Trim())
?.Sum(w => w.Amount);
foreach (var item in result)
{
var empl = employees.FirstOrDefault(w => w.PersonnelNumber?.Trim() == item.WorkNumber?.Trim() && w.DoctorName?.Trim() == item.Name?.Trim());
if (empl != null)
{
item.ReservedRatio = empl.ReservedRatio;
item.OtherPerformance = getAprAmount(empl);
}
}
return result;
}
public Dictionary<string, string> OtherListHeader(int secondId, decimal? amount)
......
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