Commit 31bd7330 by lcx

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

parent e5d1d461
......@@ -80,7 +80,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request
if (repetition.Any())
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);
}
......@@ -444,4 +444,4 @@ public ApiResponse DeptComputeDetail(int allotId)
return new ApiResponse(ResponseType.OK, new { isShowManage, data });
}
}
}
\ No newline at end of file
}
......@@ -19,6 +19,9 @@
<member name="P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem">
<summary> 二次绩效固定项 </summary>
</member>
<member name="P:Performance.EntityModels.PerformanceDbContext.ag_fixatitem_log">
<summary> </summary>
</member>
<member name="P:Performance.EntityModels.PerformanceDbContext.ag_header">
<summary> 二次分配不固定列头数据 </summary>
</member>
......@@ -554,14 +557,14 @@
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem.ID">
<summary>
<summary>
</summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem.AllotId">
<summary>
<summary>
</summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem.SecondId">
<summary>
......@@ -569,9 +572,9 @@
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem.UnitType">
<summary>
<summary>
</summary>
</summary>
</member>
<member name="P:Performance.EntityModels.ag_fixatitem.RowNumber">
<summary>
......@@ -613,6 +616,91 @@
1 value相加值为1
</summary>
</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">
<summary>
二次分配不固定列头数据
......
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using System;
......@@ -12,182 +11,268 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
{
}
/// <summary> 二次分配概览 </summary>
/// <summary> 二次分配概览 </summary>
public virtual DbSet<ag_againsituation> ag_againsituation { get; set; }
/// <summary> 二次绩效结果表 </summary>
/// <summary> 二次绩效结果表 </summary>
public virtual DbSet<ag_compute> ag_compute { get; set; }
/// <summary> 二次分配不固定数据 </summary>
/// <summary> 二次分配不固定数据 </summary>
public virtual DbSet<ag_data> ag_data { get; set; }
/// <summary> 二次分配人员名单 </summary>
/// <summary> 二次分配人员名单 </summary>
public virtual DbSet<ag_employee> ag_employee { get; set; }
/// <summary> 二次绩效固定项 </summary>
/// <summary> 二次绩效固定项 </summary>
public virtual DbSet<ag_fixatitem> ag_fixatitem { get; set; }
/// <summary> 二次分配不固定列头数据 </summary>
/// <summary> </summary>
public virtual DbSet<ag_fixatitem_log> ag_fixatitem_log { get; set; }
/// <summary> 二次分配不固定列头数据 </summary>
public virtual DbSet<ag_header> ag_header { get; set; }
/// <summary> 科室二次绩效录入内容 </summary>
/// <summary> 科室二次绩效录入内容 </summary>
public virtual DbSet<ag_itemvalue> ag_itemvalue { get; set; }
/// <summary> 二次绩效其他绩效来源 </summary>
/// <summary> 二次绩效其他绩效来源 </summary>
public virtual DbSet<ag_othersource> ag_othersource { get; set; }
/// <summary> 二次绩效列表 </summary>
/// <summary> 二次绩效列表 </summary>
public virtual DbSet<ag_secondallot> ag_secondallot { get; set; }
/// <summary> 二次绩效模板 </summary>
/// <summary> 二次绩效模板 </summary>
public virtual DbSet<ag_temp> ag_temp { get; set; }
/// <summary> 二次绩效模板项 </summary>
/// <summary> 二次绩效模板项 </summary>
public virtual DbSet<ag_tempitem> ag_tempitem { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ag_usetemp> ag_usetemp { get; set; }
/// <summary> 二次绩效工作量绩效 </summary>
/// <summary> 二次绩效工作量绩效 </summary>
public virtual DbSet<ag_workload> ag_workload { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ag_workload_type> ag_workload_type { get; set; }
/// <summary> 考核类别 </summary>
/// <summary> 考核类别 </summary>
public virtual DbSet<as_assess> as_assess { get; set; }
/// <summary> 考核列头 </summary>
/// <summary> 考核列头 </summary>
public virtual DbSet<as_columns> as_columns { get; set; }
/// <summary> 考核数据 </summary>
/// <summary> 考核数据 </summary>
public virtual DbSet<as_data> as_data { get; set; }
/// <summary> 考核类别 </summary>
/// <summary> 考核类别 </summary>
public virtual DbSet<as_tempassess> as_tempassess { get; set; }
/// <summary> 考核列头 </summary>
/// <summary> 考核列头 </summary>
public virtual DbSet<as_tempcolumns> as_tempcolumns { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<cof_again> cof_again { get; set; }
/// <summary> 上传excel文件校验配置 </summary>
/// <summary> 上传excel文件校验配置 </summary>
public virtual DbSet<cof_check> cof_check { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<cof_cmi> cof_cmi { get; set; }
/// <summary> 科室类型 </summary>
/// <summary> 科室类型 </summary>
public virtual DbSet<cof_depttype> cof_depttype { get; set; }
/// <summary> 规模绩效、效率绩效计算系数配置 </summary>
/// <summary> 规模绩效、效率绩效计算系数配置 </summary>
public virtual DbSet<cof_director> cof_director { get; set; }
/// <summary> 工作量门诊药占比系数 </summary>
/// <summary> 工作量门诊药占比系数 </summary>
public virtual DbSet<cof_drugprop> cof_drugprop { get; set; }
/// <summary> 药占比费用列头名称 </summary>
/// <summary> 药占比费用列头名称 </summary>
public virtual DbSet<cof_drugtype> cof_drugtype { get; set; }
/// <summary> 保底科室配置 </summary>
/// <summary> 保底科室配置 </summary>
public virtual DbSet<cof_guarantee> cof_guarantee { get; set; }
/// <summary> ICU医生护士有效收入汇总计算系数 </summary>
/// <summary> ICU医生护士有效收入汇总计算系数 </summary>
public virtual DbSet<cof_income> cof_income { get; set; }
/// <summary> 特殊绩效项指标 </summary>
/// <summary> 特殊绩效项指标 </summary>
public virtual DbSet<cof_singlefactor> cof_singlefactor { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<cof_workitem> cof_workitem { get; set; }
/// <summary> 工龄对应绩效系数配置 </summary>
/// <summary> 工龄对应绩效系数配置 </summary>
public virtual DbSet<cof_workyear> cof_workyear { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<collect_data> collect_data { get; set; }
/// <summary> </summary>
public virtual DbSet<collect_permission> collect_permission { get; set; }
/// <summary> </summary>
public virtual DbSet<ex_item> ex_item { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ex_module> ex_module { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ex_result> ex_result { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ex_script> ex_script { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ex_special> ex_special { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<ex_type> ex_type { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<hos_personfee> hos_personfee { get; set; }
/// <summary> 科室核算导入信息 </summary>
/// <summary> 科室核算导入信息 </summary>
public virtual DbSet<im_accountbasic> im_accountbasic { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<im_data> im_data { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<im_employee> im_employee { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<im_employee_clinic> im_employee_clinic { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<im_employee_logistics> im_employee_logistics { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<im_header> im_header { get; set; }
/// <summary> 特殊科室核算 </summary>
/// <summary> 特殊科室核算 </summary>
public virtual DbSet<im_specialunit> im_specialunit { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<log_check> log_check { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<log_dbug> log_dbug { get; set; }
/// <summary> 部分公共数据抽取SQL </summary>
/// <summary> 部分公共数据抽取SQL </summary>
public virtual DbSet<mod_dic> mod_dic { get; set; }
///// <summary> 医院数据提取脚本 </summary>
// public virtual DbSet<mod_extract> mod_extract { get; set; }
///// <summary> </summary>
// public virtual DbSet<mod_item> mod_item { get; set; }
///// <summary> </summary>
// public virtual DbSet<mod_module> mod_module { get; set; }
///// <summary> </summary>
// public virtual DbSet<mod_special> mod_special { get; set; }
/// <summary> </summary>
///// <summary> 医院数据提取脚本 </summary>
// public virtual DbSet<mod_extract> mod_extract { get; set; }
///// <summary> </summary>
// public virtual DbSet<mod_item> mod_item { get; set; }
///// <summary> </summary>
// public virtual DbSet<mod_module> mod_module { get; set; }
///// <summary> </summary>
// public virtual DbSet<mod_special> mod_special { get; set; }
/// <summary> </summary>
public virtual DbSet<per_againallot> per_againallot { get; set; }
/// <summary> 医院绩效分配 </summary>
/// <summary> 医院绩效分配 </summary>
public virtual DbSet<per_allot> per_allot { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<per_apr_amount> per_apr_amount { get; set; }
/// <summary> 预算管理金额 </summary>
/// <summary> 预算管理金额 </summary>
public virtual DbSet<per_budget_amount> per_budget_amount { get; set; }
/// <summary> 预算管理占比 </summary>
/// <summary> 预算管理占比 </summary>
public virtual DbSet<per_budget_ratio> per_budget_ratio { get; set; }
/// <summary> 预算控制年度合计 </summary>
/// <summary> 预算控制年度合计 </summary>
public virtual DbSet<per_budget_result> per_budget_result { get; set; }
/// <summary> 科室字典表 </summary>
/// <summary> 科室字典表 </summary>
public virtual DbSet<per_dept_dic> per_dept_dic { get; set; }
/// <summary> 绩效人员表 </summary>
/// <summary> 绩效人员表 </summary>
public virtual DbSet<per_employee> per_employee { get; set; }
/// <summary> 首次上传文件地址(当医院存在标准库时,首次上传用户提交固定格式的excel,开发人员配置SQL脚本) </summary>
/// <summary> 首次上传文件地址(当医院存在标准库时,首次上传用户提交固定格式的excel,开发人员配置SQL脚本) </summary>
public virtual DbSet<per_first> per_first { get; set; }
/// <summary> 上传数据解析 </summary>
/// <summary> 上传数据解析 </summary>
public virtual DbSet<per_sheet> per_sheet { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<rep_group> rep_group { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<rep_group_selection> rep_group_selection { get; set; }
/// <summary> 导入报表SQL配置 </summary>
/// <summary> 导入报表SQL配置 </summary>
public virtual DbSet<rep_importconfig> rep_importconfig { get; set; }
/// <summary> 报表配置表 </summary>
/// <summary> 报表配置表 </summary>
public virtual DbSet<rep_report> rep_report { get; set; }
/// <summary> 条件表 </summary>
/// <summary> 条件表 </summary>
public virtual DbSet<rep_selection> rep_selection { get; set; }
public virtual DbSet<report_original_surgery> report_original_surgery { get; set; }
public virtual DbSet<report_original_stays> report_original_stays { get; set; }
public virtual DbSet<report_original_persontime> report_original_persontime { get; set; }
/// <summary> 科室核算结果 </summary>
public virtual DbSet<res_account> res_account { get; set; }
/// <summary> 医生科室核算结果 </summary>
/// <summary> 医生科室核算结果 </summary>
public virtual DbSet<res_accountdoctor> res_accountdoctor { get; set; }
/// <summary> 护理科室核算结果 </summary>
/// <summary> 护理科室核算结果 </summary>
public virtual DbSet<res_accountnurse> res_accountnurse { get; set; }
/// <summary> 核算基础标准 </summary>
/// <summary> 核算基础标准 </summary>
public virtual DbSet<res_baiscnorm> res_baiscnorm { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<res_compute> res_compute { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<res_reserved> res_reserved { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<res_specialunit> res_specialunit { get; set; }
/// <summary> 医院数据提取脚本 </summary>
/// <summary> 医院数据提取脚本 </summary>
public virtual DbSet<sys_extract> sys_extract { get; set; }
/// <summary> 医院信息 </summary>
/// <summary> 医院信息 </summary>
public virtual DbSet<sys_hospital> sys_hospital { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<sys_hospitalconfig> sys_hospitalconfig { get; set; }
/// <summary> 菜单表 </summary>
/// <summary> 菜单表 </summary>
public virtual DbSet<sys_menu> sys_menu { get; set; }
/// <summary> 角色表 </summary>
/// <summary> 角色表 </summary>
public virtual DbSet<sys_role> sys_role { get; set; }
/// <summary> 角色菜单关联表 </summary>
/// <summary> 角色菜单关联表 </summary>
public virtual DbSet<sys_role_menu> sys_role_menu { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<sys_sms> sys_sms { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<sys_task> sys_task { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<sys_user> sys_user { get; set; }
/// <summary> </summary>
/// <summary> </summary>
public virtual DbSet<sys_user_hospital> sys_user_hospital { get; set; }
/// <summary> 用户角色关联表 </summary>
/// <summary> 用户角色关联表 </summary>
public virtual DbSet<sys_user_role> sys_user_role { get; set; }
}
}
//-----------------------------------------------------------------------
// <copyright file=" ag_fixatitem.cs">
// * FileName: 二次绩效固定项.cs
// * FileName: 二次绩效固定项.cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
namespace Performance.EntityModels
{
/// <summary>
/// 二次绩效固定项
/// </summary>
[Table("ag_fixatitem")]
public class ag_fixatitem
public class ag_fixatitem
{
/// <summary>
///
///
/// </summary>
[Key]
public int ID { get; set; }
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> 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">
// * 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>
//-----------------------------------------------------------------------
using Dapper;
......@@ -44,6 +44,45 @@ public int DeleteData(int 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)
{
List<string> tableArray = new List<string>
......@@ -89,48 +128,48 @@ public int SupplementaryData(int allotid)
{
#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
//from per_sheet sheet
// inner join im_data im on sheet.id = im.sheetid
// left join cof_drugtype dtype on sheet.allotid = dtype.allotid
//from per_sheet sheet
// inner join im_data im on sheet.id = im.sheetid
// left join cof_drugtype dtype on sheet.allotid = dtype.allotid
// 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);
//insert into cof_depttype(allotid,charge) select
//insert into cof_depttype(allotid,charge) select
//distinct @allotid allotid,department charge
//from per_sheet sheet
// inner join im_data im on sheet.id = im.sheetid
// left join cof_depttype dtype on sheet.allotid = dtype.allotid
//from per_sheet sheet
// inner join im_data im on sheet.id = im.sheetid
// left join cof_depttype dtype on sheet.allotid = dtype.allotid
// 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);";
#endregion
#endregion MyRegion
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
from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid
left join cof_drugtype dtype on sheet.allotid = dtype.allotid
from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid
left join cof_drugtype dtype on sheet.allotid = dtype.allotid
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);",
@"insert into cof_depttype(allotid,charge) select
@"insert into cof_depttype(allotid,charge) select
distinct @allotid allotid,department charge
from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid
left join cof_depttype dtype on sheet.allotid = dtype.allotid
from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid
left join cof_depttype dtype on sheet.allotid = dtype.allotid
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);",
/* @"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
union all
......@@ -138,7 +177,7 @@ union all
) t where DoctorName not in (select DoctorName from per_apr_amount where allotid = @allotid);",*/
@"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)"
};
......@@ -151,7 +190,6 @@ union all
}
catch (Exception)
{
}
}
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
//}
#region save
/// <summary>
/// 保存计算后的绩效
/// </summary>
......@@ -110,7 +111,6 @@ private void SaveComputeAccount(PerSheet sheet, int allotId)
perforResaccountRepository.AddRange(addList.ToArray());
}
/// <summary>
/// 保存通用格式
/// </summary>
......@@ -175,9 +175,11 @@ public void Save(List<PerSheet> perSheets, int allotId)
}
}
}
#endregion
#endregion save
#region compute
/// <summary>
/// 合并计算
/// </summary>
......@@ -199,7 +201,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
logManageService.WriteMsg("正在生成绩效", "计算科室经济核算汇总表 -- 第一次计算", 1, allotid, "ReceiveMessage");
var onceEconomic = economicCompute.OnceCompute(mergeResult);
//二次计算
//二次计算
logManageService.WriteMsg("正在生成绩效", "计算科室经济核算汇总表 -- 第二次计算", 1, allotid, "ReceiveMessage");
var twiceEconomicResult = economicCompute.TwiceCompute(onceEconomic);
......@@ -218,7 +220,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
var conitem = perforCofworkitemRepository.GetEntities(t => t.AllotID == allotid);
//医生组 一次计算
//var onceWorkload1 = workloadCompute.OnceCompute(workload1, confs);
//医生组 二次计算
//医生组 二次计算
logManageService.WriteMsg("正在生成绩效", "医生组工作量计算", 1, allotid, "ReceiveMessage");
var twiceWorkloadResult1 = workloadCompute.TwiceCompute(workload1, hospital, confs, cmis, conitem, true);
......@@ -229,7 +231,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
workload2.SheetName = "护理组工作量绩效测算表";
//护理组 一次计算
//var onceWorkload2 = workloadCompute.OnceCompute(workload2);
//护理组 二次计算
//护理组 二次计算
logManageService.WriteMsg("正在生成绩效", "护理组工作量计算", 1, allotid, "ReceiveMessage");
var twiceWorkloadResult2 = workloadCompute.TwiceCompute(workload2, hospital, confs, cmis, conitem);
......@@ -252,13 +254,13 @@ public void Save(List<PerSheet> perSheets, int allotId)
return (perSheet, mergeSheets);
}
/// <summary>
/// 计算科室绩效
/// </summary>
/// <param name="excel"></param>
/// <param name="perSheet"></param>
/// <returns></returns>
///
public List<PerSheet> Compute(PerExcel excel, List<PerSheet> perSheet)
{
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)
/// <param name="extras"></param>
public void ComputeOffice(per_allot allot, PerExcel excel)
{
//取出科室
//取出科室
var accountList = excel.PerSheet.FirstOrDefault(t => t.SheetType == SheetType.AccountBasic)?.PerData?.Select(t => (PerDataAccountBaisc)t);
List<string> involves = new List<string>
......@@ -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) });
}
///// <summary>
///// 计算保底绩效参考标准
///// </summary>
......@@ -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 nurseWorkloadData = perSheet.FirstOrDefault(t => t.SheetType == SheetType.ComputeNurseWorkload)?.PerData.Select(t => (PerData)t);
// var basicRuleList = new[]
// {
// new { Data = doctorWorkloadData, UnitType = UnitType.医生组 },
......@@ -647,6 +647,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
}
return cofs;
}
#endregion
#endregion compute
}
}
......@@ -43,6 +43,7 @@ public class AllotService : IAutoInjection
//private readonly IHubContext<AllotLogHub> hubContext;
private readonly LogManageService logManageService;
private readonly ReportService reportService;
private readonly QueryDataService queryDataService;
......@@ -99,6 +100,7 @@ public class AllotService : IAutoInjection
}
#region 基础功能
/// <summary>
/// 绩效记录
/// </summary>
......@@ -222,6 +224,8 @@ public bool DeleteAllot(int iD)
FileHelper.Move(allot.Path, path);
allot.Path = path;
_allotRepository.Remove(allot);
configService.ClearAllotData(allot.ID);
}
catch (Exception ex)
{
......@@ -254,7 +258,8 @@ public bool Update(per_allot allot)
{
return _allotRepository.Update(allot);
}
#endregion
#endregion 基础功能
public void UpdateAllotStates(int allotId, int states, string remark, int generate = 0)
{
......@@ -318,14 +323,14 @@ public void Generate(per_allot allot, string mail)
//第二次计算包含(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效、保底工勤人均绩效)得出科室业绩绩效;
//根据当前业绩绩效核算出最终绩效结果
//科室经济核算汇总、工作量汇总
logManageService.WriteMsg("科室业绩汇总", "正在生成科室收入支出汇总、工作量汇总", 1, allot.ID, "ReceiveMessage", true);
var (list, mergeSheets) = processComputService.MergeCompute(excel, allot.ID);
processComputService.Save(list, allot.ID);
#region 注释
////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)
////计算保底绩效参考标准(保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效)
//logManageService.WriteMsg("计算保底绩效参考标准值", "正在保底绩效临床医生人均绩效、保底绩效医技医生人均绩效、保底绩效护士人均绩效", 1, allot.ID, "ReceiveMessage", true);
//var minimumBaiscnorm = processComputService.ComputeMinimum(excel, mergeSheets, allot.ID);
......@@ -370,8 +375,9 @@ public void Generate(per_allot allot, string mail)
////科室材料考核
//logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
//var accountExtras = processComputService.GetAccountExtra(excel);
#endregion
//var accountExtras = processComputService.GetAccountExtra(excel);
#endregion 注释
//重新计算科室业绩(含所有提供保底金额)
logManageService.WriteMsg("正在生成绩效", "计算科室业绩分", 1, allot.ID, "ReceiveMessage", true);
......
......@@ -63,6 +63,7 @@ public class ConfigService : IAutoInjection
this.logManageService = logManageService;
this.logger = logger;
}
#endregion
#region 弃用
......@@ -247,6 +248,7 @@ public class ConfigService : IAutoInjection
#endregion
#region cof_drugprop 药占比系数配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
......@@ -303,9 +305,11 @@ public bool DrugDelete(DrugpropRequest request)
return _drugpropRepository.Remove(drugprop);
}
#endregion
#region cof_drugtype 药占比类别配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
......@@ -366,9 +370,11 @@ public bool DrugtypeDelete(DrugpropRequest request)
return _drugtypeRepository.Remove(entity);
}
#endregion
#region cof_workitem 工作量绩效
/// <summary>
/// 获取cof_workitem列表
/// </summary>
......@@ -423,9 +429,11 @@ public bool WorkItemkDelete(WorkItemRequest request)
return _workitemRepository.Remove(workyear);
}
#endregion
#region cof_depttype 科室别配置
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
......@@ -486,9 +494,11 @@ public bool DepttypeDelete(DrugpropRequest request)
return perforCofdepttypeRepository.Remove(entity);
}
#endregion
#region cof_cmi cmi
/// <summary>
/// 获取 CMI配置
/// </summary>
......@@ -544,9 +554,11 @@ public bool HosCMIDelete(cof_cmi request)
return perforCofcmiRepository.Remove(entity);
}
#endregion
#region cof_again
/// <summary>
/// 获取cof_drugprop列表
/// </summary>
......@@ -604,9 +616,11 @@ public bool AgainDelete(CofAgainRequest request)
return _againRepository.Remove(again);
}
#endregion
#region Copy
/// <summary>
/// 复制报表基础配置
/// </summary>
......@@ -664,7 +678,6 @@ public void Copy(per_allot allot)
#endregion
logger.LogInformation($"orgDurgprop");
var orgDurgprop = _drugpropRepository.GetEntities(t => t.AllotID == allot.ID);
if (orgDurgprop == null || orgDurgprop.Count == 0)
......@@ -720,9 +733,11 @@ public void Copy(per_allot allot)
_againRepository.AddRange(newAgains.ToArray());
}
}
#endregion
#region 清楚无效数据 Clear
/// <summary>
/// 清楚无效数据
/// </summary>
......@@ -734,6 +749,16 @@ public void Clear(int allotId)
}
/// <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>
/// <param name="allotId"></param>
......@@ -752,6 +777,7 @@ public void ClearAgain(int againId)
var count = _directorRepository.DelAgain(againId);
logManageService.WriteMsg("清理无效数据", $"清除二次绩效中无效数据,受影响行数:{count}", 1, againId, "ReceiveMessage", true);
}
#endregion
/// <summary>
......
......@@ -28,6 +28,7 @@ public class SecondAllotService : IAutoInjection
private readonly PerforAgtempRepository perforAgtempRepository;
private readonly PerforAgtempitemRepository perforAgtempitemRepository;
private readonly PerforAgfixatitemRepository perforAgfixatitemRepository;
private readonly PerforAgfixatitemlogRepository perforAgfixatitemlogRepository;
private readonly PerforAgusetempRepository perforAgusetempRepository;
private readonly PerforAgcomputeRepository perforAgcomputeRepository;
private readonly PerforCofagainRepository perforCofagainRepository;
......@@ -55,6 +56,7 @@ public class SecondAllotService : IAutoInjection
PerforAgtempRepository perforAgtempRepository,
PerforAgtempitemRepository perforAgtempitemRepository,
PerforAgfixatitemRepository perforAgfixatitemRepository,
PerforAgfixatitemlogRepository perforAgfixatitemlogRepository,
PerforAgusetempRepository perforAgusetempRepository,
PerforAgcomputeRepository perforAgcomputeRepository,
PerforCofagainRepository perforCofagainRepository,
......@@ -81,6 +83,7 @@ public class SecondAllotService : IAutoInjection
this.perforAgtempRepository = perforAgtempRepository;
this.perforAgtempitemRepository = perforAgtempitemRepository;
this.perforAgfixatitemRepository = perforAgfixatitemRepository;
this.perforAgfixatitemlogRepository = perforAgfixatitemlogRepository;
this.perforAgusetempRepository = perforAgusetempRepository;
this.perforAgcomputeRepository = perforAgcomputeRepository;
this.perforCofagainRepository = perforCofagainRepository;
......@@ -678,7 +681,7 @@ private void SupplyHeaderByWorkItem(UseTempRequest request, SecondResponse resul
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool SaveValue(List<ag_fixatitem> request)
public bool SaveValue(List<ag_fixatitem> request, int userId)
{
var secondId = request.First().SecondId;
var second = perforAgsecondallotRepository.GetEntity(t => t.Id == secondId);
......@@ -686,7 +689,7 @@ public bool SaveValue(List<ag_fixatitem> request)
throw new PerformanceException("二次绩效ID不存在");
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>();
if (fixatitems != null && fixatitems.Any())
{
......@@ -701,10 +704,12 @@ public bool SaveValue(List<ag_fixatitem> request)
cellItem.Type = item.Type;
cellItem.UnitType = item.UnitType;
cellItem.SpecialAttr = item.SpecialAttr;
cellItem.UpdateDate = DateTime.Now;
update.Add(cellItem);
}
else
{
item.CreateDate = DateTime.Now;
insert.Add(item);
}
}
......@@ -722,7 +727,7 @@ public bool SaveValue(List<ag_fixatitem> request)
/// <param name="fixatlist">数据库中查询到的值</param>
/// <param name="fixatitems">需要保存的数据</param>
/// <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;
// 提交数据为空时,删除所有数据
......@@ -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));
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());
}
......@@ -754,7 +778,29 @@ public bool DelValue(List<ag_fixatitem> fixatlist, List<ag_fixatitem> fixatitems
var saveRows = fixatitems.Select(t => t.RowNumber).Distinct();
var delRows = fixatlist.Select(t => t.RowNumber).Distinct().Except(saveRows);
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;
......
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