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
200beeee
Commit
200beeee
authored
Apr 28, 2024
by
wyc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考勤类型(添加字段)/考勤类型(粘贴数据)
parent
93cf0e94
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
247 additions
and
3 deletions
+247
-3
performance/Performance.Api/Controllers/AttendanceController.cs
+21
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+12
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+30
-0
performance/Performance.EntityModels/Entity/per_attendance_type.cs
+13
-0
performance/Performance.EntityModels/Other/view_attendance.cs
+12
-0
performance/Performance.Services/AttendanceService.cs
+154
-1
performance/Performance.Services/CopyService.cs
+5
-2
No files found.
performance/Performance.Api/Controllers/AttendanceController.cs
View file @
200beeee
...
@@ -180,6 +180,27 @@ public ApiResponse DeleteAttendanceType(int id)
...
@@ -180,6 +180,27 @@ public ApiResponse DeleteAttendanceType(int id)
// 删除前需要验证当前类型是否被使用,如果被使用则禁止删除
// 删除前需要验证当前类型是否被使用,如果被使用则禁止删除
return
_attendanceService
.
DeleteAttendanceType
(
id
);
return
_attendanceService
.
DeleteAttendanceType
(
id
);
}
}
/// <summary>
/// 返回HandsonTable格式考勤类型
/// </summary>
/// <returns></returns>
[
HttpGet
(
"AttType"
)]
[
ProducesResponseType
(
typeof
(
HandsonTable
),
StatusCodes
.
Status200OK
)]
public
ApiResponse
GetAttendanceTypeHandsonTable
(
int
allotId
)
{
return
new
ApiResponse
(
ResponseType
.
OK
,
_attendanceService
.
GetAttendanceTypeHandsonTable
(
allotId
));
}
/// <summary>
/// 批量添加修改考勤类型(粘贴数据)
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"Type/{allotId}/Batch/{hospitalId}"
)]
public
ApiResponse
AttendanceTypeBatch
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
return
_attendanceService
.
AttendanceTypeBatch
(
allotId
,
hospitalId
,
request
);
}
/// <summary>
/// <summary>
/// 加载默认考勤类型
/// 加载默认考勤类型
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
200beeee
...
@@ -611,6 +611,18 @@
...
@@ -611,6 +611,18 @@
<param
name=
"id"
></param>
<param
name=
"id"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.GetAttendanceTypeHandsonTable(System.Int32)"
>
<summary>
返回HandsonTable格式考勤类型
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.AttendanceTypeBatch(System.Int32,System.Int32,Performance.DtoModels.SaveCollectData)"
>
<summary>
批量添加修改考勤类型(粘贴数据)
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.AttendanceReplenishment(System.Int32)"
>
<member
name=
"M:Performance.Api.Controllers.AttendanceController.AttendanceReplenishment(System.Int32)"
>
<summary>
<summary>
加载默认考勤类型
加载默认考勤类型
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
200beeee
...
@@ -6511,6 +6511,21 @@
...
@@ -6511,6 +6511,21 @@
是否默认值 0 非默认 1 默认
是否默认值 0 非默认 1 默认
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.Entity.per_attendance_type.RemarksOne"
>
<summary>
备注01
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Entity.per_attendance_type.RemarksTwo"
>
<summary>
备注02
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Entity.per_attendance_type.RemarksThree"
>
<summary>
备注03
</summary>
</member>
<member
name=
"T:Performance.EntityModels.per_apr_amount"
>
<member
name=
"T:Performance.EntityModels.per_apr_amount"
>
<summary>
<summary>
...
@@ -10461,6 +10476,21 @@
...
@@ -10461,6 +10476,21 @@
是否默认值 0 非默认 1 默认
是否默认值 0 非默认 1 默认
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.Other.AttendanceType.RemarksOne"
>
<summary>
备注01
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.AttendanceType.RemarksTwo"
>
<summary>
备注02
</summary>
</member>
<member
name=
"P:Performance.EntityModels.Other.AttendanceType.RemarksThree"
>
<summary>
备注03
</summary>
</member>
<member
name=
"P:Performance.EntityModels.HisData.HisDepartment"
>
<member
name=
"P:Performance.EntityModels.HisData.HisDepartment"
>
<summary>
<summary>
His科室
His科室
...
...
performance/Performance.EntityModels/Entity/per_attendance_type.cs
View file @
200beeee
...
@@ -19,5 +19,18 @@ public class per_attendance_type
...
@@ -19,5 +19,18 @@ public class per_attendance_type
/// 是否默认值 0 非默认 1 默认
/// 是否默认值 0 非默认 1 默认
/// </summary>
/// </summary>
public
int
IsDefault
{
get
;
set
;
}
public
int
IsDefault
{
get
;
set
;
}
/// <summary>
/// 备注01
/// </summary>
public
string
RemarksOne
{
get
;
set
;
}
/// <summary>
/// 备注02
/// </summary>
public
string
RemarksTwo
{
get
;
set
;
}
/// <summary>
/// 备注03
/// </summary>
public
string
RemarksThree
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Other/view_attendance.cs
View file @
200beeee
...
@@ -85,5 +85,17 @@ public class AttendanceType
...
@@ -85,5 +85,17 @@ public class AttendanceType
/// 是否默认值 0 非默认 1 默认
/// 是否默认值 0 非默认 1 默认
/// </summary>
/// </summary>
public
int
IsDefault
{
get
;
set
;
}
public
int
IsDefault
{
get
;
set
;
}
/// <summary>
/// 备注01
/// </summary>
public
string
RemarksOne
{
get
;
set
;
}
/// <summary>
/// 备注02
/// </summary>
public
string
RemarksTwo
{
get
;
set
;
}
/// <summary>
/// 备注03
/// </summary>
public
string
RemarksThree
{
get
;
set
;
}
}
}
}
}
performance/Performance.Services/AttendanceService.cs
View file @
200beeee
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
using
System.Linq.Expressions
;
using
System.Linq.Expressions
;
using
System.Reflection
;
using
System.Reflection
;
using
AutoMapper
;
using
AutoMapper
;
using
GraphQL
;
using
K4os.Hash.xxHash
;
using
K4os.Hash.xxHash
;
using
Masuit.Tools
;
using
Masuit.Tools
;
using
Masuit.Tools.Reflection
;
using
Masuit.Tools.Reflection
;
...
@@ -505,6 +506,16 @@ public ApiResponse AttendanceClearAll(int allotId)
...
@@ -505,6 +506,16 @@ public ApiResponse AttendanceClearAll(int allotId)
(
nameof
(
RecordAttendcance
.
BegDate
),
"开始时间"
,
t
=>
t
.
BegDate
),
(
nameof
(
RecordAttendcance
.
BegDate
),
"开始时间"
,
t
=>
t
.
BegDate
),
(
nameof
(
RecordAttendcance
.
EndDate
),
"结束时间"
,
t
=>
t
.
EndDate
),
(
nameof
(
RecordAttendcance
.
EndDate
),
"结束时间"
,
t
=>
t
.
EndDate
),
};
};
public
static
List
<(
string
,
string
,
Func
<
per_attendance_type
,
object
>)>
AttTypes
{
get
;
}
=
new
List
<(
string
,
string
,
Func
<
per_attendance_type
,
object
>)>
{
(
nameof
(
per_attendance_type
.
AttendanceName
),
"考勤类型名称"
,
t
=>
t
.
AttendanceName
),
(
nameof
(
per_attendance_type
.
IsDeduction
),
"是否核减出勤"
,
t
=>
t
.
IsDeduction
),
(
nameof
(
per_attendance_type
.
IsDefault
),
"是否默认值"
,
t
=>
t
.
IsDefault
),
(
nameof
(
per_attendance_type
.
RemarksOne
),
"备注01"
,
t
=>
t
.
RemarksOne
),
(
nameof
(
per_attendance_type
.
RemarksTwo
),
"备注02"
,
t
=>
t
.
RemarksTwo
),
(
nameof
(
per_attendance_type
.
RemarksThree
),
"备注03"
,
t
=>
t
.
RemarksThree
),
};
#
endregion
#
endregion
#
region
考勤类型
#
region
考勤类型
...
@@ -540,6 +551,9 @@ public ApiResponse<AttendanceType> InsertAttendanceType(int allotId, AttendanceT
...
@@ -540,6 +551,9 @@ public ApiResponse<AttendanceType> InsertAttendanceType(int allotId, AttendanceT
per_Attendance_Type
.
AttendanceName
=
attendanceType
.
AttendanceName
;
per_Attendance_Type
.
AttendanceName
=
attendanceType
.
AttendanceName
;
per_Attendance_Type
.
IsDeduction
=
attendanceType
.
IsDeduction
;
per_Attendance_Type
.
IsDeduction
=
attendanceType
.
IsDeduction
;
per_Attendance_Type
.
IsDefault
=
attendanceType
.
IsDefault
;
per_Attendance_Type
.
IsDefault
=
attendanceType
.
IsDefault
;
per_Attendance_Type
.
RemarksOne
=
attendanceType
.
RemarksOne
;
per_Attendance_Type
.
RemarksTwo
=
attendanceType
.
RemarksTwo
;
per_Attendance_Type
.
RemarksThree
=
attendanceType
.
RemarksThree
;
if
(
perfoPperAttendanceTypeRepository
.
Update
(
per_Attendance_Type
))
if
(
perfoPperAttendanceTypeRepository
.
Update
(
per_Attendance_Type
))
return
new
ApiResponse
<
AttendanceType
>(
ResponseType
.
OK
,
"修改成功"
);
return
new
ApiResponse
<
AttendanceType
>(
ResponseType
.
OK
,
"修改成功"
);
...
@@ -553,7 +567,10 @@ public ApiResponse<AttendanceType> InsertAttendanceType(int allotId, AttendanceT
...
@@ -553,7 +567,10 @@ public ApiResponse<AttendanceType> InsertAttendanceType(int allotId, AttendanceT
HospitalId
=
allot
.
HospitalId
,
HospitalId
=
allot
.
HospitalId
,
AttendanceName
=
attendanceType
.
AttendanceName
,
AttendanceName
=
attendanceType
.
AttendanceName
,
IsDeduction
=
attendanceType
.
IsDeduction
,
IsDeduction
=
attendanceType
.
IsDeduction
,
IsDefault
=
attendanceType
.
IsDefault
IsDefault
=
attendanceType
.
IsDefault
,
RemarksOne
=
attendanceType
.
RemarksOne
,
RemarksTwo
=
attendanceType
.
RemarksTwo
,
RemarksThree
=
attendanceType
.
RemarksThree
,
};
};
if
(
perfoPperAttendanceTypeRepository
.
Add
(
per_Attendance_Type
))
if
(
perfoPperAttendanceTypeRepository
.
Add
(
per_Attendance_Type
))
return
new
ApiResponse
<
AttendanceType
>(
ResponseType
.
OK
,
"添加成功"
);
return
new
ApiResponse
<
AttendanceType
>(
ResponseType
.
OK
,
"添加成功"
);
...
@@ -576,6 +593,142 @@ public ApiResponse DeleteAttendanceType(int id)
...
@@ -576,6 +593,142 @@ public ApiResponse DeleteAttendanceType(int id)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"删除失败"
);
:
new
ApiResponse
(
ResponseType
.
Fail
,
"删除失败"
);
}
}
/// <summary>
/// <summary>
/// 返回HandsonTable格式考勤类型
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
HandsonTableBase
GetAttendanceTypeHandsonTable
(
int
allotId
)
{
HandsonTableBase
handson
=
new
HandsonTableBase
()
{
Columns
=
AttTypes
.
Select
(
t
=>
new
HandsonColumn
(
t
.
Item2
)).
ToList
(),
ColHeaders
=
AttTypes
.
Select
(
c
=>
c
.
Item2
).
ToList
(),
};
if
(
handson
.
Columns
!=
null
&&
handson
.
Columns
.
Any
())
{
foreach
(
var
column
in
handson
.
Columns
)
{
column
.
Type
=
"text"
;
if
(
column
.
Data
==
"是否核减出勤"
||
column
.
Data
==
"是否默认值"
)
{
column
.
Type
=
"autocomplete"
;
column
.
Source
=
new
string
[]
{
"是"
,
"否"
};
}
}
}
var
convertDate
=
GetAttendanceType
(
allotId
).
Data
.
Select
(
t
=>
new
{
t
.
AttendanceName
,
t
.
IsDeduction
,
t
.
IsDefault
,
t
.
RemarksOne
,
t
.
RemarksTwo
,
t
.
RemarksThree
,
});
if
(!
convertDate
.
Any
())
return
handson
;
List
<
HandsonRowData
>
rowDatas
=
new
List
<
HandsonRowData
>();
int
i
=
1
;
var
dict
=
new
Dictionary
<
string
,
string
>();
AttTypes
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
foreach
(
var
item
in
convertDate
)
{
var
json
=
JsonHelper
.
Serialize
(
item
);
var
firstDic
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
string
>>(
json
);
var
cells
=
(
from
conf
in
dict
join
fst
in
firstDic
on
conf
.
Key
.
ToUpper
()
equals
fst
.
Key
.
ToUpper
()
select
new
HandsonCellData
(
conf
.
Value
,
fst
.
Value
)).
ToList
();
rowDatas
.
Add
(
new
HandsonRowData
(
i
,
cells
));
i
++;
}
handson
.
SetRowData
(
rowDatas
);
foreach
(
var
item
in
handson
.
Data
)
{
item
.
Remove
(
"编号"
);
if
(
item
.
ContainsKey
(
"是否核减出勤"
)
&&
int
.
TryParse
(
item
[
"是否核减出勤"
].
ToString
(),
out
int
IsDeduction
))
{
item
[
"是否核减出勤"
]
=
(
IsDeduction
==
1
)
?
"是"
:
"否"
;
}
if
(
item
.
ContainsKey
(
"是否默认值"
)
&&
int
.
TryParse
(
item
[
"是否默认值"
].
ToString
(),
out
int
IsDefault
))
{
item
[
"是否默认值"
]
=
(
IsDefault
==
1
)
?
"是"
:
"否"
;
}
}
return
handson
;
}
/// <summary>
/// 批量添加修改考勤类型(粘贴数据)
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <param name="request"></param>
/// <returns></returns>
public
ApiResponse
AttendanceTypeBatch
(
int
allotId
,
int
hospitalId
,
SaveCollectData
request
)
{
var
dict
=
new
Dictionary
<
string
,
string
>();
AttTypes
.
ForEach
(
t
=>
dict
.
Add
(
t
.
Item1
,
t
.
Item2
));
var
dicData
=
CreateDataRow
(
request
,
dict
);
if
(
dicData
==
null
||
dicData
.
Count
==
0
)
return
new
ApiResponse
(
ResponseType
.
Error
,
"空数据,无效操作"
);
foreach
(
var
item
in
dicData
)
{
if
(
item
.
ContainsKey
(
"IsDeduction"
)
&&
item
[
"IsDeduction"
]
is
string
IsDeduction
)
{
item
[
"IsDeduction"
]
=
(
IsDeduction
==
"是"
)
?
"1"
:
"0"
;
}
if
(
item
.
ContainsKey
(
"IsDefault"
)
&&
item
[
"IsDefault"
]
is
string
IsDefault
)
{
item
[
"IsDefault"
]
=
(
IsDefault
==
"是"
)
?
"1"
:
"0"
;
}
}
var
jsons
=
JsonHelper
.
Serialize
(
dicData
);
var
newAttendanceType
=
JsonHelper
.
Deserialize
<
List
<
per_attendance_type
>>(
jsons
);
var
oldAttendanceType
=
perfoPperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
HospitalId
==
hospitalId
);
List
<
Dictionary
<
string
,
string
>>
error
=
new
List
<
Dictionary
<
string
,
string
>>();
for
(
int
i
=
0
;
i
<
newAttendanceType
.
Count
;
i
++)
{
if
(
string
.
IsNullOrEmpty
(
newAttendanceType
[
i
].
AttendanceName
?.
Trim
()))
{
error
.
Add
(
new
Dictionary
<
string
,
string
>
{
{
"行号"
,
$"第
{
i
+
1
}
行"
},
{
"考勤类型名称"
,
newAttendanceType
[
i
].
AttendanceName
??
""
},
{
"错误原因"
,
"“考勤类型名称”请补全"
},
});
}
}
if
(
error
.
Count
>
0
)
return
new
ApiResponse
(
ResponseType
.
WarningTable
,
"验证不通过,当前操作已拒绝"
,
error
);
List
<
per_attendance_type
>
addAttendanceType
=
new
List
<
per_attendance_type
>();
foreach
(
var
data
in
newAttendanceType
)
{
data
.
AllotId
=
allotId
;
data
.
HospitalId
=
hospitalId
;
addAttendanceType
.
Add
(
data
);
}
perfoPperAttendanceTypeRepository
.
RemoveRange
(
oldAttendanceType
.
ToArray
());
perfoPperAttendanceTypeRepository
.
AddRange
(
newAttendanceType
.
ToArray
());
return
new
ApiResponse
(
ResponseType
.
OK
,
""
);
}
/// <summary>
/// 加载默认考勤类型
/// 加载默认考勤类型
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
...
...
performance/Performance.Services/CopyService.cs
View file @
200beeee
...
@@ -313,13 +313,13 @@ public void Copy_Empdetail(per_allot allot, int prevAllotId, bool delHistotyData
...
@@ -313,13 +313,13 @@ public void Copy_Empdetail(per_allot allot, int prevAllotId, bool delHistotyData
}
}
}
}
/// <summary>
/// <summary>
/// 加载上月(考勤类型
--- 考勤上报详情
)
/// 加载上月(考勤类型 )
/// </summary>
/// </summary>
/// <param name="allot">当前绩效</param>
/// <param name="allot">当前绩效</param>
/// <param name="prevAllotId">上月绩效Id</param>
/// <param name="prevAllotId">上月绩效Id</param>
public
void
Copy_AttendanceType
(
per_allot
allot
,
int
prevAllotId
)
public
void
Copy_AttendanceType
(
per_allot
allot
,
int
prevAllotId
)
{
{
_logger
.
LogInformation
(
$"
copy attendanceType
"
);
_logger
.
LogInformation
(
$"
加载上月 考勤类型(per_attendance_type)和考勤上报(per_attendance_dept)
"
);
var
attendanceTypes
=
_pperAttendanceTypeRepository
.
GetEntities
(
g
=>
g
.
AllotId
==
prevAllotId
||
g
.
AllotId
==
allot
.
ID
)
??
new
List
<
per_attendance_type
>();
var
attendanceTypes
=
_pperAttendanceTypeRepository
.
GetEntities
(
g
=>
g
.
AllotId
==
prevAllotId
||
g
.
AllotId
==
allot
.
ID
)
??
new
List
<
per_attendance_type
>();
//查询上月有没有类型,没有就跳过
//查询上月有没有类型,没有就跳过
var
prevAttTypes
=
attendanceTypes
.
Where
(
w
=>
w
.
AllotId
==
prevAllotId
).
ToList
();
var
prevAttTypes
=
attendanceTypes
.
Where
(
w
=>
w
.
AllotId
==
prevAllotId
).
ToList
();
...
@@ -339,6 +339,9 @@ public void Copy_AttendanceType(per_allot allot, int prevAllotId)
...
@@ -339,6 +339,9 @@ public void Copy_AttendanceType(per_allot allot, int prevAllotId)
HospitalId
=
t
.
HospitalId
,
HospitalId
=
t
.
HospitalId
,
IsDeduction
=
t
.
IsDeduction
,
IsDeduction
=
t
.
IsDeduction
,
IsDefault
=
t
.
IsDefault
,
IsDefault
=
t
.
IsDefault
,
RemarksOne
=
t
.
RemarksOne
,
RemarksTwo
=
t
.
RemarksTwo
,
RemarksThree
=
t
.
RemarksThree
,
}).
ToList
();
}).
ToList
();
var
successfulType
=
_pperAttendanceTypeRepository
.
AddRange
(
newAttTypes
.
ToArray
());
var
successfulType
=
_pperAttendanceTypeRepository
.
AddRange
(
newAttTypes
.
ToArray
());
if
(
successfulType
)
if
(
successfulType
)
...
...
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