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
004065f6
Commit
004065f6
authored
Apr 12, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbug
parent
be833ad9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
performance/Performance.DtoModels/Request/EmployeeRequest.cs
+3
-1
performance/Performance.Services/EmployeeService.cs
+21
-5
No files found.
performance/Performance.DtoModels/Request/EmployeeRequest.cs
View file @
004065f6
...
...
@@ -120,7 +120,9 @@ public EmployeeRequestValidator()
RuleSet
(
"Insert"
,
()
=>
{
action
();
RuleFor
(
x
=>
x
.
AllotID
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
AccountingUnit
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
DoctorName
).
NotNull
().
NotEmpty
();
});
RuleSet
(
"Update"
,
()
=>
...
...
performance/Performance.Services/EmployeeService.cs
View file @
004065f6
...
...
@@ -16,9 +16,15 @@ namespace Performance.Services
public
class
EmployeeService
:
IAutoInjection
{
private
PerforImemployeeRepository
perforImemployeeRepository
;
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
)
private
PerforPersheetRepository
perforPersheetRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforPerallotRepository
perforPerallotRepository
)
{
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
}
/// <summary>
...
...
@@ -52,9 +58,20 @@ public List<im_employee> GetEmployeeList(int allotId)
/// <returns></returns>
public
im_employee
Insert
(
EmployeeRequest
request
)
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
AllotID
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效方案不存在"
);
var
sheet
=
perforPersheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
request
.
AllotID
&&
t
.
SheetType
==
(
int
)
SheetType
.
Employee
);
if
(
sheet
==
null
)
{
sheet
=
new
per_sheet
{
AllotID
=
allot
.
ID
,
SheetName
=
"医院人员名单"
,
SheetType
=
(
int
)
SheetType
.
Employee
,
Source
=
1
};
perforPersheetRepository
.
Add
(
sheet
);
}
var
employee
=
Mapper
.
Map
<
im_employee
>(
request
);
if
(
string
.
IsNullOrEmpty
(
request
.
WorkTime
))
employee
.
WorkTime
=
null
;
employee
.
WorkTime
=
ConvertHelper
.
To
<
DateTime
?>(
request
.
WorkTime
);
employee
.
SheetID
=
sheet
.
ID
;
perforImemployeeRepository
.
Add
(
employee
);
return
employee
;
}
...
...
@@ -66,7 +83,6 @@ public im_employee Insert(EmployeeRequest request)
/// <returns></returns>
public
im_employee
Update
(
EmployeeRequest
request
)
{
Nullable
<
DateTime
>
time
=
null
;
var
employee
=
perforImemployeeRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
ID
);
if
(
employee
==
null
)
throw
new
PerformanceException
(
"该人员不存在"
);
...
...
@@ -78,7 +94,7 @@ public im_employee Update(EmployeeRequest request)
employee
.
FitPeople
=
request
.
FitPeople
;
employee
.
JobTitle
=
request
.
JobTitle
;
employee
.
PostCoefficient
=
request
.
PostCoefficient
;
employee
.
WorkTime
=
string
.
IsNullOrEmpty
(
request
.
WorkTime
)
?
time
:
Convert
.
ToDateTime
(
request
.
WorkTime
);
employee
.
WorkTime
=
ConvertHelper
.
To
<
DateTime
?>
(
request
.
WorkTime
);
employee
.
ScoreAverageRate
=
request
.
ScoreAverageRate
;
employee
.
Attendance
=
request
.
Attendance
;
employee
.
PeopleNumber
=
request
.
PeopleNumber
;
...
...
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