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
ff42a0f6
Commit
ff42a0f6
authored
May 17, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
显示系数修改为百分比,抽取时收入列头取提取数据中的category
parent
a53d3791
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
33 deletions
+106
-33
performance/Performance.Services/ComputeService.cs
+1
-1
performance/Performance.Services/DFExtractService.cs
+71
-4
performance/Performance.Services/SheetSevice.cs
+34
-28
No files found.
performance/Performance.Services/ComputeService.cs
View file @
ff42a0f6
...
...
@@ -413,7 +413,7 @@ public DeptDataDetails DeptDetail(int accountId)
{
ItemName
=
t
.
TypeName
,
CellValue
=
t
.
CellValue
,
Factor
=
t
.
FactorValue
,
Factor
=
t
.
FactorValue
*
100
,
ItemValue
=
t
.
IsFactor
==
1
?
(
t
.
CellValue
*
(
t
.
FactorValue
??
0
))
:
t
.
CellValue
}).
ToList
()
};
...
...
performance/Performance.Services/DFExtractService.cs
View file @
ff42a0f6
...
...
@@ -409,8 +409,6 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
logger
.
LogInformation
(
$"item有
{
itemList
?.
Count
??
0
}
个."
);
if
(
itemList
==
null
||
!
itemList
.
Any
())
return
;
WriteHeaderAndFactor
(
sheet
,
sheetRead
,
itemList
,
isNewTemp
);
//查询数据
var
extractList
=
extracts
.
Where
(
t
=>
module
.
ExtractId
==
t
.
Id
).
ToList
();
if
(
extractList
==
null
||
extractList
.
Count
==
0
)
return
;
...
...
@@ -428,7 +426,11 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
allExtract
.
AddRange
(
result
);
}
WriteSheetData
(
sheet
,
sheetRead
,
unitList
,
allExtract
,
itemList
.
Select
(
t
=>
t
.
ItemName
),
isNewTemp
,
true
);
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
合计值为: "
+
allExtract
.
Sum
(
t
=>
t
.
Value
));
var
category
=
allExtract
.
Select
(
t
=>
t
.
Category
).
Distinct
().
ToList
();
WriteIncomeHeaderAndFactor
(
sheet
,
sheetRead
,
category
,
isNewTemp
);
WriteSheetData
(
sheet
,
sheetRead
,
unitList
,
allExtract
,
category
,
isNewTemp
,
true
);
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
提取结束."
);
}
...
...
@@ -503,6 +505,7 @@ private void WriteWorkload(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou
var
result
=
QueryDatabase
(
config
,
item
,
Allot
,
moditem
.
ItemName
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
logger
.
LogInformation
(
$"
{
module
.
ModuleName
}
提取
{
moditem
.
ItemName
}
的合计值为: "
+
allExtract
.
Sum
(
t
=>
t
.
Value
));
}
}
...
...
@@ -711,6 +714,7 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
cellItems
.
AddRange
(
items
);
if
(!
isNewTemp
)
{
List
<
string
>
original
=
new
List
<
string
>();
#
region
过滤历史模板中已有的列头
//写入列头信息
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
;
...
...
@@ -749,6 +753,69 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
#
endregion
}
/// <summary>
/// 写入列头
/// </summary>
/// <param name="sheet"></param>
/// <param name="sheetRead"></param>
/// <param name="items">列头数据(列名、系数)</param>
/// <param name="isNewTemp">是否为空白模板</param>
private
void
WriteIncomeHeaderAndFactor
(
ISheet
sheet
,
IPerSheetDataRead
sheetRead
,
List
<
string
>
items
,
bool
isNewTemp
)
{
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
=
GetOrCreate
(
sheet
,
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
);
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"写入列头信息 --
{
sheet
.
SheetName
}
"
,
1
,
Allot
.
ID
,
"ReceiveMessage"
);
logger
.
LogInformation
(
$"提取绩效数据 提取绩效数据 写入列头信息 --
{
sheet
.
SheetName
}
"
);
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
查询出的列头有:"
+
string
.
Join
(
", "
,
items
));
if
(!
isNewTemp
)
{
List
<
string
>
original
=
new
List
<
string
>();
#
region
过滤历史模板中已有的列头
//写入列头信息
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
;
for
(
int
i
=
cellStartIndex
;
i
<
head
.
LastCellNum
;
i
++)
{
var
cellvalue
=
head
.
GetCell
(
i
)?.
ToString
();
if
(
string
.
IsNullOrEmpty
(
cellvalue
))
continue
;
items
.
Remove
(
cellvalue
);
}
#
endregion
}
if
(
items
==
null
||
!
items
.
Any
())
return
;
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
需要新增的列头有:"
+
string
.
Join
(
", "
,
items
));
#
region
新增模板中不存在的列头
var
lastcellIndex
=
isNewTemp
?
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
:
head
.
LastCellNum
;
foreach
(
var
item
in
items
)
{
var
headcell
=
GetOrCreate
(
head
,
lastcellIndex
);
headcell
.
SetCellValue
(
item
);
headcell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
列头
);
var
doctorcell
=
GetOrCreate
(
doctorFactor
,
lastcellIndex
);
doctorcell
.
SetCellValue
(
0
);
doctorcell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
系数
,
CellFormat
.
百分比
);
var
nursecell
=
GetOrCreate
(
nurseFactor
,
lastcellIndex
);
nursecell
.
SetCellValue
(
0
);
nursecell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
系数
,
CellFormat
.
百分比
);
var
techniciancell
=
GetOrCreate
(
technicianFactor
,
lastcellIndex
);
techniciancell
.
SetCellValue
(
0
);
techniciancell
.
CellStyle
=
CellStyle
.
CreateCellStyle
(
workbook
,
StyleType
.
系数
,
CellFormat
.
百分比
);
lastcellIndex
++;
}
#
endregion
}
/// <summary>
/// 写入数据
/// </summary>
...
...
@@ -1026,7 +1093,7 @@ private List<ExtractDto> QueryDatabase(sys_hospitalconfig config, mod_extract ex
item
.
Category
=
category
;
}
}
return
result
.
ToList
();
return
result
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
Category
)).
ToList
();
}
}
return
null
;
...
...
performance/Performance.Services/SheetSevice.cs
View file @
ff42a0f6
This diff is collapsed.
Click to expand it.
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