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
e302b475
Commit
e302b475
authored
Apr 02, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次绩效增加字段worktype,工作量计算改变
parent
74385504
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
10 deletions
+81
-10
performance/Performance.Api/Controllers/SecondAllotController.cs
+2
-2
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+5
-0
performance/Performance.EntityModels/Entity/ag_fixatitem.cs
+5
-0
performance/Performance.Services/Details/SecondAllotDetails.cs
+1
-1
performance/Performance.Services/SecondAllotService.cs
+68
-7
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
e302b475
...
...
@@ -80,7 +80,7 @@ public ApiResponse SaveValue(int secondid, [FromBody] List<ag_fixatitem> request
if
(
unitTypeCount
!=
1
||
request
.
Any
(
t
=>
string
.
IsNullOrEmpty
(
t
.
UnitType
)))
throw
new
PerformanceException
(
"科室类型错误"
);
var
repetition
=
request
.
GroupBy
(
t
=>
new
{
t
.
RowNumber
,
t
.
ItemName
}).
Where
(
t
=>
t
.
Count
()
>
1
);
var
repetition
=
request
.
GroupBy
(
t
=>
new
{
t
.
RowNumber
,
t
.
ItemName
,
WorkType
=
t
.
WorkType
??
0
}).
Where
(
t
=>
t
.
Count
()
>
1
);
if
(
repetition
.
Any
())
throw
new
PerformanceException
(
string
.
Join
(
";"
,
repetition
.
Select
(
t
=>
$"行
{
t
.
Key
.
RowNumber
}
项‘
{
t
.
Key
.
ItemName
}
’重复录入"
)));
...
...
@@ -405,7 +405,7 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request)
//var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
var
obj
=
new
{
header
=
secondAllotService
.
OtherListHeader
(
request
.
SecondId
,
result
?.
Sum
(
t
=>
t
.
RealAmount
)),
header
=
secondAllotService
.
OtherListHeader
(
request
.
SecondId
,
result
?.
Sum
(
t
=>
t
.
RealAmount
)),
body
=
result
,
};
return
new
ApiResponse
(
ResponseType
.
OK
,
obj
);
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
e302b475
...
...
@@ -686,6 +686,11 @@
1 value相加值为1
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_fixatitem.WorkType"
>
<summary>
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_header"
>
<summary>
二次分配不固定列头数据
...
...
performance/Performance.EntityModels/Entity/ag_fixatitem.cs
View file @
e302b475
...
...
@@ -75,5 +75,10 @@ public class ag_fixatitem
/// 1 value相加值为1
/// </summary>
public
Nullable
<
int
>
SpecialAttr
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
int
>
WorkType
{
get
;
set
;
}
}
}
performance/Performance.Services/Details/SecondAllotDetails.cs
View file @
e302b475
...
...
@@ -254,7 +254,7 @@ public List<BodyItem> GetEmployeeFromSavedData(int userId, ag_secondallot second
foreach
(
var
column
in
otherShowColumns
)
{
var
tableFixedData
=
new
BodyItem
(
column
);
var
savedData
=
savedDataList
.
FirstOrDefault
(
w
=>
w
.
RowNumber
==
rowNumber
&&
w
.
Type
==
column
.
Type
&&
w
.
ItemName
==
column
.
FiledName
);
var
savedData
=
savedDataList
.
FirstOrDefault
(
w
=>
w
.
RowNumber
==
rowNumber
&&
w
.
Type
==
column
.
Type
&&
w
.
ItemName
==
column
.
FiledName
&&
w
.
WorkType
==
column
.
WorkType
);
if
(
savedData
!=
null
)
{
tableFixedData
.
Value
=
savedData
.
ItemValue
;
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
e302b475
...
...
@@ -145,6 +145,17 @@ public List<SecondListResponse> GetSecondList(int userId)
t
.
ShowFormula
=
allot
.
ShowFormula
;
}
});
// 暂时在加载列表时补充信息
if
(
secondList
!=
null
&&
secondList
.
Any
())
{
var
worktypes
=
perforAgworkloadtypeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospital
.
HospitalID
&&
t
.
Department
==
secondList
.
First
().
Department
&&
t
.
UnitType
==
secondList
.
First
().
UnitType
);
if
(
worktypes
!=
null
&&
worktypes
.
Any
())
{
worktypes
.
ForEach
(
t
=>
AddWorkTypeDefaultValues
(
t
));
}
}
return
list
;
}
...
...
@@ -1140,6 +1151,7 @@ public ag_workload_type SaveWorkType(ag_workload_type request, int userId)
};
perforAgworkloadtypeRepository
.
Add
(
entity
);
}
AddWorkTypeDefaultValues
(
entity
);
return
entity
;
}
else
if
(
request
.
Id
!=
entity
.
Id
)
...
...
@@ -1148,6 +1160,55 @@ public ag_workload_type SaveWorkType(ag_workload_type request, int userId)
return
request
;
}
private
void
AddWorkTypeDefaultValues
(
ag_workload_type
type
)
{
List
<(
string
,
string
,
int
)>
defaultValues
=
new
List
<(
string
,
string
,
int
)>
{
(
"工作量得分"
,
"WorkloadScore"
,
1
),
(
"考核得分"
,
"AssessmentScore"
,
2
),
(
"工作量绩效工资"
,
"WorkPerformance"
,
3
)
};
List
<
ag_workload
>
insertData
=
new
List
<
ag_workload
>();
var
workItems
=
perforAgworkloadRepository
.
GetEntities
(
t
=>
t
.
WorkTypeId
==
type
.
Id
);
if
(
workItems
==
null
||
!
workItems
.
Any
(
t
=>
defaultValues
.
Select
(
q
=>
q
.
Item1
).
Contains
(
t
.
ItemName
)))
{
insertData
=
defaultValues
.
Select
(
t
=>
new
ag_workload
{
HospitalId
=
type
.
HospitalId
,
Department
=
type
.
Department
,
UnitType
=
type
.
UnitType
,
ItemId
=
t
.
Item2
+
type
.
Id
,
ItemName
=
t
.
Item1
,
FactorValue
=
null
,
Sort
=
100
+
t
.
Item3
,
WorkTypeId
=
type
.
Id
}).
ToList
();
}
else
{
foreach
(
var
item
in
defaultValues
)
{
var
data
=
workItems
.
FirstOrDefault
(
t
=>
t
.
ItemName
==
item
.
Item1
);
if
(
data
==
null
)
{
insertData
.
Add
(
new
ag_workload
{
HospitalId
=
type
.
HospitalId
,
Department
=
type
.
Department
,
UnitType
=
type
.
UnitType
,
ItemId
=
item
.
Item2
+
type
.
Id
,
ItemName
=
item
.
Item1
,
FactorValue
=
null
,
Sort
=
100
+
item
.
Item3
,
WorkTypeId
=
type
.
Id
});
}
}
}
perforAgworkloadRepository
.
AddRange
(
insertData
.
ToArray
());
}
/// <summary>
/// 获取工作量类型列表
/// </summary>
...
...
@@ -1300,9 +1361,9 @@ bool method(decimal? submitDataAmount, decimal? realGiveFee)
if
(
data
==
null
||
!
data
.
Any
())
throw
new
PerformanceException
(
"提交时未检测到数据!"
);
var
total
=
data
.
Sum
(
t
=>
t
.
RealAmount
);
if
(!
method
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
"总金额与考核后金额不一致!"
);
//
var total = data.Sum(t => t.RealAmount);
//
if (!method(total, second.RealGiveFee))
//
throw new PerformanceException("总金额与考核后金额不一致!");
}
else
{
...
...
@@ -1310,10 +1371,10 @@ bool method(decimal? submitDataAmount, decimal? realGiveFee)
if
(
data
==
null
||
!
data
.
Any
())
throw
new
PerformanceException
(
"提交时未检测到数据!"
);
var
total
=
data
.
Where
(
t
=>
t
.
ItemName
==
"实发绩效工资金额"
&&
t
.
RowNumber
>
-
1
).
GroupBy
(
t
=>
t
.
RowNumber
)
.
Sum
(
t
=>
ConvertHelper
.
To
<
decimal
>(
t
.
OrderByDescending
(
o
=>
o
.
ID
).
FirstOrDefault
().
ItemValue
));
if
(!
method
(
total
,
second
.
RealGiveFee
))
throw
new
PerformanceException
(
"总金额与考核后金额不一致!"
);
//
var total = data.Where(t => t.ItemName == "实发绩效工资金额" && t.RowNumber > -1).GroupBy(t => t.RowNumber)
//
.Sum(t => ConvertHelper.To<decimal>(t.OrderByDescending(o => o.ID).FirstOrDefault().ItemValue));
//
if (!method(total, second.RealGiveFee))
//
throw new PerformanceException("总金额与考核后金额不一致!");
}
second
.
UseTempId
=
temp
.
UseTempId
;
second
.
Status
=
2
;
...
...
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