提取其他工作量

parent 281905bd
...@@ -112,7 +112,7 @@ public void DefaultModules(int hospitalId) ...@@ -112,7 +112,7 @@ public void DefaultModules(int hospitalId)
public ex_module AddModule(ModModuleRequest request) public ex_module AddModule(ModModuleRequest request)
{ {
if (!new int[] { (int)SheetType.Income, (int)SheetType.OtherWorkload, (int)SheetType.Assess }.Contains(request.SheetType.Value)) if (!new int[] { (int)SheetType.Income, (int)SheetType.OtherIncome, (int)SheetType.OtherWorkload, (int)SheetType.Assess }.Contains(request.SheetType.Value))
throw new PerformanceException("模块类型错误,只支持收入模板配置"); throw new PerformanceException("模块类型错误,只支持收入模板配置");
string addname = ""; string addname = "";
......
...@@ -54,29 +54,63 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo ...@@ -54,29 +54,63 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
try try
{ {
foreach (var module in modulesList.Where(t => t.SheetType == (int)SheetType.Income)?.OrderBy(t => t.ModuleName)) //foreach (var module in modulesList.Where(t => t.SheetType == (int)SheetType.Income)?.OrderBy(t => t.ModuleName))
//{
// var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
// if (sheet == null)
// {
// string[] keyArray = new string[] { "开单", "就诊", "执行" };
// if (keyArray.Any(key => module.ModuleName.Contains(key)))
// {
// var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("1.")).OrderByDescending(t => t.Key).First();
// var copysheet = workbook.GetSheet(item.Key);
// if (copysheet == null) continue;
// try
// {
// var newSheet = copysheet.CopySheet(module.ModuleName, true);
// workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1);
// }
// catch (Exception)
// {
// }
// }
// }
//}
foreach (var module in modulesList.Where(t => new int[] { (int)SheetType.Income, (int)SheetType.OtherIncome }.Contains(t.SheetType.Value))?.OrderBy(t => t.ModuleName))
{ {
var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank()); var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
if (sheet == null) if (sheet == null)
{ {
string[] keyArray = new string[] { "开单", "就诊", "执行" }; ExcelStyle style = new ExcelStyle(workbook);
if (keyArray.Any(key => module.ModuleName.Contains(key))) var cellStyle = style.SetBgkColorAndFormat(style.GetCellStyle(), StyleType.列头, CellFormat.默认);
{
var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("1.")).OrderByDescending(t => t.Key).First(); var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("1.0.")).OrderByDescending(t => t.Key).First();
var copysheet = workbook.GetSheet(item.Key); var newSheet = workbook.CreateSheet(module.ModuleName);
if (copysheet == null) continue; newSheet.GetOrCreate(1).GetOrCreate(6).SetCellValue("护理组分割比例:");
try newSheet.GetOrCreate(1).GetOrCreate(6).CellStyle = cellStyle;
{ newSheet.GetOrCreate(2).GetOrCreate(6).SetCellValue("医生组分割比例:");
var newSheet = copysheet.CopySheet(module.ModuleName, true); newSheet.GetOrCreate(2).GetOrCreate(6).CellStyle = cellStyle;
newSheet.GetOrCreate(3).GetOrCreate(6).SetCellValue("医技组分割比例:");
newSheet.GetOrCreate(3).GetOrCreate(6).CellStyle = cellStyle;
var r5 = newSheet.GetOrCreate(4);
r5.GetOrCreate(0).SetCellValue("核算收入(医技组)");
r5.GetOrCreate(1).SetCellValue("核算收入(医生组)");
r5.GetOrCreate(2).SetCellValue("核算收入(护理组)");
r5.GetOrCreate(3).SetCellValue("核算单元(医技组)");
r5.GetOrCreate(4).SetCellValue("核算单元(医生组)");
r5.GetOrCreate(5).SetCellValue("核算单元(护理组)");
r5.GetOrCreate(6).SetCellValue("科室名称");
r5.GetOrCreate(0).CellStyle = cellStyle;
r5.GetOrCreate(1).CellStyle = cellStyle;
r5.GetOrCreate(2).CellStyle = cellStyle;
r5.GetOrCreate(3).CellStyle = cellStyle;
r5.GetOrCreate(4).CellStyle = cellStyle;
r5.GetOrCreate(5).CellStyle = cellStyle;
r5.GetOrCreate(6).CellStyle = cellStyle;
workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1); workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1);
} }
catch (Exception)
{
}
} }
}
}
foreach (var module in modulesList.Where(t => new int[] { (int)SheetType.OtherWorkload, (int)SheetType.Assess }.Contains(t.SheetType.Value))?.OrderBy(t => t.ModuleName)) foreach (var module in modulesList.Where(t => new int[] { (int)SheetType.OtherWorkload, (int)SheetType.Assess }.Contains(t.SheetType.Value))?.OrderBy(t => t.ModuleName))
{ {
var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank()); var sheet = workbook.GetSheet(module.ModuleName) ?? workbook.GetSheet(module.ModuleName.NoBlank());
...@@ -93,7 +127,7 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo ...@@ -93,7 +127,7 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
} }
} }
} }
catch catch (Exception ex)
{ {
} }
} }
......
...@@ -234,7 +234,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s ...@@ -234,7 +234,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
var row = sheet.GetOrCreate(dataFirstRowNum); var row = sheet.GetOrCreate(dataFirstRowNum);
for (int cellIndex = point.HeaderFirstCellNum.Value; cellIndex < columnHeader.LastCellNum; cellIndex++) for (int cellIndex = point.HeaderFirstCellNum.Value; cellIndex < columnHeader.LastCellNum; cellIndex++)
{ {
var column = columnHeader.GetCell(cellIndex).GetDecodeEscapes()?.Replace("(", "(").Replace(")", ")"); ; var column = columnHeader.GetCell(cellIndex).GetDecodeEscapes()?.Replace("(", "(").Replace(")", ")");
var cell = row.CreateCell(cellIndex); var cell = row.CreateCell(cellIndex);
if (filed.ContainsKey(column)) if (filed.ContainsKey(column))
......
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