Commit e56d886c by zry

excel

parent cd28891b
...@@ -39,4 +39,5 @@ build/ ...@@ -39,4 +39,5 @@ build/
/artifacts /artifacts
.svn .svn
logs/ logs/
/files /files
\ No newline at end of file performance/Performance.Api/Files/
...@@ -8,9 +8,10 @@ class Program ...@@ -8,9 +8,10 @@ class Program
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Hello World!"); Console.WriteLine("Hello World!");
PerSheetService perSheetService = new PerSheetService(); PerHeaderService perHeaderService = new PerHeaderService();
PerSheetService perSheetService = new PerSheetService(perHeaderService);
PerExcelService perExcelService = new PerExcelService(perSheetService); PerExcelService perExcelService = new PerExcelService(perSheetService);
var excel = perExcelService.Import(@"C:\Users\ry\Desktop\文件\测试.xlsx"); var excel = perExcelService.Import(@"E:\code_git\performance\performance\Performance.Api\Files\9\201911\医院绩效分配系统数据收集模板V120190307133444707.xlsx");
Console.ReadKey(); Console.ReadKey();
} }
......
...@@ -19,11 +19,13 @@ public enum SheetType ...@@ -19,11 +19,13 @@ public enum SheetType
Employee = 2, Employee = 2,
[Description("收入")] [Description("收入")]
Income = 3, Income = 3,
[Description("其他收入")]
OtherIncome = 4,
[Description("支出")] [Description("支出")]
Expend = 4, Expend = 5,
[Description("加班")] [Description("加班")]
Overtime = 5, Overtime = 6,
[Description("工作量")] [Description("工作量")]
Workload = 6, Workload = 7,
} }
} }
...@@ -7,6 +7,10 @@ namespace Performance.DtoModels ...@@ -7,6 +7,10 @@ namespace Performance.DtoModels
public class PerData public class PerData
{ {
/// <summary> /// <summary>
/// 核算单元类别 (医生组/护理组)
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 核算单元名称 /// 核算单元名称
/// </summary> /// </summary>
public string AccountingUnit { get; set; } public string AccountingUnit { get; set; }
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PerDataIncome : PerData<decimal?>
{
/// <summary>
/// 系数值
/// </summary>
public decimal? FactorValue { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Performance.DtoModels
{
public class PerDataOtherIncome : PerData<decimal?>
{
}
}
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class PerDataWorkload : PerData<decimal> public class PerDataWorkload : PerData<decimal?>
{ {
public string ParentType { get; set; } public decimal? FactorValue { get; set; }
} }
} }
...@@ -7,6 +7,10 @@ namespace Performance.DtoModels ...@@ -7,6 +7,10 @@ namespace Performance.DtoModels
{ {
public class PerHeader public class PerHeader
{ {
/// <summary>
/// 唯一标准
/// </summary>
public string SignID { get; set; }
public int PointRow { get; set; } public int PointRow { get; set; }
public int PointCell { get; set; } public int PointCell { get; set; }
public bool IsMerge => MergeRow > 1 || MergeCell > 1; public bool IsMerge => MergeRow > 1 || MergeCell > 1;
......
...@@ -19,6 +19,10 @@ public class PerSheet ...@@ -19,6 +19,10 @@ public class PerSheet
/// </summary> /// </summary>
public string ModuleName { get; set; } public string ModuleName { get; set; }
/// <summary> /// <summary>
/// sheet头部
/// </summary>
public List<PerHeader> PerHeader { get; set; }
/// <summary>
/// sheet数据 /// sheet数据
/// </summary> /// </summary>
public List<PerData> PerData { get; set; } public List<PerData> PerData { get; set; }
......
...@@ -25,6 +25,12 @@ public class PerSheetPoint ...@@ -25,6 +25,12 @@ public class PerSheetPoint
/// 数据开始行 /// 数据开始行
/// </summary> /// </summary>
public int? DataFirstRowNum { get; set; } public int? DataFirstRowNum { get; set; }
public List<AccountingUnit> AccountingUnit { get; set; }
}
public class AccountingUnit
{
/// <summary> /// <summary>
/// 系数行号 /// 系数行号
/// </summary> /// </summary>
...@@ -37,5 +43,9 @@ public class PerSheetPoint ...@@ -37,5 +43,9 @@ public class PerSheetPoint
/// 科室名称 /// 科室名称
/// </summary> /// </summary>
public int? DeptCellNum { get; set; } public int? DeptCellNum { get; set; }
/// <summary>
/// 核算单元类型
/// </summary>
public string UnitType { get; set; }
} }
} }
...@@ -18,6 +18,12 @@ public PerExcelService(PerSheetService perSheetService) ...@@ -18,6 +18,12 @@ public PerExcelService(PerSheetService perSheetService)
{ {
_perSheetService = perSheetService; _perSheetService = perSheetService;
} }
/// <summary>
/// 导入excel数据
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public PerExcel Import(string path) public PerExcel Import(string path)
{ {
PerExcel excel = new PerExcel PerExcel excel = new PerExcel
......
...@@ -166,6 +166,7 @@ private List<PerHeader> ReadHeadMatrix(ISheet sheet, PerSheetPoint point, List<L ...@@ -166,6 +166,7 @@ private List<PerHeader> ReadHeadMatrix(ISheet sheet, PerSheetPoint point, List<L
} }
var header = new PerHeader var header = new PerHeader
{ {
SignID = Guid.NewGuid().ToString("N"),
PointRow = point.HeaderFirstRowNum.Value + r, PointRow = point.HeaderFirstRowNum.Value + r,
PointCell = point.HeaderFirstCellNum.Value + c, PointCell = point.HeaderFirstCellNum.Value + c,
MergeCell = ci, MergeCell = ci,
......
...@@ -10,6 +10,17 @@ namespace Performance.Services ...@@ -10,6 +10,17 @@ namespace Performance.Services
{ {
public class PerSheetService : IAutoInjection public class PerSheetService : IAutoInjection
{ {
PerHeaderService _perHeader;
public PerSheetService(PerHeaderService perHeader)
{
_perHeader = perHeader;
}
/// <summary>
/// 解析excel数据
/// </summary>
/// <param name="sheet"></param>
/// <returns></returns>
public PerSheet Sheet(ISheet sheet) public PerSheet Sheet(ISheet sheet)
{ {
PerSheet perSheet = new PerSheet(); PerSheet perSheet = new PerSheet();
...@@ -21,8 +32,8 @@ public PerSheet Sheet(ISheet sheet) ...@@ -21,8 +32,8 @@ public PerSheet Sheet(ISheet sheet)
return null; return null;
var sheetRead = PerSheetDataFactory.GetDataRead(perSheet.SheetType); var sheetRead = PerSheetDataFactory.GetDataRead(perSheet.SheetType);
perSheet.PerData = AnalyzeData(sheet, sheetRead); perSheet.PerHeader = _perHeader.GetPerHeaderReverse(sheet, sheetRead.Point);
perSheet.PerData = sheetRead.ReadData(sheet, perSheet.PerHeader);
return perSheet; return perSheet;
} }
...@@ -30,6 +41,8 @@ public SheetType GetSheetType(string sheetName) ...@@ -30,6 +41,8 @@ public SheetType GetSheetType(string sheetName)
{ {
if (sheetName.StartsWith("医院人员名单")) if (sheetName.StartsWith("医院人员名单"))
return SheetType.Employee; return SheetType.Employee;
else if (sheetName.StartsWith("1.0"))
return SheetType.OtherIncome;
else if (sheetName.StartsWith("1.")) else if (sheetName.StartsWith("1."))
return SheetType.Income; return SheetType.Income;
else if (sheetName.StartsWith("2.")) else if (sheetName.StartsWith("2."))
...@@ -39,24 +52,25 @@ public SheetType GetSheetType(string sheetName) ...@@ -39,24 +52,25 @@ public SheetType GetSheetType(string sheetName)
return SheetType.Unidentifiable; return SheetType.Unidentifiable;
} }
public List<PerData> AnalyzeData(ISheet sheet, IPerSheetDataRead sheetRead) //public List<PerData> AnalyzeData(ISheet sheet, IPerSheetDataRead sheetRead, List<PerHeader> headList)
{ //{
List<PerData> dataList = new List<PerData>(); // List<PerData> dataList = new List<PerData>();
PerHeaderService perHeader = new PerHeaderService();
var headList = perHeader.GetPerHeaderReverse(sheet, sheetRead.Point); // foreach (var unit in sheetRead.Point.AccountingUnit)
var vhead = headList.Where(t => t.PointCell != sheetRead.Point.AccountingUnitCellNum && t.PointCell != sheetRead.Point.DeptCellNum) // {
.OrderBy(t => t.PointCell); // var vhead = headList.Where(t => t.PointCell != unit.AccountingUnitCellNum && t.PointCell != unit.DeptCellNum).OrderBy(t => t.PointCell);
for (int r = sheetRead.Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++) // for (int r = sheetRead.Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{ // {
var row = sheet.GetRow(r); // var row = sheet.GetRow(r);
for (int c = 0; c < vhead.Count(); c++) // for (int c = 0; c < vhead.Count(); c++)
{ // {
PerData data = sheetRead.GetPerData(row, vhead.ElementAt(c)); // PerData data = sheetRead.GetPerData(row, vhead.ElementAt(c));
dataList.Add(data); // dataList.Add(data);
} // }
} // }
return dataList; // }
} // return dataList;
//}
} }
} }
...@@ -8,7 +8,16 @@ namespace Performance.Services ...@@ -8,7 +8,16 @@ namespace Performance.Services
{ {
public interface IPerSheetDataRead public interface IPerSheetDataRead
{ {
/// <summary>
/// excel 列头及数据 配置信息
/// </summary>
PerSheetPoint Point { get; } PerSheetPoint Point { get; }
PerData GetPerData(IRow row, PerHeader perHeader); /// <summary>
/// 读取数据
/// </summary>
/// <param name="sheet"></param>
/// <param name="perHeader"></param>
/// <returns></returns>
List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader);
} }
} }
...@@ -5,8 +5,16 @@ ...@@ -5,8 +5,16 @@
namespace Performance.Services namespace Performance.Services
{ {
/// <summary>
/// 工厂
/// </summary>
public class PerSheetDataFactory public class PerSheetDataFactory
{ {
/// <summary>
/// 构建excel读取
/// </summary>
/// <param name="sheetType"></param>
/// <returns></returns>
public static IPerSheetDataRead GetDataRead(SheetType sheetType) public static IPerSheetDataRead GetDataRead(SheetType sheetType)
{ {
IPerSheetDataRead dataread = null; IPerSheetDataRead dataread = null;
...@@ -18,6 +26,9 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType) ...@@ -18,6 +26,9 @@ public static IPerSheetDataRead GetDataRead(SheetType sheetType)
case SheetType.Income: case SheetType.Income:
dataread = new PerSheetDataReadIncome(); dataread = new PerSheetDataReadIncome();
break; break;
case SheetType.OtherIncome:
dataread = new PerSheetDataReadOtherIncome();
break;
case SheetType.Expend: case SheetType.Expend:
dataread = new PerSheetDataReadExpend(); dataread = new PerSheetDataReadExpend();
break; break;
......
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
using Performance.DtoModels; using Performance.DtoModels;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Performance.Services namespace Performance.Services
{ {
/// <summary>
/// 人员读取
/// </summary>
public class PerSheetDataReadEmployee : IPerSheetDataRead public class PerSheetDataReadEmployee : IPerSheetDataRead
{ {
public PerSheetPoint Point => new PerSheetPoint public PerSheetPoint Point => new PerSheetPoint
...@@ -14,20 +18,44 @@ public class PerSheetDataReadEmployee : IPerSheetDataRead ...@@ -14,20 +18,44 @@ public class PerSheetDataReadEmployee : IPerSheetDataRead
HeaderLastRowNum = 0, HeaderLastRowNum = 0,
HeaderFirstCellNum = 0, HeaderFirstCellNum = 0,
DataFirstRowNum = 1, DataFirstRowNum = 1,
AccountingUnitCellNum = 0, AccountingUnit = new List<AccountingUnit>
DeptCellNum = 1 {
new AccountingUnit
{
AccountingUnitCellNum = 0,
DeptCellNum = 1
}
}
}; };
public PerData GetPerData(IRow row, PerHeader perHeader)
public List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
return new PerDataEmployee List<PerData> dataList = new List<PerData>();
foreach (var unit in Point.AccountingUnit)
{ {
AccountingUnit = row.GetCell(Point.AccountingUnitCellNum.Value)?.ToString(), var vhead = perHeader.Where(t => t.PointCell != unit.AccountingUnitCellNum && t.PointCell != unit.DeptCellNum).OrderBy(t => t.PointCell);
Department = row.GetCell(Point.DeptCellNum.Value)?.ToString(),
TypeName = perHeader?.CellName, for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
CellValue = row.GetCell(perHeader.PointCell)?.ToString(), {
Annotation = row.GetCell(perHeader.PointCell)?.CellComment?.String?.String, var row = sheet.GetRow(r);
}; for (int c = 0; c < vhead.Count(); c++)
{
//PerData data = sheetRead.GetPerData(row, vhead.ElementAt(c));
PerData data = new PerDataEmployee
{
AccountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.ToString(),
Department = row.GetCell(unit.DeptCellNum.Value)?.ToString(),
TypeName = vhead.ElementAt(c)?.CellName,
CellValue = row.GetCell(vhead.ElementAt(c).PointCell)?.ToString(),
Annotation = row.GetCell(vhead.ElementAt(c).PointCell)?.CellComment?.String?.String,
};
dataList.Add(data);
}
}
}
return dataList;
} }
} }
} }
...@@ -7,30 +7,26 @@ ...@@ -7,30 +7,26 @@
namespace Performance.Services namespace Performance.Services
{ {
/// <summary>
/// 成本
/// </summary>
public class PerSheetDataReadExpend : IPerSheetDataRead public class PerSheetDataReadExpend : IPerSheetDataRead
{ {
public PerSheetPoint Point => new PerSheetPoint public PerSheetPoint Point => new PerSheetPoint
{ {
HeaderFirstRowNum = 3, HeaderFirstRowNum = 1,
HeaderLastRowNum = 4, HeaderLastRowNum = 2,
HeaderFirstCellNum = 3, HeaderFirstCellNum = 0,
DataFirstRowNum = 6, DataFirstRowNum = 3,
FactorRow = 5, //FactorRow = 5,
AccountingUnitCellNum = 3, //AccountingUnitCellNum = 3,
DeptCellNum = 4 //DeptCellNum = 4
}; };
public PerData GetPerData(IRow row, PerHeader perHeader) public List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
return new PerDataExpend //throw new NotImplementedException();
{ return null;
AccountingUnit = row.GetCell(Point.AccountingUnitCellNum.Value).ToString(),
Department = row.GetCell(Point.DeptCellNum.Value).ToString(),
ParentType = perHeader.Parent?.CellName,
TypeName = perHeader.CellName,
CellValue = Convert.ToDecimal(row.GetCell(perHeader.PointCell).ToString()),
Annotation = row.GetCell(perHeader.PointCell).CellComment?.String.String,
};
} }
} }
} }
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.Infrastructure;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Performance.Services namespace Performance.Services
...@@ -10,18 +12,68 @@ public class PerSheetDataReadIncome : IPerSheetDataRead ...@@ -10,18 +12,68 @@ public class PerSheetDataReadIncome : IPerSheetDataRead
{ {
public PerSheetPoint Point => new PerSheetPoint public PerSheetPoint Point => new PerSheetPoint
{ {
HeaderFirstRowNum = 1, HeaderFirstRowNum = 3,
HeaderLastRowNum = 1, HeaderLastRowNum = 3,
HeaderFirstCellNum = 0, HeaderFirstCellNum = 0,
DataFirstRowNum = 4, DataFirstRowNum = 4,
AccountingUnitCellNum = 0, AccountingUnit = new List<AccountingUnit>
DeptCellNum = 1, {
FactorRow = 1, //核算单元(医生组)
new AccountingUnit
{
AccountingUnitCellNum = 0,
UnitType = "医生组",
DeptCellNum = 2,
FactorRow = 2,
},
//核算单元(护理组)
new AccountingUnit
{
AccountingUnitCellNum = 1,
UnitType = "护理组",
DeptCellNum = 2,
FactorRow = 1,
}
}
//AccountingUnitCellNum = 0,
//DeptCellNum = 1,
//FactorRow = 1,
}; };
public PerData GetPerData(IRow row, PerHeader perHeader) public List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
throw new NotImplementedException(); List<PerData> dataList = new List<PerData>();
//循环 当前有几个核算单元
foreach (var unit in Point.AccountingUnit)
{
var vhead = perHeader.Where(t => !Point.AccountingUnit.Select(p => p.AccountingUnitCellNum).Contains(t.PointCell)
&& !Point.AccountingUnit.Select(p => p.DeptCellNum).Contains(t.PointCell)).OrderBy(t => t.PointCell);
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
for (int c = 0; c < vhead.Count(); c++)
{
var accountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.ToString();
if (string.IsNullOrEmpty(accountingUnit))
continue;
var athead = vhead.ElementAt(c);
//PerData data = sheetRead.GetPerData(row, vhead.ElementAt(c));
PerData data = new PerDataIncome
{
AccountingUnit = accountingUnit,
Department = row.GetCell(unit.DeptCellNum.Value)?.ToString(),
TypeName = athead?.CellName,
CellValue = ConvertHelper.To<decimal?>(row.GetCell(athead.PointCell)?.ToString()),
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
UnitType = unit.UnitType,
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.ToString()),
};
dataList.Add(data);
}
}
}
return dataList;
} }
} }
} }
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Performance.Services
{
public class PerSheetDataReadOtherIncome : IPerSheetDataRead
{
public PerSheetPoint Point => new PerSheetPoint
{
HeaderFirstRowNum = 1,
HeaderLastRowNum = 1,
HeaderFirstCellNum = 0,
DataFirstRowNum = 2,
AccountingUnit = new List<AccountingUnit>
{
new AccountingUnit
{
AccountingUnitCellNum = 0,
DeptCellNum = 1
}
}
};
public List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
List<PerData> dataList = new List<PerData>();
foreach (var unit in Point.AccountingUnit)
{
var vhead = perHeader.Where(t => t.PointCell != unit.AccountingUnitCellNum && t.PointCell != unit.DeptCellNum).OrderBy(t => t.PointCell);
for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
{
var row = sheet.GetRow(r);
for (int c = 0; c < vhead.Count(); c++)
{
var accountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.ToString();
if (string.IsNullOrEmpty(accountingUnit))
continue;
var athead = vhead.ElementAt(c);
PerData data = new PerDataOtherIncome
{
AccountingUnit = accountingUnit,
Department = row.GetCell(unit.DeptCellNum.Value)?.ToString(),
TypeName = athead?.CellName,
CellValue = ConvertHelper.To<decimal?>(row.GetCell(athead.PointCell)?.ToString()),
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
};
if (sheet.SheetName.Contains("医生组"))
{
data.UnitType = "医生组";
}
else if (sheet.SheetName.Contains("护理组"))
{
data.UnitType = "护理组";
}
else if (perHeader.Any(t => t.CellName.Contains("核算单元") && t.CellName.Contains("医生组")))
{
data.UnitType = "医生组";
}
else if (perHeader.Any(t => t.CellName.Contains("核算单元") && t.CellName.Contains("护理组")))
{
data.UnitType = "护理组";
}
dataList.Add(data);
}
}
}
return dataList;
}
}
}
using System; using NPOI.SS.UserModel;
using Performance.DtoModels;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using NPOI.SS.UserModel;
using Performance.DtoModels;
namespace Performance.Services namespace Performance.Services
{ {
/// <summary>
/// 加班
/// </summary>
public class PerSheetDataReadOvertime : IPerSheetDataRead public class PerSheetDataReadOvertime : IPerSheetDataRead
{ {
public PerSheetPoint Point => throw new NotImplementedException(); public PerSheetPoint Point => throw new NotImplementedException();
public PerData GetPerData(IRow row, PerHeader perHeader) public List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
......
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.Infrastructure;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -7,6 +8,9 @@ ...@@ -7,6 +8,9 @@
namespace Performance.Services namespace Performance.Services
{ {
/// <summary>
/// 工作量
/// </summary>
public class PerSheetDataReadWorkload : IPerSheetDataRead public class PerSheetDataReadWorkload : IPerSheetDataRead
{ {
public PerSheetPoint Point => new PerSheetPoint public PerSheetPoint Point => new PerSheetPoint
...@@ -14,22 +18,60 @@ public class PerSheetDataReadWorkload : IPerSheetDataRead ...@@ -14,22 +18,60 @@ public class PerSheetDataReadWorkload : IPerSheetDataRead
HeaderFirstRowNum = 1, HeaderFirstRowNum = 1,
HeaderLastRowNum = 2, HeaderLastRowNum = 2,
HeaderFirstCellNum = 1, HeaderFirstCellNum = 1,
DataFirstRowNum = 3, DataFirstRowNum = 4,
AccountingUnitCellNum = 1, AccountingUnit = new List<AccountingUnit>
DeptCellNum = 2 {
new AccountingUnit
{
AccountingUnitCellNum = 0,
DeptCellNum = 1,
FactorRow = 3
}
}
}; };
public PerData GetPerData(IRow row, PerHeader perHeader) public List<PerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{ {
return new PerDataWorkload List<PerData> dataList = new List<PerData>();
//循环 当前有几个核算单元
foreach (var unit in Point.AccountingUnit)
{ {
AccountingUnit = row.GetCell(Point.AccountingUnitCellNum.Value).ToString(), var vhead = perHeader.Where(t => !Point.AccountingUnit.Select(p => p.AccountingUnitCellNum).Contains(t.PointCell)
Department = row.GetCell(Point.DeptCellNum.Value).ToString(), && !Point.AccountingUnit.Select(p => p.DeptCellNum).Contains(t.PointCell)).OrderBy(t => t.PointCell);
ParentType = perHeader.Parent?.CellName, for (int r = Point.DataFirstRowNum.Value; r < sheet.LastRowNum + 1; r++)
TypeName = perHeader.CellName, {
CellValue = Convert.ToDecimal(row.GetCell(perHeader.PointCell).ToString()), var row = sheet.GetRow(r);
Annotation = row.GetCell(perHeader.PointCell).CellComment?.String.String, for (int c = 0; c < vhead.Count(); c++)
}; {
var accountingUnit = row.GetCell(unit.AccountingUnitCellNum.Value)?.ToString();
if (string.IsNullOrEmpty(accountingUnit))
continue;
var athead = vhead.ElementAt(c);
//PerData data = sheetRead.GetPerData(row, vhead.ElementAt(c));
PerData data = new PerDataWorkload
{
AccountingUnit = accountingUnit,
Department = row.GetCell(unit.DeptCellNum.Value)?.ToString(),
TypeName = athead?.CellName,
CellValue = ConvertHelper.To<decimal?>(row.GetCell(athead.PointCell)?.ToString()),
Annotation = row.GetCell(athead.PointCell)?.CellComment?.String?.String,
UnitType = unit.UnitType,
FactorValue = ConvertHelper.To<decimal?>(sheet.GetRow(unit.FactorRow.Value).GetCell(athead.PointCell)?.ToString()),
};
if (sheet.SheetName.Contains("医生组"))
{
data.UnitType = "医生组";
}
else if (sheet.SheetName.Contains("护理组"))
{
data.UnitType = "护理组";
}
dataList.Add(data);
}
}
}
return dataList;
} }
} }
} }
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