Commit 9f088395 by lcx

可是绩效详情带出药占比系数、cmi系数

parent 1373e6f2
......@@ -503,28 +503,28 @@
</member>
<member name="M:Performance.Api.Controllers.ConfigController.GetHosCMIList(Performance.EntityModels.cof_cmi)">
<summary>
获取 药占比类型信息列表
获取 CMI配置信息
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.HosCMIInsert(Performance.EntityModels.cof_cmi)">
<summary>
新增药占比类型
新增 CMI配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.HosCMIUpdate(Performance.EntityModels.cof_cmi)">
<summary>
修改药占比类型
修改 CMI配置
</summary>
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.ConfigController.HosCMIDelete(Performance.EntityModels.cof_cmi)">
<summary>
删除药占比类型
删除 CMI配置
</summary>
<param name="request"></param>
<returns></returns>
......
......@@ -29,6 +29,7 @@ public class ComputeService : IAutoInjection
private readonly PerforHospitalRepository hospitalRepository;
private readonly PerforPerapramountRepository perapramountRepository;
private readonly PerforCofcmiRepository cofcmiRepository;
private readonly PerforCofworkitemRepository cofworkitemRepository;
public ComputeService(PerforResaccountRepository perforResaccountRepository,
PerforPersheetRepository perforPerSheetRepository,
......@@ -44,7 +45,8 @@ public class ComputeService : IAutoInjection
PerforPerallotRepository perforPerallotRepository,
PerforHospitalRepository hospitalRepository,
PerforPerapramountRepository perapramountRepository,
PerforCofcmiRepository cofcmiRepository)
PerforCofcmiRepository cofcmiRepository,
PerforCofworkitemRepository cofworkitemRepository)
{
this.perforResaccountRepository = perforResaccountRepository;
this._perforPerSheetRepository = perforPerSheetRepository;
......@@ -61,6 +63,7 @@ public class ComputeService : IAutoInjection
this.hospitalRepository = hospitalRepository;
this.perapramountRepository = perapramountRepository;
this.cofcmiRepository = cofcmiRepository;
this.cofworkitemRepository = cofworkitemRepository;
}
public int IsShowManage(int allotId)
......@@ -528,6 +531,9 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
{
var doctor = perforResaccountRepository.GetEntity(t => t.ID == accountId);
var workitems = cofworkitemRepository.GetEntities(t => t.AllotID == doctor.AllotID);
var allotCmi = cofcmiRepository.GetEntity(t => t.AllotId == doctor.AllotID && t.UnitType == doctor.UnitType && t.AccountingUnit == doctor.AccountingUnit);
var allot = perforPerallotRepository.GetEntity(t => t.ID == doctor.AllotID);
DeptDataDetails deptDetails = new DeptDataDetails
{
......@@ -610,17 +616,32 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
ItemName = t.TypeName,
CellValue = t.CellValue,
Factor = sheet.SheetType == (int)SheetType.Workload ? t.FactorValue : t.FactorValue * 100,
ItemValue = t.IsFactor == 1 ? (t.CellValue * (t.FactorValue ?? 0)) : t.CellValue
ItemValue = t.IsFactor == 1 ? (t.CellValue * (t.FactorValue ?? 0)) : t.CellValue,
}).ToList();
if (items != null && items.Any())
{
items = items.GroupBy(t => t.ItemName).Select(t => new DetailModule
items = items.GroupBy(t => t.ItemName).Select(t =>
{
ItemName = t.Key,
CellValue = t.Sum(group => group.CellValue),
Factor = t.FirstOrDefault().Factor,
ItemValue = t.Sum(group => group.ItemValue),
var dto = new DetailModule
{
ItemName = t.Key,
CellValue = t.Sum(group => group.CellValue),
Factor = t.FirstOrDefault().Factor,
ItemValue = t.Sum(group => group.ItemValue),
};
if (sheet.SheetType == (int)SheetType.Workload)
{
if (workitems != null && workitems.Any(a => a.Type == 1 && a.Item == t.Key))
dto.MediFactor = doctor.MedicineFactor;
if (workitems != null && workitems.Any(a => a.Type == 2 && a.Item == t.Key) && allotCmi != null)
dto.CMIFactor = allotCmi.Value;
dto.ItemValue = dto.ItemValue * (dto.MediFactor ?? 1) * (dto.CMIFactor ?? 1);
}
return dto;
}).ToList();
}
......@@ -703,6 +724,8 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
ItemValue = t.ItemValue,
CellValue = t.CellValue,
Factor = t.Factor,
MediFactor = t.MediFactor,
CMIFactor = t.CMIFactor,
}).ToList();
}
}
......
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