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
cdbe954e
Commit
cdbe954e
authored
Mar 18, 2021
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2020morge' into v2020morge-graphql
parents
3604709a
85bc3234
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
performance/Performance.Services/ExtractExcelService/ExtractDtos/SpecialUnitColumns.cs
+4
-0
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+4
-2
performance/Performance.Services/ExtractExcelService/SheetDataWrite/SpecialUnitDataWrite.cs
+12
-2
No files found.
performance/Performance.Services/ExtractExcelService/ExtractDtos/SpecialUnitColumns.cs
View file @
cdbe954e
...
@@ -17,5 +17,9 @@ public class SpecialUnitColumns
...
@@ -17,5 +17,9 @@ public class SpecialUnitColumns
public
const
string
TargetFactor
=
"量化指标绩效分值"
;
public
const
string
TargetFactor
=
"量化指标绩效分值"
;
public
const
string
AdjustFactor
=
"调节系数"
;
public
const
string
AdjustFactor
=
"调节系数"
;
public
const
string
AssessBefore
=
"考核前绩效"
;
public
const
string
Avg
=
"人均"
;
}
}
}
}
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
cdbe954e
...
@@ -144,6 +144,7 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
...
@@ -144,6 +144,7 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
for
(
int
sheetIndex
=
0
;
sheetIndex
<
workbook
.
NumberOfSheets
;
sheetIndex
++)
for
(
int
sheetIndex
=
0
;
sheetIndex
<
workbook
.
NumberOfSheets
;
sheetIndex
++)
{
{
var
sheet
=
workbook
.
GetSheetAt
(
sheetIndex
);
var
sheet
=
workbook
.
GetSheetAt
(
sheetIndex
);
string
sheetName
=
sheet
.
SheetName
.
NoBlank
();
ratio
+=
40
m
/
workbook
.
NumberOfSheets
;
ratio
+=
40
m
/
workbook
.
NumberOfSheets
;
var
sheetType
=
perSheetService
.
GetSheetType
(
sheet
.
SheetName
);
var
sheetType
=
perSheetService
.
GetSheetType
(
sheet
.
SheetName
);
...
@@ -156,13 +157,14 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
...
@@ -156,13 +157,14 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
if
(
sheetType
==
SheetType
.
OtherWorkload
)
point
=
PerSheetDataFactory
.
GetDataRead
(
SheetType
.
Workload
)?.
Point
;
if
(
sheetType
==
SheetType
.
OtherWorkload
)
point
=
PerSheetDataFactory
.
GetDataRead
(
SheetType
.
Workload
)?.
Point
;
if
(
types
.
Contains
(
sheetType
)
&&
point
!=
null
&&
point
.
DataFirstCellNum
.
HasValue
)
if
(
types
.
Contains
(
sheetType
)
&&
point
!=
null
&&
point
.
DataFirstCellNum
.
HasValue
)
{
logger
.
LogInformation
(
$"
{
sheetName
}
开始清除历史数据。point:
{
JsonHelper
.
Serialize
(
point
)}
"
);
ExtractHelper
.
ClearSheetPartialData
(
sheet
,
point
,
sheetType
);
ExtractHelper
.
ClearSheetPartialData
(
sheet
,
point
,
sheetType
);
}
var
customer
=
factory
.
GetWriteData
(
sheetType
,
logger
);
var
customer
=
factory
.
GetWriteData
(
sheetType
,
logger
);
if
(
customer
!=
null
)
if
(
customer
!=
null
)
{
{
string
sheetName
=
sheet
.
SheetName
.
NoBlank
();
var
collects
=
collectData
?.
Where
(
t
=>
t
.
SheetName
.
NoBlank
()
==
sheetName
).
ToList
();
var
collects
=
collectData
?.
Where
(
t
=>
t
.
SheetName
.
NoBlank
()
==
sheetName
).
ToList
();
customer
.
WriteCollectData
(
sheet
,
point
,
sheetType
,
style
,
collects
,
exdict
);
customer
.
WriteCollectData
(
sheet
,
point
,
sheetType
,
style
,
collects
,
exdict
);
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/SpecialUnitDataWrite.cs
View file @
cdbe954e
...
@@ -189,10 +189,13 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD
...
@@ -189,10 +189,13 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD
if
(
special
!=
null
)
if
(
special
!=
null
)
{
{
var
cell
=
row
.
GetOrCreate
(
quantityIndex
);
var
cell
=
row
.
GetOrCreate
(
quantityIndex
);
if
(
cell
.
CellType
!=
CellType
.
Formula
)
{
cell
.
SetCellType
(
CellType
.
Numeric
);
cell
.
SetCellType
(
CellType
.
Numeric
);
cell
.
SetCellValue
<
double
>(
special
.
Quantity
);
cell
.
SetCellValue
<
double
>(
special
.
Quantity
);
cell
.
CellStyle
=
cellStyle
;
cell
.
CellStyle
=
cellStyle
;
}
specials
.
Remove
(
special
);
specials
.
Remove
(
special
);
}
}
dataFirstRowNum
=
rowIndex
+
1
;
dataFirstRowNum
=
rowIndex
+
1
;
...
@@ -321,7 +324,14 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s
...
@@ -321,7 +324,14 @@ private void AddMergedRegion(ISheet sheet, List<SpecialCellRange> ranges, List<s
if
(
columns
==
null
||
!
columns
.
Any
())
return
;
if
(
columns
==
null
||
!
columns
.
Any
())
return
;
if
(
ranges
==
null
||
!
ranges
.
Any
())
return
;
if
(
ranges
==
null
||
!
ranges
.
Any
())
return
;
var
columnIndexs
=
new
string
[]
{
SpecialUnitColumns
.
Department
,
SpecialUnitColumns
.
PeopleNumber
,
SpecialUnitColumns
.
AdjustFactor
}.
Select
(
t
=>
columns
.
IndexOf
(
t
));
var
columnIndexs
=
new
string
[]
{
SpecialUnitColumns
.
Department
,
SpecialUnitColumns
.
PeopleNumber
,
SpecialUnitColumns
.
AdjustFactor
,
SpecialUnitColumns
.
AssessBefore
,
SpecialUnitColumns
.
Avg
}.
Select
(
t
=>
columns
.
IndexOf
(
t
));
if
(
columnIndexs
==
null
||
!
columnIndexs
.
Any
(
t
=>
t
>
-
1
))
return
;
if
(
columnIndexs
==
null
||
!
columnIndexs
.
Any
(
t
=>
t
>
-
1
))
return
;
foreach
(
var
index
in
columnIndexs
.
Where
(
t
=>
t
>
-
1
))
foreach
(
var
index
in
columnIndexs
.
Where
(
t
=>
t
>
-
1
))
...
...
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