Commit 2a29ee0f by 纪旭 韦

Merge branch 'feature/人员字典修改' into feature/自动执行“加载上月”

parents 81f68b30 cf4715dd
...@@ -128,16 +128,17 @@ public ApiResponse Import(int hospitalId, [FromForm] IFormCollection form) ...@@ -128,16 +128,17 @@ public ApiResponse Import(int hospitalId, [FromForm] IFormCollection form)
/// 获取人员标签配置 /// 获取人员标签配置
/// </summary> /// </summary>
/// <param name="hospitalId"></param> /// <param name="hospitalId"></param>
/// <param name="allotId"></param>
/// <returns></returns> /// <returns></returns>
[Route("ReportPersonTag")] [Route("ReportPersonTag")]
[HttpPost] [HttpPost]
public ApiResponse ReportPersonTag(int hospitalId) public ApiResponse ReportPersonTag(int hospitalId,int allotId)
{ {
if (hospitalId<=0) if (hospitalId<=0)
{ {
return new ApiResponse(ResponseType.Fail,"参数错误", "hospitalId无效"); return new ApiResponse(ResponseType.Fail,"参数错误", "hospitalId无效");
} }
var relust = reportGlobalService.GetReportPersonTag(hospitalId); var relust = reportGlobalService.GetReportPersonTag(hospitalId,allotId);
return new ApiResponse(ResponseType.OK, relust); return new ApiResponse(ResponseType.OK, relust);
} }
......
...@@ -1792,11 +1792,12 @@ ...@@ -1792,11 +1792,12 @@
<param name="form"></param> <param name="form"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ReportGlobalController.ReportPersonTag(System.Int32)"> <member name="M:Performance.Api.Controllers.ReportGlobalController.ReportPersonTag(System.Int32,System.Int32)">
<summary> <summary>
获取人员标签配置 获取人员标签配置
</summary> </summary>
<param name="hospitalId"></param> <param name="hospitalId"></param>
<param name="allotId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ReportGlobalController.SaveReportPersonTag(System.Int32,Performance.DtoModels.SaveCollectData)"> <member name="M:Performance.Api.Controllers.ReportGlobalController.SaveReportPersonTag(System.Int32,Performance.DtoModels.SaveCollectData)">
......
...@@ -24,6 +24,7 @@ public class ReportGlobalService : IAutoInjection ...@@ -24,6 +24,7 @@ public class ReportGlobalService : IAutoInjection
private readonly PerforHisimportbaiscnormRepository hisimportbaiscnormRepository; private readonly PerforHisimportbaiscnormRepository hisimportbaiscnormRepository;
private readonly PerforReportperformancetagsRepository reportperformancetagsRepository; private readonly PerforReportperformancetagsRepository reportperformancetagsRepository;
private readonly PerforReportperformancepersontagsRepository reportperformancepersontagsRepository; private readonly PerforReportperformancepersontagsRepository reportperformancepersontagsRepository;
private readonly PerforPeremployeeRepository perforPeremployeeRepository;
public ReportGlobalService( public ReportGlobalService(
ILogger<ReportGlobalService> logger, ILogger<ReportGlobalService> logger,
...@@ -34,7 +35,8 @@ public class ReportGlobalService : IAutoInjection ...@@ -34,7 +35,8 @@ public class ReportGlobalService : IAutoInjection
PerforHisimportclinicRepository hisimportclinicRepository, PerforHisimportclinicRepository hisimportclinicRepository,
PerforHisimportbaiscnormRepository hisimportbaiscnormRepository, PerforHisimportbaiscnormRepository hisimportbaiscnormRepository,
PerforReportperformancetagsRepository reportperformancetagsRepository, PerforReportperformancetagsRepository reportperformancetagsRepository,
PerforReportperformancepersontagsRepository reportperformancepersontagsRepository PerforReportperformancepersontagsRepository reportperformancepersontagsRepository,
PerforPeremployeeRepository perforPeremployeeRepository
) )
{ {
this.logger = logger; this.logger = logger;
...@@ -46,6 +48,7 @@ PerforReportperformancepersontagsRepository reportperformancepersontagsRepositor ...@@ -46,6 +48,7 @@ PerforReportperformancepersontagsRepository reportperformancepersontagsRepositor
this.hisimportbaiscnormRepository = hisimportbaiscnormRepository; this.hisimportbaiscnormRepository = hisimportbaiscnormRepository;
this.reportperformancetagsRepository = reportperformancetagsRepository; this.reportperformancetagsRepository = reportperformancetagsRepository;
this.reportperformancepersontagsRepository = reportperformancepersontagsRepository; this.reportperformancepersontagsRepository = reportperformancepersontagsRepository;
this.perforPeremployeeRepository = perforPeremployeeRepository;
} }
#region Report_Global #region Report_Global
...@@ -523,7 +526,7 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key) ...@@ -523,7 +526,7 @@ private T GetCellValue<T>(IRow row, List<string> columns, string key)
#region 人员、科室标签配置 #region 人员、科室标签配置
public HandsonTable GetReportPersonTag(int hospitalId) 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 result = new HandsonTable((int)SheetType.Unidentifiable, PersonTag.Select(t => t.Value).ToArray(), PersonTag.Select(t => new collect_permission
{ {
...@@ -531,8 +534,28 @@ public HandsonTable GetReportPersonTag(int hospitalId) ...@@ -531,8 +534,28 @@ public HandsonTable GetReportPersonTag(int hospitalId)
Visible = 1 Visible = 1
}).ToList()); }).ToList());
var data = reportperformancepersontagsRepository.GetEntities(t => t.HospitalId == hospitalId)?.OrderBy(t => ConvertHelper.To<long>(t.PersonnelNumber)); var pdata = perforPeremployeeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotId == allotId).Select(t=>new { t.UnitType,t.AccountingUnit,t.PersonnelNumber,t.DoctorName });
if (data == null) return result; var tdata = reportperformancepersontagsRepository.GetEntities(t => t.HospitalId == hospitalId)?.OrderBy(t => ConvertHelper.To<long>(t.PersonnelNumber));
var data = (from t1 in pdata
join t2 in tdata
on t1.PersonnelNumber equals t2.PersonnelNumber into temp
from t in temp.DefaultIfEmpty()
select new report_performance_person_tags
{
UnitType = t1.UnitType,
AccountingUnit = t1.AccountingUnit,
PersonnelNumber = t1.PersonnelNumber,
PersonnelName = t1.DoctorName,
Tag1 = t?.Tag1,
Tag2 = t?.Tag2,
Tag3 = t?.Tag3,
Tag4 = t?.Tag4,
Tag5 = t?.Tag5,
}).Distinct()?.ToList();
if (data == null || !data.Any()) return result;
List<HandsonRowData> rowDatas = new List<HandsonRowData>(); List<HandsonRowData> rowDatas = new List<HandsonRowData>();
int i = 0; int i = 0;
...@@ -547,24 +570,27 @@ public HandsonTable GetReportPersonTag(int hospitalId) ...@@ -547,24 +570,27 @@ public HandsonTable GetReportPersonTag(int hospitalId)
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(rowDatas2, rowDatas2 != null); //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);
return result; return result;
} }
...@@ -637,8 +663,8 @@ public void SaveReportTag(int hospitalId, SaveCollectData request) ...@@ -637,8 +663,8 @@ public void SaveReportTag(int hospitalId, SaveCollectData request)
private static Dictionary<string, string> PersonTag { get; } = new Dictionary<string, string> private static Dictionary<string, string> PersonTag { get; } = new Dictionary<string, string>
{ {
//{nameof(report_performance_person_tags.UnitType), "核算单元类型"}, {nameof(report_performance_person_tags.UnitType), "核算单元类型"},
//{nameof(report_performance_person_tags.AccountingUnit), "科室"}, {nameof(report_performance_person_tags.AccountingUnit), "科室"},
{nameof(report_performance_person_tags.PersonnelNumber), "工号"}, {nameof(report_performance_person_tags.PersonnelNumber), "工号"},
{nameof(report_performance_person_tags.PersonnelName), "姓名"}, {nameof(report_performance_person_tags.PersonnelName), "姓名"},
{nameof(report_performance_person_tags.Tag1), "绩效发放情况"}, {nameof(report_performance_person_tags.Tag1), "绩效发放情况"},
......
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