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
7b96841b
Commit
7b96841b
authored
Mar 15, 2022
by
纪旭 韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始考勤页面展示
parent
a64aed5a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
254 additions
and
1 deletions
+254
-1
performance/Performance.Api/Controllers/AttendanceController.cs
+13
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-0
performance/Performance.EntityModels/Entity/per_attendance.cs
+24
-0
performance/Performance.EntityModels/Entity/per_attendance_type.cs
+21
-0
performance/Performance.EntityModels/Entity/per_attendance_vacation.cs
+25
-0
performance/Performance.EntityModels/Other/view_attendance.cs
+46
-0
performance/Performance.Repository/PerforPerAllotRepository.cs
+20
-0
performance/Performance.Repository/Repository/PerforPerAttendanceRepository.cs
+19
-0
performance/Performance.Services/AttendanceService.cs
+79
-0
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
7b96841b
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.Services
;
namespace
Performance.Api.Controllers
namespace
Performance.Api.Controllers
{
{
[
ApiController
]
[
ApiController
]
public
class
AttendanceController
:
ControllerBase
public
class
AttendanceController
:
ControllerBase
{
{
private
readonly
AttendanceService
_attendanceService
;
public
AttendanceController
(
AttendanceService
attendanceService
)
{
_attendanceService
=
attendanceService
;
}
/*
/*
per_attendance 考勤-调动记录表
per_attendance 考勤-调动记录表
...
@@ -25,6 +32,11 @@ public class AttendanceController : ControllerBase
...
@@ -25,6 +32,11 @@ public class AttendanceController : ControllerBase
public
ApiResponse
GetAttendance
(
int
allotId
)
public
ApiResponse
GetAttendance
(
int
allotId
)
{
{
// 查询考勤视图,并按照设计图做格式转换 仅查询开始结束
// 查询考勤视图,并按照设计图做格式转换 仅查询开始结束
var
result
=
_attendanceService
.
GetPerAttendance
(
allotId
);
if
(
result
!=
null
)
{
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
Fail
);
}
}
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
7b96841b
...
@@ -369,6 +369,13 @@
...
@@ -369,6 +369,13 @@
<param
name=
"allotId"
></param>
<param
name=
"allotId"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceStatistics(System.Int32)"
>
<summary>
考勤结果统计
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"
>
<member
name=
"M:Performance.Api.Controllers.BudgetController.Query(Performance.DtoModels.Request.BudgetRequest)"
>
<summary>
<summary>
预算管理查询(包含金额、占比)
预算管理查询(包含金额、占比)
...
...
performance/Performance.EntityModels/Entity/per_attendance.cs
0 → 100644
View file @
7b96841b
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Performance.EntityModels.Entity
{
[
Table
(
"per_attendance"
)]
public
class
per_attendance
{
[
Key
]
public
int
Id
{
get
;
set
;
}
public
int
HospitalId
{
get
;
set
;
}
//医院Id
public
int
AllotId
{
get
;
set
;
}
//绩效Id
public
string
PersonnelNumber
{
get
;
set
;
}
//工号
public
string
PersonnelName
{
get
;
set
;
}
//姓名
public
string
CallInUnitType
{
get
;
set
;
}
//人员类别
public
string
CallInAccountingUnit
{
get
;
set
;
}
//核算单元
public
DateTime
?
CallInDate
{
get
;
set
;
}
//调入时间
}
}
performance/Performance.EntityModels/Entity/per_attendance_type.cs
0 → 100644
View file @
7b96841b
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Performance.EntityModels.Entity
{
[
Table
(
"per_attendance_type"
)]
public
class
per_attendance_type
{
[
Key
]
public
int
Id
{
get
;
set
;
}
public
int
HospitalId
{
get
;
set
;
}
//医院Id
public
int
AllotId
{
get
;
set
;
}
//绩效Id
public
string
AttendanceName
{
get
;
set
;
}
//考勤类型名称
public
int
IsDeduction
{
get
;
set
;
}
//是否核减出勤 1 核减 2 不核减
}
}
performance/Performance.EntityModels/Entity/per_attendance_vacation.cs
0 → 100644
View file @
7b96841b
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Performance.EntityModels.Entity
{
[
Table
(
"per_attendance_vacation"
)]
public
class
per_attendance_vacation
{
[
Key
]
public
int
Id
{
get
;
set
;
}
public
int
HospitalId
{
get
;
set
;
}
//医院Id
public
int
AllotId
{
get
;
set
;
}
//绩效Id
public
string
PersonnelNumber
{
get
;
set
;
}
//工号
public
string
PersonnelName
{
get
;
set
;
}
//姓名
public
int
TypeId
{
get
;
set
;
}
//per_attendance_type表中ID
public
DateTime
?
BegDate
{
get
;
set
;
}
//开始时间
public
DateTime
?
EndDate
{
get
;
set
;
}
//结束时间
}
}
performance/Performance.EntityModels/Other/view_attendance.cs
0 → 100644
View file @
7b96841b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Performance.EntityModels.Other
{
public
class
view_attendance
{
public
int
ALLOTID
{
get
;
set
;
}
public
int
YEAR
{
get
;
set
;
}
public
int
MONTH
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
//人员类别
public
string
AccountingUnit
{
get
;
set
;
}
//核算单元
public
string
PersonnelNumber
{
get
;
set
;
}
//工号
public
string
PersonnelName
{
get
;
set
;
}
//姓名
public
DateTime
?
AttendanceDate
{
get
;
set
;
}
public
string
Source
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
//科室名称
}
public
class
InitialAttendance
{
public
string
UnitType
{
get
;
set
;
}
//人员类别
public
string
AccountingUnit
{
get
;
set
;
}
//核算单元
public
string
PersonnelNumber
{
get
;
set
;
}
//工号
public
string
PersonnelName
{
get
;
set
;
}
//姓名
public
DateTime
?
StartDate
{
get
;
set
;
}
//入科开始时间
public
DateTime
?
EndDate
{
get
;
set
;
}
//入科结束时间
public
string
Department
{
get
;
set
;
}
//科室名称
}
public
class
AttendaceHeads
{
public
string
Column
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
}
public
class
AttendanceResponse
<
T
>
{
public
List
<
AttendaceHeads
>
Heads
{
get
;
set
;
}
public
T
Datas
{
get
;
set
;
}
}
}
performance/Performance.Repository/PerforPerAllotRepository.cs
View file @
7b96841b
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
using
Dapper
;
using
Dapper
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore
;
using
Performance.EntityModels
;
using
Performance.EntityModels
;
using
Performance.EntityModels.Other
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
...
@@ -278,5 +279,23 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
...
@@ -278,5 +279,23 @@ public IEnumerable<string> GetSecondWorkloadMaps(int hospitalId)
}
}
}
}
}
}
public
IEnumerable
<
view_attendance
>
GetAttendance
(
int
allotId
)
{
using
(
var
connection
=
context
.
Database
.
GetDbConnection
())
{
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
try
{
string
query
=
$@"SELECT * FROM view_attendance where allotId = @allotId"
;
return
connection
.
Query
<
view_attendance
>(
query
,
new
{
allotId
},
commandTimeout
:
60
*
60
);
}
catch
(
Exception
)
{
throw
;
}
}
}
}
}
}
}
\ No newline at end of file
performance/Performance.Repository/Repository/PerforPerAttendanceRepository.cs
0 → 100644
View file @
7b96841b
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Performance.Repository.Repository
{
public
partial
class
PerforPerAttendanceRepository
:
PerforRepository
<
per_apr_amount
>
{
/// <summary>
/// per_attendance Repository
/// </summary>
public
PerforPerAttendanceRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/AttendanceService.cs
0 → 100644
View file @
7b96841b
using
AutoMapper
;
using
Microsoft.Extensions.Logging
;
using
Performance.EntityModels.Other
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Performance.Services
{
public
class
AttendanceService
:
IAutoInjection
{
private
readonly
IMapper
_mapper
;
private
readonly
ILogger
<
AttendanceService
>
logger
;
private
readonly
PerforPerallotRepository
_perforPerallotRepository
;
public
AttendanceService
(
IMapper
mapper
,
ILogger
<
AttendanceService
>
logger
,
PerforPerallotRepository
perforPerallotRepository
)
{
_mapper
=
mapper
;
this
.
logger
=
logger
;
this
.
_perforPerallotRepository
=
perforPerallotRepository
;
}
public
AttendanceResponse
<
List
<
InitialAttendance
>>
GetPerAttendance
(
int
allotId
)
{
var
view_attendance
=
_perforPerallotRepository
.
GetAttendance
(
allotId
);
var
start
=
view_attendance
.
Where
(
t
=>
t
.
Source
.
Contains
(
"开始"
));
var
end
=
view_attendance
.
Where
(
t
=>
t
.
Source
.
Contains
(
"结束"
));
var
attendances
=
new
List
<
InitialAttendance
>();
foreach
(
var
st
in
start
)
{
foreach
(
var
en
in
end
)
{
if
(
st
.
PersonnelName
.
Equals
(
en
.
PersonnelName
))
{
attendances
.
Add
(
new
InitialAttendance
{
AccountingUnit
=
st
.
AccountingUnit
,
Department
=
st
.
Department
,
PersonnelName
=
st
.
PersonnelName
,
PersonnelNumber
=
st
.
PersonnelNumber
,
UnitType
=
st
.
UnitType
,
StartDate
=
st
.
AttendanceDate
,
EndDate
=
en
.
AttendanceDate
});
break
;
}
}
}
AttendanceResponse
<
List
<
InitialAttendance
>>
attendanceResponse
=
new
AttendanceResponse
<
List
<
InitialAttendance
>>()
{
Heads
=
AttendanceConfig
.
AttendcanceHeads
,
Datas
=
attendances
};
return
attendanceResponse
;
}
public
class
AttendanceConfig
{
public
static
List
<
AttendaceHeads
>
AttendcanceHeads
{
get
;
}
=
new
List
<
AttendaceHeads
>
{
new
AttendaceHeads
{
Column
=
"核算单元名称"
,
Name
=
nameof
(
InitialAttendance
.
AccountingUnit
)},
new
AttendaceHeads
{
Column
=
"科室名称"
,
Name
=
nameof
(
InitialAttendance
.
Department
)},
new
AttendaceHeads
{
Column
=
"姓名"
,
Name
=
nameof
(
InitialAttendance
.
PersonnelName
)},
new
AttendaceHeads
{
Column
=
"员工工号"
,
Name
=
nameof
(
InitialAttendance
.
PersonnelNumber
)},
new
AttendaceHeads
{
Column
=
"人员组别"
,
Name
=
nameof
(
InitialAttendance
.
UnitType
)},
new
AttendaceHeads
{
Column
=
"在科开始日期"
,
Name
=
nameof
(
InitialAttendance
.
StartDate
)},
new
AttendaceHeads
{
Column
=
"在科结束日期"
,
Name
=
nameof
(
InitialAttendance
.
EndDate
)},
};
}
}
}
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