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
b8299bfe
Commit
b8299bfe
authored
Apr 20, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
科室考勤上报录入结果统计&下载接口
parent
2a6523ec
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
0 deletions
+129
-0
performance/Performance.Api/Controllers/AttendanceController.cs
+91
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+26
-0
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.DtoModels/Response/AttendanceDeptAuditList.cs
+7
-0
performance/Performance.Services/AttendanceService.cs
+0
-0
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
b8299bfe
...
...
@@ -426,6 +426,7 @@ public IActionResult DownloadStatistics(int allotId)
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科开始时问"
,
Name
=
nameof
(
AttendanceStatistics
.
BeginDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科结束时间"
,
Name
=
nameof
(
AttendanceStatistics
.
EndDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"人员系数"
,
Name
=
nameof
(
AttendanceStatistics
.
PermanentStaff
)
},
};
var
type
=
_attendanceService
.
GetAttendanceType
(
allotId
);
foreach
(
var
item
in
type
.
Data
)
...
...
@@ -483,6 +484,7 @@ public IActionResult DownloadAuditDetail(int allotId, string unitType, string ac
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科开始时问"
,
Name
=
nameof
(
AttendanceStatistics
.
BeginDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科结束时间"
,
Name
=
nameof
(
AttendanceStatistics
.
EndDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"人员系数"
,
Name
=
nameof
(
AttendanceStatistics
.
PermanentStaff
)
},
};
var
type
=
_attendanceService
.
GetAttendanceType
(
allotId
);
foreach
(
var
item
in
type
.
Data
)
...
...
@@ -607,6 +609,20 @@ public ApiResponse<List<AttendanceDeptAuditList>> DeptAuditList(int allotId, str
}
/// <summary>
/// 科室考勤上报录入状态
/// </summary>
/// <param name="allotId">绩效月ID</param>
/// <param name="unitType">核算组别</param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/state"
)]
public
ApiResponse
<
AttendanceDeptState
>
DeptState
(
int
allotId
,
string
unitType
)
{
var
userid
=
claim
.
GetUserId
();
return
_attendanceService
.
DeptState
(
allotId
,
userid
,
unitType
);
}
/// <summary>
/// 科室考勤上报录入加载
/// </summary>
/// <param name="allotId">绩效月ID</param>
...
...
@@ -640,6 +656,79 @@ public ApiResponse DeptSave(int allotId, string unitType, [FromBody] List<Attend
}
/// <summary>
/// 科室考勤上报录入结果统计
/// </summary>
/// <param name="allotId">绩效月ID</param>
/// <param name="unitType">核算组别</param>
/// <param name="accountingUnit">核算单元</param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/compute"
)]
public
ApiResponse
<
List
<
AttendanceStatistics
>>
DeptCompute
(
int
allotId
,
string
unitType
,
string
accountingUnit
)
{
if
(!
Enum
.
TryParse
(
unitType
,
out
UnitType
unitType1
))
throw
new
PerformanceException
(
"核算组别错误"
);
if
(
string
.
IsNullOrEmpty
(
accountingUnit
))
throw
new
PerformanceException
(
"核算单元错误"
);
return
_attendanceService
.
DeptCompute
(
allotId
,
unitType
,
accountingUnit
);
}
/// <summary>
/// 科室考勤上报录入结果统计下载
/// </summary>
/// <param name="allotId">绩效月ID</param>
/// <param name="unitType">核算组别</param>
/// <param name="accountingUnit">核算单元</param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"dept/download/compute"
)]
public
IActionResult
DownloadDeptCompute
(
int
allotId
,
string
unitType
,
string
accountingUnit
)
{
if
(!
Enum
.
TryParse
(
unitType
,
out
UnitType
unitType1
))
throw
new
PerformanceException
(
"核算组别错误"
);
if
(
string
.
IsNullOrEmpty
(
accountingUnit
))
throw
new
PerformanceException
(
"核算单元错误"
);
List
<
ExcelDownloadHeads
>
excelDownloadHeads
=
new
List
<
ExcelDownloadHeads
>()
{
new
ExcelDownloadHeads
{
Alias
=
"核算组别"
,
Name
=
nameof
(
AttendanceStatistics
.
UnitType
)
},
new
ExcelDownloadHeads
{
Alias
=
"核算单元名称"
,
Name
=
nameof
(
AttendanceStatistics
.
AccountingUnit
)
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelName
)
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科开始时问"
,
Name
=
nameof
(
AttendanceStatistics
.
BeginDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科结束时间"
,
Name
=
nameof
(
AttendanceStatistics
.
EndDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"人员系数"
,
Name
=
nameof
(
AttendanceStatistics
.
PermanentStaff
)
},
};
var
type
=
_attendanceService
.
GetAttendanceType
(
allotId
);
foreach
(
var
item
in
type
.
Data
)
{
excelDownloadHeads
.
Add
(
new
ExcelDownloadHeads
()
{
Alias
=
item
.
AttendanceName
,
Name
=
item
.
AttendanceName
});
}
excelDownloadHeads
.
Add
(
new
ExcelDownloadHeads
()
{
Alias
=
"出勤天数"
,
Name
=
"AttendanceDays"
});
var
userid
=
claim
.
GetUserId
();
var
res
=
_attendanceService
.
DeptCompute
(
allotId
,
unitType
,
accountingUnit
);
var
result
=
(
res
?.
Data
==
null
)
?
new
List
<
AttendanceStatistics
>()
:
res
.
Data
;
var
ser
=
JsonConvert
.
SerializeObject
(
result
);
var
rows
=
JsonConvert
.
DeserializeObject
<
List
<
Dictionary
<
string
,
object
>>>(
ser
);
var
filepath
=
_attendanceService
.
ExcelDownload
(
rows
,
"科室上报考勤结果"
,
allotId
,
excelDownloadHeads
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
var
provider
=
new
FileExtensionContentTypeProvider
();
FileInfo
fileInfo
=
new
FileInfo
(
filepath
);
var
memi
=
provider
.
Mappings
[
".xlsx"
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
fileInfo
.
Name
));
}
/// <summary>
/// 科室考勤上报录入提交
/// </summary>
/// <param name="allotId">绩效月ID</param>
...
...
@@ -688,6 +777,8 @@ public ApiResponse DeptAudit(int allotId, string unitType, string accountingUnit
{
if
(
audit
==
null
)
throw
new
PerformanceException
(
"审核参数错误"
);
if
(
string
.
IsNullOrEmpty
(
unitType
)
||
string
.
IsNullOrEmpty
(
accountingUnit
))
throw
new
PerformanceException
(
"核算单元及组别信息错误"
);
var
states
=
new
int
[]
{
(
int
)
Attendance
.
Report
.
通过
,
(
int
)
Attendance
.
Report
.
驳回
,
};
if
(!
states
.
Contains
(
audit
.
State
))
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
b8299bfe
...
...
@@ -520,6 +520,14 @@
<param
name=
"state"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DeptState(System.Int32,System.String)"
>
<summary>
科室考勤上报录入状态
</summary>
<param
name=
"allotId"
>
绩效月ID
</param>
<param
name=
"unitType"
>
核算组别
</param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DeptLoad(System.Int32)"
>
<summary>
科室考勤上报录入加载
...
...
@@ -536,6 +544,24 @@
<param
name=
"datas"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DeptCompute(System.Int32,System.String,System.String)"
>
<summary>
科室考勤上报录入结果统计
</summary>
<param
name=
"allotId"
>
绩效月ID
</param>
<param
name=
"unitType"
>
核算组别
</param>
<param
name=
"accountingUnit"
>
核算单元
</param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DownloadDeptCompute(System.Int32,System.String,System.String)"
>
<summary>
科室考勤上报录入结果统计下载
</summary>
<param
name=
"allotId"
>
绩效月ID
</param>
<param
name=
"unitType"
>
核算组别
</param>
<param
name=
"accountingUnit"
>
核算单元
</param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DeptSubmit(System.Int32,System.String,System.Collections.Generic.List{Performance.DtoModels.Request.AttendanceDept})"
>
<summary>
科室考勤上报录入提交
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
b8299bfe
...
...
@@ -3188,6 +3188,11 @@
调入时间
</summary>
</member>
<member
name=
"P:Performance.DtoModels.Response.AttendanceDeptState.Title"
>
<summary>
标题名
</summary>
</member>
<member
name=
"P:Performance.DtoModels.Response.AttendanceDeptAuditList.Code"
>
<summary>
编码
...
...
performance/Performance.DtoModels/Response/AttendanceDeptAuditList.cs
View file @
b8299bfe
...
...
@@ -2,6 +2,13 @@
namespace
Performance.DtoModels.Response
{
public
class
AttendanceDeptState
:
AttendanceDeptAuditList
{
/// <summary>
/// 标题名
/// </summary>
public
string
Title
{
get
;
set
;
}
}
public
class
AttendanceDeptAuditList
{
/// <summary>
...
...
performance/Performance.Services/AttendanceService.cs
View file @
b8299bfe
This diff is collapsed.
Click to expand it.
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