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
4405724b
Commit
4405724b
authored
Feb 05, 2020
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特殊科室
parent
7f51942a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
112 additions
and
38 deletions
+112
-38
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+20
-0
performance/Performance.EntityModels/Entity/mod_item.cs
+5
-0
performance/Performance.EntityModels/Entity/mod_module.cs
+5
-0
performance/Performance.EntityModels/Entity/mod_special.cs
+10
-0
performance/Performance.Services/NewExtractService.cs
+72
-38
No files found.
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
4405724b
...
...
@@ -2120,6 +2120,11 @@
只读 0、否 1、是
</summary>
</member>
<member
name=
"P:Performance.EntityModels.mod_item.ConfigId"
>
<summary>
数据库地址
</summary>
</member>
<member
name=
"T:Performance.EntityModels.mod_module"
>
<summary>
...
...
@@ -2165,6 +2170,11 @@
是否生成Item 0、否 1、是
</summary>
</member>
<member
name=
"P:Performance.EntityModels.mod_module.ConfigId"
>
<summary>
数据库地址
</summary>
</member>
<member
name=
"T:Performance.EntityModels.mod_special"
>
<summary>
...
...
@@ -2200,6 +2210,16 @@
调节系数
</summary>
</member>
<member
name=
"P:Performance.EntityModels.mod_special.ExtractId"
>
<summary>
抽取绩效值SQL
</summary>
</member>
<member
name=
"P:Performance.EntityModels.mod_special.ConfigId"
>
<summary>
数据库地址
</summary>
</member>
<member
name=
"T:Performance.EntityModels.per_againallot"
>
<summary>
...
...
performance/Performance.EntityModels/Entity/mod_item.cs
View file @
4405724b
...
...
@@ -60,5 +60,10 @@ public class mod_item
/// 只读 0、否 1、是
/// </summary>
public
Nullable
<
int
>
ReadOnly
{
get
;
set
;
}
/// <summary>
/// 数据库地址
/// </summary>
public
Nullable
<
int
>
ConfigId
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/mod_module.cs
View file @
4405724b
...
...
@@ -55,5 +55,10 @@ public class mod_module
/// 是否生成Item 0、否 1、是
/// </summary>
public
Nullable
<
int
>
IsGenerated
{
get
;
set
;
}
/// <summary>
/// 数据库地址
/// </summary>
public
Nullable
<
int
>
ConfigId
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/mod_special.cs
View file @
4405724b
...
...
@@ -45,5 +45,15 @@ public class mod_special
/// 调节系数
/// </summary>
public
Nullable
<
decimal
>
AdjustFactor
{
get
;
set
;
}
/// <summary>
/// 抽取绩效值SQL
/// </summary>
public
Nullable
<
int
>
ExtractId
{
get
;
set
;
}
/// <summary>
/// 数据库地址
/// </summary>
public
Nullable
<
int
>
ConfigId
{
get
;
set
;
}
}
}
performance/Performance.Services/NewExtractService.cs
View file @
4405724b
...
...
@@ -135,29 +135,29 @@ public string ExtractData(int allotId, string email, int hospitalId)
var
sheetRead
=
PerSheetDataFactory
.
GetDataRead
(
sheetType
);
switch
(
sheetType
)
{
case
SheetType
.
Employee
:
if
(
allotLast
!=
null
)
WriteEmployee
(
sheet
,
allotLast
.
ID
,
sheetRead
);
break
;
case
SheetType
.
AccountBasic
:
if
(
allotLast
!=
null
)
WriteAccountBasic
(
sheet
,
allotLast
.
ID
,
sheetRead
);
break
;
//
case SheetType.Employee:
//
if (allotLast != null)
//
WriteEmployee(sheet, allotLast.ID, sheetRead);
//
break;
//
case SheetType.AccountBasic:
//
if (allotLast != null)
//
WriteAccountBasic(sheet, allotLast.ID, sheetRead);
//
break;
case
SheetType
.
SpecialUnit
:
WriteSpecialUnit
(
sheet
,
hospital
.
ID
,
allotLast
,
sheetRead
);
break
;
case
SheetType
.
Income
:
WriteIncome
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
break
;
case
SheetType
.
OtherIncome
:
WriteOtherIncome
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
break
;
case
SheetType
.
Expend
:
WriteExpend
(
sheet
,
hospital
.
ID
,
sheetRead
);
break
;
case
SheetType
.
Workload
:
WriteWorkload
(
sheet
,
hospital
.
ID
,
unitList
,
sheetRead
,
allot
,
modulesList
,
hospitalConfigList
);
WriteSpecialUnit
(
sheet
,
hospital
.
ID
,
allot
,
sheetRead
,
hospitalConfigList
);
break
;
//case SheetType.Income:
// WriteIncome(sheet, hospital.ID, unitList, sheetRead, allot, modulesList, hospitalConfigList);
// break;
//case SheetType.OtherIncome:
// WriteOtherIncome(sheet, hospital.ID, unitList, sheetRead, allot, modulesList, hospitalConfigList);
// break;
//case SheetType.Expend:
// WriteExpend(sheet, hospital.ID, sheetRead);
// break;
//case SheetType.Workload:
// WriteWorkload(sheet, hospital.ID, unitList, sheetRead, allot, modulesList, hospitalConfigList);
// break;
}
}
using
(
FileStream
file
=
new
FileStream
(
newPath
,
FileMode
.
OpenOrCreate
))
...
...
@@ -252,17 +252,30 @@ private void WriteOtherIncome(ISheet sheet, int hospitalId, List<AccountUnitEnti
}
//查询数据
var
extractList
=
perforModextractRepository
.
GetEntities
(
t
=>
module
.
ExtractId
==
t
.
Id
);
var
extractIdList
=
itemList
.
Select
(
t
=>
t
.
ExtractId
).
Distinct
().
ToList
();
var
extractList
=
perforModextractRepository
.
GetEntities
(
t
=>
extractIdList
.
Contains
(
t
.
Id
));
if
(
extractList
==
null
||
extractList
.
Count
==
0
)
return
;
List
<
ExtractDto
>
allExtract
=
new
List
<
ExtractDto
>();
foreach
(
var
item
in
extractList
)
{
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
"提取绩效数据"
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
var
category
=
itemList
.
Where
(
t
=>
t
.
ExtractId
==
item
.
Id
);
if
(
category
==
null
||
category
.
Count
()
==
0
)
continue
;
foreach
(
var
moditem
in
category
)
{
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
,"
,
"提取绩效数据"
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
,
moditem
.
ConfigId
??
0
,
moditem
.
ItemName
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
}
}
var
specialHead
=
new
List
<
string
>();
var
extractHead
=
allExtract
?.
Select
(
t
=>
t
.
Category
);
if
(
extractHead
!=
null
&&
extractHead
.
Any
())
{
specialHead
=
itemList
.
Select
(
t
=>
t
.
ItemName
).
Intersect
(
extractHead
.
Distinct
())?.
ToList
();
}
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"填充数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
...
...
@@ -357,7 +370,7 @@ private void WriteIncome(ISheet sheet, int hospitalId, List<AccountUnitEntity> u
{
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
"提取绩效数据"
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
,
module
.
ConfigId
??
0
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
}
...
...
@@ -480,7 +493,7 @@ private void WriteWorkload(ISheet sheet, int hospitalId, List<AccountUnitEntity>
{
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"执行SQL脚本获取数据 --
{
module
.
ModuleName
}
,"
,
"提取绩效数据"
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
,
moditem
.
ItemName
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
,
moditem
.
ConfigId
??
0
,
moditem
.
ItemName
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
}
...
...
@@ -528,9 +541,10 @@ 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
)
private
List
<
ExtractDto
>
QueryDatabase
(
List
<
sys_hospitalconfig
>
hospitalConfigList
,
mod_extract
extract
,
per_allot
allot
,
int
configId
,
string
category
=
null
)
{
var
config
=
hospitalConfigList
.
FirstOrDefault
(
t
=>
t
.
Type
==
extract
.
SourceType
);
var
config
=
hospitalConfigList
.
FirstOrDefault
(
t
=>
t
.
Id
==
configId
);
if
(
config
==
null
)
return
null
;
string
executeScript
=
extract
.
ExecuteScript
;
var
parameters
=
GetParameters
(
allot
);
using
(
var
connection
=
ConnectionBuilder
.
Create
((
DatabaseType
)
config
.
DataBaseType
,
config
.
DbSource
,
config
.
DbName
,
config
.
DbUser
,
config
.
DbPassword
))
...
...
@@ -647,12 +661,12 @@ private void WriteEmployee(ISheet sheet, int allotLastId, IPerSheetDataRead shee
}
}
private
void
WriteSpecialUnit
(
ISheet
sheet
,
int
hospitalId
,
per_allot
allot
Last
,
IPerSheetDataRead
sheetRead
)
private
void
WriteSpecialUnit
(
ISheet
sheet
,
int
hospitalId
,
per_allot
allot
,
IPerSheetDataRead
sheetRead
,
List
<
sys_hospitalconfig
>
hospitalConfigList
)
{
var
dictionary
=
new
Dictionary
<
string
,
Func
<
mod_special
,
List
<
im_specialunit
>,
object
>>
var
dictionary
=
new
Dictionary
<
string
,
Func
<
mod_special
,
List
<
ExtractDto
>,
object
>>
{
{
"科室"
,
(
special
,
lastAllot
)
=>
special
.
Department
},
{
"人数"
,
(
special
,
lastAllot
)
=>
lastAllot
.
Where
(
t
=>
special
.
Department
==
t
.
Department
).
Sum
(
t
=>
t
.
Number
)
},
{
"人数"
,
(
special
,
lastAllot
)
=>
lastAllot
.
Where
(
t
=>
special
.
Department
==
t
.
Department
).
Sum
(
t
=>
t
.
Value
)
},
{
"量化指标"
,
(
special
,
lastAllot
)
=>
special
.
Target
},
{
"量化指标绩效分值"
,(
special
,
lastAllot
)
=>
special
.
TargetFactor
},
{
"调节系数"
,
(
special
,
lastAllot
)
=>
special
.
AdjustFactor
},
...
...
@@ -661,9 +675,29 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, per_allot allotLast,
var
modDataList
=
perforModspecialRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
)?.
OrderBy
(
t
=>
t
.
Department
).
ToList
();
if
(
modDataList
==
null
||
modDataList
.
Count
==
0
)
return
;
List
<
im_specialunit
>
allotDataList
=
new
List
<
im_specialunit
>();
if
(
allotLast
!=
null
)
allotDataList
=
perforImspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotLast
.
ID
);
//List<im_specialunit> allotDataList = new List<im_specialunit>();
//if (allotLast != null)
// allotDataList = perforImspecialunitRepository.GetEntities(t => t.AllotID == allotLast.ID);
//查询数据
var
extractIdList
=
modDataList
.
Select
(
t
=>
t
.
ExtractId
).
Distinct
().
ToList
();
var
extractList
=
perforModextractRepository
.
GetEntities
(
t
=>
extractIdList
.
Contains
(
t
.
Id
));
if
(
extractList
==
null
||
extractList
.
Count
==
0
)
return
;
List
<
ExtractDto
>
allExtract
=
new
List
<
ExtractDto
>();
foreach
(
var
item
in
extractList
)
{
var
category
=
modDataList
.
Where
(
t
=>
t
.
ExtractId
==
item
.
Id
);
if
(
category
==
null
||
category
.
Count
()
==
0
)
continue
;
foreach
(
var
moditem
in
category
)
{
logManageService
.
WriteMsg
(
"提取绩效数据"
,
$"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表"
,
1
,
AllotId
,
"ReceiveMessage"
);
LogHelper
.
Information
(
$"执行SQL脚本获取数据 -- 特殊核算单元绩效测算表,"
,
"提取绩效数据"
);
var
result
=
QueryDatabase
(
hospitalConfigList
,
item
,
allot
,
moditem
.
ConfigId
??
0
,
moditem
.
Target
);
if
(
result
!=
null
)
allExtract
.
AddRange
(
result
);
}
}
//取消合并单元格
int
mergedCount
=
sheet
.
NumMergedRegions
;
...
...
@@ -701,7 +735,7 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, per_allot allotLast,
if
(
dictionary
.
ContainsKey
(
cell
.
StringCellValue
))
{
var
item
=
dictionary
.
First
(
t
=>
t
.
Key
==
cell
.
StringCellValue
);
value
=
item
.
Value
.
Invoke
(
modDataList
[
i
],
all
otDataLis
t
)
??
""
;
value
=
item
.
Value
.
Invoke
(
modDataList
[
i
],
all
Extrac
t
)
??
""
;
if
(
item
.
Key
==
"科室"
&&
rowIndex
==
mergedBegin
)
{
...
...
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