Commit 33bcf556 by 钟博

Merge branch 'v20201230yubei' into v2020morge

# Conflicts:
#	performance/Performance.EntityModels/Entity/ag_secondallot.cs
parents 3ec2b9d6 122cc8b0
...@@ -262,7 +262,17 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A ...@@ -262,7 +262,17 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email)); ////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
/*
[Route("recalculation")]
[HttpPost]
public ApiResponse Recalculation([FromBody] RecalculationRequest request)
{
if (request.Money.HasValue && request.Money.Value > 0)
_allotService.Recalculation(request.AllotId, request.Money.Value);
return new ApiResponse(ResponseType.OK);
}
*/
/// <summary> /// <summary>
/// 重新计算院领导绩效 /// 重新计算院领导绩效
/// </summary> /// </summary>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Performance.DtoModels.Request;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
...@@ -22,12 +23,15 @@ public class ComputeController : Controller ...@@ -22,12 +23,15 @@ public class ComputeController : Controller
private ComputeService _computeService; private ComputeService _computeService;
private AllotService _allotService; private AllotService _allotService;
private ClaimService _claim; private ClaimService _claim;
private EmployeeService _employeeService;
public ComputeController(AllotService allotService, public ComputeController(AllotService allotService,
ComputeService computeService, ComputeService computeService,
EmployeeService employeeService,
ClaimService claim) ClaimService claim)
{ {
_allotService = allotService; _allotService = allotService;
_computeService = computeService; _computeService = computeService;
_employeeService = employeeService;
_claim = claim; _claim = claim;
} }
...@@ -253,7 +257,7 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request) ...@@ -253,7 +257,7 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
// ? 0 : Math.Round(gc.Sum(s => s.RealGiveFee) / gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() ?? 0) // ? 0 : Math.Round(gc.Sum(s => s.RealGiveFee) / gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() ?? 0)
// })); // }));
return new ApiResponse(ResponseType.OK, "ok", avgs.Select(w => new { w.PositionName, w.TotelNumber, w.TotelValue, w.AvgValue })); return new ApiResponse(ResponseType.OK, "ok", avgs.Select(w => new {w.ID, w.PositionName, w.TotelNumber, w.TotelValue, w.AvgValue }));
} }
/// <summary> /// <summary>
...@@ -366,5 +370,45 @@ public ApiResponse DoctorDetail(int computeId) ...@@ -366,5 +370,45 @@ public ApiResponse DoctorDetail(int computeId)
var result = _computeService.GetDoctorDetail(computeId); var result = _computeService.GetDoctorDetail(computeId);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
#region 人均绩效修改
/// <summary>
/// 编辑全院绩效平均
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("EditHospitalAvg")]
[HttpPost]
public ApiResponse<res_baiscnorm> EditHospitalAvg([FromBody] ComputerAvgRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var result = _computeService.EditHospitalAvg(request);
return new ApiResponse<res_baiscnorm>(ResponseType.OK, result);
}
#endregion
#region 其他绩效统计
/// <summary>
/// 其他医院绩效统计
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("OtherPerStats/{allotId}")]
[HttpPost]
public ApiResponse OtherPerStats(int allotId)
{
var employee = _employeeService.GetAprList(allotId, _claim.GetUserId());
var relust= _computeService.GetOtherPerStats(employee);
return new ApiResponse(ResponseType.OK,relust);
}
#endregion
} }
} }
\ No newline at end of file
...@@ -466,5 +466,20 @@ public ApiResponse<List<TitleValue>> GetPerforTypeDict([FromRoute] int allotId) ...@@ -466,5 +466,20 @@ public ApiResponse<List<TitleValue>> GetPerforTypeDict([FromRoute] int allotId)
var result = employeeService.GetPerforTypeDict(allotId); var result = employeeService.GetPerforTypeDict(allotId);
return new ApiResponse<List<TitleValue>>(ResponseType.OK, "绩效类型字典", result); return new ApiResponse<List<TitleValue>>(ResponseType.OK, "绩效类型字典", result);
} }
/// <summary>
/// 材料科室考核
/// </summary>
/// <returns></returns>
[Route("deptAssessment/{allotId}")]
[HttpPost]
public ApiResponse GetDeptAssessment(int allotId)
{
if (allotId<=0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var result=employeeService.GetDeptAssessment(allotId);
return new ApiResponse(ResponseType.OK,result);
}
} }
} }
...@@ -401,11 +401,11 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request) ...@@ -401,11 +401,11 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request)
[HttpPost] [HttpPost]
public ApiResponse OtherList([FromBody] AgOtherRequest request) public ApiResponse OtherList([FromBody] AgOtherRequest request)
{ {
//var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId()); var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId());
var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount); //var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
var obj = new var obj = new
{ {
header = secondAllotService.OtherListHeader(request.SecondId, realAmount), 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);
......
...@@ -1104,6 +1104,11 @@ ...@@ -1104,6 +1104,11 @@
是否需要二次分配 是否需要二次分配
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.PerDataAccountBaisc.NightShiftWorkPerforFee">
<summary>
夜班绩效
</summary>
</member>
<member name="P:Performance.DtoModels.PerDataClinicEmployee.UnitType"> <member name="P:Performance.DtoModels.PerDataClinicEmployee.UnitType">
<summary> <summary>
核算单元分类 核算单元分类
......
...@@ -5541,6 +5541,11 @@ ...@@ -5541,6 +5541,11 @@
是否需要二次分配 是否需要二次分配
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.res_account.NightShiftWorkPerforFee">
<summary>
夜班绩效
</summary>
</member>
<member name="T:Performance.EntityModels.res_accountdoctor"> <member name="T:Performance.EntityModels.res_accountdoctor">
<summary> <summary>
医生科室核算结果 医生科室核算结果
...@@ -6321,6 +6326,11 @@ ...@@ -6321,6 +6326,11 @@
调节后其他绩效 调节后其他绩效
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.res_specialunit.NightShiftWorkPerforFee">
<summary>
夜班绩效
</summary>
</member>
<member name="T:Performance.EntityModels.sys_extract"> <member name="T:Performance.EntityModels.sys_extract">
<summary> <summary>
医院数据提取脚本 医院数据提取脚本
......
...@@ -237,6 +237,11 @@ public class PerDataAccountBaisc : IPerData ...@@ -237,6 +237,11 @@ public class PerDataAccountBaisc : IPerData
/// </summary> /// </summary>
public string NeedSecondAllot { get; set; } public string NeedSecondAllot { get; set; }
/// <summary>
/// 夜班绩效
/// </summary>
public Nullable<decimal> NightShiftWorkPerforFee { get; set; }
#endregion 由计算得出 #endregion 由计算得出
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
using FluentValidation;
namespace Performance.DtoModels.Request
{
public class ComputerAvgRequest
{
public int Id { get; set; }
public int AllotId { get; set; }
public int SheetId { get; set; }
/// <summary>
/// 绩效核算人群
/// </summary>
public string PositionName { get; set; }
/// <summary>
/// 绩效总额
/// </summary>
public decimal TotelValue { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public decimal AvgValue { get; set; }
/// <summary>
/// 总人数
/// </summary>
public decimal TotelNumber { get; set; }
}
public class ComputerRequestValidator : AbstractValidator<ComputerAvgRequest>
{
public ComputerRequestValidator()
{
RuleFor(x => x.Id).NotNull();
RuleFor(x => x.AllotId).NotNull().GreaterThan(0);
RuleFor(x => x.PositionName).NotNull().NotEmpty();
RuleFor(x => x.TotelNumber).NotNull();
RuleFor(x => x.TotelValue).NotNull();
RuleFor(x => x.AvgValue).NotNull();
}
}
}
...@@ -125,5 +125,9 @@ public class ag_secondallot ...@@ -125,5 +125,9 @@ public class ag_secondallot
/// 护理部审核状态 2 等待审核 3 审核通过 4 驳回 /// 护理部审核状态 2 等待审核 3 审核通过 4 驳回
/// </summary> /// </summary>
public Nullable<int> NursingDeptStatus { get; set; } public Nullable<int> NursingDeptStatus { get; set; }
/// <summary>
/// 夜班绩效
/// </summary>
public decimal? NightShiftWorkPerforFee { get; set; }
} }
} }
...@@ -195,5 +195,9 @@ public class res_account ...@@ -195,5 +195,9 @@ public class res_account
/// 是否需要二次分配 /// 是否需要二次分配
/// </summary> /// </summary>
public string NeedSecondAllot { get; set; } public string NeedSecondAllot { get; set; }
/// <summary>
/// 夜班绩效
/// </summary>
public Nullable<decimal> NightShiftWorkPerforFee { get; set; }
} }
} }
...@@ -135,5 +135,9 @@ public class res_specialunit ...@@ -135,5 +135,9 @@ public class res_specialunit
/// 调节后其他绩效 /// 调节后其他绩效
/// </summary> /// </summary>
public Nullable<decimal> AdjustLaterOtherFee { get; set; } public Nullable<decimal> AdjustLaterOtherFee { get; set; }
/// <summary>
/// 夜班绩效
/// </summary>
public Nullable<decimal> NightShiftWorkPerforFee { get; set; }
} }
} }
...@@ -268,6 +268,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot ...@@ -268,6 +268,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData?.Select(t => (PerData)t); var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData?.Select(t => (PerData)t);
var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData?.Select(t => (PerData)t); var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData?.Select(t => (PerData)t);
var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData?.Select(t => (PerData)t); var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData?.Select(t => (PerData)t);
var accountExtraData = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountExtra)?.PerData?.Select(t => (PerData)t);
var pairs = new[] var pairs = new[]
{ {
...@@ -301,7 +302,10 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot ...@@ -301,7 +302,10 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
} }
if (UnitType.医技组 == unitType && workDoctor == null) if (UnitType.医技组 == unitType && workDoctor == null)
workDoctor = info.Data.FirstOrDefault(t => t.UnitType == UnitType.医生组.ToString() && t.AccountingUnit == dept.AccountingUnit); workDoctor = info.Data.FirstOrDefault(t => t.UnitType == UnitType.医生组.ToString() && t.AccountingUnit == dept.AccountingUnit);
// 夜班绩效 从医院奖罚的明细项中获取
var nightShift = accountExtraData.FirstOrDefault(w => w.UnitType == dept.UnitType && w.AccountingUnit == dept.AccountingUnit && w.TypeName?.Trim() == "夜班绩效")?.CellValue ?? 0;
dept.NightShiftWorkPerforFee = nightShift;
//dept.MedicineFactor = workDoctor?.MedicineFactor; //dept.MedicineFactor = workDoctor?.MedicineFactor;
//dept.ScoringAverage = scoreAverage.HasValue ? scoreAverage ?? 0 : dept.ScoringAverage; //dept.ScoringAverage = scoreAverage.HasValue ? scoreAverage ?? 0 : dept.ScoringAverage;
dept.ScoringAverage = dept.ScoringAverage; dept.ScoringAverage = dept.ScoringAverage;
...@@ -325,6 +329,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot ...@@ -325,6 +329,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot
dept.RealGiveFee = Math.Round((dept.AssessLaterPerforTotal * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0); dept.RealGiveFee = Math.Round((dept.AssessLaterPerforTotal * dept.AdjustFactor + dept.AdjustLaterOtherFee) ?? 0);
//dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number); //dept.Avg = dept.ManagerNumber + dept.Number == 0 ? 0 : dept.PerforTotal / (dept.ManagerNumber + dept.Number);
dept.Avg = dept.Number == 0 ? 0 : dept.PerforTotal / dept.Number; dept.Avg = dept.Number == 0 ? 0 : dept.PerforTotal / dept.Number;
} }
sheet.PerData.AddRange(atDataList); sheet.PerData.AddRange(atDataList);
......
...@@ -136,6 +136,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -136,6 +136,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
//取出科室 //取出科室
var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t); var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t);
var accountExtraData = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountExtra)?.PerData?.Select(t => (PerData)t);
List<res_specialunit> resDataList = new List<res_specialunit>(); List<res_specialunit> resDataList = new List<res_specialunit>();
...@@ -173,6 +174,9 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -173,6 +174,9 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
//var materialsExtra = materialsExtras?.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;
//var scoreAverage = accountScoreAverages?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue; //var scoreAverage = accountScoreAverages?.FirstOrDefault(w => w.UnitType == UnitType.特殊核算组.ToString() && w.AccountingUnit == dept?.AccountingUnit)?.TotelValue;
// 夜班绩效 从医院奖罚的明细项中获取
var nightShift = accountExtraData.FirstOrDefault(w => w.UnitType == dept.UnitType && w.AccountingUnit == dept.AccountingUnit && w.TypeName?.Trim() == "夜班绩效")?.CellValue ?? 0;
decimal? headcount = null; decimal? headcount = null;
if (typeList.Any(o => o.Description == item.QuantitativeIndicators)) if (typeList.Any(o => o.Description == item.QuantitativeIndicators))
headcount = group.Number; headcount = group.Number;
...@@ -207,6 +211,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -207,6 +211,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0, AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0,
AssessLaterOtherFee = dept?.AssessLaterOtherFee ?? 0, AssessLaterOtherFee = dept?.AssessLaterOtherFee ?? 0,
AdjustLaterOtherFee = dept?.AdjustLaterOtherFee ?? 0, AdjustLaterOtherFee = dept?.AdjustLaterOtherFee ?? 0,
NightShiftWorkPerforFee = nightShift,
}; };
res.PerforTotal = (sumValue ?? 0) + res.AssessBeforeOtherFee; res.PerforTotal = (sumValue ?? 0) + res.AssessBeforeOtherFee;
res.GiveFee = Math.Round(res.PerforTotal + res.AssessLaterOtherFee ?? 0); res.GiveFee = Math.Round(res.PerforTotal + res.AssessLaterOtherFee ?? 0);
...@@ -541,6 +546,7 @@ public void GenerateSecondAllot(per_allot allot) ...@@ -541,6 +546,7 @@ public void GenerateSecondAllot(per_allot allot)
Month = allot.Month, Month = allot.Month,
UnitType = ((UnitType)item.UnitType).ToString(), UnitType = ((UnitType)item.UnitType).ToString(),
Department = item.AccountingUnit, Department = item.AccountingUnit,
NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
RealGiveFee = item.RealGiveFee, RealGiveFee = item.RealGiveFee,
}); });
} }
...@@ -548,7 +554,7 @@ public void GenerateSecondAllot(per_allot allot) ...@@ -548,7 +554,7 @@ public void GenerateSecondAllot(per_allot allot)
} }
if (specialList != null) if (specialList != null)
{ {
foreach (var item in specialList.Select(w => new { w.AccountingUnit, w.RealGiveFee }).Distinct()) foreach (var item in specialList.Select(w => new { w.AccountingUnit, w.NightShiftWorkPerforFee, w.RealGiveFee }).Distinct())
{ {
if (!tempSecond.Any(f => f.UnitType == UnitType.特殊核算组.ToString() && f.Department == item.AccountingUnit)) if (!tempSecond.Any(f => f.UnitType == UnitType.特殊核算组.ToString() && f.Department == item.AccountingUnit))
{ {
...@@ -559,6 +565,7 @@ public void GenerateSecondAllot(per_allot allot) ...@@ -559,6 +565,7 @@ public void GenerateSecondAllot(per_allot allot)
Month = allot.Month, Month = allot.Month,
UnitType = UnitType.特殊核算组.ToString(), UnitType = UnitType.特殊核算组.ToString(),
Department = item.AccountingUnit, Department = item.AccountingUnit,
NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
RealGiveFee = item.RealGiveFee, RealGiveFee = item.RealGiveFee,
}); });
} }
...@@ -580,13 +587,16 @@ public void GenerateSecondAllot(per_allot allot) ...@@ -580,13 +587,16 @@ public void GenerateSecondAllot(per_allot allot)
UnitType = item.UnitType, UnitType = item.UnitType,
Department = item.Department, Department = item.Department,
RealGiveFee = item.RealGiveFee, RealGiveFee = item.RealGiveFee,
NightShiftWorkPerforFee = item.NightShiftWorkPerforFee,
Status = 1, Status = 1,
NursingDeptStatus = 1, NursingDeptStatus = 1,
}); });
} }
else else
{ {
if (Math.Abs((second.RealGiveFee ?? 0) - (item.RealGiveFee ?? 0)) >= 0.5m && second.Status > 1) var backResult = Math.Abs((second.RealGiveFee ?? 0) - (item.RealGiveFee ?? 0)) >= 0.5m
|| Math.Abs((second.NightShiftWorkPerforFee ?? 0) - (item.NightShiftWorkPerforFee ?? 0)) >= 0.5m;
if (backResult && second.Status > 1)
{ {
second.Status = 4; second.Status = 4;
second.Remark = "科室绩效结果发生变更,需要重新提交"; second.Remark = "科室绩效结果发生变更,需要重新提交";
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Performance.DtoModels.Request;
using Performance.DtoModels.Response;
namespace Performance.Services namespace Performance.Services
{ {
...@@ -210,8 +212,15 @@ public List<res_baiscnorm> AllComputeAvg(int allotId, List<ComputeResponse> list ...@@ -210,8 +212,15 @@ public List<res_baiscnorm> AllComputeAvg(int allotId, List<ComputeResponse> list
List<res_baiscnorm> avgs = new List<res_baiscnorm>(); List<res_baiscnorm> avgs = new List<res_baiscnorm>();
var emps = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId); var emps = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
var jobCategory = emps?.Select(w => string.IsNullOrEmpty(w.JobCategory) ? "未知" : w.JobCategory).Distinct() ?? new List<string>(); var jobCategory = emps?.Select(w => string.IsNullOrEmpty(w.JobCategory) ? "未知" : w.JobCategory).Distinct() ?? new List<string>();
var basicnorm = perforResbaiscnormRepository.GetEntities(t => t.AllotID == allotId);
var position = basicnorm?.Select(t => string.IsNullOrEmpty(t.PositionName) ? "" : t.PositionName).Distinct() ?? new List<string>();
foreach (var item in jobCategory) foreach (var item in jobCategory)
{ {
if (position.Contains(item))
{
avgs.Add(basicnorm.First(t => t.PositionName == item));
continue;
}
var sumfee = (from com in list var sumfee = (from com in list
join emp in emps?.Where(w => w.JobCategory == item) join emp in emps?.Where(w => w.JobCategory == item)
on com.JobNumber equals emp.PersonnelNumber on com.JobNumber equals emp.PersonnelNumber
...@@ -1416,5 +1425,70 @@ public DeptDataDetails GetDoctorDetail(int computeId) ...@@ -1416,5 +1425,70 @@ public DeptDataDetails GetDoctorDetail(int computeId)
} }
return doctorDetails; return doctorDetails;
} }
public res_baiscnorm EditHospitalAvg(ComputerAvgRequest request)
{
if (request.Id == 0)
{
var baiscnorm = Mapper.Map<res_baiscnorm>(request);
if (!perforResbaiscnormRepository.Add(baiscnorm))
throw new PerformanceException("保存失败");
return Mapper.Map<res_baiscnorm>(baiscnorm);
}
else
{
var baiscnorm = perforResbaiscnormRepository.GetEntity(t => t.ID == request.Id);
if (baiscnorm == null)
throw new PerformanceException($"ID不存在 :{request.Id}");
baiscnorm.TotelNumber = request.TotelNumber;
baiscnorm.TotelValue = request.TotelValue;
baiscnorm.AvgValue = request.AvgValue;
//var baiscnorm = Mapper.Map<res_baiscnorm>(request);
if (!perforResbaiscnormRepository.Update(baiscnorm))
throw new PerformanceException("保存失败");
return Mapper.Map<res_baiscnorm>(baiscnorm);
}
}
public List<Dictionary<string, string>> GetOtherPerStats(List<per_apr_amount> employees)
{
var others = new List<Dictionary<string, string>>();
if (employees==null)
return others;
var perForType = employees.Where(c=>c.Status==3).Select(t => t.PerforType).Distinct();
var doctorNum = employees.Where(c=>c.Status==3).Select(t => t.PersonnelNumber).Distinct().ToList();
if (!doctorNum.Any())
return others;
foreach (var num in doctorNum)
{
var dicData = new Dictionary<string, string>();
var amount = employees.Find(t => t.PersonnelNumber == num);
if (amount == null)
continue;
dicData.Add("核算单元",amount?.AccountingUnit??"");
dicData.Add("工号",amount?.PersonnelNumber??"");
dicData.Add("人员姓名",amount?.DoctorName??"");
foreach (var type in perForType)
{
var emp = employees.Where(t => t.PerforType == type && t.PersonnelNumber == num)?.ToList();
if (!emp.Any())
dicData.Add(type,"0");
else
dicData.Add(type,Math.Round(Convert.ToDecimal(emp?.First()?.Amount),0).ToString());
}
var sum = employees.Where(c=>c.PersonnelNumber==num)?.Sum(t => t.Amount);
dicData.Add("合计",Math.Round(Convert.ToDecimal(sum),0).ToString());
others.Add(dicData);
}
return others;
}
} }
} }
...@@ -21,6 +21,7 @@ public class EmployeeService : IAutoInjection ...@@ -21,6 +21,7 @@ public class EmployeeService : IAutoInjection
{ {
private PerforImemployeeRepository perforImemployeeRepository; private PerforImemployeeRepository perforImemployeeRepository;
private PerforPersheetRepository perforPersheetRepository; private PerforPersheetRepository perforPersheetRepository;
private PerforImdataRepository perforImdataRepository;
private PerforPerallotRepository perforPerallotRepository; private PerforPerallotRepository perforPerallotRepository;
private PerforImemployeeclinicRepository perforImemployeeclinicRepository; private PerforImemployeeclinicRepository perforImemployeeclinicRepository;
private PerforUserhospitalRepository perforUserhospitalRepository; private PerforUserhospitalRepository perforUserhospitalRepository;
...@@ -34,6 +35,7 @@ public class EmployeeService : IAutoInjection ...@@ -34,6 +35,7 @@ public class EmployeeService : IAutoInjection
public EmployeeService(PerforImemployeeRepository perforImemployeeRepository, public EmployeeService(PerforImemployeeRepository perforImemployeeRepository,
PerforPersheetRepository perforPersheetRepository, PerforPersheetRepository perforPersheetRepository,
PerforImdataRepository perforImdataRepository,
PerforPerallotRepository perforPerallotRepository, PerforPerallotRepository perforPerallotRepository,
PerforImemployeeclinicRepository perforImemployeeclinicRepository, PerforImemployeeclinicRepository perforImemployeeclinicRepository,
PerforUserhospitalRepository perforUserhospitalRepository, PerforUserhospitalRepository perforUserhospitalRepository,
...@@ -47,6 +49,7 @@ public class EmployeeService : IAutoInjection ...@@ -47,6 +49,7 @@ public class EmployeeService : IAutoInjection
{ {
this.perforImemployeeRepository = perforImemployeeRepository; this.perforImemployeeRepository = perforImemployeeRepository;
this.perforPersheetRepository = perforPersheetRepository; this.perforPersheetRepository = perforPersheetRepository;
this.perforImdataRepository = perforImdataRepository;
this.perforPerallotRepository = perforPerallotRepository; this.perforPerallotRepository = perforPerallotRepository;
this.perforImemployeeclinicRepository = perforImemployeeclinicRepository; this.perforImemployeeclinicRepository = perforImemployeeclinicRepository;
this.perforUserhospitalRepository = perforUserhospitalRepository; this.perforUserhospitalRepository = perforUserhospitalRepository;
...@@ -637,5 +640,55 @@ public List<TitleValue> GetPerforTypeDict(int allotId) ...@@ -637,5 +640,55 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
Value = t Value = t
}).ToList(); }).ToList();
} }
#region 科室考核
public List<Dictionary<string, string>> GetDeptAssessment(int allotId)
{
var sheet = perforPersheetRepository.GetEntity(t => t.AllotID == allotId && t.SheetName == "5.4 科室材料考核2");
if (sheet == null)
return new List<Dictionary<string, string>>();
var imData = perforImdataRepository.GetEntities(t => t.AllotID == allotId && t.SheetID == sheet.ID);
var headers = imData.OrderByDescending(c=>c.IsTotal).Select(t => t.TypeName).Distinct();
var dataNum = imData.Select(t => t.RowNumber)?.OrderBy(c => c.Value).Distinct().ToList();
if (!dataNum.Any())
return new List<Dictionary<string, string>>();
var rowData = new List<Dictionary<string, string>>();
foreach (var num in dataNum)
{
var dicData = new Dictionary<string, string>();
var fisHeader = false;
foreach (var header in headers)
{
var headData = imData.Find(t => t.RowNumber == num && t.TypeName == header)?.CellValue;
dicData.Add(header, Math.Round((decimal)headData * 100) + "%");
if (!fisHeader)
{
var data = imData?.First(t => t.RowNumber == num);
switch (data.UnitType)
{
case (int)UnitType.医技组:
dicData.Add("核算单元类型", "医技组");
break;
case (int)UnitType.医生组:
dicData.Add("核算单元类型", "医生组");
break;
case (int)UnitType.护理组:
dicData.Add("核算单元类型", "护理组");
break;
}
dicData.Add("核算单元", data.AccountingUnit);
fisHeader = true;
}
}
rowData.Add(dicData);
}
return rowData;
}
#endregion
} }
} }
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