Commit 56de6598 by lcx

Merge branch '单元格修改' into yubei/人员额外绩效金额

parents 972ef511 d48c18ad
......@@ -503,9 +503,8 @@ public List<res_baiscnorm> GetBaiscnorm(int allotId)
/// <returns></returns>
public DeptDataDetails DeptDetail(int accountId)
{
var sheetType = new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload };
var doctor = perforResaccountRepository.GetEntity(t => t.ID == accountId);
string typeValue = EnumHelper.GetItems<UnitType>().FirstOrDefault(t => t.Value == doctor.UnitType).Name.ToString();
var allot = perforPerallotRepository.GetEntity(t => t.ID == doctor.AllotID);
DeptDataDetails deptDetails = new DeptDataDetails
{
......@@ -513,27 +512,41 @@ public DeptDataDetails DeptDetail(int accountId)
Pandect = Mapper.Map<PerDataAccountBaisc>(doctor),
Detail = new List<DetailDtos>()
};
int type = doctor.UnitType.Value;
if (type == (int)UnitType.专家组 || type == (int)UnitType.其他医技组 || type == (int)UnitType.其他医生组)
type = 1;
else if (type == (int)UnitType.其他护理组)
type = 2;
var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == doctor.AllotID && t.UnitType == type && t.AccountingUnit == doctor.AccountingUnit);
var persheet = _perforPerSheetRepository.GetEntities(t => t.AllotID == doctor.AllotID);
var headers = _perforImheaderRepository.GetEntities(t => t.AllotID == doctor.AllotID);
//科室经济
var sheetEconomic = persheet.FirstOrDefault(t => t.SheetType == (int)SheetType.ComputeEconomic);
var dataEconomicList = basicData.Where(t => t.SheetID == sheetEconomic?.ID && t.UnitType == type && t.IsTotal != 1 && t.AccountingUnit == doctor.AccountingUnit).ToList();
var economic = dataEconomicList?.Select(t => new DeptDetail { ItemName = t.TypeName.Replace($"({typeValue})", ""), ItemValue = t.CellValue ?? 0 });
var basicData = _perforImDataRepository.GetEntities(t => t.AllotID == doctor.AllotID && t.AccountingUnit == doctor.AccountingUnit);
var dataEconomicList = basicData.Where(t => t.SheetID == sheetEconomic?.ID && t.IsTotal != 1 && t.AccountingUnit == doctor.AccountingUnit).ToList();
string typeValue = EnumHelper.GetDescription((UnitType)doctor.UnitType);
var economic = dataEconomicList?.Select(t => new
{
ItemName = t.TypeName.Replace($"({typeValue})", ""),
ItemValue = t.CellValue ?? 0,
t.UnitType
});
var headers = _perforImheaderRepository.GetEntities(t => t.AllotID == doctor.AllotID);
Regex reg = new Regex("[0-9]*");
int type = doctor.UnitType.Value;
var docUnitTypes = new List<int> { (int)UnitType.专家组, (int)UnitType.其他医生组, (int)UnitType.其他医技组 };
if (docUnitTypes.Contains(type))
type = 1;
else if (type == (int)UnitType.其他护理组)
type = 2;
var sheetType = new List<int> { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload };
foreach (var stype in sheetType)
{
if (type == 3 && stype == (int)SheetType.Workload) type = 1;
foreach (var sheet in persheet.Where(t => t.SheetType == stype))
{
var sheetName = reg.Replace(sheet.SheetName, "", 5).Replace(".", "").Replace(" ", "");
var sheetData = basicData.Where(t => t.SheetID == sheet.ID).ToList();
var sheetData = basicData.Where(t => t.SheetID == sheet.ID && t.UnitType == type).ToList();
if (sheetData == null || !sheetData.Any()) continue;
var headerData = headers?.Where(t => t.SheetID == sheet.ID);
......@@ -542,7 +555,8 @@ public DeptDataDetails DeptDetail(int accountId)
{
ItemName = sheetName,
IncomeType = sheet.SheetType == (int)SheetType.Expend ? 2 : sheet.SheetType == (int)SheetType.Workload ? 3 : 1,
Amount = (sheet.SheetType == (int)SheetType.Workload ? doctor.WorkloadFee : economic.FirstOrDefault(t => t.ItemName.Contains(sheetName))?.ItemValue) ?? 0m,
Amount = (sheet.SheetType == (int)SheetType.Workload ? doctor.WorkloadFee
: economic.FirstOrDefault(t => t.ItemName.Contains(sheetName) && t.UnitType == type)?.ItemValue) ?? 0m,
};
var items = sheetData?.Select(t => new DetailModule
......
......@@ -39,6 +39,8 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
"保底绩效系数",
"其他绩效1",
"其他绩效2",
"药占比奖罚",
"材料占比奖罚",
"医院奖罚",
"考核得分率",
"调节系数",
......
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