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
7b2ca2d7
Commit
7b2ca2d7
authored
Apr 10, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加默认值
parent
4e202288
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
performance/Performance.Services/AttendanceService.cs
+39
-2
No files found.
performance/Performance.Services/AttendanceService.cs
View file @
7b2ca2d7
...
@@ -331,6 +331,18 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
...
@@ -331,6 +331,18 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
data
.
PermanentStaff
=
data
.
PermanentStaff
.
HasValue
data
.
PermanentStaff
=
data
.
PermanentStaff
.
HasValue
?
data
.
PermanentStaff
?
data
.
PermanentStaff
:
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
data
.
PersonnelNumber
)?.
PermanentStaff
;
:
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
data
.
PersonnelNumber
)?.
PermanentStaff
;
if
(
string
.
IsNullOrEmpty
(
data
.
CallInUnitType
)
||
string
.
IsNullOrEmpty
(
data
.
CallInAccountingUnit
))
{
var
emp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
data
.
PersonnelNumber
);
data
.
CallInUnitType
=
emp
?.
UnitType
;
data
.
CallInAccountingUnit
=
emp
?.
AccountingUnit
;
}
if
(!
data
.
CallInDate
.
HasValue
||
data
.
CallInDate
.
Value
<
new
DateTime
(
1970
,
1
,
1
))
{
data
.
CallInDate
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
);
}
addPer_Attendances
.
Add
(
data
);
addPer_Attendances
.
Add
(
data
);
var
any
=
oldCallinAttendance
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
HospitalId
==
hospitalId
&&
w
.
CallInDate
==
data
.
CallInDate
&&
w
.
CallInAccountingUnit
?.
Trim
()
==
data
.
CallInAccountingUnit
?.
Trim
()
&&
w
.
CallInUnitType
?.
Trim
()
==
data
.
CallInUnitType
?.
Trim
()
&&
w
.
PersonnelName
?.
Trim
()
==
data
.
PersonnelName
?.
Trim
()
&&
w
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
());
var
any
=
oldCallinAttendance
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
HospitalId
==
hospitalId
&&
w
.
CallInDate
==
data
.
CallInDate
&&
w
.
CallInAccountingUnit
?.
Trim
()
==
data
.
CallInAccountingUnit
?.
Trim
()
&&
w
.
CallInUnitType
?.
Trim
()
==
data
.
CallInUnitType
?.
Trim
()
&&
w
.
PersonnelName
?.
Trim
()
==
data
.
PersonnelName
?.
Trim
()
&&
w
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
());
}
}
...
@@ -346,26 +358,51 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
...
@@ -346,26 +358,51 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
public
ApiResponse
AttendanceAdd
(
int
allotId
,
AttendanceData
request
)
public
ApiResponse
AttendanceAdd
(
int
allotId
,
AttendanceData
request
)
{
{
if
(
string
.
IsNullOrEmpty
(
request
.
PersonnelNumber
))
throw
new
PerformanceException
(
"人员工号必须填写"
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
);
if
(
allot
==
null
)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
data
=
mapper
.
Map
<
per_attendance
>(
request
);
var
data
=
mapper
.
Map
<
per_attendance
>(
request
);
data
.
AllotId
=
allotId
;
data
.
AllotId
=
allotId
;
data
.
HospitalId
=
allot
.
HospitalId
;
data
.
HospitalId
=
allot
.
HospitalId
;
if
(
string
.
IsNullOrEmpty
(
request
.
CallInUnitType
)
||
string
.
IsNullOrEmpty
(
request
.
CallInAccountingUnit
))
{
var
emp
=
perforPeremployeeRepository
.
GetEntity
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
PersonnelNumber
==
request
.
PersonnelNumber
);
data
.
CallInUnitType
=
emp
?.
UnitType
;
data
.
CallInAccountingUnit
=
emp
?.
AccountingUnit
;
}
if
(!
request
.
CallInDate
.
HasValue
||
request
.
CallInDate
.
Value
<
new
DateTime
(
1970
,
1
,
1
))
{
data
.
CallInDate
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
);
}
perforPerAttendanceRepository
.
Add
(
data
);
perforPerAttendanceRepository
.
Add
(
data
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
public
ApiResponse
AttendanceUpdate
(
int
allotId
,
AttendanceUpdateData
request
)
public
ApiResponse
AttendanceUpdate
(
int
allotId
,
AttendanceUpdateData
request
)
{
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
data
=
perforPerAttendanceRepository
.
GetEntity
(
w
=>
w
.
Id
==
request
.
AttendanceId
&&
w
.
AllotId
==
allotId
);
var
data
=
perforPerAttendanceRepository
.
GetEntity
(
w
=>
w
.
Id
==
request
.
AttendanceId
&&
w
.
AllotId
==
allotId
);
if
(
data
==
null
)
throw
new
PerformanceException
(
"当前调动记录不存在"
);
if
(
data
==
null
)
throw
new
PerformanceException
(
"当前调动记录不存在"
);
data
.
PermanentStaff
=
request
.
PermanentStaff
;
data
.
PermanentStaff
=
request
.
PermanentStaff
;
data
.
CallInUnitType
=
request
.
CallInUnitType
;
data
.
CallInUnitType
=
request
.
CallInUnitType
;
data
.
CallInAccountingUnit
=
request
.
CallInAccountingUnit
;
data
.
CallInAccountingUnit
=
request
.
CallInAccountingUnit
;
data
.
CallInDate
=
request
.
CallInDate
;
data
.
CallInDate
=
request
.
CallInDate
;
if
(
string
.
IsNullOrEmpty
(
request
.
CallInUnitType
)
||
string
.
IsNullOrEmpty
(
request
.
CallInAccountingUnit
))
{
var
emp
=
perforPeremployeeRepository
.
GetEntity
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
PersonnelNumber
==
data
.
PersonnelNumber
);
data
.
CallInUnitType
=
emp
?.
UnitType
;
data
.
CallInAccountingUnit
=
emp
?.
AccountingUnit
;
}
if
(!
request
.
CallInDate
.
HasValue
||
request
.
CallInDate
.
Value
<
new
DateTime
(
1970
,
1
,
1
))
{
data
.
CallInDate
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
);
}
perforPerAttendanceRepository
.
Update
(
data
);
perforPerAttendanceRepository
.
Update
(
data
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
...
...
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