Commit ba5ea1ea by lcx

特殊科室带出医院奖罚,药占比系数为空

parent a9456eda
......@@ -586,6 +586,7 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
var allData = datalist.GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
var cofList = perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotid);
if (cofList == null || !cofList.Any()) return cofs;
var unitList = (drugData?.Select(t => t.AccountingUnit) ?? new List<string>()).Union(allData.Select(t => t.AccountingUnit));
......
......@@ -836,7 +836,7 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
PerforFee = special.FirstOrDefault()?.GiveFee,
PerforTotal = special.FirstOrDefault()?.ResultsTotalFee,
Income = special.FirstOrDefault()?.ResultsTotalFee,
//Extra = special.First().Punishment.Value,
Extra = special.FirstOrDefault()?.Punishment ?? 0,
},
Detail = new List<DetailDtos>(),
};
......@@ -859,9 +859,39 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
});
}
deptDetails.Detail.Add(detail);
var extra = new DetailDtos
{
ItemName = "医院奖罚",
IncomeType = 5,
Amount = deptDetails.Pandect.Extra,
Items = GetExtraDetail(second.AllotId.Value, (int)UnitType.特殊核算组, second.Department),
GroupBasis = 1,
};
deptDetails.Detail.Add(extra);
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)
{
......
......@@ -113,11 +113,11 @@ public List<SecondListResponse> GetSecondList(int userId)
var secondList = perforAgsecondallotRepository.GetEntities(exp);
//各科室绩效分配结果
var accountList = perforResaccountRepository.GetEntities(t => allotListId.Contains(t.AllotID.Value) && t.Department == user.Department);
var accountList = perforResaccountRepository.GetEntities(t => allotListId.Contains(t.AllotID.Value) && t.AccountingUnit == user.Department);
//取得未生成二次绩效的绩效id
var exceptListId = secondList == null ? allotListId : allotListId.Except(secondList.Select(t => t.AllotId.Value));
var specialList = resspecialunitRepository.GetEntities(t => allotListId.Contains(t.AllotID.Value) && t.Department == user.Department);
var specialList = resspecialunitRepository.GetEntities(t => allotListId.Contains(t.AllotID.Value) && t.AccountingUnit == user.Department);
#region 初始化二次绩效
List<ag_secondallot> newSecond = new List<ag_secondallot>();
......
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