预留绩效重算,数据来自视图

parent cc23b62f
......@@ -458,70 +458,8 @@ public ApiResponse Reserved([FromBody] ReservedRequest request)
return new ApiResponse(ResponseType.ParameterError, "绩效信息无效");
var userid = _claim.GetUserId();
var reserveds = _allotService.GetReserved(request.HospitalId, request.Year, userid);
#region 格式转换
var result = reserveds?.Select(w => new
{
w.HospitalId,
w.Year,
w.UnitType,
w.AccountingUnit,
w.EmployeeName,
w.JobNumber,
JanReseFee = w.JanFee * w.JanRatio,
JanGiveFee = w.JanFee * (1 - w.JanRatio),
FebReseFee = w.FebFee * w.FebRatio,
FebGiveFee = w.FebFee * (1 - w.FebRatio),
MarReseFee = w.MarFee * w.MarRatio,
MarGiveFee = w.MarFee * (1 - w.MarRatio),
AprReseFee = w.AprFee * w.AprRatio,
AprGiveFee = w.AprFee * (1 - w.AprRatio),
MayReseFee = w.MayFee * w.MayRatio,
MayGiveFee = w.MayFee * (1 - w.MayRatio),
JunReseFee = w.JunFee * w.JunRatio,
JunGiveFee = w.JunFee * (1 - w.JunRatio),
JulReseFee = w.JulFee * w.JulRatio,
JulGiveFee = w.JulFee * (1 - w.JulRatio),
AugReseFee = w.AugFee * w.AugRatio,
AugGiveFee = w.AugFee * (1 - w.AugRatio),
SepReseFee = w.SepFee * w.SepRatio,
SepGiveFee = w.SepFee * (1 - w.SepRatio),
OctReseFee = w.OctFee * w.OctRatio,
OctGiveFee = w.OctFee * (1 - w.OctRatio),
NovReseFee = w.NovFee * w.NovRatio,
NovGiveFee = w.NovFee * (1 - w.NovRatio),
DecReseFee = w.DecFee * w.DecRatio,
DecGiveFee = w.DecFee * (1 - w.DecRatio),
TotalReseFee = (w.JanFee * w.JanRatio ?? 0) + (w.FebFee * w.FebRatio ?? 0) + (w.MarFee * w.MarRatio ?? 0)
+ (w.AprFee * w.AprRatio ?? 0) + (w.MayFee * w.MayRatio ?? 0) + (w.JunFee * w.JunRatio ?? 0)
+ (w.JulFee * w.JulRatio ?? 0) + (w.AugFee * w.AugRatio ?? 0) + (w.SepFee * w.SepRatio ?? 0)
+ (w.OctFee * w.OctRatio ?? 0) + (w.NovFee * w.NovRatio ?? 0) + (w.DecFee * w.DecRatio ?? 0),
TotalGiveFee = (w.JanFee * (1 - w.JanRatio) ?? 0) + (w.FebFee * (1 - w.FebRatio) ?? 0) + (w.MarFee * (1 - w.MarRatio) ?? 0)
+ (w.AprFee * (1 - w.AprRatio) ?? 0) + (w.MayFee * (1 - w.MayRatio) ?? 0) + (w.JunFee * (1 - w.JunRatio) ?? 0)
+ (w.JulFee * (1 - w.JulRatio) ?? 0) + (w.AugFee * (1 - w.AugRatio) ?? 0) + (w.SepFee * (1 - w.SepRatio) ?? 0)
+ (w.OctFee * (1 - w.OctRatio) ?? 0) + (w.NovFee * (1 - w.NovRatio) ?? 0) + (w.DecFee * (1 - w.DecRatio) ?? 0),
});
#endregion 格式转换
return new ApiResponse(ResponseType.OK, result);
return new ApiResponse(ResponseType.OK, reserveds);
}
/// <summary>
......
......@@ -384,10 +384,10 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
{
var userid = claimService.GetUserId();
var result = secondAllotService.ConfirmAudit(userid, request);
if (request.IsPass == 1)
{
resultComputeService.SaveSecondReserved(request.SecondId);
}
//if (request.IsPass == 1)
//{
// resultComputeService.SaveSecondReserved(request.SecondId);
//}
return result ? new ApiResponse(ResponseType.OK, "操作成功") : new ApiResponse(ResponseType.Fail, "操作失败");
}
......
......@@ -3294,6 +3294,101 @@
药占比对应系数
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.HospitalId">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.Year">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.UnitType">
<summary>
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.AccountingUnit">
<summary>
核算单元
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.EmployeeName">
<summary>
人员姓名
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.JobNumber">
<summary>
工号
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.JanReseFee">
<summary>
1月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.FebReseFee">
<summary>
2月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.MarReseFee">
<summary>
3月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.AprReseFee">
<summary>
4月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.MayReseFee">
<summary>
5月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.JunReseFee">
<summary>
6月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.JulReseFee">
<summary>
7月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.AugReseFee">
<summary>
8月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.SepReseFee">
<summary>
9月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.OctReseFee">
<summary>
10月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.NovReseFee">
<summary>
11月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.DecReseFee">
<summary>
12月
</summary>
</member>
<member name="P:Performance.DtoModels.EmployeeReservedDto.TotalReseFee">
<summary>
汇总
</summary>
</member>
<member name="P:Performance.DtoModels.GuaranteeResponse.AllotId">
<summary>
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class EmployeeReservedDto
{
/// <summary>
///
/// </summary>
public int HospitalId { get; set; }
/// <summary>
///
/// </summary>
public int Year { get; set; }
/// <summary>
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 人员姓名
/// </summary>
public string EmployeeName { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 1月
/// </summary>
public Nullable<decimal> JanReseFee { get; set; }
public Nullable<decimal> JanGiveFee { get; set; }
/// <summary>
/// 2月
/// </summary>
public Nullable<decimal> FebReseFee { get; set; }
public Nullable<decimal> FebGiveFee { get; set; }
/// <summary>
/// 3月
/// </summary>
public Nullable<decimal> MarReseFee { get; set; }
public Nullable<decimal> MarGiveFee { get; set; }
/// <summary>
/// 4月
/// </summary>
public Nullable<decimal> AprReseFee { get; set; }
public Nullable<decimal> AprGiveFee { get; set; }
/// <summary>
/// 5月
/// </summary>
public Nullable<decimal> MayReseFee { get; set; }
public Nullable<decimal> MayGiveFee { get; set; }
/// <summary>
/// 6月
/// </summary>
public Nullable<decimal> JunReseFee { get; set; }
public Nullable<decimal> JunGiveFee { get; set; }
/// <summary>
/// 7月
/// </summary>
public Nullable<decimal> JulReseFee { get; set; }
public Nullable<decimal> JulGiveFee { get; set; }
/// <summary>
/// 8月
/// </summary>
public Nullable<decimal> AugReseFee { get; set; }
public Nullable<decimal> AugGiveFee { get; set; }
/// <summary>
/// 9月
/// </summary>
public Nullable<decimal> SepReseFee { get; set; }
public Nullable<decimal> SepGiveFee { get; set; }
/// <summary>
/// 10月
/// </summary>
public Nullable<decimal> OctReseFee { get; set; }
public Nullable<decimal> OctGiveFee { get; set; }
/// <summary>
/// 11月
/// </summary>
public Nullable<decimal> NovReseFee { get; set; }
public Nullable<decimal> NovGiveFee { get; set; }
/// <summary>
/// 12月
/// </summary>
public Nullable<decimal> DecReseFee { get; set; }
public Nullable<decimal> DecGiveFee { get; set; }
/// <summary>
/// 汇总
/// </summary>
public Nullable<decimal> TotalReseFee { get; set; }
public Nullable<decimal> TotalGiveFee { get; set; }
}
}
......@@ -205,16 +205,16 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public virtual DbSet<report_performance_tags> report_performance_tags { get; set; }
/// <summary> 科室核算结果 </summary>
public virtual DbSet<res_account> res_account { get; set; }
/// <summary> 医生科室核算结果 </summary>
public virtual DbSet<res_accountdoctor> res_accountdoctor { get; set; }
/// <summary> 护理科室核算结果 </summary>
public virtual DbSet<res_accountnurse> res_accountnurse { get; set; }
///// <summary> 医生科室核算结果 </summary>
//public virtual DbSet<res_accountdoctor> res_accountdoctor { get; set; }
///// <summary> 护理科室核算结果 </summary>
//public virtual DbSet<res_accountnurse> res_accountnurse { get; set; }
/// <summary> 核算基础标准 </summary>
public virtual DbSet<res_baiscnorm> res_baiscnorm { get; set; }
/// <summary> </summary>
public virtual DbSet<res_compute> res_compute { get; set; }
/// <summary> </summary>
public virtual DbSet<res_reserved> res_reserved { get; set; }
///// <summary> </summary>
//public virtual DbSet<res_reserved> res_reserved { get; set; }
/// <summary> </summary>
public virtual DbSet<res_specialunit> res_specialunit { get; set; }
/// <summary> 医院数据提取脚本 </summary>
......
//-----------------------------------------------------------------------
// <copyright file=" res_accountdoctor.cs">
// * FileName: 医生科室核算结果.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// 医生科室核算结果
/// </summary>
[Table("res_accountdoctor")]
public class res_accountdoctor
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 科主任/护士长数量
/// </summary>
public Nullable<int> ManagerNumber { get; set; }
/// <summary>
/// 核算单元医生数量
/// </summary>
public Nullable<decimal> Number { get; set; }
/// <summary>
/// 医生基础系数
/// </summary>
public Nullable<decimal> BasicFactor { get; set; }
/// <summary>
/// 倾斜系数
/// </summary>
public Nullable<decimal> SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public Nullable<decimal> OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
/// <summary>
/// 科室业绩
/// </summary>
public Nullable<decimal> Income { get; set; }
/// <summary>
/// 业绩绩效
/// </summary>
public Nullable<decimal> PerforFee { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> WorkloadFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public Nullable<decimal> RealGiveFee { get; set; }
/// <summary>
/// 变更日志
/// </summary>
public string ChangeLog { get; set; }
}
}
////-----------------------------------------------------------------------
//// <copyright file=" res_accountdoctor.cs">
//// * FileName: 医生科室核算结果.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
//namespace Performance.EntityModels
//{
// /// <summary>
// /// 医生科室核算结果
// /// </summary>
// [Table("res_accountdoctor")]
// public class res_accountdoctor
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int ID { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> AllotID { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> SheetID { get; set; }
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
// /// <summary>
// /// 科室
// /// </summary>
// public string Department { get; set; }
// /// <summary>
// /// 科主任/护士长数量
// /// </summary>
// public Nullable<int> ManagerNumber { get; set; }
// /// <summary>
// /// 核算单元医生数量
// /// </summary>
// public Nullable<decimal> Number { get; set; }
// /// <summary>
// /// 医生基础系数
// /// </summary>
// public Nullable<decimal> BasicFactor { get; set; }
// /// <summary>
// /// 倾斜系数
// /// </summary>
// public Nullable<decimal> SlopeFactor { get; set; }
// /// <summary>
// /// 其他绩效1
// /// </summary>
// public Nullable<decimal> OtherPerfor1 { get; set; }
// /// <summary>
// /// 其他绩效2
// /// </summary>
// public Nullable<decimal> OtherPerfor2 { get; set; }
// /// <summary>
// /// 医院奖罚
// /// </summary>
// public Nullable<decimal> Extra { get; set; }
// /// <summary>
// /// 考核对分率
// /// </summary>
// public Nullable<decimal> ScoringAverage { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public Nullable<decimal> AdjustFactor { get; set; }
// /// <summary>
// /// 科室业绩
// /// </summary>
// public Nullable<decimal> Income { get; set; }
// /// <summary>
// /// 业绩绩效
// /// </summary>
// public Nullable<decimal> PerforFee { get; set; }
// /// <summary>
// /// 工作量绩效
// /// </summary>
// public Nullable<decimal> WorkloadFee { get; set; }
// /// <summary>
// /// 绩效合计
// /// </summary>
// public Nullable<decimal> PerforTotal { get; set; }
// /// <summary>
// /// 人均绩效
// /// </summary>
// public Nullable<decimal> Avg { get; set; }
// /// <summary>
// /// 实发绩效
// /// </summary>
// public Nullable<decimal> RealGiveFee { get; set; }
// /// <summary>
// /// 变更日志
// /// </summary>
// public string ChangeLog { get; set; }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" res_accountnurse.cs">
// * FileName: 护理科室核算结果.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// 护理科室核算结果
/// </summary>
[Table("res_accountnurse")]
public class res_accountnurse
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> SheetID { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 科室
/// </summary>
public string Department { get; set; }
/// <summary>
/// 科主任/护士长数量
/// </summary>
public Nullable<int> ManagerNumber { get; set; }
/// <summary>
/// 护士人数
/// </summary>
public Nullable<decimal> Number { get; set; }
/// <summary>
/// 护理基础系数
/// </summary>
public Nullable<decimal> BasicFactor { get; set; }
/// <summary>
/// 倾斜系数
/// </summary>
public Nullable<decimal> SlopeFactor { get; set; }
/// <summary>
/// 其他绩效1
/// </summary>
public Nullable<decimal> OtherPerfor1 { get; set; }
/// <summary>
/// 其他绩效2
/// </summary>
public Nullable<decimal> OtherPerfor2 { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Extra { get; set; }
/// <summary>
/// 考核对分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> AdjustFactor { get; set; }
/// <summary>
/// 科室业绩
/// </summary>
public Nullable<decimal> Income { get; set; }
/// <summary>
/// 业绩绩效
/// </summary>
public Nullable<decimal> PerforFee { get; set; }
/// <summary>
/// 工作量绩效
/// </summary>
public Nullable<decimal> WorkloadFee { get; set; }
/// <summary>
/// 绩效合计
/// </summary>
public Nullable<decimal> PerforTotal { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public Nullable<decimal> RealGiveFee { get; set; }
}
}
////-----------------------------------------------------------------------
//// <copyright file=" res_accountnurse.cs">
//// * FileName: 护理科室核算结果.cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
//namespace Performance.EntityModels
//{
// /// <summary>
// /// 护理科室核算结果
// /// </summary>
// [Table("res_accountnurse")]
// public class res_accountnurse
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int ID { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> AllotID { get; set; }
// /// <summary>
// ///
// /// </summary>
// public Nullable<int> SheetID { get; set; }
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
// /// <summary>
// /// 科室
// /// </summary>
// public string Department { get; set; }
// /// <summary>
// /// 科主任/护士长数量
// /// </summary>
// public Nullable<int> ManagerNumber { get; set; }
// /// <summary>
// /// 护士人数
// /// </summary>
// public Nullable<decimal> Number { get; set; }
// /// <summary>
// /// 护理基础系数
// /// </summary>
// public Nullable<decimal> BasicFactor { get; set; }
// /// <summary>
// /// 倾斜系数
// /// </summary>
// public Nullable<decimal> SlopeFactor { get; set; }
// /// <summary>
// /// 其他绩效1
// /// </summary>
// public Nullable<decimal> OtherPerfor1 { get; set; }
// /// <summary>
// /// 其他绩效2
// /// </summary>
// public Nullable<decimal> OtherPerfor2 { get; set; }
// /// <summary>
// /// 医院奖罚
// /// </summary>
// public Nullable<decimal> Extra { get; set; }
// /// <summary>
// /// 考核对分率
// /// </summary>
// public Nullable<decimal> ScoringAverage { get; set; }
// /// <summary>
// /// 调节系数
// /// </summary>
// public Nullable<decimal> AdjustFactor { get; set; }
// /// <summary>
// /// 科室业绩
// /// </summary>
// public Nullable<decimal> Income { get; set; }
// /// <summary>
// /// 业绩绩效
// /// </summary>
// public Nullable<decimal> PerforFee { get; set; }
// /// <summary>
// /// 工作量绩效
// /// </summary>
// public Nullable<decimal> WorkloadFee { get; set; }
// /// <summary>
// /// 绩效合计
// /// </summary>
// public Nullable<decimal> PerforTotal { get; set; }
// /// <summary>
// /// 人均绩效
// /// </summary>
// public Nullable<decimal> Avg { get; set; }
// /// <summary>
// /// 实发绩效
// /// </summary>
// public Nullable<decimal> RealGiveFee { get; set; }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" res_reserved.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("res_reserved")]
public class res_reserved
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public int HospitalId { get; set; }
/// <summary>
///
/// </summary>
public int Year { get; set; }
/// <summary>
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 人员姓名
/// </summary>
public string EmployeeName { get; set; }
/// <summary>
/// 工号
/// </summary>
public string JobNumber { get; set; }
/// <summary>
/// 一月
/// </summary>
public Nullable<decimal> JanFee { get; set; }
/// <summary>
/// 一月
/// </summary>
public Nullable<decimal> JanRatio { get; set; }
/// <summary>
/// 二月
/// </summary>
public Nullable<decimal> FebFee { get; set; }
/// <summary>
/// 二月
/// </summary>
public Nullable<decimal> FebRatio { get; set; }
/// <summary>
/// 三月
/// </summary>
public Nullable<decimal> MarFee { get; set; }
/// <summary>
/// 三月
/// </summary>
public Nullable<decimal> MarRatio { get; set; }
/// <summary>
/// 四月
/// </summary>
public Nullable<decimal> AprFee { get; set; }
/// <summary>
/// 四月
/// </summary>
public Nullable<decimal> AprRatio { get; set; }
/// <summary>
/// 五月
/// </summary>
public Nullable<decimal> MayFee { get; set; }
/// <summary>
/// 五月
/// </summary>
public Nullable<decimal> MayRatio { get; set; }
/// <summary>
/// 六月
/// </summary>
public Nullable<decimal> JunFee { get; set; }
/// <summary>
/// 六月
/// </summary>
public Nullable<decimal> JunRatio { get; set; }
/// <summary>
/// 七月
/// </summary>
public Nullable<decimal> JulFee { get; set; }
/// <summary>
/// 七月
/// </summary>
public Nullable<decimal> JulRatio { get; set; }
/// <summary>
/// 八月
/// </summary>
public Nullable<decimal> AugFee { get; set; }
/// <summary>
/// 八月
/// </summary>
public Nullable<decimal> AugRatio { get; set; }
/// <summary>
/// 九月
/// </summary>
public Nullable<decimal> SepFee { get; set; }
/// <summary>
/// 九月
/// </summary>
public Nullable<decimal> SepRatio { get; set; }
/// <summary>
/// 十月
/// </summary>
public Nullable<decimal> OctFee { get; set; }
/// <summary>
/// 十月
/// </summary>
public Nullable<decimal> OctRatio { get; set; }
/// <summary>
/// 十一月
/// </summary>
public Nullable<decimal> NovFee { get; set; }
/// <summary>
/// 十一月
/// </summary>
public Nullable<decimal> NovRatio { get; set; }
/// <summary>
/// 十二月
/// </summary>
public Nullable<decimal> DecFee { get; set; }
/// <summary>
/// 十二月
/// </summary>
public Nullable<decimal> DecRatio { get; set; }
}
}
////-----------------------------------------------------------------------
//// <copyright file=" res_reserved.cs">
//// * FileName: .cs
//// </copyright>
////-----------------------------------------------------------------------
//using System;
//using System.ComponentModel.DataAnnotations;
//using System.ComponentModel.DataAnnotations.Schema;
//namespace Performance.EntityModels
//{
// /// <summary>
// ///
// /// </summary>
// [Table("res_reserved")]
// public class res_reserved
// {
// /// <summary>
// ///
// /// </summary>
// [Key]
// public int Id { get; set; }
// /// <summary>
// ///
// /// </summary>
// public int HospitalId { get; set; }
// /// <summary>
// ///
// /// </summary>
// public int Year { get; set; }
// /// <summary>
// ///
// /// </summary>
// public string UnitType { get; set; }
// /// <summary>
// /// 核算单元
// /// </summary>
// public string AccountingUnit { get; set; }
// /// <summary>
// /// 人员姓名
// /// </summary>
// public string EmployeeName { get; set; }
// /// <summary>
// /// 工号
// /// </summary>
// public string JobNumber { get; set; }
// /// <summary>
// /// 一月
// /// </summary>
// public Nullable<decimal> JanFee { get; set; }
// /// <summary>
// /// 一月
// /// </summary>
// public Nullable<decimal> JanRatio { get; set; }
// /// <summary>
// /// 二月
// /// </summary>
// public Nullable<decimal> FebFee { get; set; }
// /// <summary>
// /// 二月
// /// </summary>
// public Nullable<decimal> FebRatio { get; set; }
// /// <summary>
// /// 三月
// /// </summary>
// public Nullable<decimal> MarFee { get; set; }
// /// <summary>
// /// 三月
// /// </summary>
// public Nullable<decimal> MarRatio { get; set; }
// /// <summary>
// /// 四月
// /// </summary>
// public Nullable<decimal> AprFee { get; set; }
// /// <summary>
// /// 四月
// /// </summary>
// public Nullable<decimal> AprRatio { get; set; }
// /// <summary>
// /// 五月
// /// </summary>
// public Nullable<decimal> MayFee { get; set; }
// /// <summary>
// /// 五月
// /// </summary>
// public Nullable<decimal> MayRatio { get; set; }
// /// <summary>
// /// 六月
// /// </summary>
// public Nullable<decimal> JunFee { get; set; }
// /// <summary>
// /// 六月
// /// </summary>
// public Nullable<decimal> JunRatio { get; set; }
// /// <summary>
// /// 七月
// /// </summary>
// public Nullable<decimal> JulFee { get; set; }
// /// <summary>
// /// 七月
// /// </summary>
// public Nullable<decimal> JulRatio { get; set; }
// /// <summary>
// /// 八月
// /// </summary>
// public Nullable<decimal> AugFee { get; set; }
// /// <summary>
// /// 八月
// /// </summary>
// public Nullable<decimal> AugRatio { get; set; }
// /// <summary>
// /// 九月
// /// </summary>
// public Nullable<decimal> SepFee { get; set; }
// /// <summary>
// /// 九月
// /// </summary>
// public Nullable<decimal> SepRatio { get; set; }
// /// <summary>
// /// 十月
// /// </summary>
// public Nullable<decimal> OctFee { get; set; }
// /// <summary>
// /// 十月
// /// </summary>
// public Nullable<decimal> OctRatio { get; set; }
// /// <summary>
// /// 十一月
// /// </summary>
// public Nullable<decimal> NovFee { get; set; }
// /// <summary>
// /// 十一月
// /// </summary>
// public Nullable<decimal> NovRatio { get; set; }
// /// <summary>
// /// 十二月
// /// </summary>
// public Nullable<decimal> DecFee { get; set; }
// /// <summary>
// /// 十二月
// /// </summary>
// public Nullable<decimal> DecRatio { get; set; }
// }
//}
......@@ -370,5 +370,17 @@ public List<PerReport> NurseAvg(ReportRequest request)
return DapperQuery(sql, new { hospitalId = request.HospitalId }).ToList();
}
#endregion
/// <summary>
/// 获取医院预留绩效
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="year"></param>
/// <returns></returns>
public List<EmployeeReservedDto> GetEmployeeReserved(int hospitalId, int year)
{
string sql = "SELECT * FROM view_allot_result_report WHERE HospitalID=@HospitalID AND Year=@Year";
return DapperQuery<EmployeeReservedDto>(sql, new { HospitalID = hospitalId, Year = year })?.ToList();
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" res_accountdoctor.cs">
// * FileName: res_accountdoctor.cs
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" res_accountdoctor.cs">
//// * FileName: res_accountdoctor.cs
//// </copyright>
////-----------------------------------------------------------------------
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// res_accountdoctor Repository
/// </summary>
public partial class PerforResaccountdoctorRepository : PerforRepository<res_accountdoctor>
{
public PerforResaccountdoctorRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// res_accountdoctor Repository
// /// </summary>
// public partial class PerforResaccountdoctorRepository : PerforRepository<res_accountdoctor>
// {
// public PerforResaccountdoctorRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" res_accountnurse.cs">
// * FileName: res_accountnurse.cs
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" res_accountnurse.cs">
//// * FileName: res_accountnurse.cs
//// </copyright>
////-----------------------------------------------------------------------
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// res_accountnurse Repository
/// </summary>
public partial class PerforResaccountnurseRepository : PerforRepository<res_accountnurse>
{
public PerforResaccountnurseRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// res_accountnurse Repository
// /// </summary>
// public partial class PerforResaccountnurseRepository : PerforRepository<res_accountnurse>
// {
// public PerforResaccountnurseRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
//-----------------------------------------------------------------------
// <copyright file=" res_reserved.cs">
// * FileName: res_reserved.cs
// </copyright>
//-----------------------------------------------------------------------
using Performance.EntityModels;
////-----------------------------------------------------------------------
//// <copyright file=" res_reserved.cs">
//// * FileName: res_reserved.cs
//// </copyright>
////-----------------------------------------------------------------------
//using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// res_reserved Repository
/// </summary>
public partial class PerforResreservedRepository : PerforRepository<res_reserved>
{
public PerforResreservedRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//namespace Performance.Repository
//{
// /// <summary>
// /// res_reserved Repository
// /// </summary>
// public partial class PerforResreservedRepository : PerforRepository<res_reserved>
// {
// public PerforResreservedRepository(PerformanceDbContext context) : base(context)
// {
// }
// }
//}
......@@ -26,7 +26,6 @@ public class AllotService : IAutoInjection
private ProcessComputService processComputService;
private ResultComputeService resultComputeService;
private PerforLogdbugRepository logdbug;
private readonly PerforResreservedRepository perforresreservedRepository;
private ConfigService configService;
private IHostingEnvironment _evn;
private ILogger<AllotService> _logger;
......@@ -44,6 +43,7 @@ public class AllotService : IAutoInjection
private readonly RoleService roleService;
private readonly UserService userService;
private PerforCofdirectorRepository perforCofdirectorRepository;
private readonly PerforReportRepository _reportRepository;
//private readonly IHubContext<AllotLogHub> hubContext;
private readonly LogManageService logManageService;
......@@ -51,33 +51,34 @@ public class AllotService : IAutoInjection
private readonly ReportService reportService;
private readonly QueryDataService queryDataService;
public AllotService(PerforPerallotRepository allotRepository,
BaiscNormService baiscNormService,
CheckDataService checkDataService,
ImportDataService importDataService,
ProcessComputService processComputService,
ResultComputeService resultComputeService,
ConfigService configService,
PerforLogdbugRepository logdbug,
PerforResreservedRepository perforresreservedRepository,
IHostingEnvironment evn, ILogger<AllotService> logger,
IEmailService emailService,
IOptions<Application> options,
ComputeDirector computeDirector,
PerforRescomputeRepository perforRescomputeRepository,
PerforImemployeeRepository perforImEmployeeRepository,
PerforPeragainallotRepository againallotRepository,
PerforLogcheckRepository perforLogcheckRepository,
PerforHospitalRepository perforHospitalRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforHospitalconfigRepository perforHospitalconfigRepository,
//IHubContext<AllotLogHub> hubContext
RoleService roleService,
UserService userService,
LogManageService logManageService,
ReportService reportService,
PerforCofdirectorRepository perforCofdirectorRepository,
QueryDataService queryDataService)
public AllotService(
PerforPerallotRepository allotRepository,
BaiscNormService baiscNormService,
CheckDataService checkDataService,
ImportDataService importDataService,
ProcessComputService processComputService,
ResultComputeService resultComputeService,
ConfigService configService,
PerforLogdbugRepository logdbug,
IHostingEnvironment evn, ILogger<AllotService> logger,
IEmailService emailService,
IOptions<Application> options,
ComputeDirector computeDirector,
PerforRescomputeRepository perforRescomputeRepository,
PerforImemployeeRepository perforImEmployeeRepository,
PerforPeragainallotRepository againallotRepository,
PerforLogcheckRepository perforLogcheckRepository,
PerforHospitalRepository perforHospitalRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforHospitalconfigRepository perforHospitalconfigRepository,
//IHubContext<AllotLogHub> hubContext
RoleService roleService,
UserService userService,
LogManageService logManageService,
ReportService reportService,
PerforCofdirectorRepository perforCofdirectorRepository,
PerforReportRepository reportRepository,
QueryDataService queryDataService)
{
_allotRepository = allotRepository;
_againallotRepository = againallotRepository;
......@@ -95,7 +96,6 @@ public class AllotService : IAutoInjection
_perforImEmployeeRepository = perforImEmployeeRepository;
this.configService = configService;
this.logdbug = logdbug;
this.perforresreservedRepository = perforresreservedRepository;
this.perforLogcheckRepository = perforLogcheckRepository;
this.perforHospitalRepository = perforHospitalRepository;
this.perforResbaiscnormRepository = perforResbaiscnormRepository;
......@@ -106,6 +106,7 @@ public class AllotService : IAutoInjection
this.logManageService = logManageService;
this.reportService = reportService;
this.perforCofdirectorRepository = perforCofdirectorRepository;
_reportRepository = reportRepository;
this.queryDataService = queryDataService;
}
......@@ -431,9 +432,9 @@ public void Generate(per_allot allot)
logManageService.WriteMsg("正在生成绩效", "保存绩效人均参考标准", 1, allot.ID, "ReceiveMessage", true);
perforResbaiscnormRepository.AddRange(baiscnormList.ToArray());
// 保存预留绩效
logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
resultComputeService.SaveReserved(allot, allot.HospitalId);
//// 保存预留绩效
//logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
//resultComputeService.SaveReserved(allot, allot.HospitalId);
// 科室下发
resultComputeService.GenerateSecondAllot(allot);
......@@ -625,7 +626,14 @@ public List<log_dbug> AllotLog(per_allot allot, int type)
return list;
}
public List<res_reserved> GetReserved(int hospitalId, int year, int userid)
/// <summary>
/// 获取医院预留绩效
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="year"></param>
/// <param name="userid"></param>
/// <returns></returns>
public List<EmployeeReservedDto> GetReserved(int hospitalId, int year, int userid)
{
var user = userService.GetUser(userid);
if (user == null)
......@@ -635,20 +643,18 @@ public List<res_reserved> GetReserved(int hospitalId, int year, int userid)
if (!role.HasValue)
throw new PerformanceException("用户信息错误");
var roleTypes = new[] { options.Value.NurseRole, options.Value.DirectorRole, options.Value.SpecialRole, options.Value.OfficeRole };
var reserveds = perforresreservedRepository.GetEntities(w => w.HospitalId == hospitalId && w.Year == year);
var reserveds = _reportRepository.GetEmployeeReserved(hospitalId, year);
if (reserveds != null && reserveds.Any())
{
if (role.Value == options.Value.NurseRole)
reserveds = reserveds.Where(w => !string.IsNullOrEmpty(w.UnitType) && w.UnitType.Contains(UnitType.护理组.ToString()) && w.AccountingUnit == user.Department)?.ToList();
reserveds = reserveds.Where(w => UnitTypeUtil.Is(w.UnitType, UnitType.护理组, UnitType.其他护理组) && w.AccountingUnit == user.Department)?.ToList();
else if (role.Value == options.Value.DirectorRole)
reserveds = reserveds.Where(w => !string.IsNullOrEmpty(w.UnitType) && (w.UnitType.Contains(UnitType.医生组.ToString()) || w.UnitType.Contains(UnitType.医技组.ToString())) && w.AccountingUnit == user.Department)?.ToList();
reserveds = reserveds.Where(w => UnitTypeUtil.Is(w.UnitType, UnitType.医生组, UnitType.其他医生组, UnitType.医技组, UnitType.其他医技组) && w.AccountingUnit == user.Department)?.ToList();
else if (role.Value == options.Value.SpecialRole)
reserveds = reserveds.Where(w => !string.IsNullOrEmpty(w.UnitType) && w.UnitType.Contains(UnitType.特殊核算组.ToString()) && w.AccountingUnit == user.Department)?.ToList();
reserveds = reserveds.Where(w => UnitTypeUtil.Is(w.UnitType, UnitType.特殊核算组) && w.AccountingUnit == user.Department)?.ToList();
else if (role.Value == options.Value.OfficeRole)
reserveds = reserveds.Where(w => !string.IsNullOrEmpty(w.UnitType) && (w.UnitType.Contains(UnitType.行政中层.ToString()) || w.UnitType.Contains(UnitType.行政后勤.ToString())) && w.AccountingUnit == user.Department)?.ToList();
reserveds = reserveds.Where(w => UnitTypeUtil.Is(w.UnitType, UnitType.行政中层, UnitType.行政后勤) && w.AccountingUnit == user.Department)?.ToList();
}
return reserveds;
......
using Performance.DtoModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
......@@ -30,10 +31,16 @@ public static bool IsOffice(string unit)
/// 核算单元类型是否相同
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
public static bool IsEqualsUnitType(string left, string right)
{
return left?.Replace("行政后勤", "行政工勤") == right?.Replace("行政后勤", "行政工勤");
}
public static bool Is(string unit, params UnitType[] types)
{
return !string.IsNullOrEmpty(unit) && types.Any(w => IsEqualsUnitType(w.ToString(), unit));
}
}
}
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