Commit 18e7c8b9 by ruyun.zhang@suvalue.com

Merge branch 'feature/发放表视图' into develop

parents f94a93c7 b03bdaad
...@@ -386,7 +386,7 @@ public ApiResponse<res_baiscnorm> EditHospitalAvg([FromBody] ComputerAvgRequest ...@@ -386,7 +386,7 @@ public ApiResponse<res_baiscnorm> EditHospitalAvg([FromBody] ComputerAvgRequest
[HttpPost] [HttpPost]
public ApiResponse CustomColumnHeaders([FromBody] ComputerAliasRequest request) public ApiResponse CustomColumnHeaders([FromBody] ComputerAliasRequest request)
{ {
var result = _computeService.CustomColumnHeaders(request); var result = _computeService.CustomColumnHeaders(request.HospitalId, request.Route);
return new ApiResponse(ResponseType.OK, result); return new ApiResponse(ResponseType.OK, result);
} }
...@@ -449,7 +449,7 @@ public IActionResult AllComputeDownload(int allotId) ...@@ -449,7 +449,7 @@ public IActionResult AllComputeDownload(int allotId)
var list = _computeService.AllCompute(allotId, allot.HospitalId, isShowManage); var list = _computeService.AllCompute(allotId, allot.HospitalId, isShowManage);
var filepath = downloadService.AllComputerReport(allotId, list, true,"全院绩效发放"); var filepath = downloadService.AllComputerReport(allotId, list, true, "全院绩效发放");
var memoryStream = new MemoryStream(); var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open)) using (var stream = new FileStream(filepath, FileMode.Open))
...@@ -481,7 +481,7 @@ public IActionResult AllComputeByPMDownLoad(int allotId) ...@@ -481,7 +481,7 @@ public IActionResult AllComputeByPMDownLoad(int allotId)
var result = _computeService.ComputerGroupBy(list); var result = _computeService.ComputerGroupBy(list);
var filepath = downloadService.AllComputerReport(allotId, result, false,"财务全院绩效"); var filepath = downloadService.AllComputerReport(allotId, result, false, "财务全院绩效");
var memoryStream = new MemoryStream(); var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open)) using (var stream = new FileStream(filepath, FileMode.Open))
...@@ -495,5 +495,148 @@ public IActionResult AllComputeByPMDownLoad(int allotId) ...@@ -495,5 +495,148 @@ public IActionResult AllComputeByPMDownLoad(int allotId)
return File(memoryStream, memi, Path.GetFileName(fileInfo.Name)); return File(memoryStream, memi, Path.GetFileName(fileInfo.Name));
} }
#endregion #endregion
#region 发放表视图、下载
/// <summary>
/// 全院核算绩效发放(视图)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("gethosdataView")]
[HttpPost]
public ApiResponse GethosdataView([FromBody] ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetAllComputeView(allot.HospitalId, request.AllotId, "view_allot_sign_dept");
return new ApiResponse(ResponseType.OK, "ok", list);
}
/// <summary>
/// 全院核算绩效发放(视图) 下载
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("gethosdataView/download/{allotId}")]
[HttpPost]
public IActionResult GethosdataView(int allotId)
{
var allot = _allotService.GetAllot(allotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetAllComputeView(allot.HospitalId, allotId, "view_allot_sign_dept");
var filepath = downloadService.AllComputerViewReport(allotId, list, "/result/print/compute", "全院核算绩效发放");
var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open))
{
stream.CopyToAsync(memoryStream).Wait();
}
memoryStream.Seek(0, SeekOrigin.Begin);
var provider = new FileExtensionContentTypeProvider();
FileInfo fileInfo = new FileInfo(filepath);
var memi = provider.Mappings[".xlsx"];
return File(memoryStream, memi, Path.GetFileName(fileInfo.Name));
}
/// <summary>
/// 获取全院绩效列表(视图)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("allcomputeView")]
[HttpPost]
public ApiResponse AllComputeView([FromBody] ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetAllComputeView(allot.HospitalId, request.AllotId, "view_allot_sign_emp");
return new ApiResponse(ResponseType.OK, "ok", list);
}
/// <summary>
/// 下载全院绩效列表
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("allcomputeView/download/{allotId}")]
[HttpPost]
public IActionResult AllComputeViewDownload(int allotId)
{
var allot = _allotService.GetAllot(allotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var list = _computeService.GetAllComputeView(allot.HospitalId, allotId, "view_allot_sign_emp");
var filepath = downloadService.AllComputerViewReport(allotId, list, "/result/compute", "全院绩效发放");
var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open))
{
stream.CopyToAsync(memoryStream).Wait();
}
memoryStream.Seek(0, SeekOrigin.Begin);
var provider = new FileExtensionContentTypeProvider();
FileInfo fileInfo = new FileInfo(filepath);
var memi = provider.Mappings[".xlsx"];
return File(memoryStream, memi, Path.GetFileName(fileInfo.Name));
}
/// <summary>
/// 获取全院绩效列表(人事科)
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Route("allcomputeView/personnel")]
[HttpPost]
public ApiResponse AllComputeViewByPM([FromBody] ComputerRequest request)
{
var allot = _allotService.GetAllot(request.AllotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var result = _computeService.GetAllComputeView(allot.HospitalId, request.AllotId, "view_allot_sign_emp_finance");
//var result = _computeService.ComputerGroupBy(list);
return new ApiResponse(ResponseType.OK, "ok", result);
}
/// <summary>
/// 下载全院绩效列表(人事科)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[Route("allcomputeView/personnel/download/{allotId}")]
[HttpPost]
public IActionResult AllComputeByPMViewDownLoad(int allotId)
{
var allot = _allotService.GetAllot(allotId);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在");
var result = _computeService.GetAllComputeView(allot.HospitalId, allotId, "view_allot_sign_emp_finance");
var filepath = downloadService.AllComputerViewReport(allotId, result, "/result/wholehospital", "财务全院绩效发放");
var memoryStream = new MemoryStream();
using (var stream = new FileStream(filepath, FileMode.Open))
{
stream.CopyToAsync(memoryStream).Wait();
}
memoryStream.Seek(0, SeekOrigin.Begin);
var provider = new FileExtensionContentTypeProvider();
FileInfo fileInfo = new FileInfo(filepath);
var memi = provider.Mappings[".xlsx"];
return File(memoryStream, memi, Path.GetFileName(fileInfo.Name));
#endregion
}
} }
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"AppConnection": { "AppConnection": {
//"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", //"PerformanceConnectionString": "server=112.124.13.17;database=db_performance;uid=suvalue;pwd=suvalue2016;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"PerformanceConnectionString": "server=192.168.18.166;database=db_performance_screen;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;", "PerformanceConnectionString": "server=192.168.18.166;database=db_test_zhangye;uid=root;pwd=1234qwer;pooling=true;charset=utf8;convert zero datetime=true;port=3306;connection timeout=120;max pool size=512;allow user variables=true;",
"HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;", "HangfireConnectionString": "server=192.168.18.166;database=db_hangfire;uid=root;pwd=1234qwer;port=3306;allow user variables=true;",
"RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2" "RedisConnectionString": "116.62.245.55:6379,defaultDatabase=2"
}, },
......
...@@ -575,6 +575,48 @@ ...@@ -575,6 +575,48 @@
<param name="allotId"></param> <param name="allotId"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ComputeController.GethosdataView(Performance.DtoModels.ComputerRequest)">
<summary>
全院核算绩效发放(视图)
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.GethosdataView(System.Int32)">
<summary>
全院核算绩效发放(视图) 下载
</summary>
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.AllComputeView(Performance.DtoModels.ComputerRequest)">
<summary>
获取全院绩效列表(视图)
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.AllComputeViewDownload(System.Int32)">
<summary>
下载全院绩效列表
</summary>
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.AllComputeViewByPM(Performance.DtoModels.ComputerRequest)">
<summary>
获取全院绩效列表(人事科)
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ComputeController.AllComputeByPMViewDownLoad(System.Int32)">
<summary>
下载全院绩效列表(人事科)
</summary>
<param name="allotId"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)"> <member name="M:Performance.Api.Controllers.ConfigController.GetDrugtypeList(Performance.DtoModels.DrugpropRequest)">
<summary> <summary>
获取 药占比类型信息列表 获取 药占比类型信息列表
......
...@@ -7620,5 +7620,20 @@ ...@@ -7620,5 +7620,20 @@
不公示其他绩效 不公示其他绩效
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.view_allot_result.RealPerformance">
<summary>
实发绩效
</summary>
</member>
<member name="P:Performance.DtoModels.view_allot_result.ShouldGiveFee">
<summary>
应发小计
</summary>
</member>
<member name="P:Performance.DtoModels.view_allot_result.ReservedRatioFee">
<summary>
预留金额
</summary>
</member>
</members> </members>
</doc> </doc>
...@@ -43,6 +43,25 @@ public class view_allot_result ...@@ -43,6 +43,25 @@ public class view_allot_result
/// 不公示其他绩效 /// 不公示其他绩效
/// </summary> /// </summary>
public decimal? HideOtherPerfor { get; set; } public decimal? HideOtherPerfor { get; set; }
/// <summary>
/// 实发绩效
/// </summary>
public decimal? RealPerformance { get; set; } public decimal? RealPerformance { get; set; }
/// <summary>
/// 应发小计
/// </summary>
public decimal? ShouldGiveFee { get; set; }
/// <summary>
/// 预留金额
/// </summary>
public decimal? ReservedRatioFee { get; set; }
public string Emp_UnitType { get; set; }
public string Emp_AccountingUnit { get; set; }
public string BankCard { get; set; }
public string JobCategory { get; set; }
public string Duty { get; set; }
public string TitlePosition { get; set; }
} }
} }
namespace Performance.DtoModels
{
public class view_allot_sign_dept
{
public int HospitalId { get; set; }
public int AllotID { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public int UnitName { get; set; }
public int AccountingUnit { get; set; }
public int PerforFee { get; set; }
public int WorkloadFee { get; set; }
public int AssessBeforeOtherFee { get; set; }
public int PerforTotal { get; set; }
public int ScoringAverage { get; set; }
public int Extra { get; set; }
public int MedicineExtra { get; set; }
public int MaterialsExtra { get; set; }
public int AssessLaterOtherFee { get; set; }
public int AssessLaterPerforTotal { get; set; }
public int AdjustFactor { get; set; }
public int AdjustLaterOtherFee { get; set; }
public int AprPerforAmount { get; set; }
public int HideAprOtherPerforAmount { get; set; }
public int AssessLaterManagementFee { get; set; }
public int RealGiveFee { get; set; }
}
}
namespace Performance.DtoModels
{
public class view_allot_sign_emp
{
public int HospitalID { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public int Source { get; set; }
public int AllotId { get; set; }
public int SecondId { get; set; }
public int States { get; set; }
public string UnitType { get; set; }
public string AccountingUnit { get; set; }
public string IsShowManage { get; set; }
public string EmployeeName { get; set; }
public string JobNumber { get; set; }
public string JobTitle { get; set; }
public string Emp_UnitType { get; set; }
public string Emp_AccountingUnit { get; set; }
public string BankCard { get; set; }
public string Batch { get; set; }
public string JobCategory { get; set; }
public string Duty { get; set; }
public string TitlePosition { get; set; }
public string PerforSumFee { get; set; }
public decimal PerforManagementFee { get; set; }
public decimal NightWorkPerfor { get; set; }
public decimal AdjustLaterOtherFee { get; set; }
public decimal OtherPerfor { get; set; }
public decimal HideOtherPerfor { get; set; }
public decimal ShouldGiveFee { get; set; }
public decimal ReservedRatioFee { get; set; }
public decimal RealGiveFee { get; set; }
}
}
...@@ -388,5 +388,12 @@ public List<view_allot_result> GetOwnerPerformance(List<int> hospitalId, string ...@@ -388,5 +388,12 @@ public List<view_allot_result> GetOwnerPerformance(List<int> hospitalId, string
string sql = "SELECT * FROM view_allot_result WHERE HospitalID IN @HospitalID AND JobNumber=@JobNumber"; string sql = "SELECT * FROM view_allot_result WHERE HospitalID IN @HospitalID AND JobNumber=@JobNumber";
return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber })?.ToList(); return DapperQuery<view_allot_result>(sql, new { HospitalID = hospitalId, JobNumber = jobNumber })?.ToList();
} }
public List<dynamic> QueryCompute(int allotId, string viewName)
{
var sql = $@"SELECT * FROM {viewName} WHERE AllotId = @AllotId; ";
return DapperQuery<dynamic>(sql, new { allotId })?.ToList();
}
} }
} }
...@@ -36,6 +36,7 @@ public class ComputeService : IAutoInjection ...@@ -36,6 +36,7 @@ public class ComputeService : IAutoInjection
private readonly PerforPerapramounthideRepository _hideRepository; private readonly PerforPerapramounthideRepository _hideRepository;
private readonly PerforCofworkitemRepository cofworkitemRepository; private readonly PerforCofworkitemRepository cofworkitemRepository;
private readonly PerforCofaliasRepository cofaliasRepository; private readonly PerforCofaliasRepository cofaliasRepository;
private readonly PerforReportRepository reportRepository;
public ComputeService( public ComputeService(
PerforResaccountRepository perforResaccountRepository, PerforResaccountRepository perforResaccountRepository,
...@@ -56,7 +57,8 @@ public class ComputeService : IAutoInjection ...@@ -56,7 +57,8 @@ public class ComputeService : IAutoInjection
PerforPeremployeeRepository perforPeremployeeRepository, PerforPeremployeeRepository perforPeremployeeRepository,
PerforPerapramounthideRepository hideRepository, PerforPerapramounthideRepository hideRepository,
PerforCofworkitemRepository cofworkitemRepository, PerforCofworkitemRepository cofworkitemRepository,
PerforCofaliasRepository cofaliasRepository) PerforCofaliasRepository cofaliasRepository,
PerforReportRepository reportRepository)
{ {
this.perforResaccountRepository = perforResaccountRepository; this.perforResaccountRepository = perforResaccountRepository;
this._perforPerSheetRepository = perforPerSheetRepository; this._perforPerSheetRepository = perforPerSheetRepository;
...@@ -77,6 +79,7 @@ public class ComputeService : IAutoInjection ...@@ -77,6 +79,7 @@ public class ComputeService : IAutoInjection
_hideRepository = hideRepository; _hideRepository = hideRepository;
this.cofworkitemRepository = cofworkitemRepository; this.cofworkitemRepository = cofworkitemRepository;
this.cofaliasRepository = cofaliasRepository; this.cofaliasRepository = cofaliasRepository;
this.reportRepository = reportRepository;
} }
public int IsShowManage(int allotId) public int IsShowManage(int allotId)
...@@ -1987,11 +1990,48 @@ private decimal GetDecimal(decimal? value, decimal _ = 0) ...@@ -1987,11 +1990,48 @@ private decimal GetDecimal(decimal? value, decimal _ = 0)
return Math.Round(value.Value, decimals, MidpointRounding.AwayFromZero); return Math.Round(value.Value, decimals, MidpointRounding.AwayFromZero);
} }
public List<cof_alias> CustomColumnHeaders(ComputerAliasRequest request) /// <summary>
/// 发放表自定义列头
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public List<cof_alias> CustomColumnHeaders(int hospitalId, string route)
{ {
var result = cofaliasRepository.GetEntities(t => t.HospitalId == request.HospitalId && t.Route == request.Route && t.States == 1); var alias = cofaliasRepository.GetEntities(t => t.HospitalId == hospitalId && t.Route.Equals(route, StringComparison.OrdinalIgnoreCase));
if (result == null || !result.Any()) return new List<cof_alias>();
return result; var pairs = new Dictionary<string, List<cof_alias>>
{
{ "/result/compute" , ComputeConfig.AllComputeView },
{ "/result/wholehospital" , ComputeConfig.AllComputePersonView },
{ "/result/print/compute" , ComputeConfig.AllComputeDepartmentView },
};
var init = pairs.ContainsKey(route.ToLower()) ? pairs[route.ToLower()] : new List<cof_alias>();
foreach (var item in init)
{
item.HospitalId = hospitalId;
item.Route = route;
item.OriginalName = item.Alias;
}
if (alias != null && alias.Count > 0)
{
foreach (var item in alias)
{
var x = init.FirstOrDefault(w => w.Name.Equals(item.Name, StringComparison.OrdinalIgnoreCase));
if (x == null)
{
init.Add(item);
}
else
{
x.HospitalId = hospitalId;
x.Route = route;
x.Alias = item.Alias;
x.States = item.States;
}
}
}
return init;
} }
public bool Batch(BatchRequest request) public bool Batch(BatchRequest request)
...@@ -2017,5 +2057,77 @@ public bool Batch(BatchRequest request) ...@@ -2017,5 +2057,77 @@ public bool Batch(BatchRequest request)
}); });
return perforPerbatchRepository.AddRange(data.ToArray()); return perforPerbatchRepository.AddRange(data.ToArray());
} }
public List<dynamic> GetAllComputeView(int hospitalId, int AllotId, string viewName)
{
return reportRepository.QueryCompute(AllotId, viewName);
}
}
public class ComputeConfig
{
public static List<cof_alias> AllComputeView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "来源", Name = nameof(view_allot_sign_emp.Source), States = 1},
new cof_alias{ Alias = "科室类别", Name = nameof(view_allot_sign_emp.UnitType), States = 1},
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_emp.AccountingUnit), States = 1},
new cof_alias{ Alias = "员工号", Name = nameof(view_allot_sign_emp.JobNumber), States = 1},
new cof_alias{ Alias = "人员姓名", Name = nameof(view_allot_sign_emp.EmployeeName), States = 1},
new cof_alias{ Alias = "职务", Name = nameof(view_allot_sign_emp.JobTitle), States = 1},
new cof_alias{ Alias = "批次", Name = nameof(view_allot_sign_emp.Batch), States = 1},
new cof_alias{ Alias = "银行卡号", Name = nameof(view_allot_sign_emp.BankCard), States = 1},
new cof_alias{ Alias = "正式/临聘", Name = nameof(view_allot_sign_emp.JobCategory), States = 1},
new cof_alias{ Alias = "职务", Name = nameof(view_allot_sign_emp.Duty), States = 1},
new cof_alias{ Alias = "职称", Name = nameof(view_allot_sign_emp.TitlePosition), States = 1},
new cof_alias{ Alias = "调节后业绩绩效", Name = nameof(view_allot_sign_emp.PerforSumFee), States = 1},
new cof_alias{ Alias = "调节后实发管理绩效", Name = nameof(view_allot_sign_emp.PerforManagementFee), States = 1},
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_emp.AdjustLaterOtherFee), States = 1},
new cof_alias{ Alias = "夜班费", Name = nameof(view_allot_sign_emp.NightWorkPerfor), States = 1},
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_emp.OtherPerfor), States = 1},
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_emp.HideOtherPerfor), States = 1},
new cof_alias{ Alias = "应发小计", Name = nameof(view_allot_sign_emp.ShouldGiveFee), States = 1},
new cof_alias{ Alias = "预留绩效", Name = nameof(view_allot_sign_emp.ReservedRatioFee), States = 1},
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_emp.RealGiveFee), States = 1},
};
public static List<cof_alias> AllComputePersonView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "科室类别", Name = nameof(view_allot_sign_emp.UnitType), States = 1},
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_emp.AccountingUnit), States = 1},
new cof_alias{ Alias = "员工号", Name = nameof(view_allot_sign_emp.JobNumber), States = 1},
new cof_alias{ Alias = "人员姓名", Name = nameof(view_allot_sign_emp.EmployeeName), States = 1},
new cof_alias{ Alias = "调节后业绩绩效", Name = nameof(view_allot_sign_emp.PerforSumFee), States = 1},
new cof_alias{ Alias = "调节后实发管理绩效", Name = nameof(view_allot_sign_emp.PerforManagementFee), States = 1},
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_emp.AdjustLaterOtherFee), States = 1},
new cof_alias{ Alias = "夜班费", Name = nameof(view_allot_sign_emp.NightWorkPerfor), States = 1},
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_emp.OtherPerfor), States = 1},
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_emp.HideOtherPerfor), States = 1},
new cof_alias{ Alias = "应发小计", Name = nameof(view_allot_sign_emp.ShouldGiveFee), States = 1},
new cof_alias{ Alias = "预留绩效", Name = nameof(view_allot_sign_emp.ReservedRatioFee), States = 1},
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_emp.RealGiveFee), States = 1},
};
public static List<cof_alias> AllComputeDepartmentView { get; } = new List<cof_alias>
{
new cof_alias{ Alias = "核算群体", Name = nameof(view_allot_sign_dept.UnitName), States = 1},
new cof_alias{ Alias = "核算单元", Name = nameof(view_allot_sign_dept.AccountingUnit), States = 1},
new cof_alias{ Alias = "业绩绩效", Name = nameof(view_allot_sign_dept.PerforFee), States = 1},
new cof_alias{ Alias = "工作量绩效", Name = nameof(view_allot_sign_dept.WorkloadFee), States = 1},
new cof_alias{ Alias = "考核前其他绩效", Name = nameof(view_allot_sign_dept.AssessBeforeOtherFee), States = 1},
new cof_alias{ Alias = "考核前绩效合计", Name = nameof(view_allot_sign_dept.PerforTotal), States = 1},
new cof_alias{ Alias = "科室考核得分", Name = nameof(view_allot_sign_dept.ScoringAverage), States = 1},
new cof_alias{ Alias = "药占比奖罚", Name = nameof(view_allot_sign_dept.MedicineExtra), States = 1},
new cof_alias{ Alias = "材料占比奖罚", Name = nameof(view_allot_sign_dept.MaterialsExtra), States = 1},
new cof_alias{ Alias = "医院奖罚", Name = nameof(view_allot_sign_dept.Extra), States = 1},
new cof_alias{ Alias = "考核后其他绩效", Name = nameof(view_allot_sign_dept.AssessLaterOtherFee), States = 1},
new cof_alias{ Alias = "考核后绩效", Name = nameof(view_allot_sign_dept.AssessLaterPerforTotal), States = 1},
new cof_alias{ Alias = "调节系数", Name = nameof(view_allot_sign_dept.AdjustFactor), States = 1},
new cof_alias{ Alias = "调节后其他绩效", Name = nameof(view_allot_sign_dept.AdjustLaterOtherFee), States = 1},
new cof_alias{ Alias = "科主任实发管理绩效", Name = nameof(view_allot_sign_dept.AssessLaterManagementFee), States = 1},
new cof_alias{ Alias = "医院其他绩效", Name = nameof(view_allot_sign_dept.AprPerforAmount), States = 1},
new cof_alias{ Alias = "不公示其他绩效", Name = nameof(view_allot_sign_dept.HideAprOtherPerforAmount), States = 1},
new cof_alias{ Alias = "实发绩效", Name = nameof(view_allot_sign_dept.RealGiveFee), States = 1},
};
} }
} }
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
using NPOI.HSSF.UserModel; using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel; using NPOI.XSSF.UserModel;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
...@@ -11,6 +13,7 @@ ...@@ -11,6 +13,7 @@
using Performance.Services.ExtractExcelService; using Performance.Services.ExtractExcelService;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -24,6 +27,7 @@ public class DownloadService : IAutoInjection ...@@ -24,6 +27,7 @@ public class DownloadService : IAutoInjection
private readonly PerforHospitalRepository perforHospital; private readonly PerforHospitalRepository perforHospital;
private readonly PerforCofaliasRepository perforCofalias; private readonly PerforCofaliasRepository perforCofalias;
private readonly ConfigService configService; private readonly ConfigService configService;
private readonly ComputeService _computeService;
private readonly IHostingEnvironment evn; private readonly IHostingEnvironment evn;
public DownloadService(ILogger<DownloadService> logger, public DownloadService(ILogger<DownloadService> logger,
...@@ -31,6 +35,7 @@ public class DownloadService : IAutoInjection ...@@ -31,6 +35,7 @@ public class DownloadService : IAutoInjection
PerforHospitalRepository perforHospital, PerforHospitalRepository perforHospital,
PerforCofaliasRepository perforCofalias, PerforCofaliasRepository perforCofalias,
ConfigService configService, ConfigService configService,
ComputeService computeService,
IHostingEnvironment evn) IHostingEnvironment evn)
{ {
this.logger = logger; this.logger = logger;
...@@ -38,6 +43,7 @@ public class DownloadService : IAutoInjection ...@@ -38,6 +43,7 @@ public class DownloadService : IAutoInjection
this.perforHospital = perforHospital; this.perforHospital = perforHospital;
this.perforCofalias = perforCofalias; this.perforCofalias = perforCofalias;
this.configService = configService; this.configService = configService;
_computeService = computeService;
this.evn = evn; this.evn = evn;
} }
...@@ -54,7 +60,7 @@ public class DownloadService : IAutoInjection ...@@ -54,7 +60,7 @@ public class DownloadService : IAutoInjection
/// <param name="allData"></param> /// <param name="allData"></param>
/// <param name="isAll"></param> /// <param name="isAll"></param>
/// <returns></returns> /// <returns></returns>
public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool isAll,string name) public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool isAll, string name)
{ {
var allot = perallotRepository.GetEntity(t => t.ID == allotId); var allot = perallotRepository.GetEntity(t => t.ID == allotId);
var hospital = perforHospital.GetEntity(t => t.ID == allot.HospitalId); var hospital = perforHospital.GetEntity(t => t.ID == allot.HospitalId);
...@@ -164,6 +170,84 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -164,6 +170,84 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
return filepath; return filepath;
} }
/// <summary>
/// 财务、全院绩效发放下载
/// </summary>
/// <param name="allotId"></param>
/// <param name="allData"></param>
/// <param name="isAll"></param>
/// <returns></returns>
public string AllComputerViewReport(int allotId, List<dynamic> dynamics, string route, string name)
{
var allot = perallotRepository.GetEntity(t => t.ID == allotId);
var hospital = perforHospital.GetEntity(t => t.ID == allot.HospitalId);
var alias = perforCofalias.GetEntities(t => t.HospitalId == hospital.ID);
var headList = _computeService.CustomColumnHeaders(hospital.ID, route).Where(w => w.States == 1).ToList();
var dpath = Path.Combine(evn.ContentRootPath, "Files", "PerformanceRelease", $"{allot.HospitalId}");
FileHelper.CreateDirectory(dpath);
string filepath = Path.Combine(dpath, $"{hospital.HosName}-{name}-{DateTime.Now:yyyyMMdd}");
FileHelper.DeleteFile(filepath);
using (FileStream fs = new FileStream(filepath, FileMode.OpenOrCreate))
using (ExcelPackage package = new ExcelPackage(fs))
{
var worksheet = package.Workbook.Worksheets.Add(name);
worksheet.View.FreezePanes(2, 1);
if (dynamics != null && dynamics.Count() > 0)
{
var headers = ((IDictionary<string, object>)dynamics.ElementAt(0)).Keys;
for (int col = 0; col < headList.Count; col++)
{
worksheet.SetValue(1, col + 1, headList[col].Alias);
worksheet.Cells[1, col + 1].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
worksheet.Cells[1, col + 1].Style.Border.Top.Style = ExcelBorderStyle.Thin;
worksheet.Cells[1, col + 1].Style.Border.Right.Style = ExcelBorderStyle.Thin;
worksheet.Cells[1, col + 1].Style.Border.Left.Style = ExcelBorderStyle.Thin;
}
for (int col = 0; col < headList.Count; col++)
{
for (int row = 0; row < dynamics.Count(); row++)
{
var data = dynamics.ElementAt(row);
var temp = (IDictionary<string, object>)data;
var value = temp[headList[col].Name];
worksheet.Cells[row + 2, col + 1].Value = value;
worksheet.Cells[row + 2, col + 1].Style.Numberformat.Format = "#,##0.00";//这是保留两位小数
worksheet.Cells[row + 2, col + 1].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
worksheet.Cells[row + 2, col + 1].Style.Border.Top.Style = ExcelBorderStyle.Thin;
worksheet.Cells[row + 2, col + 1].Style.Border.Right.Style = ExcelBorderStyle.Thin;
worksheet.Cells[row + 2, col + 1].Style.Border.Left.Style = ExcelBorderStyle.Thin;
}
if (col == 0)
{
worksheet.SetValue(dynamics.Count() + 2, col + 1, "合计");
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Top.Style = ExcelBorderStyle.Thin;
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Right.Style = ExcelBorderStyle.Thin;
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Left.Style = ExcelBorderStyle.Thin;
}
else
{
string address = new ExcelAddress(2, col + 1, dynamics.Count() + 1, col + 1).Address;
worksheet.Cells[dynamics.Count() + 2, col + 1].Formula = string.Format("SUM({0})", address);
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Numberformat.Format = "#,##0.00";//这是保留两位小数
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Top.Style = ExcelBorderStyle.Thin;
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Right.Style = ExcelBorderStyle.Thin;
worksheet.Cells[dynamics.Count() + 2, col + 1].Style.Border.Left.Style = ExcelBorderStyle.Thin;
}
}
}
package.Save();
}
return filepath;
}
public static List<(string, Func<ComputeResponse, object>, Func<List<ComputeResponse>, decimal>)> AllCompute { get; } = new List<(string, Func<ComputeResponse, object>, Func<List<ComputeResponse>, decimal>)> public static List<(string, Func<ComputeResponse, object>, Func<List<ComputeResponse>, decimal>)> AllCompute { get; } = new List<(string, Func<ComputeResponse, object>, Func<List<ComputeResponse>, decimal>)>
{ {
("来源",t=>t.Source,null), ("来源",t=>t.Source,null),
...@@ -203,6 +287,8 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool ...@@ -203,6 +287,8 @@ public string AllComputerReport(int allotId, List<ComputeResponse> allData, bool
("预留绩效",t=>t.ReservedRatioFee,(t) => Math.Round(t.Sum(item => item.ReservedRatioFee ?? 0), 2, MidpointRounding.AwayFromZero)), ("预留绩效",t=>t.ReservedRatioFee,(t) => Math.Round(t.Sum(item => item.ReservedRatioFee ?? 0), 2, MidpointRounding.AwayFromZero)),
("实发绩效",t=>t.RealGiveFee,(t) => Math.Round(t.Sum(item => item.RealGiveFee ?? 0), 2, MidpointRounding.AwayFromZero)) ("实发绩效",t=>t.RealGiveFee,(t) => Math.Round(t.Sum(item => item.RealGiveFee ?? 0), 2, MidpointRounding.AwayFromZero))
}; };
#endregion #endregion
#region 全院绩效核算 #region 全院绩效核算
......
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