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
ad457281
Commit
ad457281
authored
Apr 02, 2022
by
纪旭 韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考勤swagger返回结构
parent
748e0d7a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
35 deletions
+108
-35
performance/Performance.Api/Controllers/AttendanceController.cs
+12
-18
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+35
-0
performance/Performance.EntityModels/Other/view_attendance.cs
+26
-5
performance/Performance.Services/AttendanceService.cs
+35
-12
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
ad457281
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.EntityModels.Entity
;
using
Performance.EntityModels.Other
;
using
Performance.EntityModels.Other
;
using
Performance.Services
;
using
Performance.Services
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -32,15 +33,12 @@ AttendanceService attendanceService
...
@@ -32,15 +33,12 @@ AttendanceService attendanceService
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpGet
(
"GetAttendance/{allotId}"
)]
[
HttpGet
(
"GetAttendance/{allotId}"
)]
public
ApiResponse
GetAttendance
(
int
allotId
)
public
ApiResponse
<
List
<
AttendanceStatistics
>>
GetAttendance
(
int
allotId
)
{
{
// 查询考勤视图,并按照设计图做格式转换 仅查询开始结束
// 查询考勤视图,并按照设计图做格式转换 仅查询开始结束
var
result
=
_attendanceService
.
GetAttendance
(
allotId
);
var
result
=
_attendanceService
.
GetAttendance
(
allotId
);
if
(
result
!=
null
)
{
return
result
;
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
return
new
ApiResponse
(
ResponseType
.
Fail
);
}
}
#
region
调动记录
#
region
调动记录
...
@@ -51,15 +49,11 @@ public ApiResponse GetAttendance(int allotId)
...
@@ -51,15 +49,11 @@ public ApiResponse GetAttendance(int allotId)
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpGet
(
"CallIn/{allotId}"
)]
[
HttpGet
(
"CallIn/{allotId}"
)]
public
ApiResponse
GetCallIn
(
int
allotId
)
public
ApiResponse
<
List
<
view_attendance
>>
GetCallIn
(
int
allotId
)
{
{
// 查询考勤视图,并按照设计图做格式转换 仅查询调入
// 查询考勤视图,并按照设计图做格式转换 仅查询调入
var
result
=
_attendanceService
.
GetCallIn
(
allotId
);
var
result
=
_attendanceService
.
GetCallIn
(
allotId
);
if
(
result
!=
null
)
return
result
;
{
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
return
new
ApiResponse
(
ResponseType
.
Fail
);
}
}
/// <summary>
/// <summary>
...
@@ -102,9 +96,9 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
...
@@ -102,9 +96,9 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
/// <param name="hospitalId"></param>
/// <param name="hospitalId"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpGet
(
"Type/{allotId},{hospitalId}"
)]
[
HttpGet
(
"Type/{allotId},{hospitalId}"
)]
public
ApiResponse
GetAttendanceType
(
int
allotId
,
int
hospitalId
)
public
ApiResponse
<
List
<
per_attendance_type
>>
GetAttendanceType
(
int
allotId
,
int
hospitalId
)
{
{
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetAttendanceType
(
allotId
,
hospitalId
)
);
return
_attendanceService
.
GetAttendanceType
(
allotId
,
hospitalId
);
}
}
/// <summary>
/// <summary>
/// 新增或修改考勤类型
/// 新增或修改考勤类型
...
@@ -114,7 +108,7 @@ public ApiResponse GetAttendanceType(int allotId, int hospitalId)
...
@@ -114,7 +108,7 @@ public ApiResponse GetAttendanceType(int allotId, int hospitalId)
/// <param name="attendanceType"></param>
/// <param name="attendanceType"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
(
"Type/Edit/{allotId},{hospitalId}"
)]
[
HttpPost
(
"Type/Edit/{allotId},{hospitalId}"
)]
public
ApiResponse
InsertAttendanceType
(
int
allotId
,
int
hospitalId
,
AttendanceType
attendanceType
)
public
ApiResponse
<
AttendanceType
>
InsertAttendanceType
(
int
allotId
,
int
hospitalId
,
AttendanceType
attendanceType
)
{
{
// obj自己定义结构
// obj自己定义结构
return
_attendanceService
.
InsertAttendanceType
(
allotId
,
hospitalId
,
attendanceType
);
return
_attendanceService
.
InsertAttendanceType
(
allotId
,
hospitalId
,
attendanceType
);
...
@@ -145,15 +139,15 @@ public ApiResponse GetAttendanceVacationHandsonTable()
...
@@ -145,15 +139,15 @@ public ApiResponse GetAttendanceVacationHandsonTable()
}
}
/// <summary>
/// <summary>
/// 查询
AttendanceVacation
/// 查询
考勤记录
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <param name="hospitalId"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpGet
(
"Vacation/{allotId},{hospitalId}"
)]
[
HttpGet
(
"Vacation/{allotId},{hospitalId}"
)]
public
ApiResponse
GetAttendanceVacation
(
int
allotId
,
int
hospitalId
)
public
ApiResponse
<
List
<
RecordAttendcance
>>
GetAttendanceVacation
(
int
allotId
,
int
hospitalId
)
{
{
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetAttendanceVacation
(
allotId
,
hospitalId
)
);
return
_attendanceService
.
GetAttendanceVacation
(
allotId
,
hospitalId
);
}
}
/// <summary>
/// <summary>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
ad457281
...
@@ -8850,6 +8850,41 @@
...
@@ -8850,6 +8850,41 @@
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.UnitType"
>
<summary>
人员类别
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.AccountingUnit"
>
<summary>
核算单元
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.PersonnelNumber"
>
<summary>
工号
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.PersonnelName"
>
<summary>
姓名
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.AttendanceDate"
>
<summary>
考勤时间
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.Source"
>
<summary>
来源
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.view_attendance.Department"
>
<summary>
科室名称
</summary>
</member>
<member
name=
"P:Performance.EntityModels.HisData.HisDepartment"
>
<member
name=
"P:Performance.EntityModels.HisData.HisDepartment"
>
<summary>
<summary>
His科室
His科室
...
...
performance/Performance.EntityModels/Other/view_attendance.cs
View file @
ad457281
...
@@ -12,13 +12,34 @@ public class view_attendance
...
@@ -12,13 +12,34 @@ public class view_attendance
public
int
ALLOTID
{
get
;
set
;
}
public
int
ALLOTID
{
get
;
set
;
}
public
int
YEAR
{
get
;
set
;
}
public
int
YEAR
{
get
;
set
;
}
public
int
MONTH
{
get
;
set
;
}
public
int
MONTH
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
//人员类别
/// <summary>
public
string
AccountingUnit
{
get
;
set
;
}
//核算单元
/// 人员类别
public
string
PersonnelNumber
{
get
;
set
;
}
//工号
/// </summary>
public
string
PersonnelName
{
get
;
set
;
}
//姓名
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 核算单元
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
/// <summary>
/// 工号
/// </summary>
public
string
PersonnelNumber
{
get
;
set
;
}
/// <summary>
/// 姓名
/// </summary>
public
string
PersonnelName
{
get
;
set
;
}
/// <summary>
/// 考勤时间
/// </summary>
public
Nullable
<
DateTime
>
AttendanceDate
{
get
;
set
;
}
public
Nullable
<
DateTime
>
AttendanceDate
{
get
;
set
;
}
/// <summary>
/// 来源
/// </summary>
public
string
Source
{
get
;
set
;
}
public
string
Source
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
//科室名称
/// <summary>
/// 科室名称
/// </summary>
public
string
Department
{
get
;
set
;
}
}
}
public
class
InitialAttendance
public
class
InitialAttendance
...
...
performance/Performance.Services/AttendanceService.cs
View file @
ad457281
...
@@ -86,7 +86,12 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendance(int allotId)
...
@@ -86,7 +86,12 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendance(int allotId)
}
}
}
}
return
new
ApiResponse
<
List
<
AttendanceStatistics
>>(
ResponseType
.
OK
,
""
,
statistics
);
if
(
statistics
!=
null
)
return
new
ApiResponse
<
List
<
AttendanceStatistics
>>(
ResponseType
.
OK
,
statistics
);
else
{
return
new
ApiResponse
<
List
<
AttendanceStatistics
>>(
ResponseType
.
Fail
);
}
}
}
...
@@ -97,7 +102,12 @@ public ApiResponse<List<view_attendance>> GetCallIn(int allotId)
...
@@ -97,7 +102,12 @@ public ApiResponse<List<view_attendance>> GetCallIn(int allotId)
{
{
var
view_attendance
=
perforPerallotRepository
.
GetAttendance
(
allotId
).
Where
(
t
=>
t
.
Source
.
Contains
(
"调入"
)).
ToList
();
var
view_attendance
=
perforPerallotRepository
.
GetAttendance
(
allotId
).
Where
(
t
=>
t
.
Source
.
Contains
(
"调入"
)).
ToList
();
return
new
ApiResponse
<
List
<
view_attendance
>>(
ResponseType
.
OK
,
""
,
view_attendance
);
if
(
view_attendance
!=
null
)
return
new
ApiResponse
<
List
<
view_attendance
>>(
ResponseType
.
OK
,
view_attendance
);
else
{
return
new
ApiResponse
<
List
<
view_attendance
>>(
ResponseType
.
Fail
);
}
}
}
public
HandsonTable
GetBatchCallInHandsonTable
()
public
HandsonTable
GetBatchCallInHandsonTable
()
...
@@ -262,18 +272,25 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
...
@@ -262,18 +272,25 @@ public ApiResponse BatchCallIn(int allotId, int hospitalId, SaveCollectData requ
#
region
考勤类型
#
region
考勤类型
public
List
<
per_attendance_type
>
GetAttendanceType
(
int
allotId
,
int
hospitalId
)
public
ApiResponse
<
List
<
per_attendance_type
>
>
GetAttendanceType
(
int
allotId
,
int
hospitalId
)
{
{
return
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
ToList
();
var
result
=
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
ToList
();
if
(
result
!=
null
)
return
new
ApiResponse
<
List
<
per_attendance_type
>>(
ResponseType
.
OK
,
result
);
else
{
return
new
ApiResponse
<
List
<
per_attendance_type
>>(
ResponseType
.
Fail
);
}
}
public
ApiResponse
InsertAttendanceType
(
int
allotId
,
int
hospitalId
,
AttendanceType
attendanceType
)
}
public
ApiResponse
<
AttendanceType
>
InsertAttendanceType
(
int
allotId
,
int
hospitalId
,
AttendanceType
attendanceType
)
{
{
var
any
=
perfoPperAttendanceTypeRepository
.
GetEntities
().
FirstOrDefault
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
&&
t
.
AttendanceName
==
attendanceType
.
AttendanceName
);
var
any
=
perfoPperAttendanceTypeRepository
.
GetEntities
().
FirstOrDefault
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
&&
t
.
AttendanceName
==
attendanceType
.
AttendanceName
);
if
(
any
!=
null
)
if
(
any
!=
null
)
{
{
any
.
IsDeduction
=
Convert
.
ToInt32
(
attendanceType
.
IsDeduction
);
any
.
IsDeduction
=
Convert
.
ToInt32
(
attendanceType
.
IsDeduction
);
if
(
perfoPperAttendanceTypeRepository
.
Update
(
any
))
return
new
ApiResponse
(
ResponseType
.
OK
,
"修改成功"
);
if
(
perfoPperAttendanceTypeRepository
.
Update
(
any
))
return
new
ApiResponse
<
AttendanceType
>
(
ResponseType
.
OK
,
"修改成功"
);
else
return
new
ApiResponse
(
ResponseType
.
Fail
,
"修改失败"
);
else
return
new
ApiResponse
<
AttendanceType
>
(
ResponseType
.
Fail
,
"修改失败"
);
}
}
else
else
...
@@ -285,8 +302,8 @@ public ApiResponse InsertAttendanceType(int allotId, int hospitalId, AttendanceT
...
@@ -285,8 +302,8 @@ public ApiResponse InsertAttendanceType(int allotId, int hospitalId, AttendanceT
AttendanceName
=
attendanceType
.
AttendanceName
,
AttendanceName
=
attendanceType
.
AttendanceName
,
IsDeduction
=
Convert
.
ToInt32
(
attendanceType
.
IsDeduction
)
IsDeduction
=
Convert
.
ToInt32
(
attendanceType
.
IsDeduction
)
};
};
if
(
perfoPperAttendanceTypeRepository
.
Add
(
per_Attendance_Type
))
return
new
ApiResponse
(
ResponseType
.
OK
,
"添加成功"
);
if
(
perfoPperAttendanceTypeRepository
.
Add
(
per_Attendance_Type
))
return
new
ApiResponse
<
AttendanceType
>
(
ResponseType
.
OK
,
"添加成功"
);
else
return
new
ApiResponse
(
ResponseType
.
Fail
,
"添加失败"
);
else
return
new
ApiResponse
<
AttendanceType
>
(
ResponseType
.
Fail
,
"添加失败"
);
}
}
}
}
...
@@ -332,7 +349,7 @@ public HandsonTable GetAttendanceVacationHandsonTable()
...
@@ -332,7 +349,7 @@ public HandsonTable GetAttendanceVacationHandsonTable()
return
handson
;
return
handson
;
}
}
public
List
<
RecordAttendcance
>
GetAttendanceVacation
(
int
allotId
,
int
hospitalId
)
public
ApiResponse
<
List
<
RecordAttendcance
>
>
GetAttendanceVacation
(
int
allotId
,
int
hospitalId
)
{
{
var
vacatione
=
perfoPperAttendanceVacationeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
vacatione
=
perfoPperAttendanceVacationeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
type
=
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
type
=
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
...
@@ -354,7 +371,13 @@ public List<RecordAttendcance> GetAttendanceVacation(int allotId, int hospitalId
...
@@ -354,7 +371,13 @@ public List<RecordAttendcance> GetAttendanceVacation(int allotId, int hospitalId
Days
=
Convert
.
ToInt32
(
new
TimeSpan
(
Convert
.
ToDateTime
(
a
.
BegDate
).
Ticks
).
Subtract
(
new
TimeSpan
(
Convert
.
ToDateTime
(
a
.
EndDate
).
Ticks
)).
Duration
().
Days
)
+
1
Days
=
Convert
.
ToInt32
(
new
TimeSpan
(
Convert
.
ToDateTime
(
a
.
BegDate
).
Ticks
).
Subtract
(
new
TimeSpan
(
Convert
.
ToDateTime
(
a
.
EndDate
).
Ticks
)).
Duration
().
Days
)
+
1
};
};
return
data
.
ToList
();
if
(
data
!=
null
)
return
new
ApiResponse
<
List
<
RecordAttendcance
>>(
ResponseType
.
OK
,
data
.
ToList
());
else
{
return
new
ApiResponse
<
List
<
RecordAttendcance
>>(
ResponseType
.
Fail
);
}
}
}
...
@@ -500,7 +523,7 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
...
@@ -500,7 +523,7 @@ public ApiResponse AttendanceBatch(int allotId, int hospitalId, SaveCollectData
{
{
data
.
AllotId
=
allotId
;
data
.
AllotId
=
allotId
;
data
.
HospitalId
=
hospitalId
;
data
.
HospitalId
=
hospitalId
;
data
.
TypeId
=
type
.
FirstOrDefault
(
t
=>
t
.
AttendanceName
==
data
.
AttendanceName
).
Id
;
data
.
TypeId
=
type
.
Data
.
FirstOrDefault
(
t
=>
t
.
AttendanceName
==
data
.
AttendanceName
).
Id
;
addAttendanceVacatione
.
Add
(
data
);
addAttendanceVacatione
.
Add
(
data
);
var
any
=
oldAttendanceVacatione
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
HospitalId
==
hospitalId
&&
w
.
BegDate
==
data
.
BegDate
&&
w
.
EndDate
==
data
.
EndDate
&&
w
.
PersonnelName
?.
Trim
()
==
data
.
PersonnelName
?.
Trim
()
&&
w
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
()
&&
w
.
TypeId
==
data
.
TypeId
);
var
any
=
oldAttendanceVacatione
.
FirstOrDefault
(
w
=>
w
.
AllotId
==
allotId
&&
w
.
HospitalId
==
hospitalId
&&
w
.
BegDate
==
data
.
BegDate
&&
w
.
EndDate
==
data
.
EndDate
&&
w
.
PersonnelName
?.
Trim
()
==
data
.
PersonnelName
?.
Trim
()
&&
w
.
PersonnelNumber
?.
Trim
()
==
data
.
PersonnelNumber
?.
Trim
()
&&
w
.
TypeId
==
data
.
TypeId
);
if
(
any
!=
null
)
deleteAttendanceVacatione
.
Add
(
any
);
if
(
any
!=
null
)
deleteAttendanceVacatione
.
Add
(
any
);
...
...
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