医院其他绩效无效代码注释

parent e0dc34a8
using Performance.Repository; //using Performance.Repository;
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Linq; //using System.Linq;
using System.Text; //using System.Text;
namespace Performance.Services //namespace Performance.Services
{ //{
public class AprAmountService : IAutoInjection // public class AprAmountService : IAutoInjection
{ // {
private readonly PerforPeremployeeRepository _peremployeeRepository; // private readonly PerforPeremployeeRepository _peremployeeRepository;
private readonly PerforPerapramountRepository _perapramountRepository; // private readonly PerforPerapramountRepository _perapramountRepository;
public AprAmountService( // public AprAmountService(
PerforPeremployeeRepository peremployeeRepository, // PerforPeremployeeRepository peremployeeRepository,
PerforPerapramountRepository perapramountRepository) // PerforPerapramountRepository perapramountRepository)
{ // {
_peremployeeRepository = peremployeeRepository; // _peremployeeRepository = peremployeeRepository;
_perapramountRepository = perapramountRepository; // _perapramountRepository = perapramountRepository;
} // }
/// <summary> // /// <summary>
/// 获取医院其他绩效 默认审核通过 status = 3 // /// 获取医院其他绩效 默认审核通过 status = 3
/// 科室及核算组别使用人员字典 // /// 科室及核算组别使用人员字典
/// </summary> // /// </summary>
/// <param name="allotId"></param> // /// <param name="allotId"></param>
/// <param name="status"></param> // /// <param name="status"></param>
/// <returns></returns> // /// <returns></returns>
public List<AprAmount> GetAprAmount(int allotId, int status = 3) // public List<AprAmount> GetAprAmount(int allotId, int status = 3)
{ // {
var perapramounts = _perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == status); // var perapramounts = _perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == status);
var employees = _peremployeeRepository.GetEntities(t => t.AllotId == allotId); // var employees = _peremployeeRepository.GetEntities(t => t.AllotId == allotId);
var result = perapramounts.Join(employees, amt => amt.PersonnelNumber, epy => epy.PersonnelNumber, // var result = perapramounts.Join(employees, amt => amt.PersonnelNumber, epy => epy.PersonnelNumber,
(amt, epy) => new AprAmount // (amt, epy) => new AprAmount
{ // {
AccountingUnit = epy.AccountingUnit, // AccountingUnit = epy.AccountingUnit,
UnitType = epy.UnitType, // UnitType = epy.UnitType,
PersonnelNumber = amt.PersonnelNumber, // PersonnelNumber = amt.PersonnelNumber,
DoctorName = amt.DoctorName, // DoctorName = amt.DoctorName,
PerforType = amt.PerforType, // PerforType = amt.PerforType,
Amount = amt.Amount // Amount = amt.Amount
}); // });
return result?.ToList() ?? new List<AprAmount>(); // return result?.ToList() ?? new List<AprAmount>();
} // }
} // }
public class AprAmount // public class AprAmount
{ // {
/// <summary> // /// <summary>
/// 核算单元 // /// 核算单元
/// </summary> // /// </summary>
public string UnitType { get; set; } // public string UnitType { get; set; }
/// <summary> // /// <summary>
/// 人员工号 // /// 人员工号
/// </summary> // /// </summary>
public string PersonnelNumber { get; set; } // public string PersonnelNumber { get; set; }
/// <summary> // /// <summary>
/// 医生姓名 // /// 医生姓名
/// </summary> // /// </summary>
public string DoctorName { get; set; } // public string DoctorName { get; set; }
/// <summary> // /// <summary>
/// // ///
/// </summary> // /// </summary>
public string PerforType { get; set; } // public string PerforType { get; set; }
/// <summary> // /// <summary>
/// 金额 // /// 金额
/// </summary> // /// </summary>
public Nullable<decimal> Amount { get; set; } // public Nullable<decimal> Amount { get; set; }
/// <summary> // /// <summary>
/// 核算单元 // /// 核算单元
/// </summary> // /// </summary>
public string AccountingUnit { get; set; } // public string AccountingUnit { get; set; }
} // }
} //}
...@@ -959,37 +959,37 @@ public List<TitleValue> WorkHeader(int allotId) ...@@ -959,37 +959,37 @@ public List<TitleValue> WorkHeader(int allotId)
return null; return null;
} }
/// <summary> ///// <summary>
/// 人员绩效额外金额 ///// 人员绩效额外金额
/// </summary> ///// </summary>
private void CopyAprData(int prevAllotId, int allotId) //private void CopyAprData(int prevAllotId, int allotId)
{ //{
if (prevAllotId == 0) return; // if (prevAllotId == 0) return;
var list = perapramountRepository.GetEntities(t => new List<int> { prevAllotId, allotId }.Contains(t.AllotId)); // var list = perapramountRepository.GetEntities(t => new List<int> { prevAllotId, allotId }.Contains(t.AllotId));
if (list == null || !list.Any(t => t.AllotId == prevAllotId)) return; // if (list == null || !list.Any(t => t.AllotId == prevAllotId)) return;
if (list.Any(t => t.AllotId == allotId)) // if (list.Any(t => t.AllotId == allotId))
{ // {
var prevData = list.Where(t => t.AllotId == prevAllotId); // var prevData = list.Where(t => t.AllotId == prevAllotId);
var existData = list.Where(t => t.AllotId == allotId); // var existData = list.Where(t => t.AllotId == allotId);
if (existData != null && existData.Any()) // if (existData != null && existData.Any())
list = prevData.Where(t => !existData.Select(w => w.PersonnelNumber).Contains(t.PersonnelNumber)).ToList(); // list = prevData.Where(t => !existData.Select(w => w.PersonnelNumber).Contains(t.PersonnelNumber)).ToList();
} // }
if (list.Any()) // if (list.Any())
{ // {
var data = list.Select(t => new per_apr_amount // var data = list.Select(t => new per_apr_amount
{ // {
Status = 2, // Status = 2,
AllotId = allotId, // AllotId = allotId,
PersonnelNumber = t.PersonnelNumber, // PersonnelNumber = t.PersonnelNumber,
DoctorName = t.DoctorName, // DoctorName = t.DoctorName,
PerforType = t.PerforType, // PerforType = t.PerforType,
Amount = t.Amount, // Amount = t.Amount,
CreateDate = DateTime.Now // CreateDate = DateTime.Now
}); // });
perapramountRepository.AddRange(data.ToArray()); // perapramountRepository.AddRange(data.ToArray());
} // }
} //}
#region HRP人员科室 #region HRP人员科室
......
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