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
73da2c94
Commit
73da2c94
authored
Mar 25, 2022
by
纪旭 韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考勤记录,考勤类型
parent
b7dcdfdd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
608 additions
and
49 deletions
+608
-49
performance/Performance.Api/Controllers/AttendanceController.cs
+49
-21
performance/Performance.Api/wwwroot/Performance.Api.xml
+26
-7
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+1
-1
performance/Performance.DtoModels/Enum.cs
+1
-1
performance/Performance.DtoModels/HandsonTable.cs
+6
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+4
-0
performance/Performance.EntityModels/Other/view_attendance.cs
+17
-1
performance/Performance.Services/AttendanceService.cs
+503
-17
performance/Performance.Services/PerExcelService/RecognitionDataFormat.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
73da2c94
using
Microsoft.AspNetCore.Mvc
;
using
Performance.DtoModels
;
using
Performance.EntityModels.Other
;
using
Performance.Services
;
namespace
Performance.Api.Controllers
{
[
Route
(
"api"
)]
[
ApiController
]
public
class
AttendanceController
:
ControllerBase
{
...
...
@@ -32,7 +34,7 @@ AttendanceService attendanceService
public
ApiResponse
GetAttendance
(
int
allotId
)
{
// 查询考勤视图,并按照设计图做格式转换 仅查询开始结束
var
result
=
_attendanceService
.
Get
Per
Attendance
(
allotId
);
var
result
=
_attendanceService
.
GetAttendance
(
allotId
);
if
(
result
!=
null
)
{
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
...
...
@@ -51,29 +53,34 @@ public ApiResponse GetAttendance(int allotId)
public
ApiResponse
GetCallIn
(
int
allotId
)
{
// 查询考勤视图,并按照设计图做格式转换 仅查询调入
var
result
=
_attendanceService
.
GetCallIn
(
allotId
);
if
(
result
!=
null
)
{
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
return
new
ApiResponse
(
ResponseType
.
Fail
);
}
/// <summary>
/// 返回HandsonTable格式调动记录
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
[
HttpGet
(
"CallIn/GetBatch
/{allotId}
"
)]
public
ApiResponse
GetBatchCallIn
(
int
allotId
)
[
HttpGet
(
"CallIn/GetBatch"
)]
public
ApiResponse
GetBatchCallIn
HandsonTable
(
)
{
// 返回HandsonTable格式调动记录
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetBatchCallInHandsonTable
()
);
}
/// <summary>
/// 批量插入调动记录
/// </summary>
/// <param name="allotId"></param>
/// <param name="obj"></param>
/// <param name="hospitalId"></param>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
(
"CallIn/Batch/{allotId}"
)]
public
ApiResponse
BatchCallIn
(
int
allotId
,
object
obj
)
public
ApiResponse
BatchCallIn
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
// obj自己定义结构
// 批量插入调动记录,插入前需要删除所有后重新插入
...
...
@@ -82,7 +89,7 @@ public ApiResponse BatchCallIn(int allotId, object obj)
// 需要验证核算组别和核算单元是否与“核算单元及组别”(cof_accounting)完全匹配,不匹配则返回表格错误提示
// 表格错误提醒参考PersonService.CreatePerson方法
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
_attendanceService
.
BatchCallIn
(
allotId
,
hospitalId
,
request
);
}
#
endregion
...
...
@@ -91,22 +98,25 @@ public ApiResponse BatchCallIn(int allotId, object obj)
/// 查询绩效考勤类型
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <returns></returns>
[
HttpGet
(
"Type/{allotId}"
)]
public
ApiResponse
GetAttendanceType
(
int
allotId
)
[
HttpGet
(
"Type/{allotId}
,{hospitalId}
"
)]
public
ApiResponse
GetAttendanceType
(
int
allotId
,
int
hospitalId
)
{
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetAttendanceType
(
allotId
,
hospitalId
)
);
}
/// <summary>
/// 新增或修改考勤类型
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <param name="attendanceType"></param>
/// <returns></returns>
[
HttpPost
(
"Type/Edit/{
i
d}"
)]
public
ApiResponse
InsertAttendanceType
(
int
allotId
,
object
obj
)
[
HttpPost
(
"Type/Edit/{
allotId},{hospitalI
d}"
)]
public
ApiResponse
InsertAttendanceType
(
int
allotId
,
int
hospitalId
,
AttendanceType
attendanceType
)
{
// obj自己定义结构
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
_attendanceService
.
InsertAttendanceType
(
allotId
,
hospitalId
,
attendanceType
);
}
/// <summary>
/// 删除考勤类型
...
...
@@ -117,7 +127,7 @@ public ApiResponse InsertAttendanceType(int allotId, object obj)
public
ApiResponse
DeleteAttendanceType
(
int
id
)
{
// 删除前需要验证当前类型是否被使用,如果被使用则禁止删除
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
_attendanceService
.
DeleteAttendanceType
(
id
);
}
#
endregion
...
...
@@ -125,17 +135,35 @@ public ApiResponse DeleteAttendanceType(int id)
/// <summary>
/// 返回HandsonTable格式考勤记录
/// </summary>
/// <returns></returns>
[
HttpGet
(
"Vacation"
)]
public
ApiResponse
GetAttendanceVacationHandsonTable
()
{
// 返回HandsonTable格式考勤记录
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetAttendanceVacationHandsonTable
());
}
/// <summary>
/// 查询AttendanceVacation
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <returns></returns>
[
HttpGet
(
"Vacation/{allotId}"
)]
public
ApiResponse
GetAttendanceVacation
(
int
allotId
)
[
HttpGet
(
"Vacation/{allotId}
,{hospitalId}
"
)]
public
ApiResponse
GetAttendanceVacation
(
int
allotId
,
int
hospitalId
)
{
// 批量插入考勤记录,插入前需要删除所有后重新插入
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetAttendanceVacation
(
allotId
,
hospitalId
));
}
/// <summary>
/// 批量插入考勤记录,插入前需要删除所有后重新插入
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
(
"Vacation/Batch/{allotId}"
)]
public
ApiResponse
AttendanceBatch
(
int
allotId
,
object
obj
)
public
ApiResponse
AttendanceBatch
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
// obj自己定义结构
// 批量插入考勤记录,插入前需要删除所有后重新插入
...
...
@@ -143,7 +171,7 @@ public ApiResponse AttendanceBatch(int allotId, object obj)
// 需要验证工号和姓名是否与“人员字典”(per_employee)完全匹配,不匹配则返回表格错误提示
// 表格错误提醒参考PersonService.CreatePerson方法
return
new
ApiResponse
(
ResponseType
.
Fail
);
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
AttendanceBatch
(
allotId
,
hospitalId
,
request
)
);
}
#
endregion
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
73da2c94
...
...
@@ -326,33 +326,36 @@
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetBatchCallIn
(System.Int32)
"
>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetBatchCallIn
HandsonTable
"
>
<summary>
返回HandsonTable格式调动记录
</summary>
<param
name=
"allotId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.BatchCallIn(System.Int32,System.
Object
)"
>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.BatchCallIn(System.Int32,System.
Int32,Performance.DtoModels.SaveCollectData
)"
>
<summary>
批量插入调动记录
</summary>
<param
name=
"allotId"
></param>
<param
name=
"obj"
></param>
<param
name=
"hospitalId"
></param>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceType(System.Int32)"
>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceType(System.Int32
,System.Int32
)"
>
<summary>
查询绩效考勤类型
</summary>
<param
name=
"allotId"
></param>
<param
name=
"hospitalId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.InsertAttendanceType(System.Int32,System.
Object
)"
>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.InsertAttendanceType(System.Int32,System.
Int32,Performance.EntityModels.Other.AttendanceType
)"
>
<summary>
新增或修改考勤类型
</summary>
<param
name=
"allotId"
></param>
<param
name=
"hospitalId"
></param>
<param
name=
"attendanceType"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.DeleteAttendanceType(System.Int32)"
>
...
...
@@ -362,11 +365,27 @@
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceVacation
(System.Int32)
"
>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceVacation
HandsonTable
"
>
<summary>
返回HandsonTable格式考勤记录
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceVacation(System.Int32,System.Int32)"
>
<summary>
查询AttendanceVacation
</summary>
<param
name=
"allotId"
></param>
<param
name=
"hospitalId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.AttendanceBatch(System.Int32,System.Int32,Performance.DtoModels.SaveCollectData)"
>
<summary>
批量插入考勤记录,插入前需要删除所有后重新插入
</summary>
<param
name=
"allotId"
></param>
<param
name=
"hospitalId"
></param>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceStatistics(System.Int32)"
>
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
73da2c94
...
...
@@ -202,7 +202,7 @@
<member
name=
"F:Performance.DtoModels.DataFormat.分数"
>
<summary>
分数
</summary>
</member>
<member
name=
"F:Performance.DtoModels.DataFormat.日期"
>
<member
name=
"F:Performance.DtoModels.DataFormat.日期
YYYYMMDD
"
>
<summary>
日期
</summary>
</member>
<member
name=
"M:Performance.DtoModels.HandsonTable.SetRowData(System.Collections.Generic.IEnumerable{Performance.DtoModels.HandsonRowData},System.Boolean)"
>
...
...
performance/Performance.DtoModels/Enum.cs
View file @
73da2c94
...
...
@@ -116,7 +116,7 @@ public enum DataFormat
/// <summary> 分数 </summary>
分数
,
/// <summary> 日期 </summary>
日期
日期
YYYYMMDD
}
public
enum
Role
...
...
performance/Performance.DtoModels/HandsonTable.cs
View file @
73da2c94
...
...
@@ -127,6 +127,11 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat
Type
=
"text"
;
break
;
case
DataFormat
.
日期
YYYYMMDD
:
Type
=
"DateFormat"
;
DateFormat
=
"YYYY/MM/DD"
;
break
;
case
DataFormat
.
小数
:
Type
=
"numeric"
;
NumericFormat
=
new
NumericFormat
{
Pattern
=
"0,00.00"
};
...
...
@@ -152,6 +157,7 @@ public HandsonColumn(string data, bool readOnly = false, DataFormat format = Dat
public
string
Data
{
get
;
set
;
}
public
bool
ReadOnly
{
get
;
set
;
}
public
string
Type
{
get
;
set
;
}
public
string
DateFormat
{
get
;
set
;
}
public
string
[]
Source
{
get
;
set
;
}
public
bool
Strict
{
get
;
set
;
}
=
false
;
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
73da2c94
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Performance.EntityModels.Entity
;
using
System
;
namespace
Performance.EntityModels
...
...
@@ -245,5 +246,8 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> 用户角色关联表 </summary>
public
virtual
DbSet
<
sys_user_role
>
sys_user_role
{
get
;
set
;
}
public
virtual
DbSet
<
sys_version
>
sys_version
{
get
;
set
;
}
public
virtual
DbSet
<
per_attendance
>
per_attendance
{
get
;
set
;
}
public
virtual
DbSet
<
per_attendance_type
>
per_attendance_type
{
get
;
set
;
}
public
virtual
DbSet
<
per_attendance_vacation
>
per_attendance_vacation
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Other/view_attendance.cs
View file @
73da2c94
using
System
;
using
Performance.EntityModels.Entity
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -30,6 +31,14 @@ public class InitialAttendance
public
DateTime
?
EndDate
{
get
;
set
;
}
//入科结束时间
public
string
Department
{
get
;
set
;
}
//科室名称
}
public
class
RecordAttendcance
:
per_attendance_vacation
{
public
int
Days
{
get
;
set
;
}
public
string
AttendanceName
{
get
;
set
;
}
}
public
class
AttendaceHeads
{
public
string
Column
{
get
;
set
;
}
...
...
@@ -37,6 +46,13 @@ public class AttendaceHeads
}
public
class
AttendanceType
{
public
string
AttendanceName
{
get
;
set
;
}
//考勤类型名称
public
string
IsDeduction
{
get
;
set
;
}
//是否核减出勤 1 核减 2 不核减
}
public
class
AttendanceResponse
<
T
>
{
public
List
<
AttendaceHeads
>
Heads
{
get
;
set
;
}
...
...
performance/Performance.Services/AttendanceService.cs
View file @
73da2c94
using
AutoMapper
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.EntityModels.Entity
;
using
Performance.EntityModels.Other
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Repository.Repository
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -12,23 +17,40 @@ namespace Performance.Services
{
public
class
AttendanceService
:
IAutoInjection
{
private
readonly
IMapper
_
mapper
;
private
readonly
IMapper
mapper
;
private
readonly
ILogger
<
AttendanceService
>
logger
;
private
readonly
PerforPerallotRepository
_perforPerallotRepository
;
private
readonly
PerforPerallotRepository
perforPerallotRepository
;
private
readonly
PerforPerAttendanceRepository
perforPerAttendanceRepository
;
private
readonly
PerfoPperAttendanceTypeRepository
perfoPperAttendanceTypeRepository
;
private
readonly
PerfoPperAttendanceVacationeRepository
perfoPperAttendanceVacationeRepository
;
private
readonly
PerforPerdeptdicRepository
perdeptdicRepository
;
private
readonly
PerforPeremployeeRepository
perforPeremployeeRepository
;
public
AttendanceService
(
IMapper
mapper
,
ILogger
<
AttendanceService
>
logger
,
PerforPerallotRepository
perforPerallotRepository
)
PerforPerallotRepository
perforPerallotRepository
,
PerforPerAttendanceRepository
perforPerAttendanceRepository
,
PerfoPperAttendanceTypeRepository
perfoPperAttendanceTypeRepository
,
PerfoPperAttendanceVacationeRepository
perfoPperAttendanceVacationeRepository
,
PerforPerdeptdicRepository
perdeptdicRepository
,
PerforPeremployeeRepository
perforPeremployeeRepository
)
{
_
mapper
=
mapper
;
this
.
mapper
=
mapper
;
this
.
logger
=
logger
;
this
.
_perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforPerAttendanceRepository
=
perforPerAttendanceRepository
;
this
.
perfoPperAttendanceTypeRepository
=
perfoPperAttendanceTypeRepository
;
this
.
perfoPperAttendanceVacationeRepository
=
perfoPperAttendanceVacationeRepository
;
this
.
perdeptdicRepository
=
perdeptdicRepository
;
this
.
perforPeremployeeRepository
=
perforPeremployeeRepository
;
}
public
AttendanceResponse
<
List
<
InitialAttendance
>>
GetPerAttendance
(
int
allotId
)
#
region
初始考勤页面
public
AttendanceResponse
<
List
<
InitialAttendance
>>
GetAttendance
(
int
allotId
)
{
var
view_attendance
=
_perforPerallotRepository
.
GetAttendance
(
allotId
);
var
view_attendance
=
perforPerallotRepository
.
GetAttendance
(
allotId
);
if
(
view_attendance
==
null
||
!
view_attendance
.
Any
())
return
new
AttendanceResponse
<
List
<
InitialAttendance
>>();
var
start
=
view_attendance
.
Where
(
t
=>
t
.
Source
.
Contains
(
"开始"
));
var
end
=
view_attendance
.
Where
(
t
=>
t
.
Source
.
Contains
(
"结束"
));
...
...
@@ -54,7 +76,7 @@ public AttendanceResponse<List<InitialAttendance>> GetPerAttendance(int allotId)
}
}
}
AttendanceResponse
<
List
<
InitialAttendance
>>
attendanceResponse
=
new
AttendanceResponse
<
List
<
InitialAttendance
>>()
AttendanceResponse
<
List
<
InitialAttendance
>>
attendanceResponse
=
new
AttendanceResponse
<
List
<
InitialAttendance
>>()
{
Heads
=
AttendanceConfig
.
AttendcanceHeads
,
Datas
=
attendances
...
...
@@ -62,18 +84,482 @@ public AttendanceResponse<List<InitialAttendance>> GetPerAttendance(int allotId)
return
attendanceResponse
;
}
public
class
AttendanceConfig
#
endregion
#
region
调入记录
public
AttendanceResponse
<
List
<
view_attendance
>>
GetCallIn
(
int
allotId
)
{
public
static
List
<
AttendaceHeads
>
AttendcanceHeads
{
get
;
}
=
new
List
<
AttendaceHeads
>
var
view_attendance
=
perforPerallotRepository
.
GetAttendance
(
allotId
).
Where
(
t
=>
t
.
Source
.
Contains
(
"调入"
)).
ToList
();
AttendanceResponse
<
List
<
view_attendance
>>
attendanceResponse
=
new
AttendanceResponse
<
List
<
view_attendance
>>()
{
Heads
=
AttendanceConfig
.
CallinlAttendcanceHeads
,
Datas
=
view_attendance
};
return
attendanceResponse
;
}
public
HandsonTable
GetBatchCallInHandsonTable
()
{
HandsonTable
handson
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
Person
.
Select
(
c
=>
c
.
Item2
).
ToArray
(),
Person
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Item2
,
Visible
=
1
,
Readnoly
=
0
}).
ToList
());
if
(
handson
.
Columns
!=
null
&&
handson
.
Columns
.
Any
())
{
foreach
(
var
column
in
handson
.
Columns
)
{
column
.
Type
=
"text"
;
if
(
column
.
Data
==
"调入组别"
)
{
column
.
Source
=
EnumHelper
.
GetItems
<
UnitType
>().
Select
(
w
=>
w
.
Description
.
Replace
(
"行政后勤"
,
"行政工勤"
)).
ToArray
();
column
.
Strict
=
true
;
}
if
(
column
.
Data
==
"调入核算单元"
)
{
column
.
Source
=
EnumHelper
.
GetItems
<
AccountUnitType
>().
Where
(
w
=>
w
.
Description
!=
""
).
Select
(
w
=>
w
.
Description
).
ToArray
();
column
.
Strict
=
true
;
}
}
}
return
handson
;
}
public
ApiResponse
BatchCallIn
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
var
dict
=
new
Dictionary
<
string
,
string
>();
Person
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
var
dicData
=
CreateDataRow
(
request
,
dict
);
if
(
dicData
==
null
||
dicData
.
Count
==
0
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"空数据,无效操作"
);
var
jsons
=
JsonHelper
.
Serialize
(
dicData
);
var
newAttendanceVacatione
=
JsonHelper
.
Deserialize
<
List
<
per_attendance
>>(
jsons
);
var
oldCallinAttendance
=
perforPerAttendanceRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
per_allot
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
ID
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
FirstOrDefault
();
if
(
per_allot
==
null
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"无绩效数据"
);
var
per_dept_dic
=
perdeptdicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
per_employee
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
i
=
0
;
i
<
newAttendanceVacatione
.
Count
;
i
++)
{
if
(
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
PersonnelName
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
PersonnelNumber
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
CallInAccountingUnit
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
CallInUnitType
?.
Trim
())
||
newAttendanceVacatione
[
i
].
CallInDate
==
null
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
.
ToString
()??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"“关键信息缺失”请补全或删除"
},
});
}
DateTime
dt
=
new
DateTime
(
per_allot
.
Year
,
per_allot
.
Month
,
1
).
AddMonths
(
1
);
if
(
newAttendanceVacatione
[
i
].
CallInDate
>
dt
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
.
ToString
()??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"调入时间不在本月范围内"
},
});
}
if
(
newAttendanceVacatione
[
i
].
CallInUnitType
!=
per_dept_dic
.
FirstOrDefault
(
t
=>
t
.
AccountingUnit
==
newAttendanceVacatione
[
i
].
CallInAccountingUnit
)?.
UnitType
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
.
ToString
()??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"该核算单元的调入组别不一致或不存在"
},
});
}
if
(
newAttendanceVacatione
[
i
].
PersonnelName
!=
per_employee
.
FirstOrDefault
(
t
=>
t
.
PersonnelNumber
==
newAttendanceVacatione
[
i
].
PersonnelNumber
&&
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
)?.
DoctorName
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
.
ToString
()??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"该人员与人员字典不一致或不存在"
},
});
}
var
oldEmp
=
oldCallinAttendance
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
newAttendanceVacatione
[
i
].
PersonnelNumber
);
if
(!
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
PersonnelName
)
&&
oldEmp
!=
null
&&
oldEmp
.
PersonnelName
!=
newAttendanceVacatione
[
i
].
PersonnelName
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"调入核算单元"
,
newAttendanceVacatione
[
i
].
CallInAccountingUnit
??
""
},
{
"调入组别"
,
newAttendanceVacatione
[
i
].
CallInUnitType
??
""
},
{
"调入时间"
,
newAttendanceVacatione
[
i
].
CallInDate
.
ToString
()??
""
},
{
"来源"
,
"“粘贴数据”与“历史数据”比对"
},
{
"错误原因"
,
$"原名“
{
oldEmp
.
PersonnelName
}
”,工号相同但姓名不同,请删除“历史数据”中该员工"
},
});
}
}
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
List
<
per_attendance
>
addPer_Attendances
=
new
List
<
per_attendance
>();
List
<
per_attendance
>
deletePer_Attendances
=
new
List
<
per_attendance
>();
foreach
(
var
data
in
newAttendanceVacatione
)
{
data
.
AllotId
=
allotId
;
data
.
HospitalId
=
hospitalId
;
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
());
if
(
any
!=
null
)
deletePer_Attendances
.
Add
(
any
);
}
if
(
deletePer_Attendances
!=
null
&&
deletePer_Attendances
.
Any
())
perforPerAttendanceRepository
.
RemoveRange
(
deletePer_Attendances
.
ToArray
());
if
(
addPer_Attendances
!=
null
&&
addPer_Attendances
.
Any
())
perforPerAttendanceRepository
.
AddRange
(
addPer_Attendances
.
ToArray
());
return
new
ApiResponse
(
ResponseType
.
OK
,
""
);
}
#
endregion
#
region
考勤类型
public
List
<
per_attendance_type
>
GetAttendanceType
(
int
allotId
,
int
hospitalId
)
{
return
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
ToList
();
}
public
ApiResponse
InsertAttendanceType
(
int
allotId
,
int
hospitalId
,
AttendanceType
attendanceType
)
{
var
any
=
perfoPperAttendanceTypeRepository
.
GetEntities
().
FirstOrDefault
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
&&
t
.
AttendanceName
==
attendanceType
.
AttendanceName
);
if
(
any
!=
null
)
{
any
.
IsDeduction
=
Convert
.
ToInt32
(
attendanceType
.
IsDeduction
);
if
(
perfoPperAttendanceTypeRepository
.
Update
(
any
))
return
new
ApiResponse
(
ResponseType
.
OK
,
"修改成功"
);
else
return
new
ApiResponse
(
ResponseType
.
Fail
,
"修改失败"
);
}
else
{
per_attendance_type
per_Attendance_Type
=
new
per_attendance_type
()
{
AllotId
=
allotId
,
HospitalId
=
hospitalId
,
AttendanceName
=
attendanceType
.
AttendanceName
,
IsDeduction
=
Convert
.
ToInt32
(
attendanceType
.
IsDeduction
)
};
if
(
perfoPperAttendanceTypeRepository
.
Add
(
per_Attendance_Type
))
return
new
ApiResponse
(
ResponseType
.
OK
,
"添加成功"
);
else
return
new
ApiResponse
(
ResponseType
.
Fail
,
"添加失败"
);
}
}
public
ApiResponse
DeleteAttendanceType
(
int
id
)
{
var
any
=
perfoPperAttendanceTypeRepository
.
GetEntities
().
FirstOrDefault
(
t
=>
t
.
Id
==
id
);
var
use
=
perfoPperAttendanceVacationeRepository
.
GetEntities
().
FirstOrDefault
(
t
=>
t
.
TypeId
==
any
.
Id
);
if
(
any
!=
null
&&
use
==
null
)
{
if
(
perfoPperAttendanceTypeRepository
.
DeleteFromQuery
(
t
=>
t
.
Id
==
id
)
>
0
)
return
new
ApiResponse
(
ResponseType
.
OK
,
"删除成功"
);
else
return
new
ApiResponse
(
ResponseType
.
Fail
,
"删除失败"
);
}
else
return
new
ApiResponse
(
ResponseType
.
Fail
,
"删除失败"
);
}
#
endregion
#
region
考勤记录
public
HandsonTable
GetAttendanceVacationHandsonTable
()
{
HandsonTable
handson
=
new
HandsonTable
((
int
)
SheetType
.
Unidentifiable
,
Vacation
.
Select
(
c
=>
c
.
Item2
).
ToArray
(),
Vacation
.
Select
(
t
=>
new
collect_permission
{
HeadName
=
t
.
Item2
,
Visible
=
1
,
Readnoly
=
0
}).
ToList
());
if
(
handson
.
Columns
!=
null
&&
handson
.
Columns
.
Any
())
{
foreach
(
var
column
in
handson
.
Columns
)
{
column
.
Type
=
"text"
;
if
(
column
.
Data
.
Contains
(
"时间"
))
{
column
.
Type
=
"DateFormat"
;
column
.
DateFormat
=
"YYYY/MM/DD"
;
}
if
(
column
.
Data
==
"考勤类型"
)
{
column
.
Source
=
perfoPperAttendanceTypeRepository
.
GetEntities
().
Select
(
t
=>
t
.
AttendanceName
).
ToArray
();
}
}
}
return
handson
;
}
public
List
<
RecordAttendcance
>
GetAttendanceVacation
(
int
allotId
,
int
hospitalId
)
{
var
vacatione
=
perfoPperAttendanceVacationeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
type
=
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
data
=
from
a
in
vacatione
join
b
in
type
on
a
.
TypeId
equals
b
.
Id
into
temp
from
tt
in
temp
.
DefaultIfEmpty
()
select
new
RecordAttendcance
{
Id
=
a
.
Id
,
AllotId
=
a
.
AllotId
,
HospitalId
=
a
.
HospitalId
,
PersonnelName
=
a
.
PersonnelName
,
PersonnelNumber
=
a
.
PersonnelNumber
,
AttendanceName
=
tt
.
AttendanceName
,
TypeId
=
a
.
TypeId
,
BegDate
=
a
.
BegDate
,
EndDate
=
a
.
EndDate
,
Days
=
Convert
.
ToInt32
(
new
TimeSpan
(
Convert
.
ToDateTime
(
a
.
BegDate
).
Ticks
).
Subtract
(
new
TimeSpan
(
Convert
.
ToDateTime
(
a
.
EndDate
).
Ticks
)).
Duration
().
Days
)
+
1
};
return
data
.
ToList
();
}
public
ApiResponse
AttendanceBatch
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
var
dict
=
new
Dictionary
<
string
,
string
>();
Vacation
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
var
dicData
=
CreateDataRow
(
request
,
dict
);
if
(
dicData
==
null
||
dicData
.
Count
==
0
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"空数据,无效操作"
);
var
jsons
=
JsonHelper
.
Serialize
(
dicData
);
var
newAttendanceVacatione
=
JsonHelper
.
Deserialize
<
List
<
RecordAttendcance
>>(
jsons
);
var
oldAttendanceVacatione
=
perfoPperAttendanceVacationeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
var
per_employee
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
i
=
0
;
i
<
newAttendanceVacatione
.
Count
;
i
++)
{
if
(
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
PersonnelName
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
PersonnelNumber
?.
Trim
())
||
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
AttendanceName
?.
Trim
())
||
newAttendanceVacatione
[
i
].
BegDate
==
null
||
newAttendanceVacatione
[
i
].
EndDate
==
null
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"考勤类型"
,
newAttendanceVacatione
[
i
].
AttendanceName
??
""
},
{
"开始日期"
,
newAttendanceVacatione
[
i
].
BegDate
.
ToString
()??
""
},
{
"结束日期"
,
newAttendanceVacatione
[
i
].
EndDate
.
ToString
()??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"“关键信息缺失”请补全或删除"
},
});
}
if
(
newAttendanceVacatione
[
i
].
PersonnelName
!=
per_employee
.
FirstOrDefault
(
t
=>
t
.
PersonnelNumber
==
newAttendanceVacatione
[
i
].
PersonnelNumber
&&
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
)?.
DoctorName
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"考勤类型"
,
newAttendanceVacatione
[
i
].
AttendanceName
??
""
},
{
"开始日期"
,
newAttendanceVacatione
[
i
].
BegDate
.
ToString
()??
""
},
{
"结束日期"
,
newAttendanceVacatione
[
i
].
EndDate
.
ToString
()??
""
},
{
"来源"
,
"粘贴数据"
},
{
"错误原因"
,
"该人员与人员字典不一致或不存在"
},
});
}
var
oldEmp
=
oldAttendanceVacatione
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
newAttendanceVacatione
[
i
].
PersonnelNumber
);
if
(!
string
.
IsNullOrEmpty
(
newAttendanceVacatione
[
i
].
PersonnelName
)
&&
oldEmp
!=
null
&&
oldEmp
.
PersonnelName
!=
newAttendanceVacatione
[
i
].
PersonnelName
)
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"人员工号"
,
newAttendanceVacatione
[
i
].
PersonnelNumber
??
""
},
{
"人员姓名"
,
newAttendanceVacatione
[
i
].
PersonnelName
??
""
},
{
"考勤类型"
,
newAttendanceVacatione
[
i
].
AttendanceName
??
""
},
{
"开始日期"
,
newAttendanceVacatione
[
i
].
BegDate
.
ToString
()??
""
},
{
"结束日期"
,
newAttendanceVacatione
[
i
].
EndDate
.
ToString
()??
""
},
{
"来源"
,
"“粘贴数据”与“历史数据”比对"
},
{
"错误原因"
,
$"原名“
{
oldEmp
.
PersonnelName
}
”,工号相同但姓名不同,请删除“历史数据”中该员工"
},
});
}
}
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
List
<
per_attendance_vacation
>
addAttendanceVacatione
=
new
List
<
per_attendance_vacation
>();
List
<
per_attendance_vacation
>
deleteAttendanceVacatione
=
new
List
<
per_attendance_vacation
>();
var
type
=
GetAttendanceType
(
allotId
,
hospitalId
);
foreach
(
var
data
in
newAttendanceVacatione
)
{
data
.
AllotId
=
allotId
;
data
.
HospitalId
=
hospitalId
;
data
.
TypeId
=
type
.
FirstOrDefault
(
t
=>
t
.
AttendanceName
==
data
.
AttendanceName
).
Id
;
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
);
if
(
any
!=
null
)
deleteAttendanceVacatione
.
Add
(
any
);
}
if
(
deleteAttendanceVacatione
!=
null
&&
deleteAttendanceVacatione
.
Any
())
perfoPperAttendanceVacationeRepository
.
RemoveRange
(
deleteAttendanceVacatione
.
ToArray
());
if
(
addAttendanceVacatione
!=
null
&&
addAttendanceVacatione
.
Any
())
perfoPperAttendanceVacationeRepository
.
AddRange
(
addAttendanceVacatione
.
ToArray
());
return
new
ApiResponse
(
ResponseType
.
OK
,
""
);
}
#
endregion
public
void
GetAttendanceStatistics
(
int
allotId
,
int
hospitalId
)
{
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
)},
var
view_attendance
=
perforPerallotRepository
.
GetAttendance
(
allotId
);
//if (view_attendance == null || !view_attendance.Any()) return new AttendanceResponse<List<InitialAttendance>>();
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
;
}
}
}
var
Vacatione
=
perfoPperAttendanceVacationeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
).
GroupBy
(
t
=>
new
{
t
.
PersonnelNumber
,
t
.
TypeId
});
}
private
List
<
Dictionary
<
string
,
string
>>
CreateDataRow
(
SaveCollectData
request
,
Dictionary
<
string
,
string
>
config
)
{
List
<
Dictionary
<
string
,
string
>>
allData
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
r
=
0
;
r
<
request
.
Data
.
Length
;
r
++)
{
// 创建固定数据列
Dictionary
<
string
,
string
>
baseData
=
CreateBaseData
(
request
,
config
,
r
);
allData
.
Add
(
baseData
);
}
return
allData
;
}
private
Dictionary
<
string
,
string
>
CreateBaseData
(
SaveCollectData
request
,
Dictionary
<
string
,
string
>
config
,
int
rownumber
)
{
Dictionary
<
string
,
string
>
result
=
new
Dictionary
<
string
,
string
>();
for
(
int
c
=
0
;
c
<
request
.
ColHeaders
.
Length
;
c
++)
{
var
header
=
request
.
ColHeaders
[
c
];
var
first
=
config
.
FirstOrDefault
(
w
=>
w
.
Value
==
header
);
if
(!
default
(
KeyValuePair
<
string
,
string
>).
Equals
(
first
)
&&
!
result
.
ContainsKey
(
header
)
&&
request
.
Data
[
rownumber
].
Length
>
c
)
{
result
.
Add
(
first
.
Key
,
request
.
Data
[
rownumber
][
c
]);
}
}
return
result
;
}
public
static
List
<(
string
,
string
,
Func
<
per_attendance
,
object
>)>
Person
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
per_attendance
,
object
>)>
{
(
nameof
(
per_attendance
.
PersonnelName
),
"人员姓名"
,
t
=>
t
.
PersonnelName
),
(
nameof
(
per_attendance
.
PersonnelNumber
),
"员工工号"
,
t
=>
t
.
PersonnelNumber
),
(
nameof
(
per_attendance
.
CallInAccountingUnit
),
"调入核算单元"
,
t
=>
t
.
CallInAccountingUnit
),
(
nameof
(
per_attendance
.
CallInUnitType
),
"调入组别"
,
t
=>
t
.
CallInUnitType
),
(
nameof
(
per_attendance
.
CallInDate
),
"调入时间"
,
t
=>
t
.
CallInDate
),
};
public
static
List
<(
string
,
string
,
Func
<
RecordAttendcance
,
object
>)>
Vacation
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
RecordAttendcance
,
object
>)>
{
(
nameof
(
RecordAttendcance
.
PersonnelName
),
"人员姓名"
,
t
=>
t
.
PersonnelName
),
(
nameof
(
RecordAttendcance
.
PersonnelNumber
),
"员工工号"
,
t
=>
t
.
PersonnelNumber
),
(
nameof
(
RecordAttendcance
.
AttendanceName
),
"考勤类型"
,
t
=>
t
.
AttendanceName
),
(
nameof
(
RecordAttendcance
.
BegDate
),
"开始时间"
,
t
=>
t
.
BegDate
),
(
nameof
(
RecordAttendcance
.
EndDate
),
"结束时间"
,
t
=>
t
.
EndDate
),
};
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
)},
};
public
static
List
<
AttendaceHeads
>
CallinlAttendcanceHeads
{
get
;
}
=
new
List
<
AttendaceHeads
>
{
new
AttendaceHeads
{
Column
=
"人员姓名"
,
Name
=
nameof
(
per_attendance
.
PersonnelName
)},
new
AttendaceHeads
{
Column
=
"员工工号"
,
Name
=
nameof
(
per_attendance
.
PersonnelNumber
)},
new
AttendaceHeads
{
Column
=
"调入核算单元"
,
Name
=
nameof
(
per_attendance
.
CallInAccountingUnit
)},
new
AttendaceHeads
{
Column
=
"调入组别"
,
Name
=
nameof
(
per_attendance
.
CallInUnitType
)},
new
AttendaceHeads
{
Column
=
"调入时间"
,
Name
=
nameof
(
per_attendance
.
CallInDate
)},
};
}
}
}
performance/Performance.Services/PerExcelService/RecognitionDataFormat.cs
View file @
73da2c94
...
...
@@ -37,7 +37,7 @@ public class RecognitionDataFormat
{
DataFormat
.
百分比
,
new
[]
{
9
,
10
}
},
{
DataFormat
.
科学计数
,
new
[]
{
11
}
},
{
DataFormat
.
分数
,
new
[]
{
12
,
13
}
},
{
DataFormat
.
日期
,
new
[]
{
14
,
15
,
16
,
17
}
},
{
DataFormat
.
日期
YYYYMMDD
,
new
[]
{
14
,
15
,
16
,
17
}
},
};
public
static
DataFormat
GetDataFormat
(
short
type
)
...
...
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