Commit ff53294f by 钟博

HRP人员科室hands

parent 59ce6d53
......@@ -535,5 +535,44 @@ public ApiResponse WorkHeader([CustomizeValidator(RuleSet = "Select"), FromBody]
var list = _configService.WorkHeader(request.AllotID);
return new ApiResponse(ResponseType.OK, "ok", list);
}
#region HRP人员科室
/// <summary>
/// 获取HRP人员科室
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("hrpdepthands/{hospitalId}/allot/{allotId}")]
[HttpPost]
public ApiResponse GetHrpDeptHands([FromRoute] int hospitalId, int allotId)
{
if (hospitalId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "HospitalId无效");
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
var relust = _configService.GetHrpDeptHands(hospitalId, allotId);
return new ApiResponse(ResponseType.OK, relust);
}
/// <summary>
/// 保存HRP人员科室
/// </summary>
/// <param name=""></param>
/// <returns></returns>
[Route("savehrpdept/{hospitalId}/allot/{allotId}")]
[HttpPost]
public ApiResponse SaveHrpDept(int hospitalId, int allotId, [FromBody] SaveCollectData request)
{
if (hospitalId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "HospitalId无效");
if (allotId <= 0)
return new ApiResponse(ResponseType.Fail, "参数错误", "allotid无效");
return new ApiResponse(ResponseType.OK);
}
#endregion
}
}
\ No newline at end of file
......@@ -103,6 +103,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 工龄对应绩效系数配置 </summary>
public virtual DbSet<cof_workyear> cof_workyear { get; set; }
/// <summary> HRP人员科室 </summary>
public virtual DbSet<cof_hrp_department> cof_hrp_department { get; set; }
/// <summary> </summary>
public virtual DbSet<collect_data> collect_data { get; set; }
......
//-----------------------------------------------------------------------
// <copyright file=" cof_hrp_department.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Performance.EntityModels
{
/// <summary>
///
/// </summary>
[Table("cof_hrp_department")]
public class cof_hrp_department
{
/// <summary>
///
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
///
/// </summary>
public int HospitalId { get; set; }
/// <summary>
///
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// HRP人员科室
/// </summary>
public string HRPDepartment { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Performance.EntityModels;
namespace Performance.Repository.Repository
{
public partial class PerforCofHrpDeptRepository:PerforRepository<cof_hrp_department>
{
public PerforCofHrpDeptRepository(PerformanceDbContext context) : base(context)
{
}
}
}
......@@ -9,6 +9,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Performance.Repository.Repository;
namespace Performance.Services
{
......@@ -27,6 +28,7 @@ public class ConfigService : IAutoInjection
private PerforCofdepttypeRepository perforCofdepttypeRepository;
private PerforPerapramountRepository perapramountRepository;
//private PerforCofcmiRepository perforCofcmiRepository;
private PerforCofHrpDeptRepository perforCofHrpDeptRepository;
private PersonService personService;
private LogManageService logManageService;
private ILogger<ConfigService> logger;
......@@ -43,6 +45,7 @@ public class ConfigService : IAutoInjection
PerforCofdepttypeRepository perforCofdepttypeRepository,
PerforPerapramountRepository perapramountRepository,
//PerforCofcmiRepository perforCofcmiRepository,
PerforCofHrpDeptRepository perforCofHrpDeptRepository,
PersonService personService,
LogManageService logManageService,
ILogger<ConfigService> logger)
......@@ -59,6 +62,7 @@ public class ConfigService : IAutoInjection
this.perforCofdepttypeRepository = perforCofdepttypeRepository;
this.perapramountRepository = perapramountRepository;
//this.perforCofcmiRepository = perforCofcmiRepository;
this.perforCofHrpDeptRepository = perforCofHrpDeptRepository;
this.personService = personService;
this.logManageService = logManageService;
this.logger = logger;
......@@ -834,6 +838,41 @@ private void CopyAprData(int prevAllotId, int allotId)
}
}
public HandsonTable GetHrpDeptHands(int HospitalId,int AllotId)
{
var result = new HandsonTable((int)SheetType.Unidentifiable, HrpDept.Select(t => t.Value).ToArray(), HrpDept.Select(t => new collect_permission
{
HeadName = t.Value,
Visible = 1
}).ToList());
var data = perforCofHrpDeptRepository.GetEntities(t => t.HospitalId == HospitalId && t.AllotId == AllotId);
if (data == null)
return result;
List<HandsonRowData> rowDatas = new List<HandsonRowData>();
int i = 1;
foreach (var item in data)
{
var json = JsonHelper.Serialize(item);
var firstDic = JsonHelper.Deserialize<Dictionary<string, string>>(json);
var cells = (from conf in HrpDept join fst in firstDic on conf.Key.ToUpper() equals fst.Key.ToUpper() select new HandsonCellData(conf.Value, fst.Value)).ToList();
rowDatas.Add(new HandsonRowData(i, cells));
i++;
}
result.SetRowData(rowDatas, rowDatas != null);
return result;
}
public static Dictionary<string, string> HrpDept { get; } = new Dictionary<string, string>
{
{nameof(cof_hrp_department.HRPDepartment), "HRP人员科室"},
{nameof(cof_hrp_department.AccountingUnit), "核算单元"},
};
///// <summary>
///// CMI值
///// </summary>
......
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