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
22358275
Commit
22358275
authored
May 10, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取记录日志
parent
6b20f279
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+1
-1
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CustomDataWrite.cs
+19
-8
No files found.
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
22358275
...
@@ -214,7 +214,7 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
...
@@ -214,7 +214,7 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
HandleSheet
(
workbook
,
allot
,
exdict
,
extractDto
,
groupName
,
isSingle
,
sheet
,
ratio
,
types
,
factory
,
style
,
employeeDict
,
collectData
);
HandleSheet
(
workbook
,
allot
,
exdict
,
extractDto
,
groupName
,
isSingle
,
sheet
,
ratio
,
types
,
factory
,
style
,
employeeDict
,
collectData
);
}
}
customDataWrite
.
WriteDataToCustom
(
workbook
,
allot
,
style
);
customDataWrite
.
WriteDataToCustom
(
workbook
,
allot
,
style
,
allot
.
ID
,
groupName
,
isSingle
);
}
}
private
void
HandleSheet
(
IWorkbook
workbook
,
per_allot
allot
,
Dictionary
<
ExDataDict
,
object
>
exdict
,
List
<
ExtractTransDto
>
extractDto
,
string
groupName
,
bool
isSingle
,
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 @
22358275
using
Microsoft.Extensions.Logging
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
Microsoft.Extensions.Logging
;
using
NPOI.SS.UserModel
;
using
NPOI.SS.UserModel
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.EntityModels
;
using
Performance.Repository
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
{
{
...
@@ -16,20 +16,22 @@ public class CustomDataWrite : IAutoInjection
...
@@ -16,20 +16,22 @@ public class CustomDataWrite : IAutoInjection
private
readonly
PerforExmoduleRepository
exmoduleRepository
;
private
readonly
PerforExmoduleRepository
exmoduleRepository
;
private
readonly
PerforExscriptRepository
exscriptRepository
;
private
readonly
PerforExscriptRepository
exscriptRepository
;
private
readonly
CustomExtractService
customExtractService
;
private
readonly
CustomExtractService
customExtractService
;
private
readonly
LogManageService
_logService
;
public
CustomDataWrite
(
public
CustomDataWrite
(
ILogger
<
CustomDataWrite
>
logger
,
ILogger
<
CustomDataWrite
>
logger
,
PerforHospitalconfigRepository
hospitalconfigRepository
,
PerforHospitalconfigRepository
hospitalconfigRepository
,
PerforExmoduleRepository
exmoduleRepository
,
PerforExmoduleRepository
exmoduleRepository
,
PerforExscriptRepository
exscriptRepository
,
PerforExscriptRepository
exscriptRepository
,
CustomExtractService
customExtractService
CustomExtractService
customExtractService
,
)
LogManageService
logService
)
{
{
this
.
logger
=
logger
;
this
.
logger
=
logger
;
this
.
hospitalconfigRepository
=
hospitalconfigRepository
;
this
.
hospitalconfigRepository
=
hospitalconfigRepository
;
this
.
exmoduleRepository
=
exmoduleRepository
;
this
.
exmoduleRepository
=
exmoduleRepository
;
this
.
exscriptRepository
=
exscriptRepository
;
this
.
exscriptRepository
=
exscriptRepository
;
this
.
customExtractService
=
customExtractService
;
this
.
customExtractService
=
customExtractService
;
_logService
=
logService
;
}
}
public
PerSheetPoint
Point
=>
new
PerSheetPoint
public
PerSheetPoint
Point
=>
new
PerSheetPoint
...
@@ -40,8 +42,9 @@ CustomExtractService customExtractService
...
@@ -40,8 +42,9 @@ CustomExtractService customExtractService
DataFirstCellNum
=
6
,
DataFirstCellNum
=
6
,
};
};
public
void
WriteDataToCustom
(
IWorkbook
workbook
,
per_allot
allot
,
ExcelStyle
style
)
public
void
WriteDataToCustom
(
IWorkbook
workbook
,
per_allot
allot
,
ExcelStyle
style
,
int
allotId
,
string
groupName
,
bool
isSingle
)
{
{
_logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"自定义提取"
,
$"测算表自定义提取准备执行"
,
1
,
isSingle
);
var
modules
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
Custom
)?.
OrderBy
(
t
=>
t
.
ModuleName
);
var
modules
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
Custom
)?.
OrderBy
(
t
=>
t
.
ModuleName
);
if
(
modules
==
null
||
!
modules
.
Any
())
return
;
if
(
modules
==
null
||
!
modules
.
Any
())
return
;
...
@@ -49,7 +52,11 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
...
@@ -49,7 +52,11 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
if
(
exscripts
==
null
||
!
exscripts
.
Any
())
return
;
if
(
exscripts
==
null
||
!
exscripts
.
Any
())
return
;
var
configs
=
hospitalconfigRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
var
configs
=
hospitalconfigRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
if
(
configs
==
null
||
!
configs
.
Any
())
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
if
(
configs
==
null
||
!
configs
.
Any
())
{
_logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"自定义提取"
,
$"测算表自定义提取医院未配置绩效抽取信息"
,
1
,
isSingle
);
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
}
var
parameters
=
customExtractService
.
GetParameters
(
allot
);
var
parameters
=
customExtractService
.
GetParameters
(
allot
);
var
headerStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
列头
);
var
headerStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
列头
);
...
@@ -57,6 +64,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
...
@@ -57,6 +64,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
foreach
(
var
module
in
modules
)
foreach
(
var
module
in
modules
)
{
{
_logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"自定义提取"
,
$"测算表自定义提取:“
{
module
.
ModuleName
}
”"
,
1
,
isSingle
);
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
());
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
());
if
(
sheet
==
null
)
if
(
sheet
==
null
)
{
{
...
@@ -75,6 +83,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
...
@@ -75,6 +83,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
try
try
{
{
_logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"自定义提取"
,
$"测算表自定义提取“
{
module
.
ModuleName
}
”数据:
{
dynamics
?.
Count
()
??
0
}
条记录"
,
1
,
isSingle
);
// 没数据跳过
// 没数据跳过
if
(
dynamics
==
null
||
dynamics
.
Count
()
==
0
)
if
(
dynamics
==
null
||
dynamics
.
Count
()
==
0
)
continue
;
continue
;
...
@@ -109,9 +118,11 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
...
@@ -109,9 +118,11 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
}
}
rowindex
++;
rowindex
++;
}
}
_logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"自定义提取"
,
$"测算表自定义提取“
{
module
.
ModuleName
}
”提取完成"
,
1
,
isSingle
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
_logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"自定义提取"
,
$"测算表自定义提取“
{
module
.
ModuleName
}
”提取失败;失败原因:
{
ex
.
Message
}
"
,
3
,
isSingle
);
logger
.
LogError
(
$"自定义模板 -
{
sheet
.
SheetName
}
抽取异常:"
+
ex
);
logger
.
LogError
(
$"自定义模板 -
{
sheet
.
SheetName
}
抽取异常:"
+
ex
);
}
}
}
}
...
...
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