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
...@@ -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>
......
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