Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
e56d886c
Commit
e56d886c
authored
Mar 11, 2019
by
zry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
excel
parent
cd28891b
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
370 additions
and
81 deletions
+370
-81
.gitignore
+2
-2
performance/Performance.Api/Files/9/201911/医院绩效分配系统数据收集模板V120190307133444707.xlsx
+0
-0
performance/Performance.ConsoleApp/Program.cs
+3
-2
performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
+5
-3
performance/Performance.DtoModels/PerExcel/PerData.cs
+4
-0
performance/Performance.DtoModels/PerExcel/PerDataIncome.cs
+14
-0
performance/Performance.DtoModels/PerExcel/PerDataOtherIncome.cs
+10
-0
performance/Performance.DtoModels/PerExcel/PerDataWorkload.cs
+2
-2
performance/Performance.DtoModels/PerExcel/PerHeader.cs
+4
-0
performance/Performance.DtoModels/PerExcel/PerSheet.cs
+4
-0
performance/Performance.DtoModels/PerExcel/PerSheetPoint.cs
+10
-0
performance/Performance.Services/PerExcelService/PerExcelService.cs
+6
-0
performance/Performance.Services/PerExcelService/PerHeaderService.cs
+1
-0
performance/Performance.Services/PerExcelService/PerSheetService.cs
+35
-21
performance/Performance.Services/PerExcelService/SheetDataRead/IPerSheetDataRead.cs
+10
-1
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataFactory.cs
+11
-0
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadEmployee.cs
+38
-10
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadExpend.cs
+13
-17
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadIncome.cs
+59
-7
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadOtherIncome.cs
+78
-0
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadOvertime.cs
+7
-4
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadWorkload.cs
+54
-12
No files found.
.gitignore
View file @
e56d886c
...
@@ -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/
performance/Performance.Api/Files/9/201911/医院绩效分配系统数据收集模板V120190307133444707.xlsx
deleted
100644 → 0
View file @
cd28891b
File deleted
performance/Performance.ConsoleApp/Program.cs
View file @
e56d886c
...
@@ -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
();
}
}
...
...
performance/Performance.DtoModels/PerExcel/ExcelEnum.cs
View file @
e56d886c
...
@@ -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
,
}
}
}
}
performance/Performance.DtoModels/PerExcel/PerData.cs
View file @
e56d886c
...
@@ -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
;
}
...
...
performance/Performance.DtoModels/PerExcel/PerDataIncome.cs
0 → 100644
View file @
e56d886c
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerDataIncome
:
PerData
<
decimal
?>
{
/// <summary>
/// 系数值
/// </summary>
public
decimal
?
FactorValue
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/PerExcel/PerDataOtherIncome.cs
0 → 100644
View file @
e56d886c
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerDataOtherIncome
:
PerData
<
decimal
?>
{
}
}
performance/Performance.DtoModels/PerExcel/PerDataWorkload.cs
View file @
e56d886c
...
@@ -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
ParentTyp
e
{
get
;
set
;
}
public
decimal
?
FactorValu
e
{
get
;
set
;
}
}
}
}
}
performance/Performance.DtoModels/PerExcel/PerHeader.cs
View file @
e56d886c
...
@@ -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
;
...
...
performance/Performance.DtoModels/PerExcel/PerSheet.cs
View file @
e56d886c
...
@@ -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
;
}
...
...
performance/Performance.DtoModels/PerExcel/PerSheetPoint.cs
View file @
e56d886c
...
@@ -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
;
}
}
}
}
}
performance/Performance.Services/PerExcelService/PerExcelService.cs
View file @
e56d886c
...
@@ -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
...
...
performance/Performance.Services/PerExcelService/PerHeaderService.cs
View file @
e56d886c
...
@@ -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
,
...
...
performance/Performance.Services/PerExcelService/PerSheetService.cs
View file @
e56d886c
...
@@ -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
.
Per
Data
=
AnalyzeData
(
sheet
,
sheetRead
);
perSheet
.
Per
Header
=
_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;
//}
}
}
}
}
performance/Performance.Services/PerExcelService/SheetDataRead/IPerSheetDataRead.cs
View file @
e56d886c
...
@@ -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
);
}
}
}
}
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataFactory.cs
View file @
e56d886c
...
@@ -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
;
...
...
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadEmployee.cs
View file @
e56d886c
...
@@ -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
;
}
}
}
}
}
}
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadExpend.cs
View file @
e56d886c
...
@@ -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
,
};
}
}
}
}
}
}
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadIncome.cs
View file @
e56d886c
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
;
}
}
}
}
}
}
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadOtherIncome.cs
0 → 100644
View file @
e56d886c
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
;
}
}
}
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadOvertime.cs
View file @
e56d886c
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
();
}
}
...
...
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadWorkload.cs
View file @
e56d886c
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
;
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment