Commit bbfd60a6 by ruyun.zhang@suvalue.com

Merge branch 'hotfix/医院其他绩效大改'

parents b68a8a78 27e9051f
......@@ -405,9 +405,7 @@ public ApiResponse<res_baiscnorm> EditHospitalAvg([FromBody] ComputerAvgRequest
[HttpPost]
public ApiResponse OtherPerStats(int allotId)
{
var employee = _employeeService.GetAprList(allotId, _claim.GetUserId());
var relust = _computeService.GetOtherPerStats(employee);
var relust = _employeeService.GetOtherPerStats(allotId);
return new ApiResponse(ResponseType.OK, relust);
}
......
......@@ -42,6 +42,7 @@ public static void Main(string[] args)
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
logging.SetMinimumLevel(LogLevel.Trace);
})
.UseNLog()
......
......@@ -4361,11 +4361,6 @@
录入科室
</summary>
</member>
<member name="P:Performance.EntityModels.per_apr_amount.AccountingUnit">
<summary>
核算单元
</summary>
</member>
<member name="P:Performance.EntityModels.per_apr_amount.Status">
<summary>
状态 1 未提交 2 等待审核 3 审核通过 4 驳回
......@@ -7326,5 +7321,15 @@
费用
</summary>
</member>
<member name="P:Performance.EntityModels.view_per_apr_amount.UnitType">
<summary>
核算单元组别
</summary>
</member>
<member name="P:Performance.EntityModels.view_per_apr_amount.AccountingUnit">
<summary>
核算单元
</summary>
</member>
</members>
</doc>
......@@ -50,12 +50,12 @@ public class per_apr_amount
/// 录入科室
/// </summary>
public string TypeInDepartment { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
///// <summary>
///// 核算单元
///// </summary>
//public string AccountingUnit { get; set; }
/// <summary>
/// 状态 1 未提交 2 等待审核 3 审核通过 4 驳回
/// </summary>
......
namespace Performance.EntityModels
{
public class view_per_apr_amount : per_apr_amount
{
/// <summary>
/// 核算单元组别
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" per_apr_amount.cs">
// * FileName: per_apr_amount.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// per_apr_amount Repository
/// </summary>
public partial class PerforPerapramountRepository : PerforRepository<per_apr_amount>
{
public List<view_per_apr_amount> GetFullAmount(Func<per_apr_amount, bool> predicate)
{
var employees = this.context.Set<per_employee>().AsEnumerable();
var amounts = this.context.Set<per_apr_amount>().Where(predicate);
var res = amounts.Join(employees,
outer => new { outer.AllotId, outer.PersonnelNumber },
inner => new { AllotId = inner.AllotId ?? 0, inner.PersonnelNumber },
(outer, inner) => new view_per_apr_amount
{
Id = outer.Id,
AllotId = outer.AllotId,
PersonnelNumber = outer.PersonnelNumber,
DoctorName = outer.DoctorName,
PerforType = outer.PerforType,
Amount = outer.Amount,
AccountingUnit = inner.AccountingUnit,
UnitType = inner.UnitType,
TypeInDepartment = outer.TypeInDepartment,
Status = outer.Status,
AuditTime = outer.AuditTime,
AuditUser = outer.AuditUser,
CreateDate = outer.CreateDate,
CreateUser = outer.CreateUser,
Remark = outer.Remark,
IsVerify = outer.IsVerify,
VerifyMessage = outer.VerifyMessage,
});
return res.ToList() ?? new List<view_per_apr_amount>();
}
}
}
......@@ -4,6 +4,8 @@
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using Performance.EntityModels;
namespace Performance.Repository
......@@ -13,7 +15,7 @@ namespace Performance.Repository
/// </summary>
public partial class PerforPerapramountRepository : PerforRepository<per_apr_amount>
{
public PerforPerapramountRepository(PerformanceDbContext context) : base(context)
public PerforPerapramountRepository(PerformanceDbContext context) : base(context)
{
}
}
......
......@@ -481,7 +481,7 @@ private void SupplementOtherPerfor(ag_secondallot secondAllot, List<BodyItem> bo
{
if (bodyItems == null || !bodyItems.Any(w => w.RowNumber > -1)) return;
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == secondAllot.AllotId && t.Status == 3);
var perapramounts = perapramountRepository.GetFullAmount(t => t.AllotId == secondAllot.AllotId && t.Status == 3);
if (perapramounts == null || !perapramounts.Any()) return;
var rowNumberList = bodyItems.Where(w => w.RowNumber > -1).Select(w => w.RowNumber).Distinct().OrderBy(t => t).ToList();
......@@ -808,7 +808,7 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
private void SupplementSecondDetail(ag_secondallot second, List<per_employee> employees, List<ag_othersource> result, bool isTitlePerformance = true)
{
// 补充医院其他绩效 及 预留比例
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId && t.Status == 3);
var perapramounts = perapramountRepository.GetFullAmount(t => t.AllotId == second.AllotId && t.Status == 3);
var distPerformance = rescomputeRepository.GetEntities(t => t.AllotID == second.AllotId);
foreach (var item in result)
......
......@@ -185,7 +185,7 @@ private void SupplementOtherPerfor(ag_secondallot secondAllot, List<ag_bodysourc
{
if (bodyItems == null || !bodyItems.Any(w => w.RowNumber > -1)) return;
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == secondAllot.AllotId && t.Status == 3);
var perapramounts = perapramountRepository.GetFullAmount(t => t.AllotId == secondAllot.AllotId && t.Status == 3);
if (perapramounts == null || !perapramounts.Any()) return;
foreach (var rowitem in bodyItems)
......
......@@ -2145,7 +2145,7 @@ public List<SecPrintResponse> Print(int secondId)
}
// 补充医院其他绩效 及 预留比例
var perapramounts = perapramountRepository.GetEntities(t => t.AllotId == second.AllotId && t.Status == 3);
var perapramounts = perapramountRepository.GetFullAmount(t => t.AllotId == second.AllotId && t.Status == 3);
var employees = personService.GetPerEmployee(second.AllotId.Value);
// 补充字典中该科室不存在,但有其它绩效的人员信息
......@@ -2314,26 +2314,26 @@ private List<SecondPerforResponse> GetAllotPerformance(int allotId, List<res_com
}).ToList();
}
public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes)
{
if (computes == null || !computes.Any())
return computes;
//public List<SecondPerforResponse> AddAprAmount(int allotId, List<SecondPerforResponse> computes)
//{
// if (computes == null || !computes.Any())
// return computes;
var list = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3);
if (list == null || !list.Any())
return computes;
// var list = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.Status == 3);
// if (list == null || !list.Any())
// return computes;
foreach (var item in computes.GroupBy(w => new { w.AccountingUnit, w.JobNumber }))
{
// 补充过一次就不在补充了
var emp = computes.Where(w => w.AccountingUnit == item.Key.AccountingUnit && w.JobNumber == item.Key.JobNumber)
.OrderByDescending(w => w.Source).FirstOrDefault();
var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit
&& !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim());
emp.OthePerfor = apramount?.Sum(w => w.Amount) ?? 0;
}
// foreach (var item in computes.GroupBy(w => new { w.AccountingUnit, w.JobNumber }))
// {
// // 补充过一次就不在补充了
// var emp = computes.Where(w => w.AccountingUnit == item.Key.AccountingUnit && w.JobNumber == item.Key.JobNumber)
// .OrderByDescending(w => w.Source).FirstOrDefault();
// var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit
// && !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim());
// emp.OthePerfor = apramount?.Sum(w => w.Amount) ?? 0;
// }
return computes;
}
// return computes;
//}
}
}
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