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
4e5121a0
Commit
4e5121a0
authored
Mar 30, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员字典二次分配自定义显示列:
parent
985ee9f6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
7 deletions
+91
-7
performance/Performance.Api/Controllers/SecondAllotController.cs
+4
-1
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.DtoModels/Second/SecondColumnDictionary.cs
+6
-1
performance/Performance.Repository/PerforPerAllotRepository.cs
+24
-3
performance/Performance.Services/RedistributionService.cs
+52
-2
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
4e5121a0
...
...
@@ -719,6 +719,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
_redistributionService
.
ClearInvalidValue
(
cleanDatas
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
_redistributionService
.
RowsExpand
(
allot
,
dic
,
cleanDatas
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
request
.
Head
,
Body
=
cleanDatas
,
Dic
=
dic
});
}
catch
(
PerformanceException
ex
)
...
...
@@ -915,8 +916,10 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request)
// 返回信息
var
(
head
,
rows
)
=
_redistributionService
.
RedistributionDetail
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
workloadGroups
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
_redistributionService
.
RowsExpand
(
allot
,
dic
,
rows
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
head
,
Body
=
rows
,
Dic
=
dic
});
}
#
endregion
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
4e5121a0
...
...
@@ -4096,6 +4096,11 @@
格式
</summary>
</member>
<member
name=
"P:Performance.DtoModels.SecondColumnDictionary.Expand"
>
<summary>
true 扩展字段,通过配置额外展示
</summary>
</member>
<member
name=
"P:Performance.DtoModels.SecondEmployeeDto.ComputeMode"
>
<summary>
计算方式:11 不计算 12 横向计算 13 纵向计算
...
...
performance/Performance.DtoModels/Second/SecondColumnDictionary.cs
View file @
4e5121a0
...
...
@@ -38,12 +38,16 @@ public class SecondColumnDictionary
/// 格式
/// </summary>
public
bool
IsNumber
{
get
;
set
;
}
/// <summary>
/// true 扩展字段,通过配置额外展示
/// </summary>
public
bool
Expand
{
get
;
set
;
}
public
SecondColumnDictionary
()
{
}
public
SecondColumnDictionary
(
string
label
,
string
key
,
bool
isTrue
,
int
sort
,
string
site
=
"Table"
,
string
type
=
""
,
string
color
=
""
,
int
?
width
=
null
,
bool
isNumber
=
true
)
public
SecondColumnDictionary
(
string
label
,
string
key
,
bool
isTrue
,
int
sort
,
string
site
=
"Table"
,
string
type
=
""
,
string
color
=
""
,
int
?
width
=
null
,
bool
isNumber
=
true
,
bool
expand
=
false
)
{
Label
=
label
;
Key
=
key
;
...
...
@@ -54,6 +58,7 @@ public SecondColumnDictionary(string label, string key, bool isTrue, int sort, s
Color
=
color
;
Width
=
width
.
HasValue
?
width
.
ToString
()
:
((
label
??
""
).
Length
*
20
+
10
).
ToString
();
IsNumber
=
isNumber
;
Expand
=
expand
;
}
}
}
performance/Performance.Repository/PerforPerAllotRepository.cs
View file @
4e5121a0
...
...
@@ -253,9 +253,7 @@ public IEnumerable<view_second_workload_result> GetSecondWorkload(int allotid, s
/// <summary>
/// 查询HIS提取数据,工作量字典
/// </summary>
/// <param name="allotid"></param>
/// <param name="unittype"></param>
/// <param name="accountingunit"></param>
/// <param name="hospitalId"></param>
/// <returns></returns>
public
IEnumerable
<
string
>
GetSecondWorkloadMaps
(
int
hospitalId
)
{
...
...
@@ -278,5 +276,27 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
}
}
}
/// <summary>
/// 查询人员字典
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
IEnumerable
<
dynamic
>
QueryEmployee
(
int
allotId
)
{
using
(
var
connection
=
context
.
Database
.
GetDbConnection
())
{
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
try
{
string
query
=
$@"SELECT * FROM view_employee WHERE AllotID = @allotId"
;
return
connection
.
Query
(
query
,
new
{
allotId
},
commandTimeout
:
60
*
60
);
}
catch
(
Exception
)
{
throw
;
}
}
}
}
}
\ No newline at end of file
performance/Performance.Services/RedistributionService.cs
View file @
4e5121a0
...
...
@@ -178,7 +178,7 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
/*
此处数据需要额外注意,前端显示规则:通过isTrue=true显示,显示名称为label
*/
var
alias
=
_cofaliasRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Route
==
"/second_entering"
)
??
new
List
<
cof_alias
>();
var
alias
=
_cofaliasRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Route
==
"/second_entering"
&&
t
.
States
==
1
)
??
new
List
<
cof_alias
>();
Func
<
string
,
string
,
string
>
getAlias
=
(
name
,
def
)
=>
{
try
...
...
@@ -226,6 +226,27 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
maps
.
Add
(
new
SecondColumnDictionary
(
getAlias
(
nameof
(
ag_bodysource
.
TitleCoefficient
),
"职称系数"
),
nameof
(
ag_bodysource
.
TitleCoefficient
),
false
,
203
,
color
:
"title_color"
,
isNumber
:
true
));
maps
.
Add
(
new
SecondColumnDictionary
(
getAlias
(
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
"职称绩效得分"
),
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
false
,
204
,
color
:
"title_color"
,
isNumber
:
true
));
}
// 扩展字典
if
(
alias
!=
null
&&
alias
.
Any
())
{
List
<
string
>
notCalculate
=
new
List
<
string
>
{
nameof
(
ag_bodysource
.
Post
),
nameof
(
ag_bodysource
.
StaffCoefficient
),
nameof
(
ag_bodysource
.
ActualAttendance
),
nameof
(
ag_bodysource
.
JobTitle
),
nameof
(
ag_bodysource
.
TitleCoefficient
),
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
};
foreach
(
var
item
in
alias
)
{
if
(!
maps
.
Any
(
w
=>
w
.
Key
.
Equals
(
item
.
Name
,
StringComparison
.
OrdinalIgnoreCase
))
&&
!
notCalculate
.
Contains
(
item
.
Name
))
{
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Alias
,
item
.
Name
,
false
,
item
.
Sort
,
color
:
"title_color"
,
isNumber
:
false
,
expand
:
true
));
}
}
}
// 工作量
if
(
computeMode
!=
ComputeMode
.
NotCalculate
)
...
...
@@ -288,6 +309,35 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
}
/// <summary>
/// 补充内容 扩展字段,通过配置额外展示
/// </summary>
/// <param name="allot"></param>
/// <param name="dic"></param>
/// <param name="rows"></param>
public
void
RowsExpand
(
per_allot
allot
,
List
<
SecondColumnDictionary
>
dic
,
List
<
Dictionary
<
string
,
object
>>
rows
)
{
if
(
dic
!=
null
&&
dic
.
Any
(
w
=>
w
.
Expand
))
{
var
employees
=
_perallotRepository
.
QueryEmployee
(
allot
.
ID
);
foreach
(
var
row
in
rows
)
{
var
number
=
row
.
GetString
(
nameof
(
ag_bodysource
.
WorkNumber
));
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>();
var
emp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
number
);
if
(
emp
!=
null
)
pairs
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
object
>>(
JsonHelper
.
Serialize
(
emp
));
foreach
(
var
item
in
dic
.
Where
(
w
=>
w
.
Expand
))
{
var
value
=
pairs
.
GetString
(
item
.
Key
);
row
.
AddOrUpdate
(
item
.
Key
,
value
);
}
}
}
}
/// <summary>
/// 加载已保存工作量数据,加载时区分:已提交和未提交
/// </summary>
/// <param name="allot"></param>
...
...
@@ -782,7 +832,7 @@ private HandsonTableBase ComputeMode_Format2(per_allot allot, List<string> colHe
{
getAlias
(
nameof
(
ag_bodysource
.
WorkNumber
),
"工号"
),
getAlias
(
nameof
(
ag_bodysource
.
Name
),
"姓名"
),
getAlias
(
nameof
(
ag_bodysource
.
Post
),
"
人员系数
"
),
getAlias
(
nameof
(
ag_bodysource
.
Post
),
"
领取平均绩效
"
),
getAlias
(
nameof
(
ag_bodysource
.
StaffCoefficient
),
"人员系数"
),
getAlias
(
nameof
(
ag_bodysource
.
ActualAttendance
),
"出勤"
),
getAlias
(
nameof
(
ag_bodysource
.
JobTitle
),
"职称"
),
...
...
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