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
91ebb9c8
Commit
91ebb9c8
authored
Oct 27, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
9b5db502
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+21
-4
No files found.
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
91ebb9c8
...
...
@@ -22,6 +22,7 @@ public class ExtractService : IAutoInjection
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
PerforcollectdataRepository
collectdataRepository
;
private
readonly
PerforPeremployeeRepository
peremployeeRepository
;
public
ExtractService
(
ILogger
<
ExtractService
>
logger
,
...
...
@@ -31,7 +32,8 @@ public class ExtractService : IAutoInjection
PerSheetService
perSheetService
,
PerforHospitalRepository
hospitalRepository
,
PerforPerallotRepository
perallotRepository
,
PerforcollectdataRepository
collectdataRepository
PerforcollectdataRepository
collectdataRepository
,
PerforPeremployeeRepository
peremployeeRepository
)
{
this
.
logger
=
logger
;
...
...
@@ -42,6 +44,7 @@ PerforcollectdataRepository collectdataRepository
this
.
hospitalRepository
=
hospitalRepository
;
this
.
perallotRepository
=
perallotRepository
;
this
.
collectdataRepository
=
collectdataRepository
;
this
.
peremployeeRepository
=
peremployeeRepository
;
}
/// <summary>
...
...
@@ -75,7 +78,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName =
var
templateFilePath
=
ExtractHelper
.
GetExtractFile
(
hospitalId
,
ref
extractFilePath
,
filePath
);
WriteDataToFile
(
templateFilePath
,
extractFilePath
,
dict
,
standData
);
WriteDataToFile
(
templateFilePath
,
extractFilePath
,
allotId
,
dict
,
standData
);
return
templateFilePath
;
}
...
...
@@ -91,7 +94,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName =
return
extractFilePath
;
}
private
void
WriteDataToFile
(
string
templateFile
,
string
extractFile
,
Dictionary
<
ExDataDict
,
object
>
exdict
,
List
<
ExtractTransDto
>
extractDto
)
private
void
WriteDataToFile
(
string
templateFile
,
string
extractFile
,
int
allotId
,
Dictionary
<
ExDataDict
,
object
>
exdict
,
List
<
ExtractTransDto
>
extractDto
)
{
if
(!
FileHelper
.
IsExistFile
(
templateFile
))
throw
new
PerformanceException
(
""
);
...
...
@@ -117,7 +120,8 @@ private void WriteDataToFile(string templateFile, string extractFile, Dictionary
if
(
customer
!=
null
)
{
var
data
=
extractDto
.
Where
(
t
=>
t
.
SheetName
.
NoBlank
()
==
sheet
.
SheetName
.
NoBlank
())?.
ToList
();
var
exdata
=
extractDto
.
Where
(
t
=>
t
.
SheetName
.
NoBlank
()
==
sheet
.
SheetName
.
NoBlank
())?.
ToList
();
var
data
=
GetDataBySheetType
(
allotId
,
sheetType
,
exdata
);
customer
.
WriteSheetData
(
sheet
,
point
,
sheetType
,
style
,
data
,
exdict
);
}
}
...
...
@@ -128,6 +132,19 @@ private void WriteDataToFile(string templateFile, string extractFile, Dictionary
}
}
private
object
GetDataBySheetType
(
int
allotId
,
SheetType
sheetType
,
List
<
ExtractTransDto
>
extractDto
)
{
switch
(
sheetType
)
{
case
SheetType
.
Employee
:
case
SheetType
.
ClinicEmployee
:
case
SheetType
.
AccountBasic
:
return
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
default
:
return
extractDto
;
}
}
/// <summary>
/// 标准数据格式, 匹配科室字典
/// </summary>
...
...
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