Commit 31bd7330 by lcx

二次绩效删除时添加至日志表,删除绩效时删除其数据

parent e5d1d461
...@@ -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, claimService.GetUserId());
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
...@@ -444,4 +444,4 @@ public ApiResponse DeptComputeDetail(int allotId) ...@@ -444,4 +444,4 @@ public ApiResponse DeptComputeDetail(int allotId)
return new ApiResponse(ResponseType.OK, new { isShowManage, data }); return new ApiResponse(ResponseType.OK, new { isShowManage, data });
} }
} }
} }
\ No newline at end of file
...@@ -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>
...@@ -554,14 +557,14 @@ ...@@ -554,14 +557,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>
...@@ -569,9 +572,9 @@ ...@@ -569,9 +572,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>
...@@ -613,6 +616,91 @@ ...@@ -613,6 +616,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)
{
}
}
}
...@@ -87,6 +87,7 @@ public class ProcessComputService : IAutoInjection ...@@ -87,6 +87,7 @@ public class ProcessComputService : IAutoInjection
//} //}
#region save #region save
/// <summary> /// <summary>
/// 保存计算后的绩效 /// 保存计算后的绩效
/// </summary> /// </summary>
...@@ -110,7 +111,6 @@ private void SaveComputeAccount(PerSheet sheet, int allotId) ...@@ -110,7 +111,6 @@ private void SaveComputeAccount(PerSheet sheet, int allotId)
perforResaccountRepository.AddRange(addList.ToArray()); perforResaccountRepository.AddRange(addList.ToArray());
} }
/// <summary> /// <summary>
/// 保存通用格式 /// 保存通用格式
/// </summary> /// </summary>
...@@ -175,9 +175,11 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -175,9 +175,11 @@ public void Save(List<PerSheet> perSheets, int allotId)
} }
} }
} }
#endregion
#endregion save
#region compute #region compute
/// <summary> /// <summary>
/// 合并计算 /// 合并计算
/// </summary> /// </summary>
...@@ -199,7 +201,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -199,7 +201,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 +220,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -218,7 +220,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 +231,7 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -229,7 +231,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,13 +254,13 @@ public void Save(List<PerSheet> perSheets, int allotId) ...@@ -252,13 +254,13 @@ 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)
{ {
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);
...@@ -338,7 +340,7 @@ public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet) ...@@ -338,7 +340,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>
...@@ -468,7 +470,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee ...@@ -468,7 +470,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 +548,6 @@ public IEnumerable<AccountUnitTotal> GetAccountScoreAverage(PerExcel excel, Shee ...@@ -547,7 +548,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 +647,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid) ...@@ -647,6 +647,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
} }
return cofs; return cofs;
} }
#endregion
#endregion compute
} }
} }
...@@ -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 基础功能
public void UpdateAllotStates(int allotId, int states, string remark, int generate = 0) public void UpdateAllotStates(int allotId, int states, string remark, int generate = 0)
{ {
...@@ -318,14 +323,14 @@ public void Generate(per_allot allot, string mail) ...@@ -318,14 +323,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);
...@@ -370,8 +375,9 @@ public void Generate(per_allot allot, string mail) ...@@ -370,8 +375,9 @@ 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);
......
...@@ -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>
......
...@@ -28,6 +28,7 @@ public class SecondAllotService : IAutoInjection ...@@ -28,6 +28,7 @@ public class SecondAllotService : IAutoInjection
private readonly PerforAgtempRepository perforAgtempRepository; private readonly PerforAgtempRepository perforAgtempRepository;
private readonly PerforAgtempitemRepository perforAgtempitemRepository; private readonly PerforAgtempitemRepository perforAgtempitemRepository;
private readonly PerforAgfixatitemRepository perforAgfixatitemRepository; private readonly PerforAgfixatitemRepository perforAgfixatitemRepository;
private readonly PerforAgfixatitemlogRepository perforAgfixatitemlogRepository;
private readonly PerforAgusetempRepository perforAgusetempRepository; private readonly PerforAgusetempRepository perforAgusetempRepository;
private readonly PerforAgcomputeRepository perforAgcomputeRepository; private readonly PerforAgcomputeRepository perforAgcomputeRepository;
private readonly PerforCofagainRepository perforCofagainRepository; private readonly PerforCofagainRepository perforCofagainRepository;
...@@ -55,6 +56,7 @@ public class SecondAllotService : IAutoInjection ...@@ -55,6 +56,7 @@ public class SecondAllotService : IAutoInjection
PerforAgtempRepository perforAgtempRepository, PerforAgtempRepository perforAgtempRepository,
PerforAgtempitemRepository perforAgtempitemRepository, PerforAgtempitemRepository perforAgtempitemRepository,
PerforAgfixatitemRepository perforAgfixatitemRepository, PerforAgfixatitemRepository perforAgfixatitemRepository,
PerforAgfixatitemlogRepository perforAgfixatitemlogRepository,
PerforAgusetempRepository perforAgusetempRepository, PerforAgusetempRepository perforAgusetempRepository,
PerforAgcomputeRepository perforAgcomputeRepository, PerforAgcomputeRepository perforAgcomputeRepository,
PerforCofagainRepository perforCofagainRepository, PerforCofagainRepository perforCofagainRepository,
...@@ -81,6 +83,7 @@ public class SecondAllotService : IAutoInjection ...@@ -81,6 +83,7 @@ public class SecondAllotService : IAutoInjection
this.perforAgtempRepository = perforAgtempRepository; this.perforAgtempRepository = perforAgtempRepository;
this.perforAgtempitemRepository = perforAgtempitemRepository; this.perforAgtempitemRepository = perforAgtempitemRepository;
this.perforAgfixatitemRepository = perforAgfixatitemRepository; this.perforAgfixatitemRepository = perforAgfixatitemRepository;
this.perforAgfixatitemlogRepository = perforAgfixatitemlogRepository;
this.perforAgusetempRepository = perforAgusetempRepository; this.perforAgusetempRepository = perforAgusetempRepository;
this.perforAgcomputeRepository = perforAgcomputeRepository; this.perforAgcomputeRepository = perforAgcomputeRepository;
this.perforCofagainRepository = perforCofagainRepository; this.perforCofagainRepository = perforCofagainRepository;
...@@ -678,7 +681,7 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul ...@@ -678,7 +681,7 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public bool SaveValue(List<ag_fixatitem> request) public bool SaveValue(List<ag_fixatitem> request, int userId)
{ {
var secondId = request.First().SecondId; var secondId = request.First().SecondId;
var second = perforAgsecondallotRepository.GetEntity(t => t.Id == secondId); var second = perforAgsecondallotRepository.GetEntity(t => t.Id == secondId);
...@@ -686,7 +689,7 @@ public bool SaveValue(List<ag_fixatitem> request) ...@@ -686,7 +689,7 @@ public bool SaveValue(List<ag_fixatitem> request)
throw new PerformanceException("二次绩效ID不存在"); throw new PerformanceException("二次绩效ID不存在");
var fixatitems = perforAgfixatitemRepository.GetEntities(t => t.SecondId == secondId); var fixatitems = perforAgfixatitemRepository.GetEntities(t => t.SecondId == secondId);
var result = DelValue(fixatitems, request); var result = DelValue(fixatitems, request, userId);
List<ag_fixatitem> update = new List<ag_fixatitem>(), insert = new List<ag_fixatitem>(); List<ag_fixatitem> update = new List<ag_fixatitem>(), insert = new List<ag_fixatitem>();
if (fixatitems != null && fixatitems.Any()) if (fixatitems != null && fixatitems.Any())
{ {
...@@ -701,10 +704,12 @@ public bool SaveValue(List<ag_fixatitem> request) ...@@ -701,10 +704,12 @@ public bool SaveValue(List<ag_fixatitem> request)
cellItem.Type = item.Type; cellItem.Type = item.Type;
cellItem.UnitType = item.UnitType; cellItem.UnitType = item.UnitType;
cellItem.SpecialAttr = item.SpecialAttr; cellItem.SpecialAttr = item.SpecialAttr;
cellItem.UpdateDate = DateTime.Now;
update.Add(cellItem); update.Add(cellItem);
} }
else else
{ {
item.CreateDate = DateTime.Now;
insert.Add(item); insert.Add(item);
} }
} }
...@@ -722,7 +727,7 @@ public bool SaveValue(List<ag_fixatitem> request) ...@@ -722,7 +727,7 @@ public bool SaveValue(List<ag_fixatitem> request)
/// <param name="fixatlist">数据库中查询到的值</param> /// <param name="fixatlist">数据库中查询到的值</param>
/// <param name="fixatitems">需要保存的数据</param> /// <param name="fixatitems">需要保存的数据</param>
/// <returns></returns> /// <returns></returns>
public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems) public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems, int userId)
{ {
var result = true; var result = true;
// 提交数据为空时,删除所有数据 // 提交数据为空时,删除所有数据
...@@ -747,6 +752,25 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems ...@@ -747,6 +752,25 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems
{ {
var delData = fixatlist.Where(t => !groupData.Select(w => w.Id).Contains(t.ID)); var delData = fixatlist.Where(t => !groupData.Select(w => w.Id).Contains(t.ID));
int flag = fixatlist.RemoveAll(t => !groupData.Select(w => w.Id).Contains(t.ID)); int flag = fixatlist.RemoveAll(t => !groupData.Select(w => w.Id).Contains(t.ID));
var logData = delData.Select(t => new ag_fixatitem_log()
{
AllotId = t.AllotId,
SecondId = t.SecondId,
UnitType = t.UnitType,
RowNumber = t.RowNumber,
ItemName = t.ItemName,
ItemValue = t.ItemValue,
FactorValue = t.FactorValue,
Sort = t.Sort,
Type = t.Type,
SourceType = t.SourceType,
SpecialAttr = t.SpecialAttr,
DeleteDate = DateTime.Now,
DeleteUser = userId
});
perforAgfixatitemlogRepository.AddRange(logData.ToArray());
result = perforAgfixatitemRepository.RemoveRange(delData.ToArray()); result = perforAgfixatitemRepository.RemoveRange(delData.ToArray());
} }
...@@ -754,7 +778,29 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems ...@@ -754,7 +778,29 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems
var saveRows = fixatitems.Select(t => t.RowNumber).Distinct(); var saveRows = fixatitems.Select(t => t.RowNumber).Distinct();
var delRows = fixatlist.Select(t => t.RowNumber).Distinct().Except(saveRows); var delRows = fixatlist.Select(t => t.RowNumber).Distinct().Except(saveRows);
if (delRows != null && delRows.Count() > 0) if (delRows != null && delRows.Count() > 0)
result = perforAgfixatitemRepository.RemoveRange(fixatlist.Where(t => delRows.Contains(t.RowNumber)).ToArray()); {
var delData = fixatlist.Where(t => delRows.Contains(t.RowNumber));
var logData = delData.Select(t => new ag_fixatitem_log()
{
AllotId = t.AllotId,
SecondId = t.SecondId,
UnitType = t.UnitType,
RowNumber = t.RowNumber,
ItemName = t.ItemName,
ItemValue = t.ItemValue,
FactorValue = t.FactorValue,
Sort = t.Sort,
Type = t.Type,
SourceType = t.SourceType,
SpecialAttr = t.SpecialAttr,
DeleteDate = DateTime.Now,
DeleteUser = userId
});
perforAgfixatitemlogRepository.AddRange(logData.ToArray());
result = perforAgfixatitemRepository.RemoveRange(delData.ToArray());
}
} }
return result; return result;
......
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