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
9da16caa
Commit
9da16caa
authored
Apr 10, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/new_report' into dev
parents
ba95946d
be83b464
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
9 deletions
+81
-9
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
+25
-0
performance/Performance.Services/EmployeeService.cs
+35
-3
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
9da16caa
...
...
@@ -59,6 +59,19 @@ public ApiResponse List([FromBody]AllotRequest request)
}
/// <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>
/// <param name="request"></param>
...
...
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
9da16caa
...
...
@@ -15,9 +15,11 @@ namespace Performance.Api.Controllers
public
class
EmployeeController
:
Controller
{
private
EmployeeService
employeeService
;
public
EmployeeController
(
EmployeeService
employeeService
)
private
ClaimService
claim
;
public
EmployeeController
(
EmployeeService
employeeService
,
ClaimService
claim
)
{
this
.
employeeService
=
employeeService
;
this
.
claim
=
claim
;
}
/// <summary>
...
...
@@ -29,7 +31,7 @@ public EmployeeController(EmployeeService employeeService)
[
HttpPost
]
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
);
}
...
...
@@ -82,10 +84,10 @@ public ApiResponse Delete([CustomizeValidator(RuleSet = "Delete"), FromBody]Empl
[
HttpPost
]
public
ApiResponse
GetEmployeeClinicList
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
im_employee_clinic
request
)
{
if
((
request
.
AllotID
??
0
)
==
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
//
if ((request.AllotID ?? 0) == 0)
//
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
);
}
...
...
performance/Performance.DtoModels/Request/EmployeeRequest.cs
View file @
9da16caa
...
...
@@ -115,7 +115,7 @@ public EmployeeRequestValidator()
};
RuleSet
(
"Select"
,
()
=>
{
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
GreaterThan
(
0
);
//
RuleFor(x => x.AllotID).NotNull().GreaterThan(0);
});
RuleSet
(
"Insert"
,
()
=>
...
...
performance/Performance.Services/AllotService.cs
View file @
9da16caa
...
...
@@ -109,6 +109,31 @@ public List<AllotResponse> GetAllotList(int? hospitalId)
}
/// <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>
/// <param name="request"></param>
...
...
performance/Performance.Services/EmployeeService.cs
View file @
9da16caa
...
...
@@ -19,15 +19,21 @@ public class EmployeeService : IAutoInjection
private
PerforPersheetRepository
perforPersheetRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
;
private
PerforUserhospitalRepository
perforUserhospitalRepository
;
private
PerforPerallotRepository
perallotRepository
;
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
)
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
,
PerforUserhospitalRepository
perforUserhospitalRepository
,
PerforPerallotRepository
perallotRepository
)
{
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforImemployeeclinicRepository
=
perforImemployeeclinicRepository
;
this
.
perforUserhospitalRepository
=
perforUserhospitalRepository
;
this
.
perallotRepository
=
perallotRepository
;
}
#
region
行政人员
...
...
@@ -50,8 +56,21 @@ public im_employee GetEmployee(EmployeeRequest request)
/// </summary>
/// <param name="request"></param>
/// <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
);
return
employee
?.
OrderBy
(
t
=>
t
.
RowNumber
).
ToList
();
}
...
...
@@ -136,8 +155,21 @@ public bool Delete(EmployeeRequest request)
/// </summary>
/// <param name="request"></param>
/// <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
);
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