Commit 8a3157ca by lcx

特殊科室抽取

parent 377064cf
...@@ -493,27 +493,27 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit ...@@ -493,27 +493,27 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
//case SheetType.ClinicEmployee: //case SheetType.ClinicEmployee:
// WriteClinicEmployee(sheet, sheetRead, false); // WriteClinicEmployee(sheet, sheetRead, false);
// break; // break;
//case SheetType.OtherIncome: case SheetType.OtherIncome:
// ClearData(sheet, 5, 7); ClearData(sheet, 5, 7);
// WriteOtherIncome(sheet, sheetRead, modules, items, extracts, false); WriteOtherIncome(sheet, sheetRead, modules, items, extracts, false);
// break; break;
//case SheetType.Income: case SheetType.Income:
// ClearData(sheet, 5, 3, true); ClearData(sheet, 5, 3, true);
// WriteIncome(sheet, sheetRead, modules, items, extracts, false); WriteIncome(sheet, sheetRead, modules, items, extracts, false);
// break; break;
//case SheetType.Expend: case SheetType.Expend:
// ClearData(sheet, 5, 7); ClearData(sheet, 5, 7);
// WriteExpend(sheet, sheetRead, modules, items, extracts, false); WriteExpend(sheet, sheetRead, modules, items, extracts, false);
// break; break;
//case SheetType.Workload: case SheetType.Workload:
// ClearData(sheet, 3, 3); ClearData(sheet, 3, 3);
// WriteWorkload(sheet, sheetRead, modules, items, extracts, false); WriteWorkload(sheet, sheetRead, modules, items, extracts, false);
// break; break;
//case SheetType.AccountBasic: //case SheetType.AccountBasic:
// WriteAccountBasic(sheet, sheetRead, false); // WriteAccountBasic(sheet, sheetRead, false);
// break; // break;
case SheetType.SpecialUnit: case SheetType.SpecialUnit:
//ClearData(sheet, 2, 0); ClearData(sheet, 2, 3, endCellNum: 4);
SupplySpecialUnit(sheet, sheetRead, specials, extracts, lastAllot, false); SupplySpecialUnit(sheet, sheetRead, specials, extracts, lastAllot, false);
break; break;
} }
...@@ -795,7 +795,7 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook ...@@ -795,7 +795,7 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
} }
} }
private void ClearData(ISheet sheet, int beginRowNum, int beginCellNum, bool isIncome = false) private void ClearData(ISheet sheet, int beginRowNum, int beginCellNum, bool isIncome = false, int? endCellNum = null)
{ {
if (sheet == null) if (sheet == null)
return; return;
...@@ -805,8 +805,9 @@ private void ClearData(ISheet sheet, int beginRowNum, int beginCellNum, bool isI ...@@ -805,8 +805,9 @@ private void ClearData(ISheet sheet, int beginRowNum, int beginCellNum, bool isI
var row = sheet.GetRow(i); var row = sheet.GetRow(i);
if (row != null) if (row != null)
{ {
int lastCellNum = endCellNum ?? row.LastCellNum;
//跳过核算单元和科室 //跳过核算单元和科室
for (int j = beginCellNum; j < row.LastCellNum; j++) for (int j = beginCellNum; j < lastCellNum; j++)
{ {
var cell = row.GetCell(j); var cell = row.GetCell(j);
if (cell != null && (cell.CellType != CellType.Formula || isIncome)) if (cell != null && (cell.CellType != CellType.Formula || isIncome))
...@@ -1371,7 +1372,7 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e ...@@ -1371,7 +1372,7 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
headerDict.Add(t.StringCellValue, cellList.IndexOf(t)); headerDict.Add(t.StringCellValue, cellList.IndexOf(t));
}); });
if (!headerDict.ContainsKey("科室") || !headerDict.ContainsKey("量化指标")) return; if (!headerDict.ContainsKey("科室") || !headerDict.ContainsKey("量化指标") || !headerDict.ContainsKey("数量")) return;
var extractdata = data.Where(t => t.SheetName == specialname).ToList(); var extractdata = data.Where(t => t.SheetName == specialname).ToList();
...@@ -1393,6 +1394,9 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e ...@@ -1393,6 +1394,9 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
var config = deptSpecials.FirstOrDefault(t => t.Target == target); var config = deptSpecials.FirstOrDefault(t => t.Target == target);
if (config != null) if (config != null)
{ {
var numcell = GetOrCreate(row, headerDict["数量"]);
var value = extractdata?.FirstOrDefault(t => t.Department == merge.Value && t.Category == target)?.Value;
OutToExcelCell(numcell, value);
deptSpecials.RemoveAll(t => t.Department == merge.Value && t.Target == target); deptSpecials.RemoveAll(t => t.Department == merge.Value && t.Target == target);
continue; continue;
} }
......
...@@ -83,7 +83,7 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob ...@@ -83,7 +83,7 @@ public void ReturnTheLog(int allotId, string groupName, int type, string tag, ob
var http = url.ImportFile + $"/template/returnlog?type={type}&tag={tag}&message={message}&level={level}&groupName={groupName}"; var http = url.ImportFile + $"/template/returnlog?type={type}&tag={tag}&message={message}&level={level}&groupName={groupName}";
//logger.LogInformation("发送日志:" + http); //logger.LogInformation("发送日志:" + http);
logdbug.Add(allotId, tag, message.ToString(), level, type); logdbug.Add(allotId, tag, message.ToString(), level, type);
//HttpHelper.HttpPost(http); HttpHelper.HttpPost(http);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
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