预留比例

parent d87f31c9
...@@ -282,5 +282,82 @@ public ApiResponse UpdateAllotShowFormula([FromBody] AllotRequest request) ...@@ -282,5 +282,82 @@ public ApiResponse UpdateAllotShowFormula([FromBody] AllotRequest request)
var result = _allotService.UpdateAllotShowFormula(request.ID); var result = _allotService.UpdateAllotShowFormula(request.ID);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
/// <summary>
/// 获取
/// </summary>
/// <returns></returns>
[Route("reserved")]
[HttpPost]
public ApiResponse Reserved([FromBody]ReservedRequest request)
{
if (request.HospitalId < 1)
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 + w.FebFee * w.FebRatio + w.MarFee * w.MarRatio
+ w.AprFee * w.AprRatio + w.MayFee * w.MayRatio + w.JunFee * w.JunRatio
+ w.JulFee * w.JulRatio + w.AugFee * w.AugRatio + w.SepFee * w.SepRatio
+ w.OctFee * w.OctRatio + w.NovFee * w.NovRatio + w.DecFee * w.DecRatio,
TotalGiveFee = w.JanFee * (1 - w.JanRatio) + w.FebFee * (1 - w.FebRatio) + w.MarFee * (1 - w.MarRatio)
+ w.AprFee * (1 - w.AprRatio) + w.MayFee * (1 - w.MayRatio) + w.JunFee * (1 - w.JunRatio)
+ w.JulFee * (1 - w.JulRatio) + w.AugFee * (1 - w.AugRatio) + w.SepFee * (1 - w.SepRatio)
+ w.OctFee * (1 - w.OctRatio) + w.NovFee * (1 - w.NovRatio) + w.DecFee * (1 - w.DecRatio),
});
#endregion
return new ApiResponse(ResponseType.OK, result);
}
} }
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Services; using Performance.Services;
using Performance.Services.AllotCompute;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -19,12 +20,16 @@ public class SecondAllotController : ControllerBase ...@@ -19,12 +20,16 @@ public class SecondAllotController : ControllerBase
{ {
private readonly ClaimService claimService; private readonly ClaimService claimService;
private readonly SecondAllotService secondAllotService; private readonly SecondAllotService secondAllotService;
private readonly ResultComputeService resultComputeService;
public SecondAllotController(ClaimService claimService, public SecondAllotController(
SecondAllotService secondAllotService) ClaimService claimService,
SecondAllotService secondAllotService,
ResultComputeService resultComputeService)
{ {
this.claimService = claimService; this.claimService = claimService;
this.secondAllotService = secondAllotService; this.secondAllotService = secondAllotService;
this.resultComputeService = resultComputeService;
} }
#region 二次绩效列表、录入数据展示,保存数据 #region 二次绩效列表、录入数据展示,保存数据
...@@ -317,6 +322,10 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request) ...@@ -317,6 +322,10 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
{ {
var userid = claimService.GetUserId(); var userid = claimService.GetUserId();
var result = secondAllotService.ConfirmAudit(userid, request); var result = secondAllotService.ConfirmAudit(userid, request);
if (request.IsPass == 1)
{
resultComputeService.SaveSecondReserved(request.SecondId);
}
return result ? new ApiResponse(ResponseType.OK, "操作成功") : new ApiResponse(ResponseType.Fail, "操作失败"); return result ? new ApiResponse(ResponseType.OK, "操作成功") : new ApiResponse(ResponseType.Fail, "操作失败");
} }
#endregion #endregion
......
...@@ -227,6 +227,12 @@ ...@@ -227,6 +227,12 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.AllotController.Reserved(Performance.DtoModels.ReservedRequest)">
<summary>
获取
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"> <member name="M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)">
<summary> <summary>
预算管理查询(包含金额、占比) 预算管理查询(包含金额、占比)
......
...@@ -208,6 +208,9 @@ ...@@ -208,6 +208,9 @@
<member name="P:Performance.EntityModels.PerformanceDbContext.res_compute"> <member name="P:Performance.EntityModels.PerformanceDbContext.res_compute">
<summary> </summary> <summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.PerformanceDbContext.res_reserved">
<summary> </summary>
</member>
<member name="P:Performance.EntityModels.PerformanceDbContext.res_specialunit"> <member name="P:Performance.EntityModels.PerformanceDbContext.res_specialunit">
<summary> </summary> <summary> </summary>
</member> </member>
...@@ -3389,6 +3392,16 @@ ...@@ -3389,6 +3392,16 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.HospitalId">
<summary>
医院Id
</summary>
</member>
<member name="P:Performance.EntityModels.per_employee.AllotId">
<summary>
绩效Id
</summary>
</member>
<member name="P:Performance.EntityModels.per_employee.AccountingUnit"> <member name="P:Performance.EntityModels.per_employee.AccountingUnit">
<summary> <summary>
核算单元 核算单元
...@@ -3464,24 +3477,14 @@ ...@@ -3464,24 +3477,14 @@
年龄 年龄
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.Remark"> <member name="P:Performance.EntityModels.per_employee.ReservedRatio">
<summary>
备注
</summary>
</member>
<member name="P:Performance.EntityModels.per_employee.HospitalId">
<summary>
医院Id
</summary>
</member>
<member name="P:Performance.EntityModels.per_employee.AllotId">
<summary> <summary>
绩效Id 预留比例
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.ReservedRatio"> <member name="P:Performance.EntityModels.per_employee.Remark">
<summary> <summary>
预留比例 备注
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_employee.CreateTime"> <member name="P:Performance.EntityModels.per_employee.CreateTime">
...@@ -4474,6 +4477,161 @@ ...@@ -4474,6 +4477,161 @@
效率绩效人数 效率绩效人数
</summary> </summary>
</member> </member>
<member name="T:Performance.EntityModels.res_reserved">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.Id">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.HospitalId">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.Year">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.AccountingUnit">
<summary>
核算单元
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.EmployeeName">
<summary>
人员姓名
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JobNumber">
<summary>
工号
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JanFee">
<summary>
一月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JanRatio">
<summary>
一月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.FebFee">
<summary>
二月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.FebRatio">
<summary>
二月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.MarFee">
<summary>
三月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.MarRatio">
<summary>
三月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.AprFee">
<summary>
四月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.AprRatio">
<summary>
四月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.MayFee">
<summary>
五月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.MayRatio">
<summary>
五月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JunFee">
<summary>
六月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JunRatio">
<summary>
六月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JulFee">
<summary>
七月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.JulRatio">
<summary>
七月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.AugFee">
<summary>
八月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.AugRatio">
<summary>
八月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.SepFee">
<summary>
九月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.SepRatio">
<summary>
九月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.OctFee">
<summary>
十月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.OctRatio">
<summary>
十月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.NovFee">
<summary>
十一月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.NovRatio">
<summary>
十一月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.DecFee">
<summary>
十二月
</summary>
</member>
<member name="P:Performance.EntityModels.res_reserved.DecRatio">
<summary>
十二月
</summary>
</member>
<member name="T:Performance.EntityModels.res_specialunit"> <member name="T:Performance.EntityModels.res_specialunit">
<summary> <summary>
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class ReservedRequest
{
public int HospitalId { get; set; }
public int Year { get; set; }
}
}
...@@ -11,6 +11,8 @@ public class ComputeResponse ...@@ -11,6 +11,8 @@ public class ComputeResponse
/// </summary> /// </summary>
public string Source { get; set; } public string Source { get; set; }
public string UnitType { get; set; }
/// <summary> /// <summary>
/// 核算单元 /// 核算单元
/// </summary> /// </summary>
......
...@@ -157,6 +157,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options) ...@@ -157,6 +157,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> </summary> /// <summary> </summary>
public virtual DbSet<res_compute> res_compute { get; set; } public virtual DbSet<res_compute> res_compute { get; set; }
/// <summary> </summary> /// <summary> </summary>
public virtual DbSet<res_reserved> res_reserved { get; set; }
/// <summary> </summary>
public virtual DbSet<res_specialunit> res_specialunit { get; set; } public virtual DbSet<res_specialunit> res_specialunit { get; set; }
/// <summary> 医院数据提取脚本 </summary> /// <summary> 医院数据提取脚本 </summary>
public virtual DbSet<sys_extract> sys_extract { get; set; } public virtual DbSet<sys_extract> sys_extract { get; set; }
......
...@@ -22,6 +22,16 @@ public class per_employee ...@@ -22,6 +22,16 @@ public class per_employee
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// 医院Id
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 绩效Id
/// </summary>
public Nullable<int> AllotId { get; set; }
/// <summary>
/// 核算单元 /// 核算单元
/// </summary> /// </summary>
public string AccountingUnit { get; set; } public string AccountingUnit { get; set; }
...@@ -97,24 +107,14 @@ public class per_employee ...@@ -97,24 +107,14 @@ public class per_employee
public Nullable<int> Age { get; set; } public Nullable<int> Age { get; set; }
/// <summary> /// <summary>
/// 备注 /// 预留比例
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 医院Id
/// </summary>
public Nullable<int> HospitalId { get; set; }
/// <summary>
/// 绩效Id
/// </summary> /// </summary>
public Nullable<int> AllotId { get; set; } public Nullable<decimal> ReservedRatio { get; set; }
/// <summary> /// <summary>
/// 预留比例 /// 备注
/// </summary> /// </summary>
public Nullable<decimal> ReservedRatio { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// ///
......
//-----------------------------------------------------------------------
// <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; }
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=" cof_guarantee.cs">
// * FileName: cof_guarantee.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// cof_guarantee Repository
/// </summary>
public partial class PerforresreservedRepository : PerforRepository<res_reserved>
{
public PerforresreservedRepository(PerformanceDbContext context) : base(context)
{
}
}
}
...@@ -206,7 +206,7 @@ private void SaveClinicEmployee(PerSheet sheet, int allotId) ...@@ -206,7 +206,7 @@ private void SaveClinicEmployee(PerSheet sheet, int allotId)
var imdata = Mapper.Map<im_employee_clinic>(data); var imdata = Mapper.Map<im_employee_clinic>(data);
imdata.SheetID = imsheet.ID; imdata.SheetID = imsheet.ID;
imdata.AllotID = allotId; imdata.AllotID = allotId;
//imdata.OtherPerfor = data.OthePerfor; imdata.OtherPerfor = data.OthePerfor;
addList.Add(imdata); addList.Add(imdata);
} }
perforImemployeeclinicRepository.AddRange(addList.ToArray()); perforImemployeeclinicRepository.AddRange(addList.ToArray());
......
...@@ -25,6 +25,7 @@ public class AllotService : IAutoInjection ...@@ -25,6 +25,7 @@ public class AllotService : IAutoInjection
private ProcessComputService processComputService; private ProcessComputService processComputService;
private ResultComputeService resultComputeService; private ResultComputeService resultComputeService;
private PerforLogdbugRepository logdbug; private PerforLogdbugRepository logdbug;
private readonly PerforresreservedRepository perforresreservedRepository;
private ConfigService configService; private ConfigService configService;
private IHostingEnvironment _evn; private IHostingEnvironment _evn;
private ILogger<AllotService> _logger; private ILogger<AllotService> _logger;
...@@ -36,6 +37,8 @@ public class AllotService : IAutoInjection ...@@ -36,6 +37,8 @@ public class AllotService : IAutoInjection
private readonly PerforHospitalRepository perforHospitalRepository; private readonly PerforHospitalRepository perforHospitalRepository;
private readonly PerforResbaiscnormRepository perforResbaiscnormRepository; private readonly PerforResbaiscnormRepository perforResbaiscnormRepository;
private PerforHospitalconfigRepository perforHospitalconfigRepository; private PerforHospitalconfigRepository perforHospitalconfigRepository;
private readonly RoleService roleService;
private readonly UserService userService;
private PerforCofdirectorRepository perforCofdirectorRepository; private PerforCofdirectorRepository perforCofdirectorRepository;
//private readonly IHubContext<AllotLogHub> hubContext; //private readonly IHubContext<AllotLogHub> hubContext;
...@@ -51,6 +54,7 @@ public class AllotService : IAutoInjection ...@@ -51,6 +54,7 @@ public class AllotService : IAutoInjection
ResultComputeService resultComputeService, ResultComputeService resultComputeService,
ConfigService configService, ConfigService configService,
PerforLogdbugRepository logdbug, PerforLogdbugRepository logdbug,
PerforresreservedRepository perforresreservedRepository,
IHostingEnvironment evn, ILogger<AllotService> logger, IHostingEnvironment evn, ILogger<AllotService> logger,
IEmailService emailService, IEmailService emailService,
IOptions<Application> options, IOptions<Application> options,
...@@ -60,6 +64,8 @@ public class AllotService : IAutoInjection ...@@ -60,6 +64,8 @@ public class AllotService : IAutoInjection
PerforResbaiscnormRepository perforResbaiscnormRepository, PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforHospitalconfigRepository perforHospitalconfigRepository, PerforHospitalconfigRepository perforHospitalconfigRepository,
//IHubContext<AllotLogHub> hubContext //IHubContext<AllotLogHub> hubContext
RoleService roleService,
UserService userService,
LogManageService logManageService, LogManageService logManageService,
ReportService reportService, ReportService reportService,
PerforCofdirectorRepository perforCofdirectorRepository, PerforCofdirectorRepository perforCofdirectorRepository,
...@@ -78,10 +84,13 @@ public class AllotService : IAutoInjection ...@@ -78,10 +84,13 @@ public class AllotService : IAutoInjection
this.options = options; this.options = options;
this.configService = configService; this.configService = configService;
this.logdbug = logdbug; this.logdbug = logdbug;
this.perforresreservedRepository = perforresreservedRepository;
this.perforLogcheckRepository = perforLogcheckRepository; this.perforLogcheckRepository = perforLogcheckRepository;
this.perforHospitalRepository = perforHospitalRepository; this.perforHospitalRepository = perforHospitalRepository;
this.perforResbaiscnormRepository = perforResbaiscnormRepository; this.perforResbaiscnormRepository = perforResbaiscnormRepository;
this.perforHospitalconfigRepository = perforHospitalconfigRepository; this.perforHospitalconfigRepository = perforHospitalconfigRepository;
this.roleService = roleService;
this.userService = userService;
//this.hubContext = hubContext; //this.hubContext = hubContext;
this.logManageService = logManageService; this.logManageService = logManageService;
this.reportService = reportService; this.reportService = reportService;
...@@ -387,6 +396,10 @@ public void Generate(per_allot allot, string mail) ...@@ -387,6 +396,10 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("正在生成绩效", "保存绩效人均参考标准", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "保存绩效人均参考标准", 1, allot.ID, "ReceiveMessage", true);
perforResbaiscnormRepository.AddRange(baiscnormList.ToArray()); perforResbaiscnormRepository.AddRange(baiscnormList.ToArray());
// 保存预留绩效
logManageService.WriteMsg("正在生成绩效", "保存预留绩效金额", 1, allot.ID, "ReceiveMessage", true);
resultComputeService.SaveReserved(allot);
UpdateAllotStates(allot.ID, (int)AllotStates.GenerateAccomplish, EnumHelper.GetDescription(AllotStates.GenerateAccomplish), generate); UpdateAllotStates(allot.ID, (int)AllotStates.GenerateAccomplish, EnumHelper.GetDescription(AllotStates.GenerateAccomplish), generate);
perforCofdirectorRepository.SupplementaryData(allot.ID); perforCofdirectorRepository.SupplementaryData(allot.ID);
...@@ -511,5 +524,30 @@ public List<log_dbug> AllotLog(per_allot allot, int type) ...@@ -511,5 +524,30 @@ public List<log_dbug> AllotLog(per_allot allot, int type)
list = list.OrderBy(t => t.CreateTime).ToList(); list = list.OrderBy(t => t.CreateTime).ToList();
return list; return list;
} }
public List<res_reserved> GetReserved(int hospitalId, int year, int userid)
{
var user = userService.GetUser(userid);
if (user == null)
throw new PerformanceException("用户信息错误");
var role = roleService.GetUserRole(userid)?.FirstOrDefault()?.Type;
if (!role.HasValue)
throw new PerformanceException("用户信息错误");
var roleTypes = new[] { options.Value.NurseRole, options.Value.DirectorRole, options.Value.SpecialRole };
var reserveds = perforresreservedRepository.GetEntities(w => w.HospitalId == hospitalId && w.Year == year);
if (role.Value == options.Value.NurseRole)
reserveds = reserveds.Where(w => w.UnitType.Contains(UnitType.护理组.ToString()) && w.AccountingUnit == user.Department)?.ToList();
else if (role.Value == options.Value.DirectorRole)
reserveds = reserveds.Where(w => (w.UnitType.Contains(UnitType.医生组.ToString()) || w.UnitType.Contains(UnitType.医技组.ToString())) && w.AccountingUnit == user.Department)?.ToList();
else if (role.Value == options.Value.SpecialRole)
reserveds = reserveds.Where(w => w.UnitType.Contains(UnitType.特殊核算组.ToString()) && w.AccountingUnit == user.Department)?.ToList();
return reserveds;
}
} }
} }
...@@ -456,7 +456,7 @@ public List<ComputeResponse> AllCompute(int allotId) ...@@ -456,7 +456,7 @@ public List<ComputeResponse> AllCompute(int allotId)
foreach (var item in result) foreach (var item in result)
{ {
var temp = item.RealGiveFee ?? 0; var temp = item.RealGiveFee ?? 0;
item.ReservedRatio = empDic.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0; item.ReservedRatio = empDic?.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = temp * item.ReservedRatio; item.ReservedRatioFee = temp * item.ReservedRatio;
item.RealGiveFee = temp - item.ReservedRatioFee; item.RealGiveFee = temp - item.ReservedRatioFee;
} }
...@@ -519,7 +519,7 @@ public List<ComputeResponse> AllManageCompute(int allotId) ...@@ -519,7 +519,7 @@ public List<ComputeResponse> AllManageCompute(int allotId)
foreach (var item in result) foreach (var item in result)
{ {
var temp = item.RealGiveFee ?? 0; var temp = item.RealGiveFee ?? 0;
item.ReservedRatio = empDic.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0; item.ReservedRatio = empDic?.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = temp * item.ReservedRatio; item.ReservedRatioFee = temp * item.ReservedRatio;
item.RealGiveFee = temp - item.ReservedRatioFee; item.RealGiveFee = temp - item.ReservedRatioFee;
} }
......
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