Commit e0b7db57 by 李承祥

抽取系数修改

parent d9ce261a
...@@ -156,10 +156,10 @@ public string ExtractData(int allotId, string email, int hospitalId) ...@@ -156,10 +156,10 @@ public string ExtractData(int allotId, string email, int hospitalId)
WriteIncome(sheet, allotLast.ID, sheetRead, allot, modulesList, hospitalConfigList); WriteIncome(sheet, allotLast.ID, sheetRead, allot, modulesList, hospitalConfigList);
break; break;
case SheetType.OtherIncome: case SheetType.OtherIncome:
WriteOtherIncome(sheet, sheetRead); WriteOtherIncome(sheet, hospital.ID, sheetRead);
break; break;
case SheetType.Expend: case SheetType.Expend:
WriteExpend(sheet, sheetRead); WriteExpend(sheet, hospital.ID, sheetRead);
break; break;
case SheetType.Workload: case SheetType.Workload:
WriteWorkload(sheet, allotLast.ID, sheetRead, allot, modulesList, hospitalConfigList); WriteWorkload(sheet, allotLast.ID, sheetRead, allot, modulesList, hospitalConfigList);
...@@ -217,16 +217,16 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook ...@@ -217,16 +217,16 @@ private static void CreateNotExistSheet(List<mod_module> modulesList, IWorkbook
} }
} }
private void WriteOtherIncome(ISheet sheet, IPerSheetDataRead sheetRead) private void WriteOtherIncome(ISheet sheet, int hospitalId, IPerSheetDataRead sheetRead)
{ {
var module = perforModmoduleRepository.GetEntity(t => t.SheetType == (int)SheetType.Expend); var module = perforModmoduleRepository.GetEntity(t => t.SheetType == (int)SheetType.OtherIncome && t.HospitalId == hospitalId);
var itemList = perforModitemRepository.GetEntities(t => t.ModuleId == module.Id); var itemList = perforModitemRepository.GetEntities(t => t.ModuleId == module.Id);
if (itemList == null || !itemList.Any()) return; if (itemList == null || !itemList.Any()) return;
var nurseFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 1); var nurseFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "护理组").FactorRow.Value);
var doctorFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 2); var doctorFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医生组").FactorRow.Value);
var technicianFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3); var technicianFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医技组").FactorRow.Value);
var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 4); var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value);
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4; int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
//写入列头信息 //写入列头信息
...@@ -248,10 +248,10 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR ...@@ -248,10 +248,10 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
var itemList = perforModitemRepository.GetEntities(t => t.ModuleId == module.Id); var itemList = perforModitemRepository.GetEntities(t => t.ModuleId == module.Id);
if (itemList == null || !itemList.Any()) return; if (itemList == null || !itemList.Any()) return;
var nurseFactor = GetOrCreate(sheet, sheetRead.Point.HeaderFirstRowNum.Value + 0); var nurseFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "护理组").FactorRow.Value);
var doctorFactor = GetOrCreate(sheet, sheetRead.Point.HeaderFirstRowNum.Value + 1); var doctorFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医生组").FactorRow.Value);
var technicianFactor = GetOrCreate(sheet, sheetRead.Point.HeaderFirstRowNum.Value + 2); var technicianFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医技组").FactorRow.Value);
var head = GetOrCreate(sheet, sheetRead.Point.HeaderFirstRowNum.Value + 3); var head = GetOrCreate(sheet, sheetRead.Point.HeaderFirstRowNum.Value);
//写入列头信息 //写入列头信息
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4; int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
...@@ -278,7 +278,7 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR ...@@ -278,7 +278,7 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
var importSheet = perforPersheetRepository.GetEntities(t => t.AllotID == allotLastId && t.SheetType == (int)SheetType.Income); var importSheet = perforPersheetRepository.GetEntities(t => t.AllotID == allotLastId && t.SheetType == (int)SheetType.Income);
var importSheetId = importSheet.Select(t => t.ID).ToList(); var importSheetId = importSheet.Select(t => t.ID).ToList();
var importData = perforImdataRepository.GetEntities(t => importSheetId.Contains(t.SheetID.Value)); var importData = perforImdataRepository.GetEntities(t => importSheetId.Contains(t.SheetID.Value));
var rowIndex = sheetRead.Point.HeaderFirstRowNum.Value + 4; var rowIndex = sheetRead.Point.HeaderFirstRowNum.Value + 1;
foreach (var department in allExtract.Select(t => t.Department).Distinct()) foreach (var department in allExtract.Select(t => t.Department).Distinct())
{ {
var row = sheet.CreateRow(rowIndex); var row = sheet.CreateRow(rowIndex);
...@@ -442,15 +442,19 @@ private List<ExtractDto> QueryDatabase(List<sys_hospitalconfig> hospitalConfigLi ...@@ -442,15 +442,19 @@ private List<ExtractDto> QueryDatabase(List<sys_hospitalconfig> hospitalConfigLi
return null; return null;
} }
private void WriteExpend(ISheet sheet, IPerSheetDataRead sheetRead) private void WriteExpend(ISheet sheet, int hospitalId, IPerSheetDataRead sheetRead)
{ {
var module = perforModmoduleRepository.GetEntity(t => t.SheetType == (int)SheetType.Expend); var module = perforModmoduleRepository.GetEntity(t => t.SheetType == (int)SheetType.Expend && t.HospitalId == hospitalId);
var itemList = perforModitemRepository.GetEntities(t => t.ModuleId == module.Id); var itemList = perforModitemRepository.GetEntities(t => t.ModuleId == module.Id);
if (itemList == null || !itemList.Any()) return; if (itemList == null || !itemList.Any()) return;
var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 1); //var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 1);
var nurseFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 2); //var nurseFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 2);
var doctorFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3); //var doctorFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3);
var nurseFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "护理组").FactorRow.Value);
var doctorFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医生组").FactorRow.Value);
var technicianFactor = sheet.GetRow(sheetRead.Point.AccountingUnit.First(t => t.UnitType == "医技组").FactorRow.Value);
var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value);
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4; int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
//写入列头信息 //写入列头信息
...@@ -459,6 +463,7 @@ private void WriteExpend(ISheet sheet, IPerSheetDataRead sheetRead) ...@@ -459,6 +463,7 @@ private void WriteExpend(ISheet sheet, IPerSheetDataRead sheetRead)
GetOrCreate(head, cellStartIndex).SetCellValue(item.ItemName); GetOrCreate(head, cellStartIndex).SetCellValue(item.ItemName);
GetOrCreate(doctorFactor, cellStartIndex).SetCellValue(item.FactorValue1?.ToString()); GetOrCreate(doctorFactor, cellStartIndex).SetCellValue(item.FactorValue1?.ToString());
GetOrCreate(nurseFactor, cellStartIndex).SetCellValue(item.FactorValue2?.ToString()); GetOrCreate(nurseFactor, cellStartIndex).SetCellValue(item.FactorValue2?.ToString());
GetOrCreate(technicianFactor, cellStartIndex).SetCellValue(item.FactorValue3?.ToString());
cellStartIndex++; cellStartIndex++;
} }
} }
......
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