Commit 3f959877 by ruyun.zhang

科室详情修改为统一格式

parent 77cc2895
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Security.Claims;
namespace Performance.Api.Controllers namespace Performance.Api.Controllers
{ {
...@@ -173,7 +174,7 @@ public ApiResponse<List<DeptResponse>> GetAdminPerformance([FromBody] ComputerRe ...@@ -173,7 +174,7 @@ public ApiResponse<List<DeptResponse>> GetAdminPerformance([FromBody] ComputerRe
/// <returns></returns> /// <returns></returns>
[Route("unite/deptdetail")] [Route("unite/deptdetail")]
[HttpPost] [HttpPost]
public ApiResponse UniteDeptDetail([FromBody] DeptDetailRequest request) public ApiResponse UniteDeptDetail([FromBody] UniteDeptDetailRequest request)
{ {
/* /*
...@@ -220,10 +221,14 @@ public ApiResponse UniteDeptDetail([FromBody] DeptDetailRequest request) ...@@ -220,10 +221,14 @@ public ApiResponse UniteDeptDetail([FromBody] DeptDetailRequest request)
] ]
*/ */
if (!Enum.TryParse(request.UnitType, ignoreCase: true, out UnitType unitType))
throw new NotImplementedException(); return new ApiResponse(ResponseType.ParameterError, "核算组别错误");
var userid = _claim.GetUserId();
var response = _computeService.UniteDeptDetail(request.AllotId, unitType, request.AccountingUnit, userid);
return new ApiResponse(ResponseType.OK, response);
} }
#region 20230531 即将弃用,由新接口替代
/// <summary> /// <summary>
/// 科室绩效详情 /// 科室绩效详情
/// </summary> /// </summary>
...@@ -269,7 +274,8 @@ public ApiResponse DeptDetail([FromBody] DeptDetailRequest request) ...@@ -269,7 +274,8 @@ public ApiResponse DeptDetail([FromBody] DeptDetailRequest request)
var response = _computeService.DeptDetail(request.AccountID); var response = _computeService.DeptDetail(request.AccountID);
return new ApiResponse(ResponseType.OK, response); return new ApiResponse(ResponseType.OK, response);
} }
} }
#endregion
/// <summary> /// <summary>
/// 获取全院绩效列表 /// 获取全院绩效列表
......
...@@ -1045,7 +1045,7 @@ ...@@ -1045,7 +1045,7 @@
<param name="request"></param> <param name="request"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Performance.Api.Controllers.ComputeController.UniteDeptDetail(Performance.DtoModels.DeptDetailRequest)"> <member name="M:Performance.Api.Controllers.ComputeController.UniteDeptDetail(Performance.DtoModels.UniteDeptDetailRequest)">
<summary> <summary>
科室绩效详情 科室绩效详情
</summary> </summary>
......
...@@ -157,7 +157,10 @@ ...@@ -157,7 +157,10 @@
<summary> 小数 </summary> <summary> 小数 </summary>
</member> </member>
<member name="F:Performance.DtoModels.DataFormat.小数1"> <member name="F:Performance.DtoModels.DataFormat.小数1">
<summary> 小数 </summary> <summary> 小数1位 </summary>
</member>
<member name="F:Performance.DtoModels.DataFormat.小数2">
<summary> 小数2位 </summary>
</member> </member>
<member name="F:Performance.DtoModels.DataFormat.整数"> <member name="F:Performance.DtoModels.DataFormat.整数">
<summary> 整数 </summary> <summary> 整数 </summary>
...@@ -2822,6 +2825,21 @@ ...@@ -2822,6 +2825,21 @@
提交类型 1 模板提交 2 其他提交 提交类型 1 模板提交 2 其他提交
</summary> </summary>
</member> </member>
<member name="T:Performance.DtoModels.UniteDeptDetailRequest">
<summary>
查看科室绩效详情
</summary>
</member>
<member name="P:Performance.DtoModels.UniteDeptDetailRequest.AllotId">
<summary>
绩效id
</summary>
</member>
<member name="P:Performance.DtoModels.UniteDeptDetailRequest.UnitType">
<summary>
核算单元类型
</summary>
</member>
<member name="P:Performance.DtoModels.UserListRequest.Role"> <member name="P:Performance.DtoModels.UserListRequest.Role">
<summary> <summary>
角色 角色
...@@ -5464,6 +5482,9 @@ ...@@ -5464,6 +5482,9 @@
</summary> </summary>
</member> </member>
<member name="P:Performance.DtoModels.UniteDeptDetailResponse.ShowFormula">
<summary> 0 不显示 1 显示 </summary>
</member>
<member name="P:Performance.DtoModels.UserIdentity.IsAgainAdmin"> <member name="P:Performance.DtoModels.UserIdentity.IsAgainAdmin">
<summary> <summary>
是否是二次绩效管理 是为true 否则为false 是否是二次绩效管理 是为true 否则为false
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text; using System.Text;
namespace Performance.DtoModels namespace Performance.DtoModels
...@@ -67,8 +68,10 @@ public enum DataFormat ...@@ -67,8 +68,10 @@ public enum DataFormat
普通格式, 普通格式,
/// <summary> 小数 </summary> /// <summary> 小数 </summary>
小数, 小数,
/// <summary> 小数 </summary> /// <summary> 小数1位 </summary>
小数1, 小数1,
/// <summary> 小数2位 </summary>
小数2,
/// <summary> 整数 </summary> /// <summary> 整数 </summary>
整数, 整数,
/// <summary> 货币 </summary> /// <summary> 货币 </summary>
...@@ -187,4 +190,31 @@ public enum FromSource ...@@ -187,4 +190,31 @@ public enum FromSource
录入 = 1, 录入 = 1,
} }
} }
public class UniteDept
{
public enum Type
{
左侧下拉 = 1,
右侧收缩 = 2,
}
public enum Title
{
[Description("整数")] 业绩分值 = 2100,
[Description("百分比")] 预算比例 = 2110,
[Description("整数")] 业绩绩效 = 2120,
[Description("整数")] 工作量绩效 = 2130,
[Description("整数")] 考核前其他绩效 = 2140,
[Description("整数")] 考核前绩效 = 2150,
[Description("百分比")] 考核得分率 = 2160,
[Description("整数")] 药占比奖罚 = 2170,
[Description("整数")] 材料占比奖罚 = 2180,
[Description("整数")] 医院奖罚 = 2190,
[Description("整数")] 考核后绩效 = 2200,
[Description("整数")] 考核后其他绩效 = 2210,
[Description("百分比")] 调节系数 = 2220,
[Description("整数")] 调节后其他绩效 = 2230,
[Description("整数")] 实发绩效 = 2240,
}
}
} }
using FluentValidation;
namespace Performance.DtoModels
{
/// <summary>
/// 查看科室绩效详情
/// </summary>
public class UniteDeptDetailRequest
{
/// <summary>
/// 绩效id
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 核算单元类型
/// </summary>
public string UnitType { get; set; }
public string AccountingUnit { get; set; }
}
}
using System.Collections.Generic;
namespace Performance.DtoModels
{
public class UniteDeptDetailResponse
{
public string UnitType { get; set; }
public string AccountingUnit { get; set; }
/// <summary> 0 不显示 1 显示 </summary>
public int ShowFormula { get; set; }
public List<DeptDetailItem> DetailItems { get; set; }
}
public class DeptDetailItem
{
//public DeptDetailItem(int type, string title, decimal total, string remark, int sort)
// : this(type, title, total, remark, sort, new List<Dictionary<string, object>>())
//{
//}
//public DeptDetailItem(int type, string title, decimal total, string remark, int sort, List<Dictionary<string, object>> items)
//{
// Type = type;
// Title = title;
// Total = total;
// Remark = remark;
// Sort = sort;
// Items = items;
//}
public int Type { get; set; }
public string Title { get; set; }
public decimal Total { get; set; }
public string TotalFormat { get; set; }
public string Remark { get; set; }
public int Sort { get; set; }
public bool Display { get; set; } = true;
public List<Dictionary<string, object>> Items { get; set; }
}
}
using AutoMapper; using System;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using AutoMapper;
using Performance.DtoModels;
using Performance.DtoModels.Request; using Performance.DtoModels.Request;
using Performance.DtoModels.Response; using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository;
using Performance.Services.ExtractExcelService; using Performance.Services.ExtractExcelService;
namespace Performance.Services namespace Performance.Services
{ {
public class ComputeService : IAutoInjection public partial class ComputeService : IAutoInjection
{ {
private readonly IMapper _mapper; private readonly IMapper _mapper;
private readonly PerforUserRepository _userRepository;
private readonly PerforResaccountRepository perforResaccountRepository; private readonly PerforResaccountRepository perforResaccountRepository;
private readonly PerforPersheetRepository _perforPerSheetRepository; private readonly PerforPersheetRepository _perforPerSheetRepository;
private readonly PerforImdataRepository _perforImDataRepository; private readonly PerforImdataRepository _perforImDataRepository;
...@@ -42,6 +41,7 @@ public class ComputeService : IAutoInjection ...@@ -42,6 +41,7 @@ public class ComputeService : IAutoInjection
public ComputeService( public ComputeService(
IMapper mapper, IMapper mapper,
PerforUserRepository userRepository,
PerforResaccountRepository perforResaccountRepository, PerforResaccountRepository perforResaccountRepository,
PerforPersheetRepository perforPerSheetRepository, PerforPersheetRepository perforPerSheetRepository,
PerforImdataRepository perforImDataRepository, PerforImdataRepository perforImDataRepository,
...@@ -65,6 +65,7 @@ public class ComputeService : IAutoInjection ...@@ -65,6 +65,7 @@ public class ComputeService : IAutoInjection
PerforReportRepository reportRepository) PerforReportRepository reportRepository)
{ {
_mapper = mapper; _mapper = mapper;
_userRepository = userRepository;
this.perforResaccountRepository = perforResaccountRepository; this.perforResaccountRepository = perforResaccountRepository;
this._perforPerSheetRepository = perforPerSheetRepository; this._perforPerSheetRepository = perforPerSheetRepository;
this._perforImDataRepository = perforImDataRepository; this._perforImDataRepository = perforImDataRepository;
...@@ -1202,6 +1203,24 @@ public List<res_baiscnorm> GetBaiscnorm(int allotId) ...@@ -1202,6 +1203,24 @@ public List<res_baiscnorm> GetBaiscnorm(int allotId)
return perforResbaiscnormRepository.GetEntities(t => t.AllotID == allotId)?.OrderBy(t => t.PositionName).ToList(); return perforResbaiscnormRepository.GetEntities(t => t.AllotID == allotId)?.OrderBy(t => t.PositionName).ToList();
} }
private decimal? GetFactors(List<per_sheet> persheet, List<im_data> basicData, UnitType type, SheetType sheetType)
{
var sheet = persheet.FirstOrDefault(w => w.SheetType == (int)sheetType);
return basicData.FirstOrDefault(t => t.SheetID == sheet?.ID && t.UnitType == (int)type && t.IsTotal == 1)?.CellValue;
}
private UnitType TypeConversion(int? unitType)
{
UnitType type = (UnitType)unitType.Value;
var docUnitTypes = new List<UnitType> { UnitType.其他医生组, UnitType.其他医技组 };
if (docUnitTypes.Contains(type))
type = UnitType.医生组;
else if (type == UnitType.其他护理组)
type = UnitType.护理组;
return type;
}
#region 20230531 即将弃用,由新接口替代
/// <summary> /// <summary>
/// 返回科室详情 /// 返回科室详情
/// </summary> /// </summary>
...@@ -1310,11 +1329,6 @@ public DeptDataDetails DeptDetail(int accountId) ...@@ -1310,11 +1329,6 @@ public DeptDataDetails DeptDetail(int accountId)
return deptDetails; return deptDetails;
} }
private decimal? GetFactors(List<per_sheet> persheet, List<im_data> basicData, UnitType type, SheetType sheetType)
{
var sheet = persheet.FirstOrDefault(w => w.SheetType == (int)sheetType);
return basicData.FirstOrDefault(t => t.SheetID == sheet?.ID && t.UnitType == (int)type && t.IsTotal == 1)?.CellValue;
}
private (int sheettype, decimal amount) ClinicDepartmentDetail(List<per_sheet> persheet, res_account account, List<im_data> basicData, per_sheet sheet, UnitType type, string sheetName) private (int sheettype, decimal amount) ClinicDepartmentDetail(List<per_sheet> persheet, res_account account, List<im_data> basicData, per_sheet sheet, UnitType type, string sheetName)
{ {
...@@ -1433,103 +1447,6 @@ private List<DetailModule> CommonDetailItems(List<im_data> basicData, List<im_he ...@@ -1433,103 +1447,6 @@ private List<DetailModule> CommonDetailItems(List<im_data> basicData, List<im_he
return items; return items;
} }
private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details, string key)
{
if (details == null) return new DeptDataDetails<DetailModuleExtend>();
var result = new DeptDataDetails<DetailModuleExtend>()
{
ShowFormula = details.ShowFormula,
Pandect = details.Pandect,
Detail = new List<DetailDtos<DetailModuleExtend>>(),
};
if (details.Detail == null) return result;
foreach (var groupbasis in details.Detail.Select(t => t.GroupBasis).Distinct())
{
var items = new List<DetailModuleExtend>();
var data = details.Detail.Where(t => t.GroupBasis == groupbasis).ToList();
if (data.Count() > 1)
{
var depts = new List<string>();
data.ForEach(t =>
{
depts.AddRange(t.Items.Select(o => o.ItemName));
});
var billing = data.FirstOrDefault(t => t.ItemName.IndexOf(key) > -1);
var execute = data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1);
foreach (var dept in depts.Distinct().OrderBy(t => t))
{
var item1 = billing?.Items.FirstOrDefault(t => t.ItemName == dept);
var item2 = execute?.Items.FirstOrDefault(t => t.ItemName == dept);
items.Add(new DetailModuleExtend
{
ItemName = dept,
ItemValue = item1?.ItemValue,
ItemValue2 = item2?.ItemValue,
CellValue = item1?.CellValue,
CellValue2 = item2?.CellValue,
Factor = item1?.Factor,
Factor2 = item2?.Factor,
});
}
}
else
{
if (data.FirstOrDefault().ItemName.IndexOf("执行") > -1)
{
items = data.First().Items.Select(t => new DetailModuleExtend
{
ItemName = t.ItemName,
ItemValue2 = t.ItemValue,
CellValue2 = t.CellValue,
Factor2 = t.Factor,
}).ToList();
}
else
{
items = data.First().Items.Select(t => new DetailModuleExtend
{
ItemName = t.ItemName,
ItemValue = t.ItemValue,
CellValue = t.CellValue,
Factor = t.Factor,
MediFactor = t.MediFactor,
CMIFactor = t.CMIFactor,
InclineFactor = t.InclineFactor,
}).ToList();
}
}
result.Detail.Add(new DetailDtos<DetailModuleExtend>
{
ItemName = data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1) is null ? data.First().ItemName :
data.FirstOrDefault(t => t.ItemName.IndexOf("执行") > -1).ItemName?.Replace("执行", $"{key}/执行"),
IncomeType = data.First()?.IncomeType ?? 0,
OriginalType = data.First()?.OriginalType ?? 0,
Amount = data.Sum(w => w.Amount),
GroupBasis = groupbasis,
Items = items
});
}
return result;
}
private UnitType TypeConversion(int? unitType)
{
UnitType type = (UnitType)unitType.Value;
var docUnitTypes = new List<UnitType> { UnitType.其他医生组, UnitType.其他医技组 };
if (docUnitTypes.Contains(type))
type = UnitType.医生组;
else if (type == UnitType.其他护理组)
type = UnitType.护理组;
return type;
}
public DeptDataDetails DeptOfficeDetail(int accountId) public DeptDataDetails DeptOfficeDetail(int accountId)
{ {
var account = perforResaccountRepository.GetEntity(t => t.ID == accountId); var account = perforResaccountRepository.GetEntity(t => t.ID == accountId);
...@@ -1732,25 +1649,6 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second) ...@@ -1732,25 +1649,6 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
return deptDetails; return deptDetails;
} }
//private List<DetailModule> GetExtraDetail(int allotId, int unitType, string accountingUnit)
//{
// var result = new List<DetailModule>();
// var sheetId = _perforPerSheetRepository.GetEntity(t => t.AllotID == allotId && t.SheetType == (int)SheetType.AccountExtra)?.ID;
// if (!sheetId.HasValue) return result;
// var data = _perforImDataRepository.GetEntities(t => t.AllotID == allotId && t.SheetID == sheetId && t.UnitType == unitType
// && t.AccountingUnit == accountingUnit && t.IsTotal != 1);
// if (data == null || !data.Any()) return result;
// result = data.Select(t => new DetailModule
// {
// ItemName = t.TypeName,
// CellValue = t.CellValue,
// ItemValue = t.CellValue,
// }).ToList();
// return result;
//}
public ag_secondallot GetAccountId(int secondId, out int accountId) public ag_secondallot GetAccountId(int secondId, out int accountId)
{ {
...@@ -1778,7 +1676,8 @@ public ag_secondallot GetSecondByAccountId(int accountId) ...@@ -1778,7 +1676,8 @@ public ag_secondallot GetSecondByAccountId(int accountId)
Department = special.AccountingUnit, Department = special.AccountingUnit,
UnitType = UnitType.特殊核算组.ToString() UnitType = UnitType.特殊核算组.ToString()
}; };
} }
#endregion
public DeptDataDetails GetDoctorDetail(int computeId) public DeptDataDetails GetDoctorDetail(int computeId)
{ {
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Performance.DtoModels;
namespace Performance.Services namespace Performance.Services
{ {
......
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