Commit a5ad549c by lcx

报表 科主任、护士长相关修改, 获取科室改为获取核算单元

parent 514df09d
......@@ -50,7 +50,11 @@ public ApiResponse<List<BudgetResponse>> Query([FromBody]BudgetRequest request)
public ApiResponse Save(int mainYear, [FromBody]List<BudgetResponse> request)
{
var userId = claim.GetUserId();
var result = budgetService.SaveBudgetData(mainYear, request, userId);
var result = false;
if (request != null && request.Any(t => t.Id == 0))
result = budgetService.SaveBudgetData(mainYear, request, userId);
else
result = budgetService.ModifyBudgetData(request);
return result ? new ApiResponse(ResponseType.OK, "保存成功") : new ApiResponse(ResponseType.Fail, "保存失败");
}
......@@ -63,8 +67,9 @@ public ApiResponse Save(int mainYear, [FromBody]List<BudgetResponse> request)
[Route("modify")]
public ApiResponse Modify([FromBody]List<BudgetResponse> request)
{
var result = budgetService.ModifyBudgetData(request);
return result ? new ApiResponse(ResponseType.OK, "修改成功") : new ApiResponse(ResponseType.Fail, "修改失败");
//var result = budgetService.ModifyBudgetData(request);
//return result ? new ApiResponse(ResponseType.OK, "修改成功") : new ApiResponse(ResponseType.Fail, "修改失败");
return new ApiResponse();
}
/// <summary>
......
......@@ -207,10 +207,11 @@
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.BudgetController.Save(System.Collections.Generic.List{Performance.DtoModels.BudgetResponse})">
<member name="M:Performance.Api.Controllers.BudgetController.Save(System.Int32,System.Collections.Generic.List{Performance.DtoModels.BudgetResponse})">
<summary>
保存预算管理数据
</summary>
<param name="mainYear"></param>
<param name="request"></param>
<returns></returns>
</member>
......
......@@ -2121,6 +2121,11 @@
成本合计实际比例
</summary>
</member>
<member name="P:Performance.DtoModels.BudgetRatioResponse.NoPerformanceExpenditureRatio">
<summary>
人员经费(不含绩效)实际比例
</summary>
</member>
<member name="P:Performance.DtoModels.BudgetResponse.Type">
<summary>
数据来源 1. 金额 2. 占比
......
......@@ -2462,9 +2462,14 @@
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_amount.MainYear">
<summary>
根据该年份测算下一年
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_amount.Year">
<summary>
实际年份、预算年份
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_amount.HospitalRevenue">
......@@ -2582,9 +2587,14 @@
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_ratio.MainYear">
<summary>
根据该年份测算下一年
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_ratio.Year">
<summary>
实际年份、预算年份
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_ratio.HospitalRevenue">
......@@ -2822,6 +2832,16 @@
成本合计实际比例
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_result.NoPerformanceExpenditure">
<summary>
人员经费(不含绩效)
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_result.NoPerformanceExpenditureRatio">
<summary>
人员经费(不含绩效)实际比例
</summary>
</member>
<member name="P:Performance.EntityModels.per_budget_result.States">
<summary>
1.初始 2. 确认使用发放/调节系数
......
......@@ -60,5 +60,10 @@ public class BudgetRatioResponse
/// 成本合计实际比例
/// </summary>
public Nullable<decimal> TheCostCombinedRatio { get; set; }
/// <summary>
/// 人员经费(不含绩效)实际比例
/// </summary>
public Nullable<decimal> NoPerformanceExpenditureRatio { get; set; }
}
}
......@@ -142,6 +142,16 @@ public class per_budget_result
public Nullable<decimal> TheCostCombinedRatio { get; set; }
/// <summary>
/// 人员经费(不含绩效)
/// </summary>
public Nullable<decimal> NoPerformanceExpenditure { get; set; }
/// <summary>
/// 人员经费(不含绩效)实际比例
/// </summary>
public Nullable<decimal> NoPerformanceExpenditureRatio { get; set; }
/// <summary>
/// 1.初始 2. 确认使用发放/调节系数
/// </summary>
public int States { get; set; }
......
......@@ -87,5 +87,14 @@ public bool ImportData(rep_importconfig import, Dictionary<string, object> pairs
}
return true;
}
public bool UpdateData(rep_importconfig import, Dictionary<string, object> pairs)
{
using (var connection = context.Database.GetDbConnection())
{
var flag = connection.Execute(import.ImportScript, new DynamicParameters(pairs), commandTimeout: 60 * 60);
return flag > 0;
}
}
}
}
......@@ -335,6 +335,7 @@ public void Generate(per_allot allot, string mail)
logManageService.WriteMsg("正在生成报表数据", "正在生成报表数据", 1, allot.ID, "ReceiveMessage", true);
var res = reportService.ImportData(allot);
var flag = reportService.UpdateData(allot);
logManageService.WriteMsg("正在生成报表数据", $"报表数据生成完成;受影响:{res}行", 1, allot.ID, "ReceiveMessage", true);
//发送邮件
......
......@@ -46,7 +46,7 @@ public List<BudgetResponse> QueryBudgetByYear(int hospitalid, int year)
{
result.AddRange(Mapper.Map<List<BudgetResponse>>(ratios));
}
return result;
return result.OrderBy(t => t.Year).ToList();
}
/// <summary>
......@@ -168,7 +168,7 @@ public bool ModifyBudgetData(List<BudgetResponse> request)
public List<per_budget_result> QueryResultByYear(int hospitalid, int year)
{
var results = perbudgetresultRepository.GetEntities(t => t.HospitalId == hospitalid && t.Year == year);
return results;
return results?.OrderBy(t => t.Month).ToList();
}
/// <summary>
......@@ -287,7 +287,7 @@ public bool GetAdjustAndGrant(int allotId, ref decimal adjust, ref decimal grant
var result = perbudgetresultRepository.GetEntity(t => t.HospitalId == allot.HospitalId && t.Year == allot.Year && t.Month == allot.Month);
if (result == null || result.States != 2) return false;
adjust = result.Adjust.Value;
adjust = result.Adjust.Value;
grant = result.Grant.Value;
return true;
}
......
......@@ -148,8 +148,8 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, int reportId,
@where = GetFilterSelection(selections, values);
}
@where += $" and hospitalid={hospitalId}";
if (isMedical)
@where += $" and department='{department}'";
if (isMedical && sql.IndexOf("report_allot_crowd") < 0)
@where += $" and accountingunit='{department}'";
// 固定占位符
var pairs = PredefinePlaceholder(values);
pairs.Add("wh", @where);
......
......@@ -257,6 +257,33 @@ internal int ImportData(per_allot allot)
}
/// <summary>
/// 补充报表数据
/// </summary>
/// <param name="allot"></param>
/// <returns></returns>
internal int UpdateData(per_allot allot)
{
Dictionary<string, object> pairs = new Dictionary<string, object>
{
{ "@allotid", allot.ID },
{ "@hospitalid", allot.HospitalId },
};
var imports = repimportconfigRepository.GetEntities(w => w.ScriptType == 3);
foreach (var item in imports)
{
try
{
var flag = perforPerallotRepository.UpdateData(item, pairs);
}
catch (Exception ex)
{
logger.LogError(ex.ToString());
}
}
return 0;
}
/// <summary>
/// 首页
/// </summary>
/// <param name="hospitalId"></param>
......
......@@ -338,7 +338,7 @@ public List<TitleValue> Department(int hospitalID)
//if (department != null && department.Count() > 0)
// result.AddRange(department);
var department = _perforImaccountbasicRepository.GetEntities(t => t.Department != "" && idList.Contains(t.AllotID.Value)).Select(t => t.Department);
var department = _perforImaccountbasicRepository.GetEntities(t => !string.IsNullOrEmpty(t.DoctorAccountingUnit) && idList.Contains(t.AllotID.Value)).Select(t => t.DoctorAccountingUnit);
if (department != null && department.Count() > 0)
result.AddRange(department);
if (result != null && result.Any())
......
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