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
be83b464
Commit
be83b464
authored
Apr 09, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取人员名单接口修改、添加获取生成成功/归档的绩效列表
parent
6e161b9d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
10 deletions
+82
-10
performance/Performance.Api/Controllers/AllotController.cs
+13
-0
performance/Performance.Api/Controllers/EmployeeController.cs
+7
-5
performance/Performance.DtoModels/Request/EmployeeRequest.cs
+1
-1
performance/Performance.Services/AllotService.cs
+26
-1
performance/Performance.Services/EmployeeService.cs
+35
-3
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
be83b464
...
@@ -59,6 +59,19 @@ public ApiResponse List([FromBody]AllotRequest request)
...
@@ -59,6 +59,19 @@ public ApiResponse List([FromBody]AllotRequest request)
}
}
/// <summary>
/// <summary>
/// 生成成功或归档绩效记录
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"list/success"
)]
[
HttpPost
]
public
ApiResponse
Success
([
FromBody
]
AllotRequest
request
)
{
List
<
AllotResponse
>
allots
=
_allotService
.
GetSuccAllotList
(
request
.
HospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
allots
);
}
/// <summary>
/// 新增绩效
/// 新增绩效
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
...
...
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
be83b464
...
@@ -15,9 +15,11 @@ namespace Performance.Api.Controllers
...
@@ -15,9 +15,11 @@ namespace Performance.Api.Controllers
public
class
EmployeeController
:
Controller
public
class
EmployeeController
:
Controller
{
{
private
EmployeeService
employeeService
;
private
EmployeeService
employeeService
;
public
EmployeeController
(
EmployeeService
employeeService
)
private
ClaimService
claim
;
public
EmployeeController
(
EmployeeService
employeeService
,
ClaimService
claim
)
{
{
this
.
employeeService
=
employeeService
;
this
.
employeeService
=
employeeService
;
this
.
claim
=
claim
;
}
}
/// <summary>
/// <summary>
...
@@ -29,7 +31,7 @@ public EmployeeController(EmployeeService employeeService)
...
@@ -29,7 +31,7 @@ public EmployeeController(EmployeeService employeeService)
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
GetEmployeeList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
EmployeeRequest
request
)
public
ApiResponse
GetEmployeeList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
EmployeeRequest
request
)
{
{
var
employee
=
employeeService
.
GetEmployeeList
(
request
.
AllotID
.
Value
);
var
employee
=
employeeService
.
GetEmployeeList
(
request
.
AllotID
,
claim
.
GetUserId
()
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
}
...
@@ -82,10 +84,10 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Empl
...
@@ -82,10 +84,10 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Empl
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
GetEmployeeClinicList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
im_employee_clinic
request
)
public
ApiResponse
GetEmployeeClinicList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
im_employee_clinic
request
)
{
{
if
((
request
.
AllotID
??
0
)
==
0
)
//
if ((request.AllotID ?? 0) == 0)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
//
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var
employee
=
employeeService
.
GetEmployeeClinicList
(
request
.
AllotID
.
Value
);
var
employee
=
employeeService
.
GetEmployeeClinicList
(
request
.
AllotID
,
claim
.
GetUserId
()
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
employee
);
}
}
...
...
performance/Performance.DtoModels/Request/EmployeeRequest.cs
View file @
be83b464
...
@@ -115,7 +115,7 @@ public EmployeeRequestValidator()
...
@@ -115,7 +115,7 @@ public EmployeeRequestValidator()
};
};
RuleSet
(
"Select"
,
()
=>
RuleSet
(
"Select"
,
()
=>
{
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
GreaterThan
(
0
);
//
RuleFor(x => x.AllotID).NotNull().GreaterThan(0);
});
});
RuleSet
(
"Insert"
,
()
=>
RuleSet
(
"Insert"
,
()
=>
...
...
performance/Performance.Services/AllotService.cs
View file @
be83b464
...
@@ -109,6 +109,31 @@ public List<AllotResponse> GetAllotList(int? hospitalId)
...
@@ -109,6 +109,31 @@ public List<AllotResponse> GetAllotList(int? hospitalId)
}
}
/// <summary>
/// <summary>
/// 生成成功或归档绩效记录
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
public
List
<
AllotResponse
>
GetSuccAllotList
(
int
?
hospitalId
)
{
if
(!
hospitalId
.
HasValue
||
hospitalId
.
Value
<=
0
)
throw
new
PerformanceException
(
"hospitalId无效"
);
var
allotList
=
_allotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
new
List
<
int
>
{
(
int
)
AllotStates
.
Archive
,
(
int
)
AllotStates
.
GenerateSucceed
}.
Contains
(
t
.
States
));
allotList
=
allotList
==
null
?
allotList
:
allotList
.
OrderByDescending
(
t
=>
t
.
ID
).
ToList
();
var
isconfig
=
perforHospitalconfigRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
hospitalId
)
==
null
?
false
:
true
;
var
reuslt
=
Mapper
.
Map
<
List
<
AllotResponse
>>(
allotList
);
reuslt
?.
ForEach
(
t
=>
{
t
.
IsDown
=
!
string
.
IsNullOrEmpty
(
t
.
ExtractPath
);
if
(!
string
.
IsNullOrEmpty
(
t
.
ExtractPath
))
t
.
ExtractPath
=
t
.
ExtractPath
.
Replace
(
options
.
Value
.
AbsolutePath
,
options
.
Value
.
HttpPath
).
Replace
(
"\\"
,
"/"
);
t
.
HasConfig
=
isconfig
?
3
:
0
;
});
return
reuslt
;
}
/// <summary>
/// 新增
/// 新增
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
...
@@ -216,7 +241,7 @@ public void UpdateAllotStates(int allotId, int states, string remark)
...
@@ -216,7 +241,7 @@ public void UpdateAllotStates(int allotId, int states, string remark)
{
{
_allotRepository
.
UpdateAllotStates
(
allotId
,
states
,
remark
);
_allotRepository
.
UpdateAllotStates
(
allotId
,
states
,
remark
);
}
}
/// <summary>
/// <summary>
/// 生成绩效
/// 生成绩效
/// </summary>
/// </summary>
...
...
performance/Performance.Services/EmployeeService.cs
View file @
be83b464
...
@@ -19,15 +19,21 @@ public class EmployeeService : IAutoInjection
...
@@ -19,15 +19,21 @@ public class EmployeeService : IAutoInjection
private
PerforPersheetRepository
perforPersheetRepository
;
private
PerforPersheetRepository
perforPersheetRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
;
private
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
;
private
PerforUserhospitalRepository
perforUserhospitalRepository
;
private
PerforPerallotRepository
perallotRepository
;
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
)
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
,
PerforUserhospitalRepository
perforUserhospitalRepository
,
PerforPerallotRepository
perallotRepository
)
{
{
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforImemployeeclinicRepository
=
perforImemployeeclinicRepository
;
this
.
perforImemployeeclinicRepository
=
perforImemployeeclinicRepository
;
this
.
perforUserhospitalRepository
=
perforUserhospitalRepository
;
this
.
perallotRepository
=
perallotRepository
;
}
}
#
region
行政人员
#
region
行政人员
...
@@ -50,8 +56,21 @@ public im_employee GetEmployee(EmployeeRequest request)
...
@@ -50,8 +56,21 @@ public im_employee GetEmployee(EmployeeRequest request)
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
im_employee
>
GetEmployeeList
(
int
allot
Id
)
public
List
<
im_employee
>
GetEmployeeList
(
int
?
allotId
,
int
user
Id
)
{
{
if
(
allotId
==
null
||
allotId
==
0
)
{
var
userHospital
=
perforUserhospitalRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userId
);
if
(
userHospital
==
null
)
throw
new
PerformanceException
(
"用户未绑定医院!"
);
var
allotList
=
perallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
userHospital
.
HospitalID
&&
new
List
<
int
>
{
(
int
)
AllotStates
.
Archive
,
(
int
)
AllotStates
.
GenerateSucceed
}.
Contains
(
t
.
States
));
if
(
allotList
!=
null
&&
allotList
.
Any
())
{
allotId
=
allotList
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
First
().
ID
;
}
}
var
employee
=
perforImemployeeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
var
employee
=
perforImemployeeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
employee
?.
OrderBy
(
t
=>
t
.
RowNumber
).
ToList
();
return
employee
?.
OrderBy
(
t
=>
t
.
RowNumber
).
ToList
();
}
}
...
@@ -136,8 +155,21 @@ public bool Delete(EmployeeRequest request)
...
@@ -136,8 +155,21 @@ public bool Delete(EmployeeRequest request)
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
im_employee_clinic
>
GetEmployeeClinicList
(
int
allot
Id
)
public
List
<
im_employee_clinic
>
GetEmployeeClinicList
(
int
?
allotId
,
int
user
Id
)
{
{
if
(
allotId
==
null
||
allotId
==
0
)
{
var
userHospital
=
perforUserhospitalRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userId
);
if
(
userHospital
==
null
)
throw
new
PerformanceException
(
"用户未绑定医院!"
);
var
allotList
=
perallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
userHospital
.
HospitalID
&&
new
List
<
int
>
{
(
int
)
AllotStates
.
Archive
,
(
int
)
AllotStates
.
GenerateSucceed
}.
Contains
(
t
.
States
));
if
(
allotList
!=
null
&&
allotList
.
Any
())
{
allotId
=
allotList
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
First
().
ID
;
}
}
var
employee
=
perforImemployeeclinicRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
var
employee
=
perforImemployeeclinicRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
employee
?.
OrderBy
(
t
=>
t
.
RowNumber
).
ToList
();
return
employee
?.
OrderBy
(
t
=>
t
.
RowNumber
).
ToList
();
}
}
...
...
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