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
4e8ad3d1
Commit
4e8ad3d1
authored
Aug 08, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志
parent
331719ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
performance/Performance.DtoModels/Request/ExtractRequest.cs
+1
-1
performance/Performance.Extract.Api/Controllers/ExtractController.cs
+1
-1
performance/Performance.Services/NewExtractService.cs
+16
-0
No files found.
performance/Performance.DtoModels/Request/ExtractRequest.cs
View file @
4e8ad3d1
...
...
@@ -35,7 +35,7 @@ public ExtractRequestValidator()
{
RuleFor
(
x
=>
x
.
AllotId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
HospitalId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
UseScheme
).
NotNull
().
InclusiveBetween
(
1
,
2
);
//
RuleFor(x => x.UseScheme).NotNull().InclusiveBetween(1, 2);
}
}
}
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
4e8ad3d1
...
...
@@ -118,7 +118,7 @@ public void Index([FromBody]AllotRequest request)
public
void
ExtractData
([
CustomizeValidator
,
FromBody
]
ExtractRequest
request
)
{
LogHelper
.
Information
(
"请求参数:"
+
JsonHelper
.
Serialize
(
request
),
"提取绩效数据"
);
string
filePath
=
newExtractService
.
ExtractData
(
request
.
AllotId
,
""
,
request
.
HospitalId
);
string
filePath
=
newExtractService
.
ExtractData
(
request
.
AllotId
,
request
.
Email
,
request
.
HospitalId
);
LogHelper
.
Information
(
"提取文件路径:"
+
filePath
,
"提取绩效数据"
);
if
(!
string
.
IsNullOrEmpty
(
filePath
)
&&
FileHelper
.
IsExistFile
(
filePath
))
{
...
...
performance/Performance.Services/NewExtractService.cs
View file @
4e8ad3d1
...
...
@@ -179,6 +179,7 @@ public string ExtractData(int allotId, string email, int hospitalId)
{
workbook
.
Write
(
file
);
}
LogHelper
.
Information
(
$"
{
hospital
.
HosName
}
HIS数据提取成功,文件路径:
{
newPath
}
。"
,
"提取绩效数据"
);
SendEmail
(
email
,
newPath
,
$"
{
hospital
.
HosName
}
HIS数据提取成功"
,
$"
{
hospital
.
HosName
}
在
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
成功提取。"
);
return
newPath
;
}
...
...
@@ -239,6 +240,8 @@ private void WriteOtherIncome(ISheet sheet, int hospitalId, IPerSheetDataRead sh
var
head
=
sheet
.
GetRow
(
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
);
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
;
LogHelper
.
Information
(
$"写入额外收入列头信息"
,
"提取绩效数据"
);
//写入列头信息
foreach
(
var
item
in
itemList
)
{
...
...
@@ -274,6 +277,7 @@ private void WriteIncome(ISheet sheet, int hospitalId, List<AccountUnitEntity> u
var
technicianFactor
=
sheet
.
GetRow
(
sheetRead
.
Point
.
AccountingUnit
.
First
(
t
=>
t
.
UnitType
==
"医技组"
).
FactorRow
.
Value
);
var
head
=
GetOrCreate
(
sheet
,
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
);
LogHelper
.
Information
(
$"写入收入列头信息"
,
"提取绩效数据"
);
//写入列头信息
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
;
foreach
(
var
item
in
itemList
)
...
...
@@ -306,6 +310,8 @@ private void WriteIncome(ISheet sheet, int hospitalId, List<AccountUnitEntity> u
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
}
LogHelper
.
Information
(
$"填充收入数据"
,
"提取绩效数据"
);
//写入数据
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
...
...
@@ -393,6 +399,7 @@ private void WriteWorkload(ISheet sheet, int hospitalId, List<AccountUnitEntity>
var
head
=
GetOrCreate
(
sheet
,
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
0
);
var
factor
=
GetOrCreate
(
sheet
,
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
1
);
LogHelper
.
Information
(
$"写入工作量列头信息"
,
"提取绩效数据"
);
//写入列头信息
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
2
;
foreach
(
var
item
in
itemList
)
...
...
@@ -430,6 +437,8 @@ private void WriteWorkload(ISheet sheet, int hospitalId, List<AccountUnitEntity>
{
specialHead
=
itemList
.
Select
(
t
=>
t
.
ItemName
).
Intersect
(
extractHead
.
Distinct
())?.
ToList
();
}
LogHelper
.
Information
(
$"填充工作量数据"
,
"提取绩效数据"
);
//写入数据
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
2
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Distinct
())
...
...
@@ -465,6 +474,7 @@ private void WriteWorkload(ISheet sheet, int hospitalId, List<AccountUnitEntity>
private
List
<
ExtractDto
>
QueryDatabase
(
List
<
sys_hospitalconfig
>
hospitalConfigList
,
mod_extract
extract
,
per_allot
allot
,
string
category
=
null
)
{
LogHelper
.
Information
(
$"执行SQL脚本获取数据,"
,
"提取绩效数据"
);
var
config
=
hospitalConfigList
.
FirstOrDefault
(
t
=>
t
.
Type
==
extract
.
SourceType
);
var
parameters
=
GetParameters
(
allot
);
using
(
var
connection
=
ConnectionBuilder
.
Create
(
DatabaseType
.
SqlServer
,
config
.
DbSource
,
config
.
DbName
,
config
.
DbUser
,
config
.
DbPassword
))
...
...
@@ -473,6 +483,7 @@ private List<ExtractDto> QueryDatabase(List<sys_hospitalconfig> hospitalConfigLi
{
extract
.
ExecuteScript
=
Regex
.
Replace
(
extract
.
ExecuteScript
,
item
.
Key
,
item
.
Value
,
RegexOptions
.
IgnoreCase
);
}
LogHelper
.
Information
(
$"SQL脚本
{
extract
.
ExecuteScript
}
,"
,
"提取绩效数据"
);
var
result
=
connection
.
Query
<
ExtractDto
>(
extract
.
ExecuteScript
,
commandTimeout
:
20000
);
if
(
result
!=
null
&&
result
.
Count
()
>
0
)
...
...
@@ -502,6 +513,8 @@ private void WriteExpend(ISheet sheet, int hospitalId, IPerSheetDataRead sheetRe
var
head
=
sheet
.
GetRow
(
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
);
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
;
LogHelper
.
Information
(
$"写入成本支出列头信息"
,
"提取绩效数据"
);
//写入列头信息
foreach
(
var
item
in
itemList
)
{
...
...
@@ -538,6 +551,7 @@ private void WriteExpend(ISheet sheet, int hospitalId, IPerSheetDataRead sheetRe
private
void
WriteEmployee
(
ISheet
sheet
,
int
allotLastId
,
IPerSheetDataRead
sheetRead
)
{
LogHelper
.
Information
(
$"填充人员信息,"
,
"提取绩效数据"
);
var
dictionary
=
new
Dictionary
<
string
,
Func
<
im_employee
,
object
>>
{
{
"核算单元"
,
(
t
)
=>
t
.
AccountingUnit
},
...
...
@@ -577,6 +591,7 @@ private void WriteEmployee(ISheet sheet, int allotLastId, IPerSheetDataRead shee
private
void
WriteSpecialUnit
(
ISheet
sheet
,
int
hospitalId
,
per_allot
allotLast
,
IPerSheetDataRead
sheetRead
)
{
LogHelper
.
Information
(
$"填充特殊核算单元绩效测算表,"
,
"提取绩效数据"
);
var
dictionary
=
new
Dictionary
<
string
,
Func
<
mod_special
,
List
<
im_specialunit
>,
object
>>
{
{
"科室"
,
(
special
,
lastAllot
)
=>
special
.
Department
},
...
...
@@ -656,6 +671,7 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, per_allot allotLast,
private
void
WriteAccountBasic
(
ISheet
sheet
,
int
allotLastId
,
IPerSheetDataRead
sheetRead
)
{
LogHelper
.
Information
(
$"填充临床科室医护绩效测算表,"
,
"提取绩效数据"
);
var
dictionary
=
new
Dictionary
<
string
,
Func
<
im_accountbasic
,
object
>>
{
{
"核算单元类型"
,
(
t
)
=>
t
.
UnitType
},
...
...
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