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
dc211ac8
Commit
dc211ac8
authored
Feb 14, 2022
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取数据优先公式
parent
527ea30b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
performance/Performance.Repository/BaseRepository.cs
+1
-1
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+2
-2
performance/Performance.Services/ExtractExcelService/SheetDataWrite/SpecialUnitDataWrite.cs
+7
-7
No files found.
performance/Performance.Repository/BaseRepository.cs
View file @
dc211ac8
...
...
@@ -209,7 +209,7 @@ public int InsertExecute(IEnumerable<TEntity> data)
}
catch
{
return
0
;
throw
;
}
}
}
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
dc211ac8
...
...
@@ -434,7 +434,7 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
var
value
=
deptData
.
FirstOrDefault
(
t
=>
t
.
TypeName
.
NoBlank
()
==
column
)?.
CellValue
;
//数据为空,且单元格值不为空,不写入数据(保留原始值)
var
notWrite
=
string
.
IsNullOrEmpty
(
value
)
&&
!
string
.
IsNullOrEmpty
(
cell
.
ToString
());
if
(
cell
.
CellType
!=
CellType
.
Formula
&&
!
notWrite
)
if
(!
notWrite
)
{
cell
.
SetCellValue
<
decimal
>(
value
);
if
(
headers
!=
null
&&
headers
.
Contains
(
column
))
...
...
@@ -531,7 +531,7 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
var
cell
=
row
.
GetOrCreate
(
cellIndex
);
var
value
=
deptData
.
FirstOrDefault
(
t
=>
t
.
TypeName
.
NoBlank
()
==
column
)?.
CellValue
;
if
(
cell
.
CellType
!=
CellType
.
Formula
)
if
(
!
string
.
IsNullOrEmpty
(
value
)
&&
cell
.
CellType
!=
CellType
.
Formula
)
{
cell
.
SetCellValue
<
decimal
>(
value
);
cell
.
CellStyle
=
cellStyle
;
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/SpecialUnitDataWrite.cs
View file @
dc211ac8
...
...
@@ -201,12 +201,12 @@ private void SupplySpecialQuantity(ISheet sheet, ExcelStyle style, List<SpecialD
{
var
cell
=
row
.
GetOrCreate
(
quantityIndex
);
if
(
cell
.
CellType
!=
CellType
.
Formula
)
{
cell
.
SetCellType
(
CellType
.
Numeric
);
cell
.
SetCellValue
<
double
>(
special
.
Quantity
);
cell
.
CellStyle
=
cellStyle
;
}
//
if (cell.CellType != CellType.Formula)
//
{
cell
.
SetCellType
(
CellType
.
Numeric
);
cell
.
SetCellValue
<
double
>(
special
.
Quantity
);
cell
.
CellStyle
=
cellStyle
;
//
}
specials
.
Remove
(
special
);
}
dataFirstRowNum
=
rowIndex
+
1
;
...
...
@@ -310,7 +310,7 @@ private void WriteSpecialData(IRow row, ICellStyle style, SpecialDto special, Li
var
index
=
columns
.
IndexOf
(
item
.
Key
);
var
cell
=
row
.
GetOrCreate
(
index
);
if
(
cell
!=
null
&&
cell
.
CellType
!=
CellType
.
Formula
)
if
(
cell
!=
null
/*&& cell.CellType != CellType.Formula*/
)
{
if
(
new
string
[]
{
SpecialUnitColumns
.
Department
,
SpecialUnitColumns
.
Target
}.
Contains
(
item
.
Key
))
cell
.
SetCellValue
(
item
.
Value
.
Invoke
(
special
)?.
ToString
());
...
...
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