Commit 62cac2f9 by ruyun.zhang@suvalue.com

Merge remote-tracking branch 'origin/develop' into develop

parents 86f88cde 79811453
...@@ -27,10 +27,10 @@ public GuaranteeController(GuaranteeService guaranteeService) ...@@ -27,10 +27,10 @@ public GuaranteeController(GuaranteeService guaranteeService)
/// <returns></returns> /// <returns></returns>
[Route("list")] [Route("list")]
[HttpPost] [HttpPost]
public ApiResponse<List<cof_guarantee>> Guarantee([CustomizeValidator(RuleSet = "Select"), FromBody]GuaranteeRequest request) public ApiResponse<List<GuaranteeResponse>> Guarantee([CustomizeValidator(RuleSet = "Select"), FromBody]GuaranteeRequest request)
{ {
var list = guaranteeService.Guarantee(request.AllotId); var list = guaranteeService.GuaranTree(request.AllotId);
return new ApiResponse<List<cof_guarantee>>(ResponseType.OK, "ok", list); return new ApiResponse<List<GuaranteeResponse>>(ResponseType.OK, "ok", list);
} }
/// <summary> /// <summary>
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class GuaranteeResponse
{
/// <summary>
///
/// </summary>
public Nullable<int> AllotId { get; set; }
/// <summary>
/// 优先级
/// </summary>
public Nullable<int> Priority { get; set; }
/// <summary>
/// 核算单元类型 1 医生组 2 护理组 3 医技组
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 保底科室
/// </summary>
public string Target { get; set; }
/// <summary>
/// 保底来源科室
/// </summary>
public List<GuaranItems> Source { get; set; }
}
public class GuaranItems
{
public int GId { get; set; }
public string GValue { get; set; }
}
}
...@@ -310,15 +310,16 @@ public DeptDataDetails DeptDetail(int allotId, int accountId, int type) ...@@ -310,15 +310,16 @@ public DeptDataDetails DeptDetail(int allotId, int accountId, int type)
{ {
var sheetType = new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload }; var sheetType = new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload };
var doctor = perforResaccountRepository.GetEntity(t => t.UnitType == type && t.AllotID == allotId && t.ID == accountId); var doctor = perforResaccountRepository.GetEntity(t => t.UnitType == type && t.AllotID == allotId && t.ID == accountId);
string typeValue = EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Value == type).Name.ToString();
DeptDataDetails deptDetails = new DeptDataDetails DeptDataDetails deptDetails = new DeptDataDetails
{ {
Pandect = Mapper.Map<PerDataAccountBaisc>(doctor), Pandect = Mapper.Map<PerDataAccountBaisc>(doctor),
Detail = new List<DetailDtos>() Detail = new List<DetailDtos>()
}; };
if (type == (int)UnitType.专家组 || type == (int)UnitType.其他组)
type = 1;
var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == allotId && t.UnitType == type && t.AccountingUnit == doctor.AccountingUnit); var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == allotId && t.UnitType == type && t.AccountingUnit == doctor.AccountingUnit);
var persheet = _perforPerSheetRepository.GetEntities(t => t.AllotID == allotId); var persheet = _perforPerSheetRepository.GetEntities(t => t.AllotID == allotId);
string typeValue = EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Value == type).Name.ToString();
//科室经济 //科室经济
var sheetEconomic = persheet.FirstOrDefault(t => t.SheetType == (int)SheetType.ComputeEconomic); var sheetEconomic = persheet.FirstOrDefault(t => t.SheetType == (int)SheetType.ComputeEconomic);
......
...@@ -37,6 +37,32 @@ public List<cof_guarantee> Guarantee(int allotId) ...@@ -37,6 +37,32 @@ public List<cof_guarantee> Guarantee(int allotId)
} }
/// <summary> /// <summary>
/// 保底绩效配置列表
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public List<GuaranteeResponse> GuaranTree(int allotId)
{
var list = perforCofguaranteeRepository.GetEntities(t => t.AllotId == allotId);
if (list != null && list.Any())
{
var group = list
.Where(t => !string.IsNullOrEmpty(t.Target) && !string.IsNullOrEmpty(t.Source))
.GroupBy(t => new { t.UnitType, t.Target })
.Select(g => new GuaranteeResponse
{
AllotId = allotId,
Target = g.Key.Target,
Source = g.Select(t => new GuaranItems { GId = t.Id, GValue = t.Source }).ToList(),
Priority = g.Min(m => m.Priority.Value),
UnitType = ((UnitType)g.Key.UnitType.Value).ToString()
}).OrderBy(t => t.UnitType).ThenBy(t => t.Priority).ToList();
return group;
}
return new List<GuaranteeResponse>();
}
/// <summary>
/// 新增保底绩效配置 /// 新增保底绩效配置
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
......
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