特殊科室处理

parent bb84d139
...@@ -95,8 +95,8 @@ public void Execute(per_allot allot) ...@@ -95,8 +95,8 @@ public void Execute(per_allot allot)
var baiscnorm = NurseBaiscnorm(list); var baiscnorm = NurseBaiscnorm(list);
// 计算最总数据 // 计算最总数据
Compute(allot, excel, baiscnorm); var baiscnormList = Compute(allot, excel, baiscnorm);
SpecialUnitCompute(excel, allot); SpecialUnitCompute(excel, allot, baiscnormList);
//发送邮件 //发送邮件
SendEmail(allot); SendEmail(allot);
...@@ -110,13 +110,41 @@ public void Execute(per_allot allot) ...@@ -110,13 +110,41 @@ public void Execute(per_allot allot)
/// </summary> /// </summary>
/// <param name="excel"></param> /// <param name="excel"></param>
/// <param name="allot"></param> /// <param name="allot"></param>
private void SpecialUnitCompute(PerExcel excel, per_allot allot) private void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscnorm> baiscnormList)
{ {
var specialUnit = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.SpecialUnit); var specialUnit = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.SpecialUnit);
if (specialUnit == null || specialUnit.PerData.Count == 0) if (specialUnit == null || specialUnit.PerData.Count == 0)
return; return;
var dataList = specialUnit.PerData.Select(t => (PerDataSpecialUnit)t); var dataList = specialUnit.PerData.Select(t => (PerDataSpecialUnit)t);
BaiscNormService baiscNormService = new BaiscNormService();
var typeList = EnumHelper.GetItems<PerformanceType>();
List<res_specialunit> resList = new List<res_specialunit>();
foreach (var t in dataList)
{
var type = typeList.FirstOrDefault(o => o.Description == t.QuantitativeIndicators);
if (type != null)
t.QuantitativeIndicatorsValue = baiscNormService.GetBaiscNorm(baiscnormList, (PerformanceType)type.Value);
var res = 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,
};
resList.Add(res);
}
var resDataList = dataList.Select(t => new res_specialunit var resDataList = dataList.Select(t => new res_specialunit
{ {
AllotID = allot.ID, AllotID = allot.ID,
...@@ -450,7 +478,7 @@ private IRow CreateRow(ICellStyle cellstyle, ISheet exportSheet, IRow row, PerHe ...@@ -450,7 +478,7 @@ private IRow CreateRow(ICellStyle cellstyle, ISheet exportSheet, IRow row, PerHe
/// 计算最终数据 /// 计算最终数据
/// </summary> /// </summary>
/// <param name="excel"></param> /// <param name="excel"></param>
public void Compute(per_allot allot, PerExcel excel, res_baiscnorm baiscnorm) public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, res_baiscnorm baiscnorm)
{ {
var sheetList = _perforImSheetRepository.GetEntities(t => t.AllotID == allot.ID); var sheetList = _perforImSheetRepository.GetEntities(t => t.AllotID == allot.ID);
//取出人员信息 //取出人员信息
...@@ -485,6 +513,8 @@ public void Compute(per_allot allot, PerExcel excel, res_baiscnorm baiscnorm) ...@@ -485,6 +513,8 @@ public void Compute(per_allot allot, PerExcel excel, res_baiscnorm baiscnorm)
baiscnormList.ForEach(t => t.AllotID = allot.ID); baiscnormList.ForEach(t => t.AllotID = allot.ID);
_perforResbaiscnormRepository.AddRange(baiscnormList.ToArray()); _perforResbaiscnormRepository.AddRange(baiscnormList.ToArray());
return baiscnormList;
} }
} }
} }
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