Commit e36fc6a1 by lcx

Merge branch 'v2020calculate' into v2020income

parents 99f87bfd d37d7cda
...@@ -331,8 +331,7 @@ public ApiResponse SubmitAudit(SubmitAuditRequest request) ...@@ -331,8 +331,7 @@ public ApiResponse SubmitAudit(SubmitAuditRequest request)
[Route("/api/second/audit/list")] [Route("/api/second/audit/list")]
public ApiResponse<List<ag_secondallot>> AuditList([FromBody] AllotDeptRequest request) public ApiResponse<List<ag_secondallot>> AuditList([FromBody] AllotDeptRequest request)
{ {
var userid = claimService.GetUserId(); var list = secondAllotService.AuditList(request.AllotId);
var list = secondAllotService.AuditList(userid, request.AllotId);
return new ApiResponse<List<ag_secondallot>>(ResponseType.OK, "审核列表", list); return new ApiResponse<List<ag_secondallot>>(ResponseType.OK, "审核列表", list);
} }
...@@ -355,6 +354,18 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request) ...@@ -355,6 +354,18 @@ public ApiResponse AuditResult([FromBody] SecondAuditRequest request)
/// <summary> /// <summary>
/// 护理部二次绩效审核列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("/api/second/audit/nursingdept/list")]
public ApiResponse<List<ag_secondallot>> NursingDeptlist([FromBody] AllotDeptRequest request)
{
var list = secondAllotService.NursingDeptlist(request.AllotId);
return new ApiResponse<List<ag_secondallot>>(ResponseType.OK, "审核列表", list);
}
/// <summary>
/// 护理部二次绩效审核结果;驳回、成功 /// 护理部二次绩效审核结果;驳回、成功
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
......
...@@ -1168,6 +1168,12 @@ ...@@ -1168,6 +1168,12 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.SecondAllotController.NursingDeptlist(Performance.DtoModels.AllotDeptRequest)">
<summary>
护理部二次绩效审核列表
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.NursingDeptAuditResult(Performance.DtoModels.SecondAuditRequest)"> <member name="M:Performance.Api.Controllers.SecondAllotController.NursingDeptAuditResult(Performance.DtoModels.SecondAuditRequest)">
<summary> <summary>
护理部二次绩效审核结果;驳回、成功 护理部二次绩效审核结果;驳回、成功
......
...@@ -2817,6 +2817,11 @@ ...@@ -2817,6 +2817,11 @@
是否开启科室CMI占比 1 启用 2 禁用 是否开启科室CMI占比 1 启用 2 禁用
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.HospitalResponse.IsOpenNursingDeptAudit">
<summary>
是否开启护理部审核 1 启用 2 禁用
</summary>
</member>
<member name="P:Performance.DtoModels.IncomeResponse.SheetNameKeyword"> <member name="P:Performance.DtoModels.IncomeResponse.SheetNameKeyword">
<summary> <summary>
关键字匹配 关键字匹配
......
...@@ -857,6 +857,11 @@ ...@@ -857,6 +857,11 @@
备注 备注
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.ag_secondallot.NursingDeptStatus">
<summary>
护理部审核状态 2 等待审核 3 审核通过 4 驳回
</summary>
</member>
<member name="P:Performance.EntityModels.ag_secondallot.NursingDeptAuditTime"> <member name="P:Performance.EntityModels.ag_secondallot.NursingDeptAuditTime">
<summary> <summary>
护理部审核时间 护理部审核时间
...@@ -5012,6 +5017,11 @@ ...@@ -5012,6 +5017,11 @@
是否开启科室CMI占比 1 启用 2 禁用 是否开启科室CMI占比 1 启用 2 禁用
</summary> </summary>
</member> </member>
<member name="P:Performance.EntityModels.sys_hospital.IsOpenNursingDeptAudit">
<summary>
是否开启护理部审核 1 启用 2 禁用
</summary>
</member>
<member name="T:Performance.EntityModels.sys_hospitalconfig"> <member name="T:Performance.EntityModels.sys_hospitalconfig">
<summary> <summary>
......
...@@ -23,5 +23,9 @@ public class HospitalResponse ...@@ -23,5 +23,9 @@ public class HospitalResponse
/// 是否开启科室CMI占比 1 启用 2 禁用 /// 是否开启科室CMI占比 1 启用 2 禁用
/// </summary> /// </summary>
public int IsOpenCMIPercent { get; set; } public int IsOpenCMIPercent { get; set; }
/// <summary>
/// 是否开启护理部审核 1 启用 2 禁用
/// </summary>
public int IsOpenNursingDeptAudit { get; set; }
} }
} }
...@@ -87,6 +87,11 @@ public class ag_secondallot ...@@ -87,6 +87,11 @@ public class ag_secondallot
public string Remark { get; set; } public string Remark { get; set; }
/// <summary> /// <summary>
/// 护理部审核状态 2 等待审核 3 审核通过 4 驳回
/// </summary>
public Nullable<int> NursingDeptStatus { get; set; }
/// <summary>
/// 护理部审核时间 /// 护理部审核时间
/// </summary> /// </summary>
public Nullable<DateTime> NursingDeptAuditTime { get; set; } public Nullable<DateTime> NursingDeptAuditTime { get; set; }
......
...@@ -90,5 +90,10 @@ public class sys_hospital ...@@ -90,5 +90,10 @@ public class sys_hospital
/// 是否开启科室CMI占比 1 启用 2 禁用 /// 是否开启科室CMI占比 1 启用 2 禁用
/// </summary> /// </summary>
public Nullable<int> IsOpenCMIPercent { get; set; } public Nullable<int> IsOpenCMIPercent { get; set; }
/// <summary>
/// 是否开启护理部审核 1 启用 2 禁用
/// </summary>
public Nullable<int> IsOpenNursingDeptAudit { get; set; }
} }
} }
...@@ -403,7 +403,6 @@ public IEnumerable<AccountUnitTotal> GetAccountExtra(PerExcel excel, SheetType s ...@@ -403,7 +403,6 @@ public IEnumerable<AccountUnitTotal> GetAccountExtra(PerExcel excel, SheetType s
assessList = (isTotal) assessList = (isTotal)
? assessList?.Where(w => w.IsTotal == 1) ? assessList?.Where(w => w.IsTotal == 1)
: assessList?.Where(w => w.IsTotal != 1); : assessList?.Where(w => w.IsTotal != 1);
return assessList?.Select(t => new EmpolyeeTotal return assessList?.Select(t => new EmpolyeeTotal
{ {
UnitType = t.UnitType, UnitType = t.UnitType,
......
...@@ -352,7 +352,7 @@ public void Generate(per_allot allot, string mail) ...@@ -352,7 +352,7 @@ public void Generate(per_allot allot, string mail)
// 科室奖罚汇总 // 科室奖罚汇总
logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "科室奖罚汇总", 1, allot.ID, "ReceiveMessage", true);
var accountExtras = processComputService.GetAccountExtra(excel, SheetType.AccountExtra); var accountExtras = processComputService.GetAccountExtra(excel, SheetType.AccountExtra, true);
// 科室药占比考核 // 科室药占比考核
logManageService.WriteMsg("正在生成绩效", "科室药占比考核", 1, allot.ID, "ReceiveMessage", true); logManageService.WriteMsg("正在生成绩效", "科室药占比考核", 1, allot.ID, "ReceiveMessage", true);
var drugExtras = processComputService.GetAccountExtra(excel, SheetType.AccountDrugAssess, true); var drugExtras = processComputService.GetAccountExtra(excel, SheetType.AccountDrugAssess, true);
......
...@@ -350,12 +350,12 @@ public per_budget_result Collect(int hospitalid, int year, int month) ...@@ -350,12 +350,12 @@ public per_budget_result Collect(int hospitalid, int year, int month)
///绩效总金额 ///绩效总金额
private decimal GetTheNewPerformance(int hospitalid, int year, int month) private decimal GetTheNewPerformance(int hospitalid, int year, int month)
{ {
string sql = @"select sum(realgivefee) from ( string sql = @"select ifnull(sum(fee),0) as fee from (
select realgivefee from res_compute t1 select realgivefee as fee from res_compute t1
join per_allot t2 on t1.allotid=t2.id join per_allot t2 on t1.allotid=t2.id
where hospitalid=@hospitalid and year=@year and month=@month and accounttype in ('护士长','科主任','行政中层','行政高层') where hospitalid=@hospitalid and year=@year and month=@month and accounttype in ('护士长','科主任','行政中层','行政高层')
union all union all
select realgivefee from ag_compute t1 select AssessLaterPerforTotal as fee from res_account t1
join per_allot t2 on t1.allotid=t2.id join per_allot t2 on t1.allotid=t2.id
where hospitalid=@hospitalid and year=@year and month=@month where hospitalid=@hospitalid and year=@year and month=@month
) tab"; ) tab";
...@@ -364,13 +364,13 @@ union all ...@@ -364,13 +364,13 @@ union all
///医疗收入 ///医疗收入
private decimal GetMedicalIncome(int hospitalid, int year, int month) private decimal GetMedicalIncome(int hospitalid, int year, int month)
{ {
string sql = @"select sum(cellvalue) from report_original_income t1 where hospitalid=@hospitalid and year=@year and month=@month"; string sql = @"select ifnull(sum(cellvalue),0) as fee from report_original_income t1 where hospitalid=@hospitalid and year=@year and month=@month";
return perbudgetresultRepository.DapperQueryFirstOrDefault<decimal>(sql, new { hospitalid, year, month }); return perbudgetresultRepository.DapperQueryFirstOrDefault<decimal>(sql, new { hospitalid, year, month });
} }
///药品收入 ///药品收入
private decimal GetMedicineProportion(int hospitalid, int year, int month) private decimal GetMedicineProportion(int hospitalid, int year, int month)
{ {
string sql = @"select sum(CellValue) string sql = @"select ifnull(sum(cellvalue),0) as fee
from report_original_income t1 from report_original_income t1
join cof_drugtype t2 on t1.allotid = t2.allotid and t2.chargetype = '药费' join cof_drugtype t2 on t1.allotid = t2.allotid and t2.chargetype = '药费'
where hospitalid=@hospitalid and year=@year and month=@month"; where hospitalid=@hospitalid and year=@year and month=@month";
...@@ -379,7 +379,7 @@ private decimal GetMedicineProportion(int hospitalid, int year, int month) ...@@ -379,7 +379,7 @@ private decimal GetMedicineProportion(int hospitalid, int year, int month)
///材料支出 ///材料支出
private decimal GetMaterialCosts(int hospitalid, int year, int month) private decimal GetMaterialCosts(int hospitalid, int year, int month)
{ {
string sql = @"select sum(CellValue) string sql = @"select ifnull(sum(cellvalue),0) as fee
from report_original_income t1 from report_original_income t1
join cof_drugtype t2 on t1.allotid = t2.allotid and t2.chargetype = '材料费' join cof_drugtype t2 on t1.allotid = t2.allotid and t2.chargetype = '材料费'
where hospitalid=@hospitalid and year=@year and month=@month"; where hospitalid=@hospitalid and year=@year and month=@month";
......
...@@ -714,7 +714,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -714,7 +714,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
}; };
foreach (var stype in sheetType) foreach (var stype in sheetType)
{ {
if (type == 3 && stype == (int)SheetType.Workload) type = 1; //if (type == 3 && stype == (int)SheetType.Workload) type = 1;
foreach (var sheet in persheet.Where(t => t.SheetType == stype)) foreach (var sheet in persheet.Where(t => t.SheetType == stype))
{ {
if (single != "" && sheet.SheetName.Substring(0, 3) != single) if (single != "" && sheet.SheetName.Substring(0, 3) != single)
...@@ -722,6 +722,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId) ...@@ -722,6 +722,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
single = sheet.SheetName.Substring(0, 3); single = sheet.SheetName.Substring(0, 3);
var sheetName = reg.Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", ""); var sheetName = reg.Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", "");
//var nType = (stype == (int)SheetType.Workload) ? 1 : type;
var sheetData = basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == type && t.IsTotal != 1).ToList(); var sheetData = basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == type && t.IsTotal != 1).ToList();
if (sheetData == null || !sheetData.Any()) continue; if (sheetData == null || !sheetData.Any()) continue;
......
...@@ -1212,21 +1212,18 @@ public bool DeleteWorkType(WorkloadRequest request) ...@@ -1212,21 +1212,18 @@ public bool DeleteWorkType(WorkloadRequest request)
/// </summary> /// </summary>
/// <param name="userId">用户ID</param> /// <param name="userId">用户ID</param>
/// <returns></returns> /// <returns></returns>
public List<ag_secondallot> AuditList(int userId, int allotId) public List<ag_secondallot> AuditList(int allotId)
{ {
//var hospital = perforUserhospitalRepository.GetEntities(t => t.UserID == userId);
//var allotList = perforPerallotRepository.GetEntities(t => hospital.Select(h => h.HospitalID).Contains(t.HospitalId));
//if (allotList != null && allotList.Count > 0)
//{
// var allotIds = allotList.Select(t => t.ID);
// return perforAgsecondallotRepository.GetEntities(t => allotIds.Contains(t.AllotId.Value) && t.Status == 2);
//}
//return null;
var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId); var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null) if (allot == null)
throw new PerformanceException("所选绩效不存在!"); throw new PerformanceException("所选绩效不存在!");
var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allotId && !new int[] { (int)UnitType.行政高层, (int)UnitType.行政中层 }.Contains(t.UnitType.Value)); var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allotId && !new int[] { (int)UnitType.行政高层, (int)UnitType.行政中层 }.Contains(t.UnitType.Value));
return SecondList(allot, accountUnit);
}
private List<ag_secondallot> SecondList(per_allot allot, List<res_account> accountUnit)
{
if (accountUnit == null || !accountUnit.Any()) return new List<ag_secondallot>(); if (accountUnit == null || !accountUnit.Any()) return new List<ag_secondallot>();
var secondList = perforAgsecondallotRepository.GetEntities(t => t.AllotId == allot.ID && t.Year == allot.Year && t.Month == allot.Month); var secondList = perforAgsecondallotRepository.GetEntities(t => t.AllotId == allot.ID && t.Year == allot.Year && t.Month == allot.Month);
...@@ -1236,7 +1233,7 @@ public List<ag_secondallot> AuditList(int userId, int allotId) ...@@ -1236,7 +1233,7 @@ public List<ag_secondallot> AuditList(int userId, int allotId)
if (second != null) return second; if (second != null) return second;
return new ag_secondallot return new ag_secondallot
{ {
AllotId = allotId, AllotId = allot.ID,
Year = allot.Year, Year = allot.Year,
Month = allot.Month, Month = allot.Month,
UnitType = ((UnitType)t.UnitType).ToString(), UnitType = ((UnitType)t.UnitType).ToString(),
...@@ -1253,6 +1250,21 @@ public List<ag_secondallot> AuditList(int userId, int allotId) ...@@ -1253,6 +1250,21 @@ public List<ag_secondallot> AuditList(int userId, int allotId)
} }
/// <summary> /// <summary>
/// 护理部二次绩效考核列表
/// </summary>
/// <param name="userId">用户ID</param>
/// <returns></returns>
public List<ag_secondallot> NursingDeptlist(int allotId)
{
var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null)
throw new PerformanceException("所选绩效不存在!");
var types = new int[] { (int)UnitType.其他护理组, (int)UnitType.护理组 };
var accountUnit = perforResaccountRepository.GetEntities(t => t.AllotID == allotId && types.Contains(t.UnitType.Value));
return SecondList(allot, accountUnit);
}
/// <summary>
/// 提交审核 /// 提交审核
/// </summary> /// </summary>
/// <param name="userId">用户ID</param> /// <param name="userId">用户ID</param>
...@@ -1417,13 +1429,13 @@ public bool NursingDeptAudit(int userId, SecondAuditRequest request) ...@@ -1417,13 +1429,13 @@ public bool NursingDeptAudit(int userId, SecondAuditRequest request)
throw new PerformanceException("二次分配绩效无效"); throw new PerformanceException("二次分配绩效无效");
if (request.IsPass == 1) if (request.IsPass == 1)
{ {
second.Status = 3; second.NursingDeptStatus = 3;
second.NursingDeptRemark = $"护理部审核通过;{request.Remark}"; second.NursingDeptRemark = $"护理部审核通过;{request.Remark}";
} }
else else
{ {
second.UseTempId = null; second.UseTempId = null;
second.Status = 4; second.NursingDeptStatus = 4;
second.NursingDeptRemark = $"护理部驳回;驳回原因:{request.Remark}"; second.NursingDeptRemark = $"护理部驳回;驳回原因:{request.Remark}";
} }
second.NursingDeptAuditUser = userId; second.NursingDeptAuditUser = userId;
......
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