Commit 75707e9e by ruyun.zhang@suvalue.com

Merge branch 'feature/人员字典二次分配自定义显示列' into develop

parents c13e3e29 110c430a
...@@ -740,6 +740,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request) ...@@ -740,6 +740,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
_redistributionService.ClearInvalidValue(cleanDatas); _redistributionService.ClearInvalidValue(cleanDatas);
var dic = _redistributionService.GetTableHeaderDictionary((ComputeMode)request.ComputeMode, allot, second, loads, workloadGroups); var dic = _redistributionService.GetTableHeaderDictionary((ComputeMode)request.ComputeMode, allot, second, loads, workloadGroups);
_redistributionService.RowsExpand(allot, dic, cleanDatas);
return new ApiResponse(ResponseType.OK, new { Head = request.Head, Body = cleanDatas, Dic = dic }); return new ApiResponse(ResponseType.OK, new { Head = request.Head, Body = cleanDatas, Dic = dic });
} }
catch (PerformanceException ex) catch (PerformanceException ex)
...@@ -936,8 +937,10 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request) ...@@ -936,8 +937,10 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request)
// 返回信息 // 返回信息
var (head, rows) = _redistributionService.RedistributionDetail((ComputeMode)request.ComputeMode, allot, second, workloadGroups); var (head, rows) = _redistributionService.RedistributionDetail((ComputeMode)request.ComputeMode, allot, second, workloadGroups);
var dic = _redistributionService.GetTableHeaderDictionary((ComputeMode)request.ComputeMode, allot, second, loads, workloadGroups); var dic = _redistributionService.GetTableHeaderDictionary((ComputeMode)request.ComputeMode, allot, second, loads, workloadGroups);
_redistributionService.RowsExpand(allot, dic, rows);
return new ApiResponse(ResponseType.OK, new { Head = head, Body = rows, Dic = dic }); return new ApiResponse(ResponseType.OK, new { Head = head, Body = rows, Dic = dic });
} }
#endregion #endregion
......
...@@ -205,13 +205,6 @@ ...@@ -205,13 +205,6 @@
<member name="F:Performance.DtoModels.DataFormat.日期YYYYMMDD"> <member name="F:Performance.DtoModels.DataFormat.日期YYYYMMDD">
<summary> 日期 </summary> <summary> 日期 </summary>
</member> </member>
<member name="M:Performance.DtoModels.HandsonTable.SetRowData(System.Collections.Generic.IEnumerable{Performance.DtoModels.HandsonRowData},System.Boolean)">
<summary>
</summary>
<param name="datas"></param>
<param name="isTypein">是否是用户录入的 是:true 不是:false</param>
</member>
<member name="P:Performance.DtoModels.HistoryData.Year"> <member name="P:Performance.DtoModels.HistoryData.Year">
<summary> <summary>
...@@ -4159,6 +4152,11 @@ ...@@ -4159,6 +4152,11 @@
格式 格式
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.SecondColumnDictionary.Expand">
<summary>
true 扩展字段,通过配置额外展示
</summary>
</member>
<member name="P:Performance.DtoModels.SecondEmployeeDto.ComputeMode"> <member name="P:Performance.DtoModels.SecondEmployeeDto.ComputeMode">
<summary> <summary>
计算方式:11 不计算 12 横向计算 13 纵向计算 计算方式:11 不计算 12 横向计算 13 纵向计算
......
...@@ -6105,6 +6105,11 @@ ...@@ -6105,6 +6105,11 @@
验证失败描述 验证失败描述
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.per_apr_amount_hide.MarkStatus">
<summary>
审计状态 1 已审计
</summary>
</member>
<member name="P:Performance.EntityModels.Entity.per_attendance_type.IsDeduction"> <member name="P:Performance.EntityModels.Entity.per_attendance_type.IsDeduction">
<summary> <summary>
是否核减出勤 1 核减 2 不核减 是否核减出勤 1 核减 2 不核减
......
...@@ -37,12 +37,6 @@ public HandsonTable(int sheetType, string[] cols, List<collect_permission> permi ...@@ -37,12 +37,6 @@ public HandsonTable(int sheetType, string[] cols, List<collect_permission> permi
InitColumns(permissions); InitColumns(permissions);
} }
/// <summary>
///
/// </summary>
/// <param name="datas"></param>
/// <param name="isTypein">是否是用户录入的 是:true 不是:false</param>
public void SetRowData(IEnumerable<HandsonRowData> datas, bool isTypein) public void SetRowData(IEnumerable<HandsonRowData> datas, bool isTypein)
{ {
foreach (var dt in datas) foreach (var dt in datas)
......
...@@ -62,6 +62,7 @@ public class ComputerAliasUpdate ...@@ -62,6 +62,7 @@ public class ComputerAliasUpdate
} }
public class ComputerAliasHead public class ComputerAliasHead
{ {
public string Name { get; set; }
public string Head { get; set; } public string Head { get; set; }
public int HeadId { get; set; } public int HeadId { get; set; }
public int Sort { get; set; } public int Sort { get; set; }
......
...@@ -18,9 +18,4 @@ public class PerEmployeeResponse : per_employee ...@@ -18,9 +18,4 @@ public class PerEmployeeResponse : per_employee
/// </summary> /// </summary>
public new string BirthDate { get; set; } public new string BirthDate { get; set; }
} }
public class PersonePassword : per_employee
{
public string Password { get; set; }
}
} }
...@@ -38,12 +38,16 @@ public class SecondColumnDictionary ...@@ -38,12 +38,16 @@ public class SecondColumnDictionary
/// 格式 /// 格式
/// </summary> /// </summary>
public bool IsNumber { get; set; } public bool IsNumber { get; set; }
/// <summary>
/// true 扩展字段,通过配置额外展示
/// </summary>
public bool Expand { get; set; }
public SecondColumnDictionary() public SecondColumnDictionary()
{ {
} }
public SecondColumnDictionary(string label, string key, bool isTrue, int sort, string site = "Table", string type = "", string color = "", int? width = null, bool isNumber = true) public SecondColumnDictionary(string label, string key, bool isTrue, int sort, string site = "Table", string type = "", string color = "", int? width = null, bool isNumber = true, bool expand = false)
{ {
Label = label; Label = label;
Key = key; Key = key;
...@@ -54,6 +58,7 @@ public SecondColumnDictionary(string label, string key, bool isTrue, int sort, s ...@@ -54,6 +58,7 @@ public SecondColumnDictionary(string label, string key, bool isTrue, int sort, s
Color = color; Color = color;
Width = width.HasValue ? width.ToString() : ((label ?? "").Length * 20 + 10).ToString(); Width = width.HasValue ? width.ToString() : ((label ?? "").Length * 20 + 10).ToString();
IsNumber = isNumber; IsNumber = isNumber;
Expand = expand;
} }
} }
} }
...@@ -150,5 +150,15 @@ public class per_employee ...@@ -150,5 +150,15 @@ public class per_employee
/// ///
/// </summary> /// </summary>
public Nullable<int> CreateUser { get; set; } public Nullable<int> CreateUser { get; set; }
public string Reserve01 { get; set; }
public string Reserve02 { get; set; }
public string Reserve03 { get; set; }
public string Reserve04 { get; set; }
public string Reserve05 { get; set; }
public string Reserve06 { get; set; }
public string Reserve07 { get; set; }
public string Reserve08 { get; set; }
public string Reserve09 { get; set; }
public string Reserve10 { get; set; }
} }
} }
...@@ -254,9 +254,7 @@ public IEnumerable<view_second_workload_result> GetSecondWorkload(int allotid, s ...@@ -254,9 +254,7 @@ public IEnumerable<view_second_workload_result> GetSecondWorkload(int allotid, s
/// <summary> /// <summary>
/// 查询HIS提取数据,工作量字典 /// 查询HIS提取数据,工作量字典
/// </summary> /// </summary>
/// <param name="allotid"></param> /// <param name="hospitalId"></param>
/// <param name="unittype"></param>
/// <param name="accountingunit"></param>
/// <returns></returns> /// <returns></returns>
public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId) public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
{ {
...@@ -281,6 +279,7 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId) ...@@ -281,6 +279,7 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
} }
public IEnumerable<view_attendance> GetAttendance(int allotId) public IEnumerable<view_attendance> GetAttendance(int allotId)
{ {
using (var connection = context.Database.GetDbConnection()) using (var connection = context.Database.GetDbConnection())
...@@ -297,5 +296,27 @@ public IEnumerable<view_attendance> GetAttendance(int allotId) ...@@ -297,5 +296,27 @@ public IEnumerable<view_attendance> GetAttendance(int allotId)
} }
} }
} }
/// <summary>
/// 查询人员字典
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public IEnumerable<dynamic> QueryEmployee(int allotId)
{
using (var connection = context.Database.GetDbConnection())
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string query = $@"SELECT * FROM view_employee WHERE AllotID = @allotId";
return connection.Query(query, new { allotId }, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
}
}
} }
} }
\ No newline at end of file
using Performance.DtoModels;
using Performance.EntityModels;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Performance.Services
{
public class ComputeConfig
{
public static List<cof_alias> PerformanceTotal(string route, string[] heads)
{
if (heads == null || heads.Length == 0 || (heads.Length > 0 && heads[0] == ""))
{
if (route == "/report/wholehospital_grant_summary")
return AllComputeView.ToList();
if (route == "/report/wholehospital_accounting_grant_summary")
return AllComputeDepartmentView.ToList();
if (route == "/report/wholehospital_finance_grant_summary")
return AllComputePersonView.ToList();
}
if (route == "/report/wholehospital_grant_summary")
return AllComputeView.Where(t => heads.Contains(t.Name.ToLower())).ToList();
if (route == "/report/wholehospital_accounting_grant_summary")
return AllComputeDepartmentView.Where(t => heads.Contains(t.Name.ToLower())).ToList();
if (route == "/report/wholehospital_finance_grant_summary")
return AllComputePersonView.Where(t => heads.Contains(t.Name.ToLower())).ToList();
return null;
}
public static List<cof_alias> AllComputeView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "来源", Name = nameof(view_allot_sign_emp.Source), States = 1, SumStatus = 0, Sort = 1 },
new cof_alias{ Alias = "核算组别", Name = nameof(view_allot_sign_emp.UnitType), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元编码", Name = nameof(view_allot_sign_emp.Code), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_emp.AccountingUnit), States = 1, SumStatus = 0, Sort = 3 },
new cof_alias{ Alias = "员工号", Name = nameof(view_allot_sign_emp.JobNumber), States = 1, SumStatus = 0, Sort = 4 },
new cof_alias{ Alias = "人员姓名", Name = nameof(view_allot_sign_emp.EmployeeName), States = 1, SumStatus = 0, Sort = 5 },
new cof_alias{ Alias = "职称", Name = nameof(view_allot_sign_emp.TitlePosition), States = 1, SumStatus = 0, Sort = 6 },
new cof_alias{ Alias = "批次", Name = nameof(view_allot_sign_emp.Batch), States = 1, SumStatus = 0, Sort = 7 },
new cof_alias{ Alias = "银行卡号", Name = nameof(view_allot_sign_emp.BankCard), States = 1, SumStatus = 0, Sort = 8 },
new cof_alias{ Alias = "正式/临聘", Name = nameof(view_allot_sign_emp.JobCategory), States = 1, SumStatus = 0, Sort = 9 },
new cof_alias{ Alias = "职务", Name = nameof(view_allot_sign_emp.Duty), States = 1, SumStatus = 0, Sort = 10 },
new cof_alias{ Alias = "调节后业绩绩效", Name = nameof(view_allot_sign_emp.PerforSumFee), States = 1, SumStatus = 1, Sort = 11 },
new cof_alias{ Alias = "调节后实发管理绩效", Name = nameof(view_allot_sign_emp.PerforManagementFee), States = 1, SumStatus = 1, Sort = 12 },
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_emp.AdjustLaterOtherFee), States = 1, SumStatus = 1, Sort = 13 },
new cof_alias{ Alias = "夜班费", Name = nameof(view_allot_sign_emp.NightWorkPerfor), States = 1, SumStatus = 1, Sort = 14 },
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_emp.OtherPerfor), States = 1, SumStatus = 1, Sort = 15 },
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_emp.HideOtherPerfor), States = 1, SumStatus = 1, Sort = 16 },
new cof_alias{ Alias = "应发小计", Name = nameof(view_allot_sign_emp.ShouldGiveFee), States = 1, SumStatus = 1, Sort = 17 },
new cof_alias{ Alias = "预留绩效", Name = nameof(view_allot_sign_emp.ReservedRatioFee), States = 1, SumStatus = 1, Sort = 18 },
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_emp.RealGiveFee), States = 1, SumStatus = 1, Sort = 19 },
};
private static List<cof_alias> _allComputeViewByDate = new List<cof_alias>();
public static List<cof_alias> AllComputeViewByDate
{
get
{
if (_allComputeViewByDate == null || _allComputeViewByDate.Count == 0)
{
_allComputeViewByDate.Add(new cof_alias { Alias = "年份", Name = nameof(view_allot_sign_emp.Year), States = 1, SumStatus = 0 });
_allComputeViewByDate.Add(new cof_alias { Alias = "月份", Name = nameof(view_allot_sign_emp.Month), States = 1, SumStatus = 0 });
_allComputeViewByDate.AddRange(AllComputeView);
}
return _allComputeViewByDate;
}
}
public static List<cof_alias> AllComputePersonView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "核算组别", Name = nameof(view_allot_sign_emp.UnitType), States = 1, SumStatus = 0, Sort = 1 },
new cof_alias{ Alias = "核算单元编码", Name = nameof(view_allot_sign_emp.Code), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_emp.AccountingUnit), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "员工号", Name = nameof(view_allot_sign_emp.JobNumber), States = 1, SumStatus = 0, Sort = 3 },
new cof_alias{ Alias = "人员姓名", Name = nameof(view_allot_sign_emp.EmployeeName), States = 1, SumStatus = 0, Sort = 4 },
new cof_alias{ Alias = "调节后业绩绩效", Name = nameof(view_allot_sign_emp.PerforSumFee), States = 1, SumStatus = 1, Sort = 5 },
new cof_alias{ Alias = "调节后实发管理绩效", Name = nameof(view_allot_sign_emp.PerforManagementFee), States = 1, SumStatus = 1, Sort = 6 },
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_emp.AdjustLaterOtherFee), States = 1, SumStatus = 1, Sort = 7 },
new cof_alias{ Alias = "夜班费", Name = nameof(view_allot_sign_emp.NightWorkPerfor), States = 1, SumStatus = 1, Sort = 8 },
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_emp.OtherPerfor), States = 1, SumStatus = 1, Sort = 9 },
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_emp.HideOtherPerfor), States = 1, SumStatus = 1, Sort = 10 },
new cof_alias{ Alias = "应发小计", Name = nameof(view_allot_sign_emp.ShouldGiveFee), States = 1, SumStatus = 1, Sort = 11 },
new cof_alias{ Alias = "预留绩效", Name = nameof(view_allot_sign_emp.ReservedRatioFee), States = 1, SumStatus = 1, Sort = 12 },
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_emp.RealGiveFee), States = 1, SumStatus = 1, Sort = 13 },
};
private static List<cof_alias> _allComputePersonViewByDate = new List<cof_alias>();
public static List<cof_alias> AllComputePersonViewByDate
{
get
{
if (_allComputePersonViewByDate == null || _allComputePersonViewByDate.Count == 0)
{
_allComputePersonViewByDate.Add(new cof_alias { Alias = "年份", Name = nameof(view_allot_sign_emp.Year), States = 1, SumStatus = 0 });
_allComputePersonViewByDate.Add(new cof_alias { Alias = "月份", Name = nameof(view_allot_sign_emp.Month), States = 1, SumStatus = 0 });
_allComputePersonViewByDate.AddRange(AllComputePersonView);
}
return _allComputePersonViewByDate;
}
}
public static List<cof_alias> AllComputeDepartmentView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "核算组别", Name = nameof(view_allot_sign_dept.UnitType), States = 1, SumStatus = 0, Sort = 1 },
new cof_alias{ Alias = "核算单元编码", Name = nameof(view_allot_sign_emp.Code), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_dept.AccountingUnit), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "业绩绩效", Name = nameof(view_allot_sign_dept.PerforFee), States = 1, SumStatus = 1, Sort = 3 },
new cof_alias{ Alias = "工作量绩效", Name = nameof(view_allot_sign_dept.WorkloadFee), States = 1, SumStatus = 1, Sort = 4 },
new cof_alias{ Alias = "考核前其他绩效", Name = nameof(view_allot_sign_dept.AssessBeforeOtherFee), States = 1, SumStatus = 1, Sort = 5 },
new cof_alias{ Alias = "考核前绩效合计", Name = nameof(view_allot_sign_dept.PerforTotal), States = 1, SumStatus = 1, Sort = 6 },
new cof_alias{ Alias = "科室考核得分", Name = nameof(view_allot_sign_dept.ScoringAverage), States = 1, SumStatus = 1, Sort = 7 },
new cof_alias{ Alias = "药占比奖罚", Name = nameof(view_allot_sign_dept.MedicineExtra), States = 1, SumStatus = 1, Sort = 8 },
new cof_alias{ Alias = "材料占比奖罚", Name = nameof(view_allot_sign_dept.MaterialsExtra), States = 1, SumStatus = 1, Sort = 9 },
new cof_alias{ Alias = "医院奖罚", Name = nameof(view_allot_sign_dept.Extra), States = 1, SumStatus = 1, Sort = 10 },
new cof_alias{ Alias = "考核后其他绩效", Name = nameof(view_allot_sign_dept.AssessLaterOtherFee), States = 1, SumStatus = 1, Sort = 11 },
new cof_alias{ Alias = "考核后绩效", Name = nameof(view_allot_sign_dept.AssessLaterPerforTotal), States = 1, SumStatus = 1, Sort = 12 },
new cof_alias{ Alias = "调节系数", Name = nameof(view_allot_sign_dept.AdjustFactor), States = 1, SumStatus = 1, Sort = 13 },
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_dept.AdjustLaterOtherFee), States = 1, SumStatus = 1, Sort = 14 },
new cof_alias{ Alias = "科主任实发管理绩效", Name = nameof(view_allot_sign_dept.AssessLaterManagementFee), States = 1, SumStatus = 1, Sort = 15 },
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_dept.AprPerforAmount), States = 1, SumStatus = 1, Sort = 16 },
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_dept.HideAprOtherPerforAmount), States = 1, SumStatus = 1, Sort = 17 },
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_dept.RealGiveFee), States = 1, SumStatus = 1, Sort = 18 },
};
private static List<cof_alias> _allComputeDepartmentViewByDate = new List<cof_alias>();
public static List<cof_alias> AllComputeDepartmentViewByDate
{
get
{
if (_allComputeDepartmentViewByDate == null || _allComputeDepartmentViewByDate.Count == 0)
{
_allComputeDepartmentViewByDate.Add(new cof_alias { Alias = "年份", Name = nameof(view_allot_sign_emp.Year), States = 1, SumStatus = 0 });
_allComputeDepartmentViewByDate.Add(new cof_alias { Alias = "月份", Name = nameof(view_allot_sign_emp.Month), States = 1, SumStatus = 0 });
_allComputeDepartmentViewByDate.AddRange(AllComputeDepartmentView);
}
return _allComputeDepartmentViewByDate;
}
}
public static List<cof_alias> GetAllPersonnelTags(bool ownerQuery)
{
var alias = new List<cof_alias>
{
new cof_alias{ Alias = "员工工号", Name = nameof(per_employee.PersonnelNumber), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "姓名", Name = nameof(per_employee.DoctorName), States = 1, SumStatus = 0, Sort = 4 },
new cof_alias{ Alias = "核算单元", Name = nameof(per_employee.AccountingUnit), States = 1, SumStatus = 0, Sort = 6 },
new cof_alias{ Alias = "正式/临聘", Name = nameof(per_employee.JobCategory), States = 1, SumStatus = 0, Sort = 8 },
new cof_alias{ Alias = "职务", Name = nameof(per_employee.Duty), States = 1, SumStatus = 0, Sort = 10 },
new cof_alias{ Alias = "职称", Name = nameof(per_employee.JobTitle), States = 1, SumStatus = 0, Sort = 12 },
new cof_alias{ Alias = "出勤天数", Name = nameof(per_employee.AttendanceDay), States = 1, SumStatus = 0, Sort = 14 },
new cof_alias{ Alias = "预留比例", Name = nameof(per_employee.ReservedRatio), States = 1, SumStatus = 0, Sort = 16 },
new cof_alias{ Alias = "银行卡号", Name = nameof(per_employee.BankCard), States = 1, SumStatus = 0, Sort = 18 },
new cof_alias{ Alias = "备用01", Name = nameof(per_employee.Reserve01), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用02", Name = nameof(per_employee.Reserve02), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用03", Name = nameof(per_employee.Reserve03), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用04", Name = nameof(per_employee.Reserve04), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用05", Name = nameof(per_employee.Reserve05), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用06", Name = nameof(per_employee.Reserve06), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用07", Name = nameof(per_employee.Reserve07), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用08", Name = nameof(per_employee.Reserve08), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用09", Name = nameof(per_employee.Reserve09), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "备用10", Name = nameof(per_employee.Reserve10), States = 0, SumStatus = 0, Sort = 20 },
new cof_alias{ Alias = "绩效发放情况", Name = nameof(report_performance_person_tags.Tag1), States = 1, SumStatus = 0, Sort = 100 },
new cof_alias{ Alias = "当月绩效权重", Name = nameof(report_performance_person_tags.Tag2), States = 1, SumStatus = 0, Sort = 101 },
new cof_alias{ Alias = "重点群体对比1", Name = nameof(report_performance_person_tags.Tag3), States = 1, SumStatus = 0, Sort = 102 },
new cof_alias{ Alias = "重点群体对比2", Name = nameof(report_performance_person_tags.Tag4), States = 1, SumStatus = 0, Sort = 103 },
new cof_alias{ Alias = "重点群体对比5", Name = nameof(report_performance_person_tags.Tag5), States = 1, SumStatus = 0, Sort = 104 },
};
if (ownerQuery)
alias.Add(new cof_alias { Alias = "密码", Name = "Password", States = 1, SumStatus = 0, Sort = 7 });
return alias.OrderBy(w => w.Sort).ToList();
}
}
}
...@@ -2024,13 +2024,15 @@ public bool UpdateHeadersStatus(ComputerAliasUpdate request) ...@@ -2024,13 +2024,15 @@ public bool UpdateHeadersStatus(ComputerAliasUpdate request)
var data = heads.Select(t => new cof_alias var data = heads.Select(t => new cof_alias
{ {
Route = request.Route, Route = request.Route,
Alias = t.Alias, Alias = request.computerAliasHead.FirstOrDefault(w => w.Name == t.Name)?.Head ?? t.Alias,
OriginalName = t.Alias, OriginalName = t.Alias,
HospitalId = request.HospitalId, HospitalId = request.HospitalId,
Name = t.Name, Name = t.Name,
States = items.Contains(t.Alias ?? "") ? 1 : 0, States = items.Contains(t.Alias ?? "") ? 1 : 0,
SumStatus = t.SumStatus, SumStatus = t.SumStatus,
Sort = request.computerAliasHead.FirstOrDefault(w => w.Head == t.Alias).Sort Sort = request.computerAliasHead.Any(w => w.Name == t.Name)
? request.computerAliasHead.FirstOrDefault(w => w.Name == t.Name).Sort
: t.Sort
}); });
cofaliasRepository.AddRange(data.ToArray()); cofaliasRepository.AddRange(data.ToArray());
} }
...@@ -2094,6 +2096,11 @@ public bool UpdateHeadersStatus(ComputerAliasUpdate request) ...@@ -2094,6 +2096,11 @@ public bool UpdateHeadersStatus(ComputerAliasUpdate request)
/// <returns></returns> /// <returns></returns>
public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params string[] heads) public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params string[] heads)
{ {
var hos = hospitalRepository.GetEntity(w => w.ID == hospitalId);
return CustomColumnHeaders(hos, route, heads);
}
public List<cof_alias> CustomColumnHeaders(sys_hospital hos, string route, params string[] heads)
{
var pairs = new Dictionary<string, List<cof_alias>> var pairs = new Dictionary<string, List<cof_alias>>
{ {
{ "/result/compute" , ComputeConfig.AllComputeView }, { "/result/compute" , ComputeConfig.AllComputeView },
...@@ -2108,10 +2115,14 @@ public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params ...@@ -2108,10 +2115,14 @@ public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params
{ "/report/wholehospital_accounting_grant_summary" , ComputeConfig.PerformanceTotal(route,heads) }, { "/report/wholehospital_accounting_grant_summary" , ComputeConfig.PerformanceTotal(route,heads) },
{ "/report/wholehospital_finance_grant_summary" , ComputeConfig.PerformanceTotal(route,heads) }, { "/report/wholehospital_finance_grant_summary" , ComputeConfig.PerformanceTotal(route,heads) },
{ "/result/all_employee" , ComputeConfig.GetAllPersonnelTags(hos?.IsOwnerQuery == 1) },
}; };
var init = pairs.ContainsKey(route.ToLower()) ? pairs[route.ToLower()] : new List<cof_alias>(); var init = pairs.ContainsKey(route.ToLower()) ? pairs[route.ToLower()] : new List<cof_alias>();
var alias = cofaliasRepository.GetEntities(t => t.HospitalId == hospitalId && t.Route.Equals(route, StringComparison.OrdinalIgnoreCase))?.OrderBy(w => w.Sort).ToList() if (hos == null)
return init;
var alias = cofaliasRepository.GetEntities(t => t.HospitalId == hos.ID && t.Route.Equals(route, StringComparison.OrdinalIgnoreCase))?.OrderBy(w => w.Sort).ToList()
?? new List<cof_alias>(); ?? new List<cof_alias>();
if (alias == null || !alias.Any()) return init; if (alias == null || !alias.Any()) return init;
...@@ -2126,7 +2137,7 @@ public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params ...@@ -2126,7 +2137,7 @@ public List<cof_alias> CustomColumnHeaders(int hospitalId, string route, params
else else
{ {
x.Id = item.Id; x.Id = item.Id;
x.HospitalId = hospitalId; x.HospitalId = hos.ID;
x.Route = route; x.Route = route;
x.OriginalName = item.OriginalName; x.OriginalName = item.OriginalName;
x.Alias = item.Alias; x.Alias = item.Alias;
...@@ -2330,143 +2341,4 @@ public QueryComputeByDateGetPage GetPerformanceSummary(HospitalGrantSummary requ ...@@ -2330,143 +2341,4 @@ public QueryComputeByDateGetPage GetPerformanceSummary(HospitalGrantSummary requ
return pairs; return pairs;
} }
} }
public class ComputeConfig
{
public static List<cof_alias> PerformanceTotal(string route, string[] heads)
{
if (heads == null || heads.Length == 0 || (heads.Length > 0 && heads[0] == ""))
{
if (route == "/report/wholehospital_grant_summary")
return AllComputeView.ToList();
if (route == "/report/wholehospital_accounting_grant_summary")
return AllComputeDepartmentView.ToList();
if (route == "/report/wholehospital_finance_grant_summary")
return AllComputePersonView.ToList();
}
if (route == "/report/wholehospital_grant_summary")
return AllComputeView.Where(t => heads.Contains(t.Name.ToLower())).ToList();
if (route == "/report/wholehospital_accounting_grant_summary")
return AllComputeDepartmentView.Where(t => heads.Contains(t.Name.ToLower())).ToList();
if (route == "/report/wholehospital_finance_grant_summary")
return AllComputePersonView.Where(t => heads.Contains(t.Name.ToLower())).ToList();
return null;
}
public static List<cof_alias> AllComputeView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "来源", Name = nameof(view_allot_sign_emp.Source), States = 1, SumStatus = 0, Sort = 1 },
new cof_alias{ Alias = "核算组别", Name = nameof(view_allot_sign_emp.UnitType), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元编码", Name = nameof(view_allot_sign_emp.Code), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_emp.AccountingUnit), States = 1, SumStatus = 0, Sort = 3 },
new cof_alias{ Alias = "员工号", Name = nameof(view_allot_sign_emp.JobNumber), States = 1, SumStatus = 0, Sort = 4 },
new cof_alias{ Alias = "人员姓名", Name = nameof(view_allot_sign_emp.EmployeeName), States = 1, SumStatus = 0, Sort = 5 },
new cof_alias{ Alias = "职称", Name = nameof(view_allot_sign_emp.TitlePosition), States = 1, SumStatus = 0, Sort = 6 },
new cof_alias{ Alias = "批次", Name = nameof(view_allot_sign_emp.Batch), States = 1, SumStatus = 0, Sort = 7 },
new cof_alias{ Alias = "银行卡号", Name = nameof(view_allot_sign_emp.BankCard), States = 1, SumStatus = 0, Sort = 8 },
new cof_alias{ Alias = "正式/临聘", Name = nameof(view_allot_sign_emp.JobCategory), States = 1, SumStatus = 0, Sort = 9 },
new cof_alias{ Alias = "职务", Name = nameof(view_allot_sign_emp.Duty), States = 1, SumStatus = 0, Sort = 10 },
new cof_alias{ Alias = "调节后业绩绩效", Name = nameof(view_allot_sign_emp.PerforSumFee), States = 1, SumStatus = 1, Sort = 11 },
new cof_alias{ Alias = "调节后实发管理绩效", Name = nameof(view_allot_sign_emp.PerforManagementFee), States = 1, SumStatus = 1, Sort = 12 },
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_emp.AdjustLaterOtherFee), States = 1, SumStatus = 1, Sort = 13 },
new cof_alias{ Alias = "夜班费", Name = nameof(view_allot_sign_emp.NightWorkPerfor), States = 1, SumStatus = 1, Sort = 14 },
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_emp.OtherPerfor), States = 1, SumStatus = 1, Sort = 15 },
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_emp.HideOtherPerfor), States = 1, SumStatus = 1, Sort = 16 },
new cof_alias{ Alias = "应发小计", Name = nameof(view_allot_sign_emp.ShouldGiveFee), States = 1, SumStatus = 1, Sort = 17 },
new cof_alias{ Alias = "预留绩效", Name = nameof(view_allot_sign_emp.ReservedRatioFee), States = 1, SumStatus = 1, Sort = 18 },
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_emp.RealGiveFee), States = 1, SumStatus = 1, Sort = 19 },
};
private static List<cof_alias> _allComputeViewByDate = new List<cof_alias>();
public static List<cof_alias> AllComputeViewByDate
{
get
{
if (_allComputeViewByDate == null || _allComputeViewByDate.Count == 0)
{
_allComputeViewByDate.Add(new cof_alias { Alias = "年份", Name = nameof(view_allot_sign_emp.Year), States = 1, SumStatus = 0 });
_allComputeViewByDate.Add(new cof_alias { Alias = "月份", Name = nameof(view_allot_sign_emp.Month), States = 1, SumStatus = 0 });
_allComputeViewByDate.AddRange(AllComputeView);
}
return _allComputeViewByDate;
}
}
public static List<cof_alias> AllComputePersonView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "核算组别", Name = nameof(view_allot_sign_emp.UnitType), States = 1, SumStatus = 0, Sort = 1 },
new cof_alias{ Alias = "核算单元编码", Name = nameof(view_allot_sign_emp.Code), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_emp.AccountingUnit), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "员工号", Name = nameof(view_allot_sign_emp.JobNumber), States = 1, SumStatus = 0, Sort = 3 },
new cof_alias{ Alias = "人员姓名", Name = nameof(view_allot_sign_emp.EmployeeName), States = 1, SumStatus = 0, Sort = 4 },
new cof_alias{ Alias = "调节后业绩绩效", Name = nameof(view_allot_sign_emp.PerforSumFee), States = 1, SumStatus = 1, Sort = 5 },
new cof_alias{ Alias = "调节后实发管理绩效", Name = nameof(view_allot_sign_emp.PerforManagementFee), States = 1, SumStatus = 1, Sort = 6 },
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_emp.AdjustLaterOtherFee), States = 1, SumStatus = 1, Sort = 7 },
new cof_alias{ Alias = "夜班费", Name = nameof(view_allot_sign_emp.NightWorkPerfor), States = 1, SumStatus = 1, Sort = 8 },
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_emp.OtherPerfor), States = 1, SumStatus = 1, Sort = 9 },
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_emp.HideOtherPerfor), States = 1, SumStatus = 1, Sort = 10 },
new cof_alias{ Alias = "应发小计", Name = nameof(view_allot_sign_emp.ShouldGiveFee), States = 1, SumStatus = 1, Sort = 11 },
new cof_alias{ Alias = "预留绩效", Name = nameof(view_allot_sign_emp.ReservedRatioFee), States = 1, SumStatus = 1, Sort = 12 },
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_emp.RealGiveFee), States = 1, SumStatus = 1, Sort = 13 },
};
private static List<cof_alias> _allComputePersonViewByDate = new List<cof_alias>();
public static List<cof_alias> AllComputePersonViewByDate
{
get
{
if (_allComputePersonViewByDate == null || _allComputePersonViewByDate.Count == 0)
{
_allComputePersonViewByDate.Add(new cof_alias { Alias = "年份", Name = nameof(view_allot_sign_emp.Year), States = 1, SumStatus = 0 });
_allComputePersonViewByDate.Add(new cof_alias { Alias = "月份", Name = nameof(view_allot_sign_emp.Month), States = 1, SumStatus = 0 });
_allComputePersonViewByDate.AddRange(AllComputePersonView);
}
return _allComputePersonViewByDate;
}
}
public static List<cof_alias> AllComputeDepartmentView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "核算组别", Name = nameof(view_allot_sign_dept.UnitType), States = 1, SumStatus = 0, Sort = 1 },
new cof_alias{ Alias = "核算单元编码", Name = nameof(view_allot_sign_emp.Code), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_dept.AccountingUnit), States = 1, SumStatus = 0, Sort = 2 },
new cof_alias{ Alias = "业绩绩效", Name = nameof(view_allot_sign_dept.PerforFee), States = 1, SumStatus = 1, Sort = 3 },
new cof_alias{ Alias = "工作量绩效", Name = nameof(view_allot_sign_dept.WorkloadFee), States = 1, SumStatus = 1, Sort = 4 },
new cof_alias{ Alias = "考核前其他绩效", Name = nameof(view_allot_sign_dept.AssessBeforeOtherFee), States = 1, SumStatus = 1, Sort = 5 },
new cof_alias{ Alias = "考核前绩效合计", Name = nameof(view_allot_sign_dept.PerforTotal), States = 1, SumStatus = 1, Sort = 6 },
new cof_alias{ Alias = "科室考核得分", Name = nameof(view_allot_sign_dept.ScoringAverage), States = 1, SumStatus = 1, Sort = 7 },
new cof_alias{ Alias = "药占比奖罚", Name = nameof(view_allot_sign_dept.MedicineExtra), States = 1, SumStatus = 1, Sort = 8 },
new cof_alias{ Alias = "材料占比奖罚", Name = nameof(view_allot_sign_dept.MaterialsExtra), States = 1, SumStatus = 1, Sort = 9 },
new cof_alias{ Alias = "医院奖罚", Name = nameof(view_allot_sign_dept.Extra), States = 1, SumStatus = 1, Sort = 10 },
new cof_alias{ Alias = "考核后其他绩效", Name = nameof(view_allot_sign_dept.AssessLaterOtherFee), States = 1, SumStatus = 1, Sort = 11 },
new cof_alias{ Alias = "考核后绩效", Name = nameof(view_allot_sign_dept.AssessLaterPerforTotal), States = 1, SumStatus = 1, Sort = 12 },
new cof_alias{ Alias = "调节系数", Name = nameof(view_allot_sign_dept.AdjustFactor), States = 1, SumStatus = 1, Sort = 13 },
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_dept.AdjustLaterOtherFee), States = 1, SumStatus = 1, Sort = 14 },
new cof_alias{ Alias = "科主任实发管理绩效", Name = nameof(view_allot_sign_dept.AssessLaterManagementFee), States = 1, SumStatus = 1, Sort = 15 },
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_dept.AprPerforAmount), States = 1, SumStatus = 1, Sort = 16 },
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_dept.HideAprOtherPerforAmount), States = 1, SumStatus = 1, Sort = 17 },
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_dept.RealGiveFee), States = 1, SumStatus = 1, Sort = 18 },
};
private static List<cof_alias> _allComputeDepartmentViewByDate = new List<cof_alias>();
public static List<cof_alias> AllComputeDepartmentViewByDate
{
get
{
if (_allComputeDepartmentViewByDate == null || _allComputeDepartmentViewByDate.Count == 0)
{
_allComputeDepartmentViewByDate.Add(new cof_alias { Alias = "年份", Name = nameof(view_allot_sign_emp.Year), States = 1, SumStatus = 0 });
_allComputeDepartmentViewByDate.Add(new cof_alias { Alias = "月份", Name = nameof(view_allot_sign_emp.Month), States = 1, SumStatus = 0 });
_allComputeDepartmentViewByDate.AddRange(AllComputeDepartmentView);
}
return _allComputeDepartmentViewByDate;
}
}
}
} }
...@@ -718,17 +718,8 @@ private string[] GetUnitType(int userId) ...@@ -718,17 +718,8 @@ private string[] GetUnitType(int userId)
public HandsonTable GetBatchPersonStructrue(int hospitalId) public HandsonTable GetBatchPersonStructrue(int hospitalId)
{ {
var hos = perforHospitalRepository.GetEntity(t => t.ID == hospitalId); var cols = Person.Select(t => t.Item2).ToArray();
var cols = hos.IsOwnerQuery == 1 ? PersonPassword.Select(t => t.Item2).ToArray() : Person.Select(t => t.Item2).ToArray(); var permissions = Person.Select(t => new collect_permission { HeadName = t.Item2, Visible = 1 }).ToList();
var permissions = hos.IsOwnerQuery == 1 ? PersonPassword.Select(t => new collect_permission
{
HeadName = t.Item2,
Visible = 1
}).ToList() : Person.Select(t => new collect_permission
{
HeadName = t.Item2,
Visible = 1
}).ToList();
var result = new HandsonTable((int)SheetType.Unidentifiable, cols, permissions); var result = new HandsonTable((int)SheetType.Unidentifiable, cols, permissions);
var deptdics = perdeptdicRepository.GetEntities(t => t.HospitalId == hospitalId); var deptdics = perdeptdicRepository.GetEntities(t => t.HospitalId == hospitalId);
...@@ -1073,23 +1064,6 @@ private void DeptDicList(int HospitalId, List<per_dept_dic> deptDics, DeptdicHan ...@@ -1073,23 +1064,6 @@ private void DeptDicList(int HospitalId, List<per_dept_dic> deptDics, DeptdicHan
return result; return result;
} }
public static List<(string, string, Func<PersonePassword, object>)> PersonPassword { get; } = new List<(string, string, Func<PersonePassword, object>)>
{
(nameof(PersonePassword.UnitType), "核算组别", t => t.UnitType),
(nameof(PersonePassword.AccountingUnit), "核算单元", t => t.AccountingUnit),
(nameof(PersonePassword.Department), "科室名称", t => t.Department),
(nameof(PersonePassword.DoctorName), "姓名" ,t => t.DoctorName),
(nameof(PersonePassword.PersonnelNumber), "员工工号", t => t.PersonnelNumber),
//(nameof(PersonePassword.JobCategory), "正式/临聘", t => t.JobCategory),
//(nameof(PersonePassword.Duty), "职务", t => t.Duty),
//(nameof(PersonePassword.JobTitle), "职称", t => t.JobTitle),
//(nameof(PersonePassword.AttendanceDay), "出勤天数", t => t.AttendanceDay),
//(nameof(PersonePassword.ReservedRatio), "预留比例", t => t.ReservedRatio),
//(nameof(PersonePassword.BankCard), "银行卡号", t => t.BankCard),
//(nameof(PersonePassword.Password), "密码", t => t.Password),
//(nameof(PersonePassword.Remark), "备注", t => t.Remark),
};
public static List<(string, string, Func<per_employee, object>)> Person { get; } = new List<(string, string, Func<per_employee, object>)> public static List<(string, string, Func<per_employee, object>)> Person { get; } = new List<(string, string, Func<per_employee, object>)>
{ {
(nameof(per_employee.UnitType), "核算组别", t => t.UnitType), (nameof(per_employee.UnitType), "核算组别", t => t.UnitType),
......
...@@ -178,7 +178,7 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute ...@@ -178,7 +178,7 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
/* /*
此处数据需要额外注意,前端显示规则:通过isTrue=true显示,显示名称为label 此处数据需要额外注意,前端显示规则:通过isTrue=true显示,显示名称为label
*/ */
var alias = _cofaliasRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Route == "/second_entering") ?? new List<cof_alias>(); var alias = _cofaliasRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Route == "/second_entering" && t.States == 1) ?? new List<cof_alias>();
Func<string, string, string> getAlias = (name, def) => Func<string, string, string> getAlias = (name, def) =>
{ {
try try
...@@ -226,6 +226,27 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute ...@@ -226,6 +226,27 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
maps.Add(new SecondColumnDictionary(getAlias(nameof(ag_bodysource.TitleCoefficient), "职称系数"), nameof(ag_bodysource.TitleCoefficient), false, 203, color: "title_color", isNumber: true)); maps.Add(new SecondColumnDictionary(getAlias(nameof(ag_bodysource.TitleCoefficient), "职称系数"), nameof(ag_bodysource.TitleCoefficient), false, 203, color: "title_color", isNumber: true));
maps.Add(new SecondColumnDictionary(getAlias(nameof(ag_bodysource.TitlePerformanceScore), "职称绩效得分"), nameof(ag_bodysource.TitlePerformanceScore), false, 204, color: "title_color", isNumber: true)); maps.Add(new SecondColumnDictionary(getAlias(nameof(ag_bodysource.TitlePerformanceScore), "职称绩效得分"), nameof(ag_bodysource.TitlePerformanceScore), false, 204, color: "title_color", isNumber: true));
} }
// 扩展字典
if (alias != null && alias.Any())
{
List<string> notCalculate = new List<string>
{
nameof(ag_bodysource.Post),
nameof(ag_bodysource.StaffCoefficient),
nameof(ag_bodysource.ActualAttendance),
nameof(ag_bodysource.JobTitle),
nameof(ag_bodysource.TitleCoefficient),
nameof(ag_bodysource.TitlePerformanceScore),
};
foreach (var item in alias)
{
if (!maps.Any(w => w.Key.Equals(item.Name, StringComparison.OrdinalIgnoreCase))
&& !notCalculate.Contains(item.Name))
{
maps.Add(new SecondColumnDictionary(item.Alias, item.Name, false, item.Sort, color: "title_color", isNumber: false, expand: true));
}
}
}
// 工作量 // 工作量
if (computeMode != ComputeMode.NotCalculate) if (computeMode != ComputeMode.NotCalculate)
...@@ -288,6 +309,35 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute ...@@ -288,6 +309,35 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
} }
/// <summary> /// <summary>
/// 补充内容 扩展字段,通过配置额外展示
/// </summary>
/// <param name="allot"></param>
/// <param name="dic"></param>
/// <param name="rows"></param>
public void RowsExpand(per_allot allot, List<SecondColumnDictionary> dic, List<Dictionary<string, object>> rows)
{
if (dic != null && dic.Any(w => w.Expand))
{
var employees = _perallotRepository.QueryEmployee(allot.ID);
foreach (var row in rows)
{
var number = row.GetString(nameof(ag_bodysource.WorkNumber));
Dictionary<string, object> pairs = new Dictionary<string, object>();
var emp = employees.FirstOrDefault(w => w.PersonnelNumber == number);
if (emp != null)
pairs = JsonHelper.Deserialize<Dictionary<string, object>>(JsonHelper.Serialize(emp));
foreach (var item in dic.Where(w => w.Expand))
{
var value = pairs.GetString(item.Key);
row.AddOrUpdate(item.Key, value);
}
}
}
}
/// <summary>
/// 加载已保存工作量数据,加载时区分:已提交和未提交 /// 加载已保存工作量数据,加载时区分:已提交和未提交
/// </summary> /// </summary>
/// <param name="allot"></param> /// <param name="allot"></param>
......
...@@ -16,6 +16,8 @@ namespace Performance.Services ...@@ -16,6 +16,8 @@ namespace Performance.Services
public class ReportGlobalService : IAutoInjection public class ReportGlobalService : IAutoInjection
{ {
private readonly ILogger logger; private readonly ILogger logger;
private readonly ComputeService _computeService;
private readonly PerforHospitalRepository _hospitalRepository;
private readonly PerforPerallotRepository perallotRepository; private readonly PerforPerallotRepository perallotRepository;
private readonly PerforReportglobalRepository reportglobalRepository; private readonly PerforReportglobalRepository reportglobalRepository;
private readonly PerforHisimportdataRepository hisimportdataRepository; private readonly PerforHisimportdataRepository hisimportdataRepository;
...@@ -31,6 +33,8 @@ public class ReportGlobalService : IAutoInjection ...@@ -31,6 +33,8 @@ public class ReportGlobalService : IAutoInjection
public ReportGlobalService( public ReportGlobalService(
ILogger<ReportGlobalService> logger, ILogger<ReportGlobalService> logger,
ComputeService computeService,
PerforHospitalRepository hospitalRepository,
PerforPerallotRepository perallotRepository, PerforPerallotRepository perallotRepository,
PerforReportglobalRepository reportglobalRepository, PerforReportglobalRepository reportglobalRepository,
PerforHisimportdataRepository hisimportdataRepository, PerforHisimportdataRepository hisimportdataRepository,
...@@ -46,6 +50,8 @@ PersonService personService ...@@ -46,6 +50,8 @@ PersonService personService
) )
{ {
this.logger = logger; this.logger = logger;
_computeService = computeService;
_hospitalRepository = hospitalRepository;
this.perallotRepository = perallotRepository; this.perallotRepository = perallotRepository;
this.reportglobalRepository = reportglobalRepository; this.reportglobalRepository = reportglobalRepository;
this.hisimportdataRepository = hisimportdataRepository; this.hisimportdataRepository = hisimportdataRepository;
...@@ -537,11 +543,11 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key) ...@@ -537,11 +543,11 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key)
public HandsonTable GetReportPersonTag(int hospitalId, int allotId) public HandsonTable GetReportPersonTag(int hospitalId, int allotId)
{ {
var result = new HandsonTable((int)SheetType.Unidentifiable, PersonTag.Select(t => t.Value).ToArray(), PersonTag.Select(t => new collect_permission var hos = _hospitalRepository.GetEntity(t => t.ID == hospitalId);
{ var type = (int)SheetType.Unidentifiable;
HeadName = t.Value, var cols = _computeService.CustomColumnHeaders(hos, "/result/all_employee").Select(t => t.Alias).ToArray();
Visible = 1 var permissions = _computeService.CustomColumnHeaders(hos,"/result/all_employee").Select(t => new collect_permission { HeadName = t.Alias, Visible = 1 }).ToList();
}).ToList()); var result = new HandsonTable(type, cols, permissions);
var pdata = perforPeremployeeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotId == allotId); var pdata = perforPeremployeeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotId == allotId);
var tdata = reportperformancepersontagsRepository.GetEntities(t => t.HospitalId == hospitalId)?.OrderBy(t => ConvertHelper.To<long>(t.PersonnelNumber)); var tdata = reportperformancepersontagsRepository.GetEntities(t => t.HospitalId == hospitalId)?.OrderBy(t => ConvertHelper.To<long>(t.PersonnelNumber));
...@@ -571,11 +577,14 @@ select new ...@@ -571,11 +577,14 @@ select new
if (data == null || !data.Any()) return result; if (data == null || !data.Any()) return result;
var userhospitals = perforUserhospitalRepository.GetEntities(w => w.HospitalID == hospitalId);
var users = new List<sys_user>(); var users = new List<sys_user>();
if (userhospitals != null && userhospitals.Any()) if (hos?.IsOwnerQuery == 1)
{ {
users = perforUserRepository.GetEntities(w => userhospitals.Select(w => w.UserID).Contains(w.ID) && w.IsDelete == 1) ?? new List<sys_user>(); var userhospitals = perforUserhospitalRepository.GetEntities(w => w.HospitalID == hospitalId);
if (userhospitals != null && userhospitals.Any())
{
users = perforUserRepository.GetEntities(w => userhospitals.Select(w => w.UserID).Contains(w.ID) && w.IsDelete == 1) ?? new List<sys_user>();
}
} }
List<HandsonRowData> rowDatas = new List<HandsonRowData>(); List<HandsonRowData> rowDatas = new List<HandsonRowData>();
int i = 0; int i = 0;
...@@ -584,34 +593,19 @@ select new ...@@ -584,34 +593,19 @@ select new
var json = JsonHelper.Serialize(item); var json = JsonHelper.Serialize(item);
var firstDic = JsonHelper.Deserialize<Dictionary<string, string>>(json); var firstDic = JsonHelper.Deserialize<Dictionary<string, string>>(json);
var cells = (from conf in PersonTag join fst in firstDic on conf.Key.ToUpper() equals fst.Key.ToUpper() select new HandsonCellData(conf.Value, fst.Value)).ToList(); var cells = (from conf in ComputeConfig.GetAllPersonnelTags(hos?.IsOwnerQuery == 1)
var user = users.FirstOrDefault(w => w.Login == item.PersonnelNumber && w.Department == item.AccountingUnit); join fst in firstDic on conf.Name.ToUpper() equals fst.Key.ToUpper()
if (user != null) select new HandsonCellData(conf.Alias, fst.Value)).ToList();
if (hos?.IsOwnerQuery == 1)
{ {
cells.Add(new HandsonCellData(PersonTag[nameof(PersonePassword.Password)], user.Password)); var password = users.FirstOrDefault(w => w.Login == item.PersonnelNumber && w.Department == item.AccountingUnit)?.Password ?? "";
cells.Add(new HandsonCellData("密码", password));
} }
rowDatas.Add(new HandsonRowData(i, cells)); rowDatas.Add(new HandsonRowData(i, cells));
i++; i++;
} }
//List<HandsonRowData> rowDatas2 = new List<HandsonRowData>();
//foreach (var item in rowDatas)
//{
// if (rowDatas2.Count == 0)
// rowDatas2.Add(item);
// var flag = true;
// foreach (var item2 in rowDatas2)
// {
// if (item.CellData.ToList()[1].Value.Equals(item2.CellData.ToList()[1].Value))
// flag = false;
// }
// if (flag)
// rowDatas2.Add(item);
//}
result.SetRowData(rowDatas, rowDatas != null); result.SetRowData(rowDatas, rowDatas != null);
var columns = new string[] { "员工工号", "姓名", "核算单元" }; var columns = new string[] { "员工工号", "姓名", "核算单元" };
...@@ -626,10 +620,12 @@ select new ...@@ -626,10 +620,12 @@ select new
public ApiResponse SaveReportPersonTag(int hospitalId, int allotId, int userId, SaveCollectData request) public ApiResponse SaveReportPersonTag(int hospitalId, int allotId, int userId, SaveCollectData request)
{ {
var hos = _hospitalRepository.GetEntity(t => t.ID == hospitalId);
var employees = perforPeremployeeRepository.GetEntities(t => t.AllotId == allotId); var employees = perforPeremployeeRepository.GetEntities(t => t.AllotId == allotId);
if (employees == null || !employees.Any()) throw new PerformanceException("人员字典中未保存数据"); if (employees == null || !employees.Any()) throw new PerformanceException("人员字典中未保存数据");
var dicData = CreateDataRow(hospitalId, request, PersonTag); var alias = ComputeConfig.GetAllPersonnelTags(hos?.IsOwnerQuery == 1);
var dicData = CreateDataRow(hospitalId, request, alias);
var tags = reportperformancepersontagsRepository.GetEntities(t => t.HospitalId == hospitalId); var tags = reportperformancepersontagsRepository.GetEntities(t => t.HospitalId == hospitalId);
var upEmployees = new List<per_employee>(); var upEmployees = new List<per_employee>();
...@@ -769,7 +765,9 @@ public HandsonTable GetReportTag(int hospitalId) ...@@ -769,7 +765,9 @@ public HandsonTable GetReportTag(int hospitalId)
public void SaveReportTag(int hospitalId, SaveCollectData request) public void SaveReportTag(int hospitalId, SaveCollectData request)
{ {
var dicData = CreateDataRow(hospitalId, request, PersonTag); var hos = _hospitalRepository.GetEntity(t => t.ID == hospitalId);
var alias = ComputeConfig.GetAllPersonnelTags(hos?.IsOwnerQuery == 1);
var dicData = CreateDataRow(hospitalId, request, alias);
List<report_performance_tags> report = new List<report_performance_tags>(); List<report_performance_tags> report = new List<report_performance_tags>();
foreach (var item in dicData) foreach (var item in dicData)
...@@ -787,29 +785,6 @@ public void SaveReportTag(int hospitalId, SaveCollectData request) ...@@ -787,29 +785,6 @@ public void SaveReportTag(int hospitalId, SaveCollectData request)
reportperformancetagsRepository.AddRange(report.ToArray()); reportperformancetagsRepository.AddRange(report.ToArray());
} }
private static Dictionary<string, string> PersonTag { get; } = new Dictionary<string, string>
{
//{nameof(report_performance_person_tags.UnitType), "核算单元类型"},
//{nameof(report_performance_person_tags.AccountingUnit), "科室"},
//{nameof(per_employee.Id), "Id"},
{nameof(per_employee.PersonnelNumber), "员工工号"},
{nameof(per_employee.DoctorName), "姓名"},
{nameof(per_employee.AccountingUnit), "核算单元"},
{nameof(PersonePassword.Password), "密码"},
{nameof(per_employee.JobCategory), "正式/临聘" },
{nameof(per_employee.Duty), "职务" },
{nameof(per_employee.JobTitle), "职称" },
{nameof(per_employee.AttendanceDay), "出勤天数" },
{nameof(per_employee.ReservedRatio), "预留比例" },
{nameof(per_employee.BankCard), "银行卡号" },
{nameof(per_employee.Remark), "备注" },
{ nameof(report_performance_person_tags.Tag1), "绩效发放情况"},
{nameof(report_performance_person_tags.Tag2), "当月绩效权重"},
{nameof(report_performance_person_tags.Tag3), "重点群体对比1"},
{nameof(report_performance_person_tags.Tag4), "重点群体对比2"},
{nameof(report_performance_person_tags.Tag5), "重点群体对比5"},
};
public static Dictionary<string, string> ReportTag { get; } = new Dictionary<string, string> public static Dictionary<string, string> ReportTag { get; } = new Dictionary<string, string>
{ {
...@@ -822,14 +797,14 @@ public void SaveReportTag(int hospitalId, SaveCollectData request) ...@@ -822,14 +797,14 @@ public void SaveReportTag(int hospitalId, SaveCollectData request)
{nameof(report_performance_tags.Tag5), "重点群体对比5"}, {nameof(report_performance_tags.Tag5), "重点群体对比5"},
}; };
private List<Dictionary<string, string>> CreateDataRow(int hospitalId, SaveCollectData request, Dictionary<string, string> config) private List<Dictionary<string, string>> CreateDataRow(int hospitalId, SaveCollectData request, List<cof_alias> alias)
{ {
List<Dictionary<string, string>> allData = new List<Dictionary<string, string>>(); List<Dictionary<string, string>> allData = new List<Dictionary<string, string>>();
for (int r = 0; r < request.Data.Length; r++) for (int r = 0; r < request.Data.Length; r++)
{ {
// 创建固定数据列 // 创建固定数据列
Dictionary<string, string> baseData = CreateBaseData(request, config, r); Dictionary<string, string> baseData = CreateBaseData(request, alias, r);
baseData.Add(nameof(cof_hrp_department.HospitalId), hospitalId.ToString()); baseData.Add(nameof(cof_hrp_department.HospitalId), hospitalId.ToString());
allData.Add(baseData); allData.Add(baseData);
...@@ -837,18 +812,18 @@ public void SaveReportTag(int hospitalId, SaveCollectData request) ...@@ -837,18 +812,18 @@ public void SaveReportTag(int hospitalId, SaveCollectData request)
return allData; return allData;
} }
private Dictionary<string, string> CreateBaseData(SaveCollectData request, Dictionary<string, string> config, int rownumber) private Dictionary<string, string> CreateBaseData(SaveCollectData request, List<cof_alias> alias, int rownumber)
{ {
Dictionary<string, string> result = new Dictionary<string, string>(); Dictionary<string, string> result = new Dictionary<string, string>();
for (int c = 0; c < request.ColHeaders.Length; c++) for (int c = 0; c < request.ColHeaders.Length; c++)
{ {
var header = request.ColHeaders[c]; var header = request.ColHeaders[c];
var first = config.FirstOrDefault(w => w.Value == header); var first = alias.FirstOrDefault(w => w.Alias == header);
if (!default(KeyValuePair<string, string>).Equals(first) if (!default(KeyValuePair<string, string>).Equals(first)
&& !result.ContainsKey(header) && !result.ContainsKey(header)
&& request.Data[rownumber].Length > c) && request.Data[rownumber].Length > c)
{ {
result.Add(first.Key, request.Data[rownumber][c]); result.Add(first.Name, request.Data[rownumber][c]);
} }
} }
......
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