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
88f655c2
Commit
88f655c2
authored
Apr 18, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考勤下载BUG修复
parent
a371cde7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
31 deletions
+31
-31
performance/Performance.Api/Controllers/AttendanceController.cs
+25
-25
performance/Performance.Services/AttendanceService.cs
+6
-6
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
88f655c2
...
...
@@ -201,19 +201,19 @@ public IActionResult DownloadAttendance(int allotId)
{
List
<
ExcelDownloadHeads
>
excelDownloadHeads
=
new
List
<
ExcelDownloadHeads
>()
{
new
ExcelDownloadHeads
{
Alias
=
"核算单元名称"
,
Name
=
"AccountingUnit"
},
new
ExcelDownloadHeads
{
Alias
=
"科室名称"
,
Name
=
"Department"
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
"PersonnelName"
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
"PersonnelNumber"
},
new
ExcelDownloadHeads
{
Alias
=
"人员类别"
,
Name
=
"UnitType"
},
new
ExcelDownloadHeads
{
Alias
=
"在科开始时问"
,
Name
=
"BeginDate"
},
new
ExcelDownloadHeads
{
Alias
=
"在科结束时间"
,
Name
=
"EndDate"
},
new
ExcelDownloadHeads
{
Alias
=
"核算单元名称"
,
Name
=
nameof
(
AttendanceStatistics
.
AccountingUnit
)
},
new
ExcelDownloadHeads
{
Alias
=
"科室名称"
,
Name
=
nameof
(
AttendanceStatistics
.
Department
)
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelName
)
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"人员类别"
,
Name
=
nameof
(
AttendanceStatistics
.
UnitType
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科开始时问"
,
Name
=
nameof
(
AttendanceStatistics
.
BeginDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"在科结束时间"
,
Name
=
nameof
(
AttendanceStatistics
.
EndDate
)
},
};
var
result
=
_attendanceService
.
GetAttendance
(
allotId
).
Data
;
var
ser
=
JsonConvert
.
SerializeObject
(
result
);
var
rows
=
JsonConvert
.
DeserializeObject
<
List
<
Dictionary
<
string
,
object
>>>(
ser
);
var
filepath
=
_attendanceService
.
ExcelDownload
(
rows
,
"初始考勤记录"
,
allotId
,
excelDownloadHeads
);
var
filepath
=
_attendanceService
.
ExcelDownload
(
rows
,
"初始考勤记录"
,
allotId
,
excelDownloadHeads
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
...
...
@@ -239,12 +239,12 @@ public IActionResult DownloadVacation(int allotId)
{
List
<
ExcelDownloadHeads
>
excelDownloadHeads
=
new
List
<
ExcelDownloadHeads
>()
{
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
"PersonnelName"
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
"PersonnelNumber"
},
new
ExcelDownloadHeads
{
Alias
=
"考勤类型"
,
Name
=
"AttendanceName"
},
new
ExcelDownloadHeads
{
Alias
=
"开始时问"
,
Name
=
"BegDate"
},
new
ExcelDownloadHeads
{
Alias
=
"结束时间"
,
Name
=
"EndDate"
},
new
ExcelDownloadHeads
{
Alias
=
"天数"
,
Name
=
"Days"
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
nameof
(
RecordAttendcance
.
PersonnelName
)
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
RecordAttendcance
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"考勤类型"
,
Name
=
nameof
(
RecordAttendcance
.
AttendanceName
)
},
new
ExcelDownloadHeads
{
Alias
=
"开始时问"
,
Name
=
nameof
(
RecordAttendcance
.
BegDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"结束时间"
,
Name
=
nameof
(
RecordAttendcance
.
EndDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"天数"
,
Name
=
nameof
(
RecordAttendcance
.
Days
)
},
};
var
result
=
_attendanceService
.
GetAttendanceVacation
(
allotId
).
Data
;
...
...
@@ -277,11 +277,11 @@ public IActionResult DownloadCallIn(int allotId)
{
List
<
ExcelDownloadHeads
>
excelDownloadHeads
=
new
List
<
ExcelDownloadHeads
>()
{
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
"PersonnelName"
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
"PersonnelNumber"
},
new
ExcelDownloadHeads
{
Alias
=
"调入核算单元"
,
Name
=
"AttendanceName"
},
new
ExcelDownloadHeads
{
Alias
=
"调入组别"
,
Name
=
"UnitType"
},
new
ExcelDownloadHeads
{
Alias
=
"调入时间"
,
Name
=
"AttendanceDate"
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
nameof
(
view_attendance
.
PersonnelName
)
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
view_attendance
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"调入核算单元"
,
Name
=
nameof
(
view_attendance
.
AccountingUnit
)
},
new
ExcelDownloadHeads
{
Alias
=
"调入组别"
,
Name
=
nameof
(
view_attendance
.
UnitType
)
},
new
ExcelDownloadHeads
{
Alias
=
"调入时间"
,
Name
=
nameof
(
view_attendance
.
AttendanceDate
)
},
};
var
result
=
_attendanceService
.
GetCallIn
(
allotId
).
Data
;
...
...
@@ -313,12 +313,12 @@ public IActionResult DownloadStatistics(int allotId)
{
List
<
ExcelDownloadHeads
>
excelDownloadHeads
=
new
List
<
ExcelDownloadHeads
>()
{
new
ExcelDownloadHeads
{
Alias
=
"科室名称"
,
Name
=
"Department"
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
"PersonnelName"
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
"PersonnelNumber"
},
new
ExcelDownloadHeads
{
Alias
=
"人员类别"
,
Name
=
"UnitType"
},
new
ExcelDownloadHeads
{
Alias
=
"开始时问"
,
Name
=
"BeginDate"
},
new
ExcelDownloadHeads
{
Alias
=
"结束时间"
,
Name
=
"EndDate"
},
new
ExcelDownloadHeads
{
Alias
=
"科室名称"
,
Name
=
nameof
(
AttendanceStatistics
.
Department
)
},
new
ExcelDownloadHeads
{
Alias
=
"姓名"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelName
)
},
new
ExcelDownloadHeads
{
Alias
=
"员工号"
,
Name
=
nameof
(
AttendanceStatistics
.
PersonnelNumber
)
},
new
ExcelDownloadHeads
{
Alias
=
"人员类别"
,
Name
=
nameof
(
AttendanceStatistics
.
UnitType
)
},
new
ExcelDownloadHeads
{
Alias
=
"开始时问"
,
Name
=
nameof
(
AttendanceStatistics
.
BeginDate
)
},
new
ExcelDownloadHeads
{
Alias
=
"结束时间"
,
Name
=
nameof
(
AttendanceStatistics
.
EndDate
)
},
};
var
type
=
_attendanceService
.
GetAttendanceType
(
allotId
);
foreach
(
var
item
in
type
.
Data
)
...
...
performance/Performance.Services/AttendanceService.cs
View file @
88f655c2
...
...
@@ -671,11 +671,11 @@ public ApiResponse<List<AttendanceStatistics>> GetAttendanceStatistics(int allot
var
types
=
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
new
List
<
per_attendance_type
>();
var
vacationeData
=
perfoPperAttendanceVacationeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
new
List
<
per_attendance_vacation
>();
//// 只关注请假的人
var
numbers
=
vacationeData
.
Select
(
w
=>
w
.
PersonnelNumber
).
ToList
();
var
attendanceData
=
perforPerallotRepository
.
GetAttendance
(
allotId
)
.
Where
(
w
=>
numbers
.
Contains
(
w
.
PersonnelNumber
))
.
ToList
();
//
var attendanceData = perforPerallotRepository.GetAttendance(allotId);
//
var numbers = vacationeData.Select(w => w.PersonnelNumber).ToList();
//
var attendanceData = perforPerallotRepository.GetAttendance(allotId)
//
.Where(w => numbers.Contains(w.PersonnelNumber))
//
.ToList();
var
attendanceData
=
perforPerallotRepository
.
GetAttendance
(
allotId
);
List
<
AttendanceStatistics
>
statistics
=
new
List
<
AttendanceStatistics
>();
// 交叉补全科室结束时间
...
...
@@ -792,7 +792,7 @@ private List<DateTime> SplitEveryDay(DateTime begin, DateTime end)
return
result
;
}
public
string
ExcelDownload
(
List
<
Dictionary
<
string
,
object
>>
rows
,
string
name
,
int
allotId
,
List
<
ExcelDownloadHeads
>
headList
)
public
string
ExcelDownload
(
List
<
Dictionary
<
string
,
object
>>
rows
,
string
name
,
int
allotId
,
List
<
ExcelDownloadHeads
>
headList
)
{
var
perAllot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
string
title
=
$"
{
perAllot
.
Year
}
年
{
perAllot
.
Month
}
月
{
name
}
"
;
...
...
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