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
209f4fe4
Commit
209f4fe4
authored
Jun 26, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
划拨列头写入修改
parent
e2c16919
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+2
-2
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CostTransferDataWrite.cs
+9
-7
No files found.
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
209f4fe4
...
@@ -2261,12 +2261,12 @@
...
@@ -2261,12 +2261,12 @@
</member>
</member>
<member
name=
"P:Performance.EntityModels.cost_transfer.Status"
>
<member
name=
"P:Performance.EntityModels.cost_transfer.Status"
>
<summary>
<summary>
0 未审核 1 全部通过 2 部分通过 3 全部驳回
0 未审核 1 全部通过 2 部分通过 3 全部驳回
4 含有下发驳回
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.cost_transfer.AdminStatus"
>
<member
name=
"P:Performance.EntityModels.cost_transfer.AdminStatus"
>
<summary>
<summary>
0 未审核 1 全部通过 2 部分通过 3 全部驳回
0 未审核 1 全部通过 2 部分通过 3 全部驳回
4 含有下发驳回
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.EntityModels.cost_transfer_item"
>
<member
name=
"T:Performance.EntityModels.cost_transfer_item"
>
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CostTransferDataWrite.cs
View file @
209f4fe4
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
{
{
public
class
CostTransferDataWrite
:
IAutoInjection
public
class
CostTransferDataWrite
:
IAutoInjection
{
{
private
readonly
ILogger
logger
;
private
readonly
ILogger
logger
;
private
readonly
PerforCosttransferRepository
costtransferRepository
;
private
readonly
PerforCosttransferRepository
costtransferRepository
;
...
@@ -35,15 +35,15 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
...
@@ -35,15 +35,15 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
{
{
try
try
{
{
var
columns
=
SupplySheetHeader
(
sheet
,
point
,
style
);
if
(
columns
==
null
||
!
columns
.
Any
())
return
;
var
costTransfers
=
costtransferRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
costTransfers
=
costtransferRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
if
(
costTransfers
==
null
||
!
costTransfers
.
Any
())
return
;
if
(
costTransfers
==
null
||
!
costTransfers
.
Any
())
return
;
var
costTransferItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
costTransfers
.
Select
(
c
=>
c
.
Id
).
Contains
(
t
.
TransferId
)
&&
t
.
Status
==
1
&&
t
.
AdminStatus
==
1
&&
t
.
IsWrited
==
0
);
var
costTransferItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
costTransfers
.
Select
(
c
=>
c
.
Id
).
Contains
(
t
.
TransferId
)
&&
t
.
Status
==
1
&&
t
.
AdminStatus
==
1
&&
t
.
IsWrited
==
0
);
if
(
costTransferItems
==
null
||
!
costTransferItems
.
Any
())
return
;
if
(
costTransferItems
==
null
||
!
costTransferItems
.
Any
())
return
;
var
columns
=
SupplySheetHeader
(
sheet
,
point
);
if
(
columns
==
null
||
!
columns
.
Any
())
return
;
var
departments
=
costTransfers
.
Select
(
t
=>
t
.
AdoptedDepartment
??
""
).
Union
(
costTransfers
.
Select
(
t
=>
t
.
ApplicantDepartment
??
""
)).
Distinct
().
ToList
();
var
departments
=
costTransfers
.
Select
(
t
=>
t
.
AdoptedDepartment
??
""
).
Union
(
costTransfers
.
Select
(
t
=>
t
.
ApplicantDepartment
??
""
)).
Distinct
().
ToList
();
var
cellStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
数据
);
var
cellStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
数据
);
...
@@ -62,7 +62,7 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
...
@@ -62,7 +62,7 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
}
}
}
}
private
Dictionary
<
string
,
int
>
SupplySheetHeader
(
ISheet
sheet
,
PerSheetPoint
point
)
private
Dictionary
<
string
,
int
>
SupplySheetHeader
(
ISheet
sheet
,
PerSheetPoint
point
,
ExcelStyle
style
)
{
{
Dictionary
<
string
,
int
>
pairs
=
new
Dictionary
<
string
,
int
>();
Dictionary
<
string
,
int
>
pairs
=
new
Dictionary
<
string
,
int
>();
var
header
=
sheet
.
GetRow
(
point
.
HeaderFirstRowNum
.
Value
);
var
header
=
sheet
.
GetRow
(
point
.
HeaderFirstRowNum
.
Value
);
...
@@ -84,13 +84,15 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
...
@@ -84,13 +84,15 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
if
(
fixedColumns
!=
null
&&
fixedColumns
.
Any
())
if
(
fixedColumns
!=
null
&&
fixedColumns
.
Any
())
{
{
var
index
=
header
.
LastCellNum
+
1
;
var
cellStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
列头
);
var
index
=
header
.
LastCellNum
;
foreach
(
var
column
in
fixedColumns
)
foreach
(
var
column
in
fixedColumns
)
{
{
var
cell
=
header
.
CreateCell
(
index
);
var
cell
=
header
.
CreateCell
(
index
);
cell
.
SetCellValue
(
column
);
cell
.
SetCellValue
(
column
);
cell
.
CellStyle
=
cellStyle
;
if
(!
pairs
.
ContainsKey
(
column
))
if
(!
pairs
.
ContainsKey
(
column
))
pairs
.
Add
(
column
,
index
);
pairs
.
Add
(
column
,
index
);
index
++;
index
++;
...
...
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