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

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