Commit 443c7feb by ruyun.zhang@suvalue.com

Merge branch 'release/v22.1.7-Stable' into release/v22.1.24

parents 5928d132 93f2a53c
...@@ -369,11 +369,13 @@ public IActionResult WholeHospitalGrantSummaryDownload([FromBody] HospitalGrantS ...@@ -369,11 +369,13 @@ public IActionResult WholeHospitalGrantSummaryDownload([FromBody] HospitalGrantS
string.IsNullOrEmpty(request.EndTime) || !DateTime.TryParse(request.EndTime, out edate)) string.IsNullOrEmpty(request.EndTime) || !DateTime.TryParse(request.EndTime, out edate))
throw new PerformanceException("请输入正确的时间"); throw new PerformanceException("请输入正确的时间");
var resetGroupBy = request.GroupBy.Copy();
var list = _computeService.GetAllComputeViewByDateAndTotal("view_allot_sign_emp", request); var list = _computeService.GetAllComputeViewByDateAndTotal("view_allot_sign_emp", request);
if (null == list) if (null == list)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
request.GroupBy = resetGroupBy;
List<string> headlist = new List<string>(); List<string> headlist = new List<string>();
foreach (var item in request.GroupBy.Union(request.SumBy).ToList()) foreach (var item in request.GroupBy.Union(request.SumBy).ToList())
...@@ -596,7 +598,6 @@ public IActionResult AllComputeByPMViewDownLoad([FromBody] BeginEndTime request) ...@@ -596,7 +598,6 @@ public IActionResult AllComputeByPMViewDownLoad([FromBody] BeginEndTime request)
[HttpPost] [HttpPost]
public ApiResponse GetWholeHospitalFinanceGrantSummary([FromBody] HospitalGrantSummary request) public ApiResponse GetWholeHospitalFinanceGrantSummary([FromBody] HospitalGrantSummary request)
{ {
return new ApiResponse(ResponseType.OK, "ok", _computeService.GetPerformanceSummary(request, "view_allot_sign_emp_finance")); return new ApiResponse(ResponseType.OK, "ok", _computeService.GetPerformanceSummary(request, "view_allot_sign_emp_finance"));
} }
......
...@@ -431,17 +431,17 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu ...@@ -431,17 +431,17 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu
Dictionary<string, List<string>> dict = new Dictionary<string, List<string>> Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>
{ {
{ "view_allot_sign_emp_group", new List<string>{ "hospitalid", "year", "month", "source", "allotid", "secondid", "states", "unittype", "accountingunit", "isshowmanage", "employeename", "jobnumber", "jobtitle", "emp_unittype", "emp_accountingunit", "bankcard", "batch", "jobcategory", "duty", "titleposition" } }, { "view_allot_sign_emp_group", new List<string>{ /* "year", "month", "allotid", "secondid",*/ "hospitalid", "source", "states", "unittype", "accountingunit", "isshowmanage", "employeename", "jobnumber", "jobtitle", "emp_unittype", "emp_accountingunit", "bankcard", "batch", "jobcategory", "duty", "titleposition" } },
{ "view_allot_sign_emp_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } }, { "view_allot_sign_emp_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } },
{ "view_allot_sign_dept_group", new List<string>{ "hospitalid", "allotid", "year", "month", "unittype", "accountingunit" } }, { "view_allot_sign_dept_group", new List<string>{ "hospitalid",/* "allotid", "year", "month", */"unittype", "accountingunit" } },
{ "view_allot_sign_dept_sum", new List<string>{ "perforfee", "workloadfee", "assessbeforeotherfee", "perfortotal", "scoringaverage", "extra", "medicineextra", "materialsextra", "assesslaterotherfee", "assesslaterperfortotal", "adjustfactor", "adjustlaterotherfee", "aprperforamount", "hideaprotherperforamount", "assesslatermanagementfee", "realgivefee" } }, { "view_allot_sign_dept_sum", new List<string>{ "perforfee", "workloadfee", "assessbeforeotherfee", "perfortotal", "scoringaverage", "extra", "medicineextra", "materialsextra", "assesslaterotherfee", "assesslaterperfortotal", "adjustfactor", "adjustlaterotherfee", "aprperforamount", "hideaprotherperforamount", "assesslatermanagementfee", "realgivefee" } },
{ "view_allot_sign_emp_finance_group", new List<string>{ "hospitalid", "year", "month", "allotid", "jobnumber", "employeename", "jobtitle", "unittype", "accountingunit", "bankcard", "jobcategory", "duty", "titleposition" } }, { "view_allot_sign_emp_finance_group", new List<string>{ "hospitalid",/* "year", "month", "allotid",*/ "jobnumber", "employeename", "jobtitle", "unittype", "accountingunit", "bankcard", "jobcategory", "duty", "titleposition" } },
{ "view_allot_sign_emp_finance_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } }, { "view_allot_sign_emp_finance_sum", new List<string>{ "perforsumfee", "performanagementfee", "nightworkperfor", "adjustlaterotherfee", "otherperfor", "hideotherperfor", "shouldgivefee", "reservedratiofee", "realgivefee" } },
}; };
if (request.GroupBy == null || !request.GroupBy.Any(t => !string.IsNullOrEmpty(t))) request.GroupBy = dict[viewName + "_group"];
request.GroupBy.Remove("");
if (request.SumBy == null || !request.SumBy.Any(t => !string.IsNullOrEmpty(t))) request.SumBy = dict[viewName + "_sum"]; if (request.SumBy == null || !request.SumBy.Any(t => !string.IsNullOrEmpty(t))) request.SumBy = dict[viewName + "_sum"];
if (request.Search != null && request.Search.Any(w => !string.IsNullOrEmpty(w.Title) && !string.IsNullOrEmpty(w.Value))) if (request.Search != null && request.Search.Any(w => !string.IsNullOrEmpty(w.Title) && !string.IsNullOrEmpty(w.Value)))
...@@ -453,8 +453,27 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu ...@@ -453,8 +453,27 @@ public List<dynamic> QueryComputeByDateAndTotal(string viewName, HospitalGrantSu
if (!string.IsNullOrEmpty(request.SortBy)) if (!string.IsNullOrEmpty(request.SortBy))
sql += $" order by {request.SortBy} "; sql += $" order by {request.SortBy} ";
if (request.GroupBy == null || !request.GroupBy.Any(t => !string.IsNullOrEmpty(t))) /*request.GroupBy = dict[viewName + "_group"];*/
{
switch (viewName)
{
case "view_allot_sign_emp":
request.GroupBy.AddRange(new[] { "Source", "UnitType", "AccountingUnit", "JobNumber", "EmployeeName", "JobCategory" });
break;
case "view_allot_sign_dept":
request.GroupBy.AddRange(new[] { "UnitType", "AccountingUnit" });
break;
case "view_allot_sign_emp_finance":
request.GroupBy.AddRange(new[] { "UnitType", "AccountingUnit", "JobNumber", "EmployeeName" });
break;
}
sql = $"select {string.Join(",", dict[viewName + "_group"])}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", request.GroupBy)}";
}
else
{
sql = $"select {string.Join(",", request.GroupBy)}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", request.GroupBy)}"; sql = $"select {string.Join(",", request.GroupBy)}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", request.GroupBy)}";
}
//sql = $"select {string.Join(",", request.GroupBy)}, {string.Join(",", request.SumBy.Select(t => $"sum({t}) {t}"))} from ({sql}) tab group by {string.Join(",", request.GroupBy)}";
return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }).ToList(); return DapperQuery<dynamic>(sql, new { beginTime = request.BeginTime, endTime = request.EndTime }).ToList();
} }
......
...@@ -695,6 +695,7 @@ public bool IssuedChangeSecond(per_allot allot, List<ag_secondallot> secondList) ...@@ -695,6 +695,7 @@ public bool IssuedChangeSecond(per_allot allot, List<ag_secondallot> secondList)
if (item.IssueStatus == 2) if (item.IssueStatus == 2)
{ {
second.UseTempId = null;
second.Status = 4; second.Status = 4;
second.Remark = "科室绩效结果发生变更,需要重新提交"; second.Remark = "科室绩效结果发生变更,需要重新提交";
if (hospital.IsOpenNursingDeptAudit == 1) if (hospital.IsOpenNursingDeptAudit == 1)
......
...@@ -1655,6 +1655,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second) ...@@ -1655,6 +1655,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
AssessBeforeOtherFee = special.FirstOrDefault()?.AssessBeforeOtherFee ?? 0, AssessBeforeOtherFee = special.FirstOrDefault()?.AssessBeforeOtherFee ?? 0,
AssessLaterOtherFee = special.FirstOrDefault()?.AssessLaterOtherFee ?? 0, AssessLaterOtherFee = special.FirstOrDefault()?.AssessLaterOtherFee ?? 0,
AdjustLaterOtherFee = special.FirstOrDefault()?.AdjustLaterOtherFee ?? 0, AdjustLaterOtherFee = special.FirstOrDefault()?.AdjustLaterOtherFee ?? 0,
AssessLaterPerforTotal = special.FirstOrDefault()?.GiveFee ?? 0, // 考核后绩效 特殊情况,为了前端统一
}, },
Detail = new List<DetailDtos>(), Detail = new List<DetailDtos>(),
}; };
...@@ -1812,8 +1813,8 @@ public DeptDataDetails GetDoctorDetail(int computeId) ...@@ -1812,8 +1813,8 @@ public DeptDataDetails GetDoctorDetail(int computeId)
var isShowManage = IsShowManage(resCompute.AllotID.Value); var isShowManage = IsShowManage(resCompute.AllotID.Value);
// 开启 显示管理绩效 // 开启 显示管理绩效
if (isShowManage != 2) if (isShowManage != 1)
doctorDetails.Pandect.RealGiveFee = doctorDetails.Pandect.AssessLaterManagementFee; doctorDetails.Pandect.RealGiveFee = doctorDetails.Pandect.AssessLaterManagementFee * (resCompute.Adjust ?? 1) + (resCompute.AdjustLaterOtherFee ?? 0);
var types = new int[] var types = new int[]
{ {
...@@ -2188,6 +2189,7 @@ public QueryComputeByDateGetPage GetPerformanceSummary(HospitalGrantSummary requ ...@@ -2188,6 +2189,7 @@ public QueryComputeByDateGetPage GetPerformanceSummary(HospitalGrantSummary requ
string.IsNullOrEmpty(request.EndTime) || !DateTime.TryParse(request.EndTime, out edate)) string.IsNullOrEmpty(request.EndTime) || !DateTime.TryParse(request.EndTime, out edate))
throw new PerformanceException("请输入正确的时间"); throw new PerformanceException("请输入正确的时间");
request.EndTime = Convert.ToDateTime(request.EndTime).AddMonths(1).ToString();
var datas = reportRepository.QueryComputeByDateAndTotal(ViewName, request); var datas = reportRepository.QueryComputeByDateAndTotal(ViewName, request);
if (null == datas) if (null == datas)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
......
...@@ -274,8 +274,8 @@ public bool Applicat(CostTransferRequest request) ...@@ -274,8 +274,8 @@ public bool Applicat(CostTransferRequest request)
if (request.Adopted.Department == request.Applicant.Department && request.Adopted.UnitType == request.Applicant.UnitType) if (request.Adopted.Department == request.Applicant.Department && request.Adopted.UnitType == request.Applicant.UnitType)
throw new PerformanceException("参数错误,提交科室相同"); throw new PerformanceException("参数错误,提交科室相同");
var item = request.Items.Where(t => string.IsNullOrEmpty(t.Source) || string.IsNullOrEmpty(t.Category)); if (request.Items.Any(t => string.IsNullOrEmpty(t.Category))
if (item.Count() > 0) throw new PerformanceException("参数错误,申请信息填写不完整"); || request.Items.Any(t => t.IsUseRatio == 1 && string.IsNullOrEmpty(t.Source))) throw new PerformanceException("参数错误,申请信息填写不完整");
var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId); var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId);
var allotStatus = new[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive }; var allotStatus = new[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive };
......
...@@ -134,6 +134,8 @@ private void WriteDataToFile(int userId, per_allot allot, List<cust_script> scri ...@@ -134,6 +134,8 @@ private void WriteDataToFile(int userId, per_allot allot, List<cust_script> scri
var parameters = GetParameters(allot); var parameters = GetParameters(allot);
var (isSecondAdmin, department, unitType) = GetUserDepartment(userId); var (isSecondAdmin, department, unitType) = GetUserDepartment(userId);
parameters.Add("@department", $"'{department}'"); parameters.Add("@department", $"'{department}'");
if (unitType != null && unitType.Any())
parameters.Add("@unittype", $"{string.Join(", ", unitType.Select(t => $"'{t}'"))}");
foreach (var item in scripts) foreach (var item in scripts)
{ {
......
...@@ -1551,7 +1551,7 @@ private List<ag_secondallot> SecondList(per_allot allot, List<res_account> accou ...@@ -1551,7 +1551,7 @@ private List<ag_secondallot> SecondList(per_allot allot, List<res_account> accou
}; };
}); });
var enums = EnumHelper.GetItems<UnitType>(); var enums = EnumHelper.GetItems<UnitType>();
return result.Where(w => w.RealGiveFee != 0) return result.Where(w => w.RealGiveFee.HasValue && w.RealGiveFee != 0)
.OrderBy(t => t.Status == 4 ? 2 : t.Status) .OrderBy(t => t.Status == 4 ? 2 : t.Status)
.ThenBy(t => enums.FirstOrDefault(f => f.Name == t.UnitType)?.Value) .ThenBy(t => enums.FirstOrDefault(f => f.Name == t.UnitType)?.Value)
.ThenBy(t => t.Department) .ThenBy(t => t.Department)
......
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