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
4d55acf9
Commit
4d55acf9
authored
Aug 23, 2022
by
Licx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改提交获取列表接口
parent
1390990c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
39 deletions
+108
-39
performance/Performance.Api/Controllers/EmployeeController.cs
+32
-8
performance/Performance.Services/EmployeeService.cs
+76
-31
No files found.
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
4d55acf9
...
...
@@ -268,12 +268,12 @@ public ApiResponse Audit(int allotid)
/// <returns></returns>
[
Route
(
"apr/getlist"
)]
[
HttpPost
]
public
ApiResponse
GetAprList
([
FromBody
]
AllotIdReques
t
request
)
public
ApiResponse
GetAprList
([
FromBody
]
per_apr_amoun
t
request
)
{
if
(
request
.
AllotId
==
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
var
employee
=
employeeService
.
GetApr
List
(
request
.
AllotId
,
claim
.
GetUserId
()
);
var
employee
=
employeeService
.
GetApr
ByTypeInDepartment
(
request
.
AllotId
,
request
.
TypeInDepartment
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
...
...
@@ -398,12 +398,12 @@ public ApiResponse DeleteApr([FromBody] IdRequest request)
/// <returns></returns>
[
HttpPost
]
[
Route
(
"apr/commit"
)]
public
ApiResponse
CommitResult
([
FromBody
]
AprAmountAuditReques
t
request
)
public
ApiResponse
CommitResult
([
FromBody
]
per_apr_amoun
t
request
)
{
if
(
request
.
AllotId
==
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
var
result
=
employeeService
.
CommitApr
(
request
.
AllotId
,
claim
.
GetUserId
(),
request
.
IsPass
);
var
result
=
employeeService
.
CommitApr
(
request
.
AllotId
,
request
.
TypeInDepartment
,
request
.
Status
??
1
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
...
...
@@ -540,6 +540,18 @@ public ApiResponse AprOverview(int allotId)
});
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
}
/// <summary>
/// 清理该科室录入数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
(
"apr/clear"
)]
public
ApiResponse
<
List
<
TitleValue
>>
ClearAprData
([
FromBody
]
per_apr_amount
request
)
{
var
result
=
employeeService
.
ClearAprData
(
request
);
return
new
ApiResponse
<
List
<
TitleValue
>>(
ResponseType
.
OK
,
"删除成功"
);
}
#
endregion
/// <summary>
...
...
@@ -587,12 +599,12 @@ public ApiResponse GetDeptAssessment(int allotId)
/// <returns></returns>
[
Route
(
"apr/hide/getlist"
)]
[
HttpPost
]
public
ApiResponse
GetAprHideList
([
FromBody
]
AllotIdReques
t
request
)
public
ApiResponse
GetAprHideList
([
FromBody
]
per_apr_amoun
t
request
)
{
if
(
request
.
AllotId
==
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
var
employee
=
employeeService
.
GetAprHide
List
(
request
.
AllotId
,
claim
.
GetUserId
()
);
var
employee
=
employeeService
.
GetAprHide
ByTypeInDepartment
(
request
.
AllotId
,
request
.
TypeInDepartment
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
...
...
@@ -717,12 +729,12 @@ public ApiResponse DeleteAprHide([FromBody] IdRequest request)
/// <returns></returns>
[
HttpPost
]
[
Route
(
"apr/hide/commit"
)]
public
ApiResponse
CommitResultHide
([
FromBody
]
AprAmountAuditReques
t
request
)
public
ApiResponse
CommitResultHide
([
FromBody
]
per_apr_amoun
t
request
)
{
if
(
request
.
AllotId
==
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
var
result
=
employeeService
.
CommitAprHide
(
request
.
AllotId
,
claim
.
GetUserId
(),
request
.
IsPass
);
var
result
=
employeeService
.
CommitAprHide
(
request
.
AllotId
,
request
.
TypeInDepartment
,
request
.
Status
??
1
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
...
...
@@ -848,6 +860,18 @@ public ApiResponse AprHideOverview(int allotId)
});
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
result
);
}
/// <summary>
/// 清理该科室录入不公示数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
(
"apr/hide/clear"
)]
public
ApiResponse
<
List
<
TitleValue
>>
ClearAprHideData
([
FromBody
]
per_apr_amount
request
)
{
var
result
=
employeeService
.
ClearAprHideData
(
request
);
return
new
ApiResponse
<
List
<
TitleValue
>>(
ResponseType
.
OK
,
"删除成功"
);
}
#
endregion
/// <summary>
...
...
performance/Performance.Services/EmployeeService.cs
View file @
4d55acf9
...
...
@@ -489,7 +489,7 @@ public bool InsertApr(per_apr_amount request, int userId)
throw
new
PerformanceException
(
"工号在字典中不存在"
);
request
.
TypeInDepartment
=
GetTypeInDepartment
(
userId
);
request
.
Status
=
2
;
request
.
Status
=
1
;
request
.
CreateDate
=
DateTime
.
Now
;
request
.
CreateUser
=
userId
;
return
perapramountRepository
.
Add
(
request
);
...
...
@@ -513,7 +513,7 @@ public bool UpdateApr(per_apr_amount request)
if
(
data
==
null
)
throw
new
PerformanceException
(
"修改数据无效"
);
data
.
Status
=
2
;
data
.
Status
=
1
;
data
.
PersonnelNumber
=
request
.
PersonnelNumber
;
data
.
DoctorName
=
request
.
DoctorName
;
data
.
PerforType
=
request
.
PerforType
;
...
...
@@ -542,11 +542,12 @@ public bool DeleteApr(int id)
/// 提交、撤销医院其他绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="userId"></param>
/// <param name="department">录入科室</param>
/// <param name="department"></param>
/// <returns></returns>
public
bool
CommitApr
(
int
allotId
,
int
userId
,
int
status
)
public
bool
CommitApr
(
int
allotId
,
string
department
,
int
status
)
{
var
list
=
GetApr
List
(
allotId
,
userId
);
var
list
=
GetApr
ByTypeInDepartment
(
allotId
,
department
);
if
(
list
==
null
)
return
true
;
list
.
ForEach
(
t
=>
t
.
Status
=
status
);
...
...
@@ -636,15 +637,13 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userid
);
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未绑定角色"
);
//var data = new List<per_apr_amount>();
//var roles = new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 };
//if (roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办查看所有科室的数据
// data = perapramountRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0);
//else
// data = perapramountRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0 && t.CreateUser == userid);
//if (data != null && data.Any())
// perapramountRepository.RemoveRange(data.ToArray());
var
typeIn
=
GetTypeInDepartment
(
userid
);
var
data
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotid
&&
t
.
TypeInDepartment
==
typeIn
);
if
(
data
!=
null
&&
data
.
Any
())
{
data
.
ForEach
(
t
=>
t
.
Status
=
1
);
perapramountRepository
.
UpdateRange
(
data
.
ToArray
());
}
try
{
...
...
@@ -685,7 +684,6 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
var
entities
=
new
List
<
per_apr_amount
>();
var
createtime
=
DateTime
.
Now
;
var
typeIn
=
GetTypeInDepartment
(
userid
);
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotid
);
for
(
int
rowindex
=
1
;
rowindex
<
sheet
.
LastRowNum
+
1
;
rowindex
++)
...
...
@@ -695,7 +693,7 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
var
entity
=
new
per_apr_amount
{
Status
=
2
,
Status
=
1
,
PersonnelNumber
=
dict
[
"人员工号"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"人员工号"
]).
GetValue
(),
DoctorName
=
dict
[
"姓名"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"姓名"
]).
GetValue
(),
PerforType
=
dict
[
"绩效类型"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
...
...
@@ -959,7 +957,7 @@ public bool InsertAprHide(per_apr_amount_hide request, int userId)
throw
new
PerformanceException
(
"工号在字典中不存在"
);
request
.
TypeInDepartment
=
GetTypeInDepartment
(
userId
);
request
.
Status
=
2
;
request
.
Status
=
1
;
request
.
CreateDate
=
DateTime
.
Now
;
request
.
CreateUser
=
userId
;
return
_hideRepository
.
Add
(
request
);
...
...
@@ -983,7 +981,7 @@ public bool UpdateAprHide(per_apr_amount_hide request)
if
(
data
==
null
)
throw
new
PerformanceException
(
"修改数据无效"
);
data
.
Status
=
2
;
data
.
Status
=
1
;
data
.
PersonnelNumber
=
request
.
PersonnelNumber
;
data
.
DoctorName
=
request
.
DoctorName
;
data
.
PerforType
=
request
.
PerforType
;
...
...
@@ -1015,9 +1013,9 @@ public bool DeleteAprHide(int id)
/// <param name="userId"></param>
/// <param name="status"></param>
/// <returns></returns>
public
bool
CommitAprHide
(
int
allotId
,
int
userId
,
int
status
)
public
bool
CommitAprHide
(
int
allotId
,
string
department
,
int
status
)
{
var
list
=
GetAprHide
List
(
allotId
,
userId
);
var
list
=
GetAprHide
ByTypeInDepartment
(
allotId
,
department
);
if
(
list
==
null
)
return
true
;
list
.
ForEach
(
t
=>
t
.
Status
=
status
);
...
...
@@ -1107,15 +1105,13 @@ public void ImpoerAprHideEmployees(int allotid, string path, int userid)
var
userrole
=
userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userid
);
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"用户未绑定角色"
);
//var data = new List<per_apr_amount_hide>();
//var roles = new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 };
//if (roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办查看所有科室的数据
// data = _hideRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0);
//else
// data = _hideRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0 && t.CreateUser == userid);
//if (data != null && data.Any())
// _hideRepository.RemoveRange(data.ToArray());
var
typeIn
=
GetTypeInDepartment
(
userid
);
var
data
=
_hideRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotid
&&
t
.
TypeInDepartment
==
typeIn
);
if
(
data
!=
null
&&
data
.
Any
())
{
data
.
ForEach
(
t
=>
t
.
Status
=
1
);
_hideRepository
.
UpdateRange
(
data
.
ToArray
());
}
try
{
...
...
@@ -1156,7 +1152,6 @@ public void ImpoerAprHideEmployees(int allotid, string path, int userid)
var
entities
=
new
List
<
per_apr_amount_hide
>();
var
createtime
=
DateTime
.
Now
;
var
typeIn
=
GetTypeInDepartment
(
userid
);
for
(
int
rowindex
=
1
;
rowindex
<
sheet
.
LastRowNum
+
1
;
rowindex
++)
{
var
row
=
sheet
.
GetRow
(
rowindex
);
...
...
@@ -1164,7 +1159,7 @@ public void ImpoerAprHideEmployees(int allotid, string path, int userid)
var
entity
=
new
per_apr_amount_hide
{
Status
=
2
,
Status
=
1
,
PersonnelNumber
=
dict
[
"人员工号"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"人员工号"
]).
GetValue
(),
DoctorName
=
dict
[
"姓名"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"姓名"
]).
GetValue
(),
PerforType
=
dict
[
"绩效类型"
]
<
0
?
""
:
row
.
GetCell
(
dict
[
"绩效类型"
]).
GetValue
(),
...
...
@@ -1879,6 +1874,56 @@ public void AuditGather(List<Gather> gather)
_service
.
SyncDataToResult
(
gatherFirst
.
AllotId
);
}
}
/// <summary>
/// 清理该科室录入数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
ClearAprData
(
per_apr_amount
request
)
{
var
data
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
TypeInDepartment
==
request
.
TypeInDepartment
);
if
(
data
==
null
||
!
data
.
Any
())
return
true
;
return
perapramountRepository
.
RemoveRange
(
data
.
ToArray
());
}
/// <summary>
/// 清理该科室录入不公示数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
bool
ClearAprHideData
(
per_apr_amount
request
)
{
var
data
=
_hideRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
&&
t
.
TypeInDepartment
==
request
.
TypeInDepartment
);
if
(
data
==
null
||
!
data
.
Any
())
return
true
;
return
_hideRepository
.
RemoveRange
(
data
.
ToArray
());
}
/// <summary>
/// 根据录入科室获取其他绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="department">录入科室</param>
/// <returns></returns>
public
List
<
per_apr_amount
>
GetAprByTypeInDepartment
(
int
allotId
,
string
department
)
{
var
data
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
TypeInDepartment
==
department
);
return
data
;
}
/// <summary>
/// 根据录入科室获取不公示其他绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="department">录入科室</param>
/// <returns></returns>
public
List
<
per_apr_amount_hide
>
GetAprHideByTypeInDepartment
(
int
allotId
,
string
department
)
{
var
data
=
_hideRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
TypeInDepartment
==
department
);
return
data
;
}
}
public
class
ComparisonConfig
...
...
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