Commit d03d91b8 by ruyun.zhang@suvalue.com

Merge branch 'v2020morge' into custom_script

parents 3bd71cea 1afb895e
...@@ -80,7 +80,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request ...@@ -80,7 +80,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request
if (repetition.Any()) if (repetition.Any())
throw new PerformanceException(string.Join(";", repetition.Select(t => $"行{t.Key.RowNumber}项‘{t.Key.ItemName}’重复录入"))); throw new PerformanceException(string.Join(";", repetition.Select(t => $"行{t.Key.RowNumber}项‘{t.Key.ItemName}’重复录入")));
var result = secondAllotService.SaveValue(request); var result = secondAllotService.SaveValue(request, secondid);
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
<member name="P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem"> <member name="P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem">
<summary> 二次绩效固定项 </summary> <summary> 二次绩效固定项 </summary>
</member> </member>
<member name="P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem_log">
<summary> </summary>
</member>
<member name="P:Performance.EntityModels.PerformanceDbContext.ag_header"> <member name="P:Performance.EntityModels.PerformanceDbContext.ag_header">
<summary> 二次分配不固定列头数据 </summary> <summary> 二次分配不固定列头数据 </summary>
</member> </member>
...@@ -557,14 +560,14 @@ ...@@ -557,14 +560,14 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_fixatitem.ID"> <member name="P:Performance.EntityModels.ag_fixatitem.ID">
<summary> <summary>
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_fixatitem.AllotId"> <member name="P:Performance.EntityModels.ag_fixatitem.AllotId">
<summary> <summary>
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_fixatitem.SecondId"> <member name="P:Performance.EntityModels.ag_fixatitem.SecondId">
<summary> <summary>
...@@ -572,9 +575,9 @@ ...@@ -572,9 +575,9 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_fixatitem.UnitType"> <member name="P:Performance.EntityModels.ag_fixatitem.UnitType">
<summary> <summary>
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_fixatitem.RowNumber"> <member name="P:Performance.EntityModels.ag_fixatitem.RowNumber">
<summary> <summary>
...@@ -616,6 +619,91 @@ ...@@ -616,6 +619,91 @@
1 value相加值为1 1 value相加值为1
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_fixatitem.CreateDate">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem.UpdateDate">
<summary>
</summary>
</member>
<member name="T:Performance.EntityModels.ag_fixatitem_log">
<summary>
二次绩效固定项
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.ID">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.AllotId">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.SecondId">
<summary>
二次绩效ID
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.UnitType">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.RowNumber">
<summary>
行号
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.ItemName">
<summary>
项目名
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.ItemValue">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.FactorValue">
<summary>
系数
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.Sort">
<summary>
排序
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.Type">
<summary>
字段类型 1 顶部概况 2 表格固定 3 工作量
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.SourceType">
<summary>
1 自动带出 2 计算得出
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.SpecialAttr">
<summary>
1 value相加值为1
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.DeleteDate">
<summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem_log.DeleteUser">
<summary>
</summary>
</member>
<member name="T:Performance.EntityModels.ag_header"> <member name="T:Performance.EntityModels.ag_header">
<summary> <summary>
二次分配不固定列头数据 二次分配不固定列头数据
......
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// <copyright file=" ag_fixatitem.cs"> // <copyright file=" ag_fixatitem.cs">
// * FileName: 二次绩效固定项.cs // * FileName: 二次绩效固定项.cs
// </copyright> // </copyright>
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels namespace Performance.EntityModels
{ {
/// <summary> /// <summary>
/// 二次绩效固定项 /// 二次绩效固定项
/// </summary> /// </summary>
[Table("ag_fixatitem")] [Table("ag_fixatitem")]
public class ag_fixatitem public class ag_fixatitem
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[Key] [Key]
public int ID { get; set; } public int ID { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public Nullable<int> AllotId { get; set; } public Nullable<int> AllotId { get; set; }
/// <summary> /// <summary>
/// 二次绩效ID /// 二次绩效ID
/// </summary> /// </summary>
public Nullable<int> SecondId { get; set; } public Nullable<int> SecondId { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string UnitType { get; set; } public string UnitType { get; set; }
/// <summary> /// <summary>
/// 行号 /// 行号
/// </summary> /// </summary>
public Nullable<int> RowNumber { get; set; } public Nullable<int> RowNumber { get; set; }
/// <summary> /// <summary>
/// 项目名 /// 项目名
/// </summary> /// </summary>
public string ItemName { get; set; } public string ItemName { get; set; }
/// <summary> /// <summary>
/// 值 /// 值
/// </summary> /// </summary>
public string ItemValue { get; set; } public string ItemValue { get; set; }
/// <summary> /// <summary>
/// 系数 /// 系数
/// </summary> /// </summary>
public Nullable<decimal> FactorValue { get; set; } public Nullable<decimal> FactorValue { get; set; }
/// <summary> /// <summary>
/// 排序 /// 排序
/// </summary> /// </summary>
public Nullable<decimal> Sort { get; set; } public Nullable<decimal> Sort { get; set; }
/// <summary> /// <summary>
/// 字段类型 1 顶部概况 2 表格固定 3 工作量 /// 字段类型 1 顶部概况 2 表格固定 3 工作量
/// </summary> /// </summary>
public Nullable<int> Type { get; set; } public Nullable<int> Type { get; set; }
/// <summary> /// <summary>
/// 1 自动带出 2 计算得出 /// 1 自动带出 2 计算得出
/// </summary> /// </summary>
public Nullable<int> SourceType { get; set; } public Nullable<int> SourceType { get; set; }
/// <summary> /// <summary>
/// 1 value相加值为1 /// 1 value相加值为1
/// </summary> /// </summary>
public Nullable<int> SpecialAttr { get; set; } public Nullable<int> SpecialAttr { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> CreateDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> UpdateDate { get; set; }
} }
} }
//-----------------------------------------------------------------------
// <copyright file=" ag_fixatitem_log.cs">
// * FileName:
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
/// 二次绩效固定项
/// </summary>
[Table("ag_fixatitem_log")]
public class ag_fixatitem_log
{
/// <summary>
///
/// </summary>
[Key]
public int ID { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> AllotId { get; set; }
/// <summary>
/// 二次绩效ID
/// </summary>
public Nullable<int> SecondId { get; set; }
/// <summary>
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 行号
/// </summary>
public Nullable<int> RowNumber { get; set; }
/// <summary>
/// 项目名
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 值
/// </summary>
public string ItemValue { get; set; }
/// <summary>
/// 系数
/// </summary>
public Nullable<decimal> FactorValue { get; set; }
/// <summary>
/// 排序
/// </summary>
public Nullable<decimal> Sort { get; set; }
/// <summary>
/// 字段类型 1 顶部概况 2 表格固定 3 工作量
/// </summary>
public Nullable<int> Type { get; set; }
/// <summary>
/// 1 自动带出 2 计算得出
/// </summary>
public Nullable<int> SourceType { get; set; }
/// <summary>
/// 1 value相加值为1
/// </summary>
public Nullable<int> SpecialAttr { get; set; }
/// <summary>
///
/// </summary>
public Nullable<DateTime> DeleteDate { get; set; }
/// <summary>
///
/// </summary>
public Nullable<int> DeleteUser { get; set; }
}
}
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// <copyright file=" cof_director.cs"> // <copyright file=" cof_director.cs">
// * FileName: cof_director.cs // * FileName: cof_director.cs
// * history : Created by T4 2019-03-22 15:48:55 // * history : Created by T4 2019-03-22 15:48:55
// </copyright> // </copyright>
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
using Dapper; using Dapper;
...@@ -44,6 +44,45 @@ public int DeleteData(int allotId) ...@@ -44,6 +44,45 @@ public int DeleteData(int allotId)
return Execute(sql, new { allotId }); return Execute(sql, new { allotId });
} }
public int DeleteAllotData(int allotId)
{
List<string> tableArray = new List<string>
{
"cof_again",
"cof_check",
"cof_cmi",
"cof_depttype",
"cof_director",
"cof_drugprop",
"cof_drugtype",
"cof_guarantee",
"cof_income",
"cof_singlefactor",
"cof_workitem",
"cof_workyear",
"im_accountbasic",
"im_data",
"im_employee",
"im_employee_clinic",
"im_employee_logistics",
"im_header",
"im_specialunit",
"per_sheet",
"res_account",
"res_accountdoctor",
"res_accountnurse",
"res_baiscnorm",
"res_compute",
"res_specialunit",
"log_check",
};
string sql = "";
tableArray.ForEach(t => sql += $"delete from {t} where allotid=@allotId;");
sql += "delete from log_dbug where allotid=@allotId and type=1;";
return Execute(sql, new { allotId });
}
public int DeleteResData(int allotId) public int DeleteResData(int allotId)
{ {
List<string> tableArray = new List<string> List<string> tableArray = new List<string>
...@@ -89,48 +128,48 @@ public int SupplementaryData(int allotid) ...@@ -89,48 +128,48 @@ public int SupplementaryData(int allotid)
{ {
#region MyRegion #region MyRegion
// var sql = @"insert into cof_drugtype(allotid,charge) select // var sql = @"insert into cof_drugtype(allotid,charge) select
//distinct @allotid allotid,typename charge //distinct @allotid allotid,typename charge
//from per_sheet sheet //from per_sheet sheet
// inner join im_data im on sheet.id = im.sheetid // inner join im_data im on sheet.id = im.sheetid
// left join cof_drugtype dtype on sheet.allotid = dtype.allotid // left join cof_drugtype dtype on sheet.allotid = dtype.allotid
// and im.typename != dtype.charge // and im.typename != dtype.charge
//where sheet.allotid = @allotid and sheet.sheettype = 3 and im.typename not in //where sheet.allotid = @allotid and sheet.sheettype = 3 and im.typename not in
// (select charge from cof_drugtype where allotid = @allotid); // (select charge from cof_drugtype where allotid = @allotid);
//insert into cof_depttype(allotid,charge) select //insert into cof_depttype(allotid,charge) select
//distinct @allotid allotid,department charge //distinct @allotid allotid,department charge
//from per_sheet sheet //from per_sheet sheet
// inner join im_data im on sheet.id = im.sheetid // inner join im_data im on sheet.id = im.sheetid
// left join cof_depttype dtype on sheet.allotid = dtype.allotid // left join cof_depttype dtype on sheet.allotid = dtype.allotid
// and im.department != dtype.charge // and im.department != dtype.charge
//where sheet.allotid = @allotid and sheet.sheettype = 9 and im.department not in //where sheet.allotid = @allotid and sheet.sheettype = 9 and im.department not in
// (select charge from cof_depttype where allotid = @allotid);"; // (select charge from cof_depttype where allotid = @allotid);";
#endregion #endregion MyRegion
List<string> sqls = new List<string> List<string> sqls = new List<string>
{ {
@"insert into cof_drugtype(allotid,charge) select @"insert into cof_drugtype(allotid,charge) select
distinct @allotid allotid,typename charge distinct @allotid allotid,typename charge
from per_sheet sheet from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid inner join im_data im on sheet.id = im.sheetid
left join cof_drugtype dtype on sheet.allotid = dtype.allotid left join cof_drugtype dtype on sheet.allotid = dtype.allotid
and im.typename != dtype.charge and im.typename != dtype.charge
where sheet.allotid = @allotid and sheet.sheettype = 3 and im.typename not in where sheet.allotid = @allotid and sheet.sheettype = 3 and im.typename not in
(select charge from cof_drugtype where allotid = @allotid);", (select charge from cof_drugtype where allotid = @allotid);",
@"insert into cof_depttype(allotid,charge) select @"insert into cof_depttype(allotid,charge) select
distinct @allotid allotid,department charge distinct @allotid allotid,department charge
from per_sheet sheet from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid inner join im_data im on sheet.id = im.sheetid
left join cof_depttype dtype on sheet.allotid = dtype.allotid left join cof_depttype dtype on sheet.allotid = dtype.allotid
and im.department != dtype.charge and im.department != dtype.charge
where sheet.allotid = @allotid and sheet.sheettype = 9 and im.department not in where sheet.allotid = @allotid and sheet.sheettype = 9 and im.department not in
(select charge from cof_depttype where allotid = @allotid);", (select charge from cof_depttype where allotid = @allotid);",
/* @"insert into per_apr_amount(AllotId, PersonnelNumber, DoctorName) /* @"insert into per_apr_amount(AllotId, PersonnelNumber, DoctorName)
select distinct @allotid AllotId, t.PersonnelNumber, t.DoctorName from select distinct @allotid AllotId, t.PersonnelNumber, t.DoctorName from
( (
select AllotId,PeopleNumber PersonnelNumber,DoctorName from im_employee where allotid = @allotid select AllotId,PeopleNumber PersonnelNumber,DoctorName from im_employee where allotid = @allotid
union all union all
...@@ -138,7 +177,7 @@ union all ...@@ -138,7 +177,7 @@ union all
) t where DoctorName not in (select DoctorName from per_apr_amount where allotid = @allotid);",*/ ) t where DoctorName not in (select DoctorName from per_apr_amount where allotid = @allotid);",*/
@"insert into cof_cmi(AllotId, UnitType, AccountingUnit) @"insert into cof_cmi(AllotId, UnitType, AccountingUnit)
select AllotId,UnitType,DoctorAccountingUnit from im_accountbasic where allotid = @allotid select AllotId,UnitType,DoctorAccountingUnit from im_accountbasic where allotid = @allotid
and concat(UnitType,DoctorAccountingUnit) not in (select concat(UnitType,AccountingUnit) from cof_cmi where allotid = @allotid)" and concat(UnitType,DoctorAccountingUnit) not in (select concat(UnitType,AccountingUnit) from cof_cmi where allotid = @allotid)"
}; };
...@@ -151,7 +190,6 @@ union all ...@@ -151,7 +190,6 @@ union all
} }
catch (Exception) catch (Exception)
{ {
} }
} }
return flag; return flag;
......
//-----------------------------------------------------------------------
// <copyright file=" ag_fixatitem_log.cs">
// * FileName: ag_fixatitem_log.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using Performance.EntityModels;
namespace Performance.Repository
{
/// <summary>
/// ag_fixatitem_log Repository
/// </summary>
public partial class PerforAgfixatitemlogRepository : PerforRepository<ag_fixatitem_log>
{
public PerforAgfixatitemlogRepository(PerformanceDbContext context) : base(context)
{
}
}
}
...@@ -16,6 +16,7 @@ namespace Performance.Services.AllotCompute ...@@ -16,6 +16,7 @@ namespace Performance.Services.AllotCompute
/// </summary> /// </summary>
public class ProcessComputService : IAutoInjection public class ProcessComputService : IAutoInjection
{ {
private readonly BudgetService _budgetService;
private PerforCofincomeRepository perforCofincomeRepository; private PerforCofincomeRepository perforCofincomeRepository;
private PerforCofdrugpropRepository perforCofdrugpropRepository; private PerforCofdrugpropRepository perforCofdrugpropRepository;
private PerforPersheetRepository perforPerSheetRepository; private PerforPersheetRepository perforPerSheetRepository;
...@@ -33,7 +34,9 @@ public class ProcessComputService : IAutoInjection ...@@ -33,7 +34,9 @@ public class ProcessComputService : IAutoInjection
private readonly PerforHospitalRepository hospitalRepository; private readonly PerforHospitalRepository hospitalRepository;
private readonly PerforPerallotRepository perallotRepository; private readonly PerforPerallotRepository perallotRepository;
public ProcessComputService(PerforCofincomeRepository perforCofincomeRepository, public ProcessComputService(
BudgetService budgetService,
PerforCofincomeRepository perforCofincomeRepository,
PerforCofdrugpropRepository perforCofdrugpropRepository, PerforCofdrugpropRepository perforCofdrugpropRepository,
PerforPersheetRepository perforPerSheetRepository, PerforPersheetRepository perforPerSheetRepository,
PerforImdataRepository perforImDataRepository, PerforImdataRepository perforImDataRepository,
...@@ -50,6 +53,7 @@ public class ProcessComputService : IAutoInjection ...@@ -50,6 +53,7 @@ public class ProcessComputService : IAutoInjection
PerforHospitalRepository hospitalRepository, PerforHospitalRepository hospitalRepository,
PerforPerallotRepository perallotRepository) PerforPerallotRepository perallotRepository)
{ {
_budgetService = budgetService;
this.perforCofincomeRepository = perforCofincomeRepository; this.perforCofincomeRepository = perforCofincomeRepository;
this.perforCofdrugpropRepository = perforCofdrugpropRepository; this.perforCofdrugpropRepository = perforCofdrugpropRepository;
this.perforPerSheetRepository = perforPerSheetRepository; this.perforPerSheetRepository = perforPerSheetRepository;
...@@ -87,6 +91,7 @@ public class ProcessComputService : IAutoInjection ...@@ -87,6 +91,7 @@ public class ProcessComputService : IAutoInjection
//} //}
#region save #region save
/// <summary> /// <summary>
/// 保存计算后的绩效 /// 保存计算后的绩效
/// </summary> /// </summary>
...@@ -110,7 +115,6 @@ private void SaveComputeAccount(PerSheet sheet, int allotId) ...@@ -110,7 +115,6 @@ private void SaveComputeAccount(PerSheet sheet, int allotId)
perforResaccountRepository.AddRange(addList.ToArray()); perforResaccountRepository.AddRange(addList.ToArray());
} }
/// <summary> /// <summary>
/// 保存通用格式 /// 保存通用格式
/// </summary> /// </summary>
...@@ -175,9 +179,11 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -175,9 +179,11 @@ public void Save(List<PerSheet> perSheets, int allotId)
} }
} }
} }
#endregion
#endregion save
#region compute #region compute
/// <summary> /// <summary>
/// 合并计算 /// 合并计算
/// </summary> /// </summary>
...@@ -199,7 +205,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -199,7 +205,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
logManageService.WriteMsg("正在生成绩效", "计算科室经济核算汇总表 -- 第一次计算", 1, allotid, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "计算科室经济核算汇总表 -- 第一次计算", 1, allotid, "ReceiveMessage");
var onceEconomic = economicCompute.OnceCompute(mergeResult); var onceEconomic = economicCompute.OnceCompute(mergeResult);
//二次计算 //二次计算
logManageService.WriteMsg("正在生成绩效", "计算科室经济核算汇总表 -- 第二次计算", 1, allotid, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "计算科室经济核算汇总表 -- 第二次计算", 1, allotid, "ReceiveMessage");
var twiceEconomicResult = economicCompute.TwiceCompute(onceEconomic); var twiceEconomicResult = economicCompute.TwiceCompute(onceEconomic);
...@@ -218,7 +224,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -218,7 +224,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
var conitem = perforCofworkitemRepository.GetEntities(t => t.AllotID == allotid); var conitem = perforCofworkitemRepository.GetEntities(t => t.AllotID == allotid);
//医生组 一次计算 //医生组 一次计算
//var onceWorkload1 = workloadCompute.OnceCompute(workload1, confs); //var onceWorkload1 = workloadCompute.OnceCompute(workload1, confs);
//医生组 二次计算 //医生组 二次计算
logManageService.WriteMsg("正在生成绩效", "医生组工作量计算", 1, allotid, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "医生组工作量计算", 1, allotid, "ReceiveMessage");
var twiceWorkloadResult1 = workloadCompute.TwiceCompute(workload1, hospital, confs, cmis, conitem, true); var twiceWorkloadResult1 = workloadCompute.TwiceCompute(workload1, hospital, confs, cmis, conitem, true);
...@@ -229,7 +235,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -229,7 +235,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
workload2.SheetName = "护理组工作量绩效测算表"; workload2.SheetName = "护理组工作量绩效测算表";
//护理组 一次计算 //护理组 一次计算
//var onceWorkload2 = workloadCompute.OnceCompute(workload2); //var onceWorkload2 = workloadCompute.OnceCompute(workload2);
//护理组 二次计算 //护理组 二次计算
logManageService.WriteMsg("正在生成绩效", "护理组工作量计算", 1, allotid, "ReceiveMessage"); logManageService.WriteMsg("正在生成绩效", "护理组工作量计算", 1, allotid, "ReceiveMessage");
var twiceWorkloadResult2 = workloadCompute.TwiceCompute(workload2, hospital, confs, cmis, conitem); var twiceWorkloadResult2 = workloadCompute.TwiceCompute(workload2, hospital, confs, cmis, conitem);
...@@ -252,14 +258,14 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -252,14 +258,14 @@ public void Save(List<PerSheet> perSheets, int allotId)
return (perSheet, mergeSheets); return (perSheet, mergeSheets);
} }
/// <summary> /// <summary>
/// 计算科室绩效 /// 计算科室绩效
/// </summary> /// </summary>
/// <param name="excel"></param> /// <param name="excel"></param>
/// <param name="perSheet"></param> /// <param name="perSheet"></param>
/// <returns></returns> /// <returns></returns>
public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet) ///
public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet, per_allot allot)
{ {
var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t); var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t);
var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData?.Select(t => (PerData)t); var economicData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeEconomic)?.PerData?.Select(t => (PerData)t);
...@@ -273,6 +279,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet) ...@@ -273,6 +279,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet)
new { Name = "护理组临床科室单元核算表", Data = nurseWorkloadData, SheetType = SheetType.ComputeNurseAccount, new { Name = "护理组临床科室单元核算表", Data = nurseWorkloadData, SheetType = SheetType.ComputeNurseAccount,
UnitTypes = new List<UnitType> { UnitType.护理组, UnitType.其他护理组 } }, UnitTypes = new List<UnitType> { UnitType.护理组, UnitType.其他护理组 } },
}; };
var isBudget = _budgetService.GetAdjustAndGrant(allot, out decimal adjust, out decimal grant);
List<PerSheet> result = new List<PerSheet>(); List<PerSheet> result = new List<PerSheet>();
foreach (var info in pairs) foreach (var info in pairs)
{ {
...@@ -301,7 +308,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet) ...@@ -301,7 +308,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet)
dept.MedicineFactor = workDoctor?.MedicineFactor; dept.MedicineFactor = workDoctor?.MedicineFactor;
//dept.ScoringAverage = scoreAverage.HasValue ? scoreAverage ?? 0 : dept.ScoringAverage; //dept.ScoringAverage = scoreAverage.HasValue ? scoreAverage ?? 0 : dept.ScoringAverage;
dept.ScoringAverage = dept.ScoringAverage; dept.ScoringAverage = dept.ScoringAverage;
dept.AdjustFactor = dept.AdjustFactor == 0m ? 0 : dept.AdjustFactor; dept.AdjustFactor = (isBudget ? adjust : dept?.AdjustFactor) ?? 1;
dept.Income = econDoctor?.CellValue ?? 0; dept.Income = econDoctor?.CellValue ?? 0;
dept.WorkloadFee = workDoctor?.CellValue ?? 0; dept.WorkloadFee = workDoctor?.CellValue ?? 0;
dept.AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0; dept.AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0;
...@@ -338,7 +345,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet) ...@@ -338,7 +345,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet)
/// <param name="extras"></param> /// <param name="extras"></param>
public void ComputeOffice(per_allot allot, PerExcel excel) public void ComputeOffice(per_allot allot, PerExcel excel)
{ {
//取出科室 //取出科室
var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t); var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t);
List<string> involves = new List<string> List<string> involves = new List<string>
...@@ -351,6 +358,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel) ...@@ -351,6 +358,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
List<PerDataAccountBaisc> perDatas = new List<PerDataAccountBaisc>(); List<PerDataAccountBaisc> perDatas = new List<PerDataAccountBaisc>();
// 取出科室 // 取出科室
var dataList = empolyeeList.Select(w => new { w.AccountType, w.AccountingUnit }).Distinct(); var dataList = empolyeeList.Select(w => new { w.AccountType, w.AccountingUnit }).Distinct();
var isBudget = _budgetService.GetAdjustAndGrant(allot, out decimal adjust, out decimal grant);
foreach (var account in dataList) foreach (var account in dataList)
{ {
...@@ -370,7 +378,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel) ...@@ -370,7 +378,7 @@ public void ComputeOffice(per_allot allot, PerExcel excel)
dept.AccountingUnit = account.AccountingUnit; dept.AccountingUnit = account.AccountingUnit;
dept.UnitType = account.AccountType; dept.UnitType = account.AccountType;
dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage; dept.ScoringAverage = resAccount?.ScoringAverage == null ? 0 : resAccount.ScoringAverage;
dept.AdjustFactor = resAccount?.AdjustFactor == null ? 0 : resAccount.AdjustFactor; dept.AdjustFactor = (isBudget ? adjust : resAccount?.AdjustFactor) ?? 1;
dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0); dept.Income = empolyees.Sum(w => w.PerforTotal ?? 0);
//dept.Extra = (extra ?? 0); //dept.Extra = (extra ?? 0);
//dept.MedicineExtra = 0;// (drugExtra ?? 0); //dept.MedicineExtra = 0;// (drugExtra ?? 0);
...@@ -468,7 +476,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee ...@@ -468,7 +476,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee
?.Select(t => new AccountUnitTotal { UnitType = t.Key.UnitType, AccountingUnit = t.Key.AccountingUnit, TotelValue = t.Sum(g => g.CellValue) }); ?.Select(t => new AccountUnitTotal { UnitType = t.Key.UnitType, AccountingUnit = t.Key.AccountingUnit, TotelValue = t.Sum(g => g.CellValue) });
} }
///// <summary> ///// <summary>
///// 计算保底绩效参考标准 ///// 计算保底绩效参考标准
///// </summary> ///// </summary>
...@@ -547,7 +554,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee ...@@ -547,7 +554,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee
// var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData.Select(t => (PerData)t); // var doctorWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeDoctorWorkload)?.PerData.Select(t => (PerData)t);
// var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData.Select(t => (PerData)t); // var nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData.Select(t => (PerData)t);
// var basicRuleList = new[] // var basicRuleList = new[]
// { // {
// new { Data = doctorWorkloadData, UnitType = UnitType.医生组 }, // new { Data = doctorWorkloadData, UnitType = UnitType.医生组 },
...@@ -647,6 +653,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid) ...@@ -647,6 +653,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
} }
return cofs; return cofs;
} }
#endregion
#endregion compute
} }
} }
...@@ -204,7 +204,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -204,7 +204,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
MedicineExtra = dept?.MedicineExtra ?? 0, MedicineExtra = dept?.MedicineExtra ?? 0,
MaterialsExtra = dept?.MaterialsExtra ?? 0, MaterialsExtra = dept?.MaterialsExtra ?? 0,
Adjust = isBudget ? adjust : (dept?.AdjustFactor ?? 1), Adjust = (isBudget ? adjust : dept?.AdjustFactor) ?? 1,
AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0, AssessBeforeOtherFee = dept?.AssessBeforeOtherFee ?? 0,
AssessLaterOtherFee = dept?.AssessLaterOtherFee ?? 0, AssessLaterOtherFee = dept?.AssessLaterOtherFee ?? 0,
...@@ -245,7 +245,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno ...@@ -245,7 +245,7 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
ScoreAverageRate = empolyee.ScoreAverageRate, ScoreAverageRate = empolyee.ScoreAverageRate,
Punishment = 0, Punishment = 0,
//OtherPerfor = empolyee.OtherPerfor, //OtherPerfor = empolyee.OtherPerfor,
OtherManagePerfor = empolyee.OtherManagePerfor, OtherManagePerfor = empolyee?.OtherManagePerfor ?? 0,
Number = group.Number, Number = group.Number,
PerforTotal = sumValue, PerforTotal = sumValue,
//Avg = group.Number == 0 ? 0 : (sumValue / group.Number), //Avg = group.Number == 0 ? 0 : (sumValue / group.Number),
......
...@@ -43,6 +43,7 @@ public class AllotService : IAutoInjection ...@@ -43,6 +43,7 @@ public class AllotService : IAutoInjection
//private readonly IHubContext<AllotLogHub> hubContext; //private readonly IHubContext<AllotLogHub> hubContext;
private readonly LogManageService logManageService; private readonly LogManageService logManageService;
private readonly ReportService reportService; private readonly ReportService reportService;
private readonly QueryDataService queryDataService; private readonly QueryDataService queryDataService;
...@@ -99,6 +100,7 @@ public class AllotService : IAutoInjection ...@@ -99,6 +100,7 @@ public class AllotService : IAutoInjection
} }
#region 基础功能 #region 基础功能
/// <summary> /// <summary>
/// 绩效记录 /// 绩效记录
/// </summary> /// </summary>
...@@ -222,6 +224,8 @@ public bool DeleteAllot(int iD) ...@@ -222,6 +224,8 @@ public bool DeleteAllot(int iD)
FileHelper.Move(allot.Path, path); FileHelper.Move(allot.Path, path);
allot.Path = path; allot.Path = path;
_allotRepository.Remove(allot); _allotRepository.Remove(allot);
configService.ClearAllotData(allot.ID);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -254,7 +258,8 @@ public bool Update(per_allot allot) ...@@ -254,7 +258,8 @@ public bool Update(per_allot allot)
{ {
return _allotRepository.Update(allot); return _allotRepository.Update(allot);
} }
#endregion
#endregion 基础功能
/// <summary> /// <summary>
/// 修改自定义提取结果地址 /// 修改自定义提取结果地址
...@@ -330,14 +335,14 @@ public void Generate(per_allot allot, string mail) ...@@ -330,14 +335,14 @@ public void Generate(per_allot allot, string mail)
//第二次计算包含(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效、保底工勤人均绩效)得出科室业绩绩效; //第二次计算包含(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效、保底工勤人均绩效)得出科室业绩绩效;
//根据当前业绩绩效核算出最终绩效结果 //根据当前业绩绩效核算出最终绩效结果
//科室经济核算汇总、工作量汇总 //科室经济核算汇总、工作量汇总
logManageService.WriteMsg("科室业绩汇总", "正在生成科室收入支出汇总、工作量汇总", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("科室业绩汇总", "正在生成科室收入支出汇总、工作量汇总", 1, allot.ID, "ReceiveMessage", true);
var (list, mergeSheets) = processComputService.MergeCompute(excel, allot.ID); var (list, mergeSheets) = processComputService.MergeCompute(excel, allot.ID);
processComputService.Save(list, allot.ID); processComputService.Save(list, allot.ID);
#region 注释 #region 注释
////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)
////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)
//logManageService.WriteMsg("计算保底绩效参考标准值", "正在保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("计算保底绩效参考标准值", "正在保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效", 1, allot.ID, "ReceiveMessage", true);
//var minimumBaiscnorm = processComputService.ComputeMinimum(excel, mergeSheets, allot.ID); //var minimumBaiscnorm = processComputService.ComputeMinimum(excel, mergeSheets, allot.ID);
...@@ -382,12 +387,13 @@ public void Generate(per_allot allot, string mail) ...@@ -382,12 +387,13 @@ public void Generate(per_allot allot, string mail)
////科室材料考核 ////科室材料考核
//logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true); //logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
//var accountExtras = processComputService.GetAccountExtra(excel); //var accountExtras = processComputService.GetAccountExtra(excel);
#endregion
#endregion 注释
//重新计算科室业绩(含所有提供保底金额) //重新计算科室业绩(含所有提供保底金额)
logManageService.WriteMsg("正在生成绩效", "计算科室业绩分", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "计算科室业绩分", 1, allot.ID, "ReceiveMessage", true);
var sheetLast = processComputService.Compute(excel, mergeSheets); var sheetLast = processComputService.Compute(excel, mergeSheets, allot);
//保存计算过程数据 //保存计算过程数据
logManageService.WriteMsg("正在生成绩效", "保存科室业绩结果及计算过程中产生的数据", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "保存科室业绩结果及计算过程中产生的数据", 1, allot.ID, "ReceiveMessage", true);
......
...@@ -174,13 +174,13 @@ public List<ResComputeResponse> GetCompute(int allotId, int type) ...@@ -174,13 +174,13 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
//t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd"); //t.WorkTime = string.IsNullOrEmpty(t.WorkTime) ? null : Convert.ToDateTime(t.WorkTime).ToString("yyyy-MM-dd");
if (isShowManage == 2) if (isShowManage == 2)
{ {
t.PerforSumFee = t.ShouldGiveFee + t.AssessBeforeOtherFee; t.PerforSumFee = (t.ShouldGiveFee ?? 0) + (t.AssessBeforeOtherFee ?? 0);
var employee = employees.FirstOrDefault(e => e.DoctorName == t.EmployeeName && e.AccountingUnit == t.AccountingUnit && pairs[type].Contains(e.UnitType)); var employee = employees.FirstOrDefault(e => e.DoctorName == t.EmployeeName && e.AccountingUnit == t.AccountingUnit && pairs[type].Contains(e.UnitType));
var scoreAverageRate = t.ScoreAverageRate ?? employee.ScoreAverageRate ?? 1; var scoreAverageRate = t.ScoreAverageRate ?? employee.ScoreAverageRate ?? 1;
var attendance = t.Attendance ?? employee.Attendance ?? 0; var attendance = t.Attendance ?? employee.Attendance ?? 0;
t.GiveFee = t.ShouldGiveFee * scoreAverageRate * attendance + (t.OtherPerfor ?? 0) + t.Punishment + t.OtherPerfor + t.AssessLaterOtherFee; t.GiveFee = (t.ShouldGiveFee ?? 0) * scoreAverageRate * attendance + (t.OtherPerfor ?? 0) + (t.Punishment ?? 0) + (t.AssessLaterOtherFee ?? 0);
t.RealGiveFee = t.GiveFee * (t.Adjust ?? 1m) + t.AdjustLaterOtherFee; t.RealGiveFee = t.GiveFee * (t.Adjust ?? 1m) + (t.AdjustLaterOtherFee ?? 0);
t.BaiscNormValue = t.RealGiveFee; t.BaiscNormValue = (t.RealGiveFee ?? 0);
} }
var aprAmount = apramounts?.Where(w => !(string.IsNullOrEmpty(w.DoctorName) && string.IsNullOrEmpty(w.PersonnelNumber)) && w.DoctorName?.Trim() == t.EmployeeName?.Trim() && w.PersonnelNumber?.Trim() == t.JobNumber?.Trim()); var aprAmount = apramounts?.Where(w => !(string.IsNullOrEmpty(w.DoctorName) && string.IsNullOrEmpty(w.PersonnelNumber)) && w.DoctorName?.Trim() == t.EmployeeName?.Trim() && w.PersonnelNumber?.Trim() == t.JobNumber?.Trim());
...@@ -471,10 +471,13 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM ...@@ -471,10 +471,13 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
{ {
item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforSumFee = Math.Round(item.PerforSumFee ?? 0, 0, MidpointRounding.AwayFromZero);
item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero); item.PerforManagementFee = Math.Round(item.PerforManagementFee ?? 0, 0, MidpointRounding.AwayFromZero);
var real = Math.Round((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0), 0) * item.Adjust + item.AdjustLaterOtherFee;
item.OthePerfor = Math.Round(item.OthePerfor ?? 0, 0, MidpointRounding.AwayFromZero); //二次分配默认 调节系数100%
item.NightWorkPerfor = Math.Round(item.NightWorkPerfor ?? 0, 0, MidpointRounding.AwayFromZero); item.Adjust = item.Source == "二次绩效" ? 1 : item.Adjust;
var real = Math.Round((item.PerforSumFee ?? 0) + (item.PerforManagementFee ?? 0), 0) * item.Adjust + (item.AdjustLaterOtherFee ?? 0);
item.OthePerfor = Math.Round((item.OthePerfor ?? 0), 0, MidpointRounding.AwayFromZero);
item.NightWorkPerfor = Math.Round((item.NightWorkPerfor ?? 0), 0, MidpointRounding.AwayFromZero);
item.ShouldGiveFee = Math.Round((real ?? 0) + (item.OthePerfor ?? 0) + (item.NightWorkPerfor ?? 0), 0, MidpointRounding.AwayFromZero); item.ShouldGiveFee = Math.Round((real ?? 0) + (item.OthePerfor ?? 0) + (item.NightWorkPerfor ?? 0), 0, MidpointRounding.AwayFromZero);
item.ReservedRatio = empDic?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0; item.ReservedRatio = empDic?.FirstOrDefault(w => w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
item.ReservedRatioFee = Math.Round((real ?? 0) * (item.ReservedRatio ?? 0), 0, MidpointRounding.AwayFromZero); item.ReservedRatioFee = Math.Round((real ?? 0) * (item.ReservedRatio ?? 0), 0, MidpointRounding.AwayFromZero);
......
...@@ -63,6 +63,7 @@ public class ConfigService : IAutoInjection ...@@ -63,6 +63,7 @@ public class ConfigService : IAutoInjection
this.logManageService = logManageService; this.logManageService = logManageService;
this.logger = logger; this.logger = logger;
} }
#endregion #endregion
#region 弃用 #region 弃用
...@@ -247,6 +248,7 @@ public class ConfigService : IAutoInjection ...@@ -247,6 +248,7 @@ public class ConfigService : IAutoInjection
#endregion #endregion
#region cof_drugprop 药占比系数配置 #region cof_drugprop 药占比系数配置
/// <summary> /// <summary>
/// 获取cof_drugprop列表 /// 获取cof_drugprop列表
/// </summary> /// </summary>
...@@ -303,9 +305,11 @@ public bool DrugDelete(DrugpropRequest request) ...@@ -303,9 +305,11 @@ public bool DrugDelete(DrugpropRequest request)
return _drugpropRepository.Remove(drugprop); return _drugpropRepository.Remove(drugprop);
} }
#endregion #endregion
#region cof_drugtype 药占比类别配置 #region cof_drugtype 药占比类别配置
/// <summary> /// <summary>
/// 获取cof_drugprop列表 /// 获取cof_drugprop列表
/// </summary> /// </summary>
...@@ -366,9 +370,11 @@ public bool DrugtypeDelete(DrugpropRequest request) ...@@ -366,9 +370,11 @@ public bool DrugtypeDelete(DrugpropRequest request)
return _drugtypeRepository.Remove(entity); return _drugtypeRepository.Remove(entity);
} }
#endregion #endregion
#region cof_workitem 工作量绩效 #region cof_workitem 工作量绩效
/// <summary> /// <summary>
/// 获取cof_workitem列表 /// 获取cof_workitem列表
/// </summary> /// </summary>
...@@ -423,9 +429,11 @@ public bool WorkItemkDelete(WorkItemRequest request) ...@@ -423,9 +429,11 @@ public bool WorkItemkDelete(WorkItemRequest request)
return _workitemRepository.Remove(workyear); return _workitemRepository.Remove(workyear);
} }
#endregion #endregion
#region cof_depttype 科室别配置 #region cof_depttype 科室别配置
/// <summary> /// <summary>
/// 获取cof_drugprop列表 /// 获取cof_drugprop列表
/// </summary> /// </summary>
...@@ -486,9 +494,11 @@ public bool DepttypeDelete(DrugpropRequest request) ...@@ -486,9 +494,11 @@ public bool DepttypeDelete(DrugpropRequest request)
return perforCofdepttypeRepository.Remove(entity); return perforCofdepttypeRepository.Remove(entity);
} }
#endregion #endregion
#region cof_cmi cmi #region cof_cmi cmi
/// <summary> /// <summary>
/// 获取 CMI配置 /// 获取 CMI配置
/// </summary> /// </summary>
...@@ -544,9 +554,11 @@ public bool HosCMIDelete(cof_cmi request) ...@@ -544,9 +554,11 @@ public bool HosCMIDelete(cof_cmi request)
return perforCofcmiRepository.Remove(entity); return perforCofcmiRepository.Remove(entity);
} }
#endregion #endregion
#region cof_again #region cof_again
/// <summary> /// <summary>
/// 获取cof_drugprop列表 /// 获取cof_drugprop列表
/// </summary> /// </summary>
...@@ -604,9 +616,11 @@ public bool AgainDelete(CofAgainRequest request) ...@@ -604,9 +616,11 @@ public bool AgainDelete(CofAgainRequest request)
return _againRepository.Remove(again); return _againRepository.Remove(again);
} }
#endregion #endregion
#region Copy #region Copy
/// <summary> /// <summary>
/// 复制报表基础配置 /// 复制报表基础配置
/// </summary> /// </summary>
...@@ -664,7 +678,6 @@ public void Copy(per_allot allot) ...@@ -664,7 +678,6 @@ public void Copy(per_allot allot)
#endregion #endregion
logger.LogInformation($"orgDurgprop"); logger.LogInformation($"orgDurgprop");
var orgDurgprop = _drugpropRepository.GetEntities(t => t.AllotID == allot.ID); var orgDurgprop = _drugpropRepository.GetEntities(t => t.AllotID == allot.ID);
if (orgDurgprop == null || orgDurgprop.Count == 0) if (orgDurgprop == null || orgDurgprop.Count == 0)
...@@ -720,9 +733,11 @@ public void Copy(per_allot allot) ...@@ -720,9 +733,11 @@ public void Copy(per_allot allot)
_againRepository.AddRange(newAgains.ToArray()); _againRepository.AddRange(newAgains.ToArray());
} }
} }
#endregion #endregion
#region 清楚无效数据 Clear #region 清楚无效数据 Clear
/// <summary> /// <summary>
/// 清楚无效数据 /// 清楚无效数据
/// </summary> /// </summary>
...@@ -734,6 +749,16 @@ public void Clear(int allotId) ...@@ -734,6 +749,16 @@ public void Clear(int allotId)
} }
/// <summary> /// <summary>
/// 删除绩效相关数据
/// </summary>
/// <param name="allotId"></param>
public void ClearAllotData(int allotId)
{
var count = _directorRepository.DeleteAllotData(allotId);
logManageService.WriteMsg("清理无效数据", $"清理无效数据,受影响行数:{count}", 1, allotId, "ReceiveMessage", true);
}
/// <summary>
/// 清除核算数据 /// 清除核算数据
/// </summary> /// </summary>
/// <param name="allotId"></param> /// <param name="allotId"></param>
...@@ -752,6 +777,7 @@ public void ClearAgain(int againId) ...@@ -752,6 +777,7 @@ public void ClearAgain(int againId)
var count = _directorRepository.DelAgain(againId); var count = _directorRepository.DelAgain(againId);
logManageService.WriteMsg("清理无效数据", $"清除二次绩效中无效数据,受影响行数:{count}", 1, againId, "ReceiveMessage", true); logManageService.WriteMsg("清理无效数据", $"清除二次绩效中无效数据,受影响行数:{count}", 1, againId, "ReceiveMessage", true);
} }
#endregion #endregion
/// <summary> /// <summary>
......
...@@ -413,11 +413,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS ...@@ -413,11 +413,11 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
// 考核前绩效 // 考核前绩效
compute.PerforSumFee = compute.Attendance == 0 ? Math.Round(compute.ShouldGiveFee ?? 0) : Math.Round(compute.Avg / compute.Attendance + compute.ShouldGiveFee ?? 0); compute.PerforSumFee = compute.Attendance == 0 ? Math.Round(compute.ShouldGiveFee ?? 0) : Math.Round(compute.Avg / compute.Attendance + compute.ShouldGiveFee ?? 0);
// 考核后绩效 // 考核后绩效
compute.GiveFee = Math.Round(compute.Avg + compute.AssessLaterManagementFee ?? 0); compute.GiveFee = Math.Round((compute.Avg ?? 0) + (compute.AssessLaterManagementFee ?? 0));
// 参考基数专用绩效合计 // 参考基数专用绩效合计
compute.BaiscNormPerforTotal = compute.PerforSumFee; compute.BaiscNormPerforTotal = compute.PerforSumFee;
// 实发绩效 // 实发绩效
compute.RealGiveFee = Math.Round((compute.Avg + compute.AssessLaterManagementFee) * compute.Adjust + compute.AdjustLaterOtherFee ?? 0); compute.RealGiveFee = Math.Round(((compute.Avg ?? 0) + (compute.AssessLaterManagementFee ?? 0)) * compute.Adjust + (compute.AdjustLaterOtherFee??0) ?? 0);
////绩效合计 ////绩效合计
//compute.PerforSumFee = Math.Round((compute.Avg * (empolyee.Basics ?? 0)) + compute.ShouldGiveFee + compute.AssessBeforeOtherFee ?? 0); //compute.PerforSumFee = Math.Round((compute.Avg * (empolyee.Basics ?? 0)) + compute.ShouldGiveFee + compute.AssessBeforeOtherFee ?? 0);
......
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