特殊科室计算

parent c5bdeb1a
......@@ -96,6 +96,7 @@ public AutoMapperConfigs()
.ForMember(dest => dest.AdjustFactor, opt => opt.MapFrom(src => src.NurseAdjustFactor));
CreateMap<PerDataAccountBaisc, im_accountbasic>();
CreateMap<PerDataSpecialUnit, im_specialunit>();
CreateMap<PerDataAccountDoctor, res_accountdoctor>();
CreateMap<PerDataAccountNurse, res_accountnurse>();
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PerDataSpecialUnit : IPerData
{
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 科室名称
/// </summary>
public string Department { get; set; }
/// <summary>
/// 人数
/// </summary>
public Nullable<decimal> Number { get; set; }
/// <summary>
/// 量化指标
/// </summary>
public string QuantitativeIndicators { get; set; }
/// <summary>
/// 数量
/// </summary>
public Nullable<decimal> Quantity { get; set; }
/// <summary>
/// 量化指标绩效分值
/// </summary>
public Nullable<decimal> QuantitativeIndicatorsValue { get; set; }
/// <summary>
/// 考核得分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 其他绩效
/// </summary>
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> Adjust { get; set; }
public int RowNumber { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" im_specialunit.cs">
// * FileName: im_specialunit.cs
// * history : 2019-03-26 09:51:09
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// im_specialunit Entity Model
/// </summary>
[Table("im_specialunit")]
public class im_specialunit
{
/// <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<decimal> Number { get; set; }
/// <summary>
/// 量化指标
/// </summary>
public string QuantitativeIndicators { get; set; }
/// <summary>
/// 数量
/// </summary>
public Nullable<decimal> Quantity { get; set; }
/// <summary>
/// 量化指标绩效分值
/// </summary>
public Nullable<decimal> QuantitativeIndicatorsValue { get; set; }
/// <summary>
/// 考核得分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 其他绩效
/// </summary>
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> Adjust { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" res_specialunit.cs">
// * FileName: res_specialunit.cs
// * history : 2019-03-26 10:25:00
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// res_specialunit Entity Model
/// </summary>
[Table("res_specialunit")]
public class res_specialunit
{
/// <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<decimal> Number { get; set; }
/// <summary>
/// 量化指标
/// </summary>
public string QuantitativeIndicators { get; set; }
/// <summary>
/// 数量
/// </summary>
public Nullable<decimal> Quantity { get; set; }
/// <summary>
/// 量化指标绩效分值
/// </summary>
public Nullable<decimal> QuantitativeIndicatorsValue { get; set; }
/// <summary>
/// 考核得分率
/// </summary>
public Nullable<decimal> ScoringAverage { get; set; }
/// <summary>
/// 其他绩效
/// </summary>
public Nullable<decimal> OtherPerfor { get; set; }
/// <summary>
/// 医院奖罚
/// </summary>
public Nullable<decimal> Punishment { get; set; }
/// <summary>
/// 调节系数
/// </summary>
public Nullable<decimal> Adjust { get; set; }
/// <summary>
/// 人均绩效
/// </summary>
public Nullable<decimal> Avg { get; set; }
/// <summary>
/// 应发绩效
/// </summary>
public Nullable<decimal> ShouldFee { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public Nullable<decimal> GiveFee { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" im_specialunit.cs">
// * FileName: im_specialunit.cs
// * history : Created by T4 2019-03-26 09:51:44
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// im_specialunit Repository
/// </summary>
public class PerforImspecialunitRepository : PerforRepository<im_specialunit>
{
public PerforImspecialunitRepository(PerformanceDbContext context) : base(context)
{
}
}
}
//-----------------------------------------------------------------------
// <copyright file=" res_specialunit.cs">
// * FileName: res_specialunit.cs
// * history : Created by T4 2019-03-26 10:25:06
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// res_specialunit Repository
/// </summary>
public class PerforResspecialunitRepository : PerforRepository<res_specialunit>
{
public PerforResspecialunitRepository(PerformanceDbContext context) : base(context)
{
}
}
}
......@@ -31,6 +31,8 @@ public class PerExcelService : IAutoInjection
private PerforResAccountnurseRepository _perforResAccountnurseRepository;
private PerforResbaiscnormRepository _perforResbaiscnormRepository;
private PerforRescomputeRepository _perforRescomputeRepository;
private PerforImspecialunitRepository _perforImspecialunitRepository;
private PerforResspecialunitRepository _perforResspecialunitRepository;
public PerExcelService(PerSheetService perSheetService,
PerHeaderService perHeaderService,
PerforPerSheetRepository perforImSheetRepository,
......@@ -45,7 +47,9 @@ public class PerExcelService : IAutoInjection
PerforResAccountnurseRepository perforResAccountnurseRepository,
PerforResbaiscnormRepository perforResbaiscnormRepository,
PerforRescomputeRepository perforRescomputeRepository,
PerforCofworkyearRepository perforCofworkyearRepository)
PerforCofworkyearRepository perforCofworkyearRepository,
PerforImspecialunitRepository perforImspecialunitRepository,
PerforResspecialunitRepository perforResspecialunitRepository)
{
_perSheetService = perSheetService;
_perHeaderService = perHeaderService;
......@@ -62,6 +66,8 @@ public class PerExcelService : IAutoInjection
_perforResbaiscnormRepository = perforResbaiscnormRepository;
_perforRescomputeRepository = perforRescomputeRepository;
_perforCofworkyearRepository = perforCofworkyearRepository;
_perforImspecialunitRepository = perforImspecialunitRepository;
_perforResspecialunitRepository = perforResspecialunitRepository;
}
public void Execute(per_allot allot)
......@@ -82,11 +88,49 @@ public void Execute(per_allot allot)
// 计算最总数据
Compute(allot, excel, baiscnorm);
SpecialUnitCompute(excel, allot);
//发送邮件
SendEmail(allot);
}
/// <summary>
/// 特殊科室绩效计算
/// </summary>
/// <param name="excel"></param>
/// <param name="allot"></param>
private void SpecialUnitCompute(PerExcel excel, per_allot allot)
{
var specialUnit = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.SpecialUnit);
if (specialUnit == null || specialUnit.PerData.Count == 0)
return;
var dataList = specialUnit.PerData.Select(t => (PerDataSpecialUnit)t);
var resDataList = dataList.Select(t => new res_specialunit
{
AllotID = allot.ID,
AccountingUnit = t.AccountingUnit,
Department = t.AccountingUnit,
Number = t.Number,
QuantitativeIndicators = t.QuantitativeIndicators,
Quantity = t.Quantity,
QuantitativeIndicatorsValue = t.QuantitativeIndicatorsValue,
ScoringAverage = t.ScoringAverage,
OtherPerfor = t.OtherPerfor,
Punishment = t.Punishment,
Adjust = t.Adjust,
Avg = t.Quantity * t.QuantitativeIndicatorsValue / t.Number,
ShouldFee = t.Quantity * t.QuantitativeIndicatorsValue,
GiveFee = (t.Quantity * t.QuantitativeIndicatorsValue + t.OtherPerfor + t.Punishment) * t.Adjust,
});
_perforResspecialunitRepository.AddRange(resDataList.ToArray());
}
/// <summary>
/// 获取临床护士平均绩效
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
private res_baiscnorm NurseBaiscnorm(List<PerSheet> list)
{
var sheet = list.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseAccount);
......@@ -198,6 +242,19 @@ public void Save(List<PerSheet> perSheets, int allotId, int source)
}
_perforImaccountbasicRepository.AddRange(addList.ToArray());
}
else if (sheet.SheetType == SheetType.SpecialUnit)
{
var dataList = sheet.PerData.Select(t => (PerDataSpecialUnit)t);
List<im_specialunit> addList = new List<im_specialunit>();
foreach (var data in dataList)
{
var imdata = Mapper.Map<im_specialunit>(data);
imdata.SheetID = imsheet.ID;
imdata.AllotID = allotId;
addList.Add(imdata);
}
_perforImspecialunitRepository.AddRange(addList.ToArray());
}
else if (sheet.SheetType == SheetType.ComputeDoctorAccount)
{
var dataList = sheet.PerData.Select(t => (PerDataAccountDoctor)t);
......
......@@ -41,6 +41,9 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType)
case SheetType.DeptAccounting:
dataread = new PerSheetDataReadDeptAccountingt();
break;
case SheetType.SpecialUnit:
dataread = new PerSheetDataReadSpecialUnit();
break;
}
return dataread;
}
......
......@@ -67,6 +67,8 @@ public SheetType GetSheetType(string sheetName)
return SheetType.Workload;
else if (sheetName.StartsWith("4.1"))
return SheetType.DeptAccounting;
else if (sheetName.StartsWith("4.2"))
return SheetType.SpecialUnit;
return SheetType.Unidentifiable;
}
......
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
{
public class PerSheetDataReadSpecialUnit : IPerSheetDataRead
{
public PerSheetPoint Point => new PerSheetPoint
{
HeaderFirstRowNum = 0,
HeaderLastRowNum = 0,
HeaderFirstCellNum = 0,
DataFirstRowNum = 1,
};
public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
List<IPerData> dataList = new List<IPerData>();
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
if (row == null) continue;
var accountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "核算单元").PointCell).ToString();
if (string.IsNullOrEmpty(accountingUnit))
continue;
PerDataSpecialUnit employee = new PerDataSpecialUnit
{
RowNumber = r,
AccountingUnit = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell).ToString(),
Department = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "科室").PointCell).ToString(),
Number = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "人数").PointCell).ToString()),
QuantitativeIndicators = row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标").PointCell).ToString(),
Quantity = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "数量").PointCell).ToString()),
QuantitativeIndicatorsValue = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "量化指标绩效分值").PointCell).ToString()),
ScoringAverage = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "考核得分率").PointCell).ToString()),
OtherPerfor = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "其他绩效").PointCell).ToString()),
Punishment = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "医院奖罚").PointCell).ToString()),
Adjust = ConvertHelper.To<decimal?>(row.GetCell(perHeader.FirstOrDefault(p => p.CellValue == "调节系数").PointCell).ToString()),
};
dataList.Add(employee);
}
return dataList;
}
}
}
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