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
826fb36a
Commit
826fb36a
authored
Jun 28, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加自定义提取,抽取列值替换公式
parent
1b8f0709
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+1
-1
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+6
-0
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CustomDataWrite.cs
+1
-1
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
826fb36a
...
...
@@ -150,7 +150,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
var
value
=
deptData
.
FirstOrDefault
(
t
=>
t
.
Category
.
NoBlank
()
==
column
)?.
Value
;
//数据为空,且单元格值不为空,不写入数据(保留原始值)
var
notWrite
=
!
value
.
HasValue
&&
!
string
.
IsNullOrEmpty
(
cell
.
ToString
());
if
(
cell
.
CellType
!=
CellType
.
Formula
&&
!
notWrite
)
if
(
/*cell.CellType != CellType.Formula && */
!
notWrite
)
{
cell
.
SetCellValue
<
decimal
>(
value
);
if
(
headers
!=
null
&&
headers
.
Contains
(
column
))
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
826fb36a
...
...
@@ -4,6 +4,7 @@
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Services.ExtractExcelService.SheetDataWrite
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
...
...
@@ -19,6 +20,7 @@ public class ExtractService : IAutoInjection
private
readonly
PersonService
personService
;
private
readonly
PerSheetService
perSheetService
;
private
readonly
DictionaryService
dictionaryService
;
private
readonly
CustomDataWrite
customDataWrite
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
PerforCollectdataRepository
collectdataRepository
;
private
readonly
PerforPeremployeeRepository
peremployeeRepository
;
...
...
@@ -31,6 +33,7 @@ public class ExtractService : IAutoInjection
PersonService
personService
,
PerSheetService
perSheetService
,
DictionaryService
dictionaryService
,
CustomDataWrite
customDataWrite
,
PerforPerallotRepository
perallotRepository
,
PerforCollectdataRepository
collectdataRepository
,
PerforPeremployeeRepository
peremployeeRepository
,
...
...
@@ -43,6 +46,7 @@ PerforPerdeptdicRepository perdeptdicRepository
this
.
personService
=
personService
;
this
.
perSheetService
=
perSheetService
;
this
.
dictionaryService
=
dictionaryService
;
this
.
customDataWrite
=
customDataWrite
;
this
.
perallotRepository
=
perallotRepository
;
this
.
collectdataRepository
=
collectdataRepository
;
this
.
peremployeeRepository
=
peremployeeRepository
;
...
...
@@ -162,6 +166,8 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
HandleSheet
(
workbook
,
allot
,
exdict
,
extractDto
,
groupName
,
isSingle
,
sheet
,
ratio
,
types
,
factory
,
style
,
employeeDict
,
collectData
);
}
customDataWrite
.
WriteDataToCustom
(
workbook
,
allot
,
style
);
}
private
void
HandleSheet
(
IWorkbook
workbook
,
per_allot
allot
,
Dictionary
<
ExDataDict
,
object
>
exdict
,
List
<
ExtractTransDto
>
extractDto
,
string
groupName
,
bool
isSingle
,
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CustomDataWrite.cs
View file @
826fb36a
...
...
@@ -9,7 +9,7 @@
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
{
public
class
CustomDataWrite
public
class
CustomDataWrite
:
IAutoInjection
{
private
readonly
ILogger
<
CustomDataWrite
>
logger
;
private
readonly
PerforHospitalconfigRepository
hospitalconfigRepository
;
...
...
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