Commit beaacc6a by lcx

二次绩效模板修改,其他来源增加字段

parent 1c1701d3
...@@ -114,7 +114,7 @@ public ApiResponse SaveCompute([FromBody] List<ag_compute> request) ...@@ -114,7 +114,7 @@ public ApiResponse SaveCompute([FromBody] List<ag_compute> request)
[HttpPost] [HttpPost]
public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBody] UseTempRequest request) public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBody] UseTempRequest request)
{ {
var result = secondAllotService.GetSecondDetail(request); var result = secondAllotService.GetSecondDetail(request, claimService.GetUserId());
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
...@@ -333,7 +333,7 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request) ...@@ -333,7 +333,7 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request)
var result = secondAllotService.OtherList(request.SecondId); var result = secondAllotService.OtherList(request.SecondId);
var obj = new var obj = new
{ {
header = secondAllotService.OtherListHeader(request.SecondId, result?.Sum(t => t.Amount)), header = secondAllotService.OtherListHeader(request.SecondId, result?.Sum(t => t.RealAmount)),
body = result, body = result,
}; };
return new ApiResponse(ResponseType.OK, obj); return new ApiResponse(ResponseType.OK, obj);
......
...@@ -713,9 +713,39 @@ ...@@ -713,9 +713,39 @@
职称 职称
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_othersource.Amount"> <member name="P:Performance.EntityModels.ag_othersource.TitlePerformance">
<summary> <summary>
金额 职称绩效
</summary>
</member>
<member name="P:Performance.EntityModels.ag_othersource.WorkPerformance">
<summary>
工作量绩效工资
</summary>
</member>
<member name="P:Performance.EntityModels.ag_othersource.DeptReward">
<summary>
科室单项奖励
</summary>
</member>
<member name="P:Performance.EntityModels.ag_othersource.DistPerformance">
<summary>
可分配绩效
</summary>
</member>
<member name="P:Performance.EntityModels.ag_othersource.OtherPerformance">
<summary>
医院其他绩效
</summary>
</member>
<member name="P:Performance.EntityModels.ag_othersource.NightWorkPerformance">
<summary>
夜班工作量绩效
</summary>
</member>
<member name="P:Performance.EntityModels.ag_othersource.RealAmount">
<summary>
实发绩效工资金额
</summary> </summary>
</member> </member>
<member name="T:Performance.EntityModels.ag_secondallot"> <member name="T:Performance.EntityModels.ag_secondallot">
...@@ -813,6 +843,11 @@ ...@@ -813,6 +843,11 @@
类型 类型
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_temp.IsEnable">
<summary>
是否可用 1 可用 2 不可用
</summary>
</member>
<member name="T:Performance.EntityModels.ag_tempitem"> <member name="T:Performance.EntityModels.ag_tempitem">
<summary> <summary>
二次绩效模板项 二次绩效模板项
...@@ -3223,14 +3258,14 @@ ...@@ -3223,14 +3258,14 @@
人员类别 人员类别
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.AttendanceDay"> <member name="P:Performance.EntityModels.per_employee.Attendance">
<summary> <summary>
出勤天数 出勤
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.Attendance"> <member name="P:Performance.EntityModels.per_employee.AttendanceDay">
<summary> <summary>
出勤 出勤天数
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.PermanentStaff"> <member name="P:Performance.EntityModels.per_employee.PermanentStaff">
......
...@@ -47,8 +47,38 @@ public class ag_othersource ...@@ -47,8 +47,38 @@ public class ag_othersource
public string WorkPost { get; set; } public string WorkPost { get; set; }
/// <summary> /// <summary>
/// 金额 /// 职称绩效
/// </summary> /// </summary>
public Nullable<decimal> Amount { get; set; } public Nullable<decimal> TitlePerformance { get; set; }
/// <summary>
/// 工作量绩效工资
/// </summary>
public Nullable<decimal> WorkPerformance { get; set; }
/// <summary>
/// 科室单项奖励
/// </summary>
public Nullable<decimal> DeptReward { get; set; }
/// <summary>
/// 可分配绩效
/// </summary>
public Nullable<decimal> DistPerformance { get; set; }
/// <summary>
/// 医院其他绩效
/// </summary>
public Nullable<decimal> OtherPerformance { get; set; }
/// <summary>
/// 夜班工作量绩效
/// </summary>
public Nullable<decimal> NightWorkPerformance { get; set; }
/// <summary>
/// 实发绩效工资金额
/// </summary>
public Nullable<decimal> RealAmount { get; set; }
} }
} }
...@@ -30,5 +30,10 @@ public class ag_temp ...@@ -30,5 +30,10 @@ public class ag_temp
/// 类型 /// 类型
/// </summary> /// </summary>
public string UnitType { get; set; } public string UnitType { get; set; }
/// <summary>
/// 是否可用 1 可用 2 不可用
/// </summary>
public int IsEnable { get; set; }
} }
} }
...@@ -7,55 +7,55 @@ ...@@ -7,55 +7,55 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels namespace Performance.EntityModels
{ {
/// <summary> /// <summary>
/// 科室字典表 /// 科室字典表
/// </summary> /// </summary>
[Table("per_dept_dic")] [Table("per_dept_dic")]
public class per_dept_dic public class per_dept_dic
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Key] [Key]
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// his系统科室名称 /// his系统科室名称
/// </summary> /// </summary>
public string HISDeptName { get; set; } public string HISDeptName { get; set; }
/// <summary> /// <summary>
/// 科室 /// 科室
/// </summary> /// </summary>
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 核算单元 /// 核算单元
/// </summary> /// </summary>
public string AccountingUnit { get; set; } public string AccountingUnit { get; set; }
/// <summary> /// <summary>
/// 核算单元类型 /// 核算单元类型
/// </summary> /// </summary>
public string UnitType { get; set; } public string UnitType { get; set; }
/// <summary> /// <summary>
/// 来源住院/门诊 /// 来源住院/门诊
/// </summary> /// </summary>
public string Source { get; set; } public string Source { get; set; }
/// <summary> /// <summary>
/// 医院Id /// 医院Id
/// </summary> /// </summary>
public Nullable<int> HospitalId { get; set; } public Nullable<int> HospitalId { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public Nullable<DateTime> CreateTime { get; set; } public Nullable<DateTime> CreateTime { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
......
...@@ -7,116 +7,115 @@ ...@@ -7,116 +7,115 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels namespace Performance.EntityModels
{ {
/// <summary> /// <summary>
/// 绩效人员表 /// 绩效人员表
/// </summary> /// </summary>
[Table("per_employee")] [Table("per_employee")]
public class per_employee public class per_employee
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Key] [Key]
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// 核算单元 /// 核算单元
/// </summary> /// </summary>
public string AccountingUnit { get; set; } public string AccountingUnit { get; set; }
/// <summary> /// <summary>
/// 科室 /// 科室
/// </summary> /// </summary>
public string Department { get; set; } public string Department { get; set; }
/// <summary> /// <summary>
/// 姓名 /// 姓名
/// </summary> /// </summary>
public string DoctorName { get; set; } public string DoctorName { get; set; }
/// <summary> /// <summary>
/// 员工工号 /// 员工工号
/// </summary> /// </summary>
public string PersonnelNumber { get; set; } public string PersonnelNumber { get; set; }
/// <summary> /// <summary>
/// 正式/临聘 /// 正式/临聘
/// </summary> /// </summary>
public string JobCategory { get; set; } public string JobCategory { get; set; }
/// <summary> /// <summary>
/// 职务 /// 职务
/// </summary> /// </summary>
public string Duty { get; set; } public string Duty { get; set; }
/// <summary> /// <summary>
/// 职称 /// 职称
/// </summary> /// </summary>
public string JobTitle { get; set; } public string JobTitle { get; set; }
/// <summary> /// <summary>
/// 人员类别 /// 人员类别
/// </summary> /// </summary>
public string UnitType { get; set; } public string UnitType { get; set; }
/// <summary>
/// 出勤天数
/// </summary>
public Nullable<int> AttendanceDay { get; set; }
/// <summary> /// <summary>
/// 出勤率 /// 出勤率
/// </summary> /// </summary>
public Nullable<decimal> Attendance { get; set; } public Nullable<decimal> Attendance { get; set; }
/// <summary>
/// 出勤天数
/// </summary>
public Nullable<int> AttendanceDay { get; set; }
/// <summary> /// <summary>
/// 核算人数 /// 核算人数
/// </summary> /// </summary>
public Nullable<decimal> PermanentStaff { get; set; } public Nullable<decimal> PermanentStaff { get; set; }
/// <summary> /// <summary>
/// 效率人数 /// 效率人数
/// </summary> /// </summary>
public Nullable<decimal> EfficiencyNumber { get; set; } public Nullable<decimal> EfficiencyNumber { get; set; }
/// <summary> /// <summary>
/// 参加工作时间 /// 参加工作时间
/// </summary> /// </summary>
public Nullable<DateTime> WorkTime { get; set; } public Nullable<DateTime> WorkTime { get; set; }
/// <summary> /// <summary>
/// 出生年月 /// 出生年月
/// </summary> /// </summary>
public Nullable<DateTime> BirthDate { get; set; } public Nullable<DateTime> BirthDate { get; set; }
/// <summary> /// <summary>
/// 年龄 /// 年龄
/// </summary> /// </summary>
public Nullable<int> Age { get; set; } public Nullable<int> Age { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
/// </summary> /// </summary>
public string Remark { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// 医院Id /// 医院Id
/// </summary> /// </summary>
public Nullable<int> HospitalId { get; set; } public Nullable<int> HospitalId { get; set; }
/// <summary> /// <summary>
/// 绩效Id /// 绩效Id
/// </summary> /// </summary>
public Nullable<int> AllotId { get; set; } public Nullable<int> AllotId { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public Nullable<DateTime> CreateTime { get; set; } public Nullable<DateTime> CreateTime { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
......
...@@ -274,13 +274,18 @@ public List<SecondListResponse> GetSecondList(int userId) ...@@ -274,13 +274,18 @@ public List<SecondListResponse> GetSecondList(int userId)
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public SecondResponse GetSecondDetail(UseTempRequest request) public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
{ {
var usetemp = perforAgusetempRepository.GetEntity(t => t.HospitalId == request.HospitalId var usetemp = perforAgusetempRepository.GetEntity(t => t.HospitalId == request.HospitalId
&& t.Department == request.Department && t.UnitType == request.UnitType); //获取科室二次绩效费用分配使用的模板 && t.Department == request.Department && t.UnitType == request.UnitType); //获取科室二次绩效费用分配使用的模板
if (usetemp == null) if (usetemp == null)
throw new PerformanceException("当前科室暂未配置绩效模板"); throw new PerformanceException("当前科室暂未配置绩效模板");
var temp = perforAgtempRepository.GetEntity(t => t.Id == usetemp.UseTempId);
if (temp == null || temp.IsEnable != 1)
throw new PerformanceException("模板无效,请重新选择");
var second = perforAgsecondallotRepository.GetEntity(t => t.Id == request.SecondId); var second = perforAgsecondallotRepository.GetEntity(t => t.Id == request.SecondId);
//获取固定模板列 + 工作量列 //获取固定模板列 + 工作量列
var headItems = GetHeadItems(request.TempId, usetemp.HospitalId.Value, usetemp.Department, usetemp.UnitType); var headItems = GetHeadItems(request.TempId, usetemp.HospitalId.Value, usetemp.Department, usetemp.UnitType);
...@@ -310,7 +315,9 @@ public SecondResponse GetSecondDetail(UseTempRequest request) ...@@ -310,7 +315,9 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
else else
{ {
//无数据 根据IsBring带出历史二次绩效中需要带出的数据 //无数据 根据IsBring带出历史二次绩效中需要带出的数据
result.BodyItems = GetBringItems(request, headItems); //result.BodyItems = GetBringItems(request, headItems);
result.BodyItems = GetEmployees(second.AllotId.Value, userId, headItems);
var bodys = Mapper.Map<List<BodyItem>>(headItems.Where(t => t.Type == 1)); var bodys = Mapper.Map<List<BodyItem>>(headItems.Where(t => t.Type == 1));
if (bodys != null && bodys.Any()) if (bodys != null && bodys.Any())
bodys.ForEach(t => t.RowNumber = -1); bodys.ForEach(t => t.RowNumber = -1);
...@@ -330,17 +337,38 @@ public SecondResponse GetSecondDetail(UseTempRequest request) ...@@ -330,17 +337,38 @@ public SecondResponse GetSecondDetail(UseTempRequest request)
}; };
} }
private void GetEmployees(int allotId, int userId) private List<BodyItem> GetEmployees(int allotId, int userId, List<HeadItem> heads)
{ {
Dictionary<int, Func<per_employee, object>> dict = new Dictionary<int, Func<per_employee, object>> var list = new List<BodyItem>();
var employees = personService.GetPersons(allotId, userId);
if (employees == null || !employees.Any()) return list;
Dictionary<(string, string), Func<per_employee, object>> dict = new Dictionary<(string, string), Func<per_employee, object>>
{ {
{ 19, (t) => t.DoctorName }, { ("姓名", "FullName"), (t) => t.DoctorName },
{ 20, (t) => t.JobTitle }, { ("岗位", "Post"), (t) => t.JobTitle },
{ 22, (t) => t.AttendanceDay }, { ("实际出勤", "ActualAttendance"), (t) => t.AttendanceDay },
}; };
var employees = personService.GetPersons(allotId, userId); int rowNumber = 1;
var list = new List<BodyItem>(); foreach (var employee in employees)
{
foreach (var item in dict)
{
var head = heads.FirstOrDefault(t => t.FiledName == item.Key.Item1 && t.FiledId == item.Key.Item2);
if (head != null)
{
var body = Mapper.Map<BodyItem>(head);
body.Value = item.Value.Invoke(employee).ToString();
body.RowNumber = rowNumber;
list.Add(body);
}
}
rowNumber++;
}
return list;
} }
/// <summary> /// <summary>
...@@ -691,7 +719,7 @@ public bool SaveCompute(List<ag_compute> request) ...@@ -691,7 +719,7 @@ public bool SaveCompute(List<ag_compute> request)
/// <returns></returns> /// <returns></returns>
public List<SecondTempResponse> GetTemp(int hospitalid, string department, int userId) public List<SecondTempResponse> GetTemp(int hospitalid, string department, int userId)
{ {
var temps = perforAgtempRepository.GetEntities(); var temps = perforAgtempRepository.GetEntities(t => t.IsEnable == 1);
if (temps != null && temps.Any()) if (temps != null && temps.Any())
{ {
var userrole = userroleRepository.GetEntity(t => t.UserID == userId); var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
...@@ -1181,7 +1209,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request) ...@@ -1181,7 +1209,7 @@ public bool ConfirmAudit(int userId, SecondAuditRequest request)
WorkPost = item.WorkPost, WorkPost = item.WorkPost,
JobNumber = item.WorkNumber, JobNumber = item.WorkNumber,
PersonName = item.Name, PersonName = item.Name,
RealGiveFee = item.Amount, RealGiveFee = item.RealAmount,
}); });
} }
} }
...@@ -1299,7 +1327,13 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request ...@@ -1299,7 +1327,13 @@ public List<ag_othersource> OtherSave(int secondId, List<ag_othersource> request
existEntities.First(t => t.Id == item.Id).Name = item.Name; existEntities.First(t => t.Id == item.Id).Name = item.Name;
existEntities.First(t => t.Id == item.Id).Department = item.Department; existEntities.First(t => t.Id == item.Id).Department = item.Department;
existEntities.First(t => t.Id == item.Id).WorkPost = item.WorkPost; existEntities.First(t => t.Id == item.Id).WorkPost = item.WorkPost;
existEntities.First(t => t.Id == item.Id).Amount = item.Amount; existEntities.First(t => t.Id == item.Id).TitlePerformance = item.TitlePerformance;
existEntities.First(t => t.Id == item.Id).WorkPerformance = item.WorkPerformance;
existEntities.First(t => t.Id == item.Id).DeptReward = item.DeptReward;
existEntities.First(t => t.Id == item.Id).DistPerformance = item.DistPerformance;
existEntities.First(t => t.Id == item.Id).OtherPerformance = item.OtherPerformance;
existEntities.First(t => t.Id == item.Id).NightWorkPerformance = item.NightWorkPerformance;
existEntities.First(t => t.Id == item.Id).RealAmount = item.RealAmount;
} }
perforAgothersourceRepository.UpdateRange(existEntities.ToArray()); perforAgothersourceRepository.UpdateRange(existEntities.ToArray());
......
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