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
0a84fa15
Commit
0a84fa15
authored
Feb 28, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增删除所有员工接口
parent
b4f39cc1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
+29
-5
performance/Performance.Api/Controllers/PersonController.cs
+14
-0
performance/Performance.Services/EmployeeService.cs
+2
-4
performance/Performance.Services/PersonService.cs
+13
-1
No files found.
performance/Performance.Api/Controllers/PersonController.cs
View file @
0a84fa15
...
@@ -93,6 +93,20 @@ public ApiResponse DeletePerson(int employeeId)
...
@@ -93,6 +93,20 @@ public ApiResponse DeletePerson(int employeeId)
}
}
/// <summary>
/// <summary>
/// 删除所有员工
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
Route
(
"person/deleteall/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
DeleteAllPerson
(
int
allotId
)
{
var
result
=
personService
.
DeleteAllPerson
(
allotId
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"删除成功!"
)
:
new
ApiResponse
(
ResponseType
.
OK
,
"删除失败!"
);
}
/// <summary>
/// 下载当前测算表
/// 下载当前测算表
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
...
...
performance/Performance.Services/EmployeeService.cs
View file @
0a84fa15
...
@@ -565,7 +565,6 @@ public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
...
@@ -565,7 +565,6 @@ public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
item
.
Status
=
(
request
.
IsPass
==
1
)
?
3
:
4
;
item
.
Status
=
(
request
.
IsPass
==
1
)
?
3
:
4
;
item
.
AuditUser
=
userid
;
item
.
AuditUser
=
userid
;
item
.
AuditTime
=
DateTime
.
Now
;
item
.
AuditTime
=
DateTime
.
Now
;
item
.
Remark
=
request
.
Remark
;
perapramountRepository
.
UpdateRange
(
apramounts
.
ToArray
());
perapramountRepository
.
UpdateRange
(
apramounts
.
ToArray
());
}
}
}
}
...
@@ -966,16 +965,15 @@ public bool ConfirmAuditHide(int userid, AprAmountAuditRequest request)
...
@@ -966,16 +965,15 @@ public bool ConfirmAuditHide(int userid, AprAmountAuditRequest request)
var
allApramounts
=
_hideRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
);
var
allApramounts
=
_hideRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
request
.
AllotId
);
foreach
(
var
member
in
request
.
Members
)
foreach
(
var
member
in
request
.
Members
)
{
{
var
apramounts
=
allApramounts
?.
Where
(
t
=>
(
t
.
DoctorName
??
""
)
==
member
.
DoctorName
&&
(
t
.
PersonnelNumber
??
""
)
==
member
.
PersonnelNumber
);
var
apramounts
=
allApramounts
?.
Where
(
t
=>
(
t
.
PersonnelNumber
??
""
)
==
member
.
PersonnelNumber
);
if
(
apramounts
==
null
||
!
apramounts
.
Any
())
if
(
apramounts
==
null
||
!
apramounts
.
Any
())
throw
new
PerformanceException
(
"
审核信息无效,请确认"
);
throw
new
PerformanceException
(
$"工号为“
{
member
.
PersonnelNumber
}
”的
审核信息无效,请确认"
);
foreach
(
var
item
in
apramounts
)
foreach
(
var
item
in
apramounts
)
{
{
item
.
Status
=
(
request
.
IsPass
==
1
)
?
3
:
4
;
item
.
Status
=
(
request
.
IsPass
==
1
)
?
3
:
4
;
item
.
AuditUser
=
userid
;
item
.
AuditUser
=
userid
;
item
.
AuditTime
=
DateTime
.
Now
;
item
.
AuditTime
=
DateTime
.
Now
;
item
.
Remark
=
request
.
Remark
;
_hideRepository
.
UpdateRange
(
apramounts
.
ToArray
());
_hideRepository
.
UpdateRange
(
apramounts
.
ToArray
());
}
}
}
}
...
...
performance/Performance.Services/PersonService.cs
View file @
0a84fa15
...
@@ -92,7 +92,7 @@ public void CreateAllotPersons(int hospitalId, int allotId, int prevAllotId = -1
...
@@ -92,7 +92,7 @@ public void CreateAllotPersons(int hospitalId, int allotId, int prevAllotId = -1
var
isExist
=
(
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
allotId
)?.
Count
??
0
)
>
0
;
var
isExist
=
(
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
allotId
)?.
Count
??
0
)
>
0
;
//如果为空则先删除在执行下面的代码
//如果为空则先删除在执行下面的代码
if
(
isExist
)
{
peremployeeRepository
.
DeleteFromQuery
(
u
=>
u
.
HospitalId
==
hospitalId
&&
u
.
AllotId
==
allotId
);}
if
(
isExist
)
{
peremployeeRepository
.
DeleteFromQuery
(
u
=>
u
.
HospitalId
==
hospitalId
&&
u
.
AllotId
==
allotId
);
}
List
<
per_employee
>
persons
=
new
List
<
per_employee
>();
List
<
per_employee
>
persons
=
new
List
<
per_employee
>();
...
@@ -322,6 +322,18 @@ public bool DeletePerson(int employeeId)
...
@@ -322,6 +322,18 @@ public bool DeletePerson(int employeeId)
}
}
/// <summary>
/// <summary>
/// 删除员工
/// </summary>
/// <param name="employeeId"></param>
/// <returns></returns>
public
bool
DeleteAllPerson
(
int
allotId
)
{
var
employees
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
new
List
<
per_employee
>();
return
peremployeeRepository
.
RemoveRange
(
employees
.
ToArray
());
}
/// <summary>
/// 检查核算单元是否已存在
/// 检查核算单元是否已存在
/// </summary>
/// </summary>
/// <param name="hosapitalId">医院Id</param>
/// <param name="hosapitalId">医院Id</param>
...
...
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