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
62001c29
Commit
62001c29
authored
Apr 12, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考勤下发比对变化BUG修复
parent
9dc64c89
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
39 deletions
+106
-39
performance/Performance.Api/Controllers/ConfigController.cs
+1
-0
performance/Performance.DtoModels/PerAttendanceIssueDto.cs
+3
-0
performance/Performance.Services/AttendanceService.cs
+65
-37
performance/Performance.Services/ConfigService.cs
+6
-1
performance/Performance.Services/CopyService.cs
+31
-1
No files found.
performance/Performance.Api/Controllers/ConfigController.cs
View file @
62001c29
...
...
@@ -901,6 +901,7 @@ public ApiResponse CopyDropDown()
//new CopyDrop{Label="收入费用类别",Value="drugTypes"},
new
CopyDrop
{
Label
=
"支出费用类别"
,
Value
=
"drugTypeDisburses"
},
new
CopyDrop
{
Label
=
"费用类别系数"
,
Value
=
"drugTypeFactors"
},
new
CopyDrop
{
Label
=
"考勤类型"
,
Value
=
"attendanceType"
},
//new CopyDrop{Label="科室类型",Value="deptTypes"},
new
CopyDrop
{
Label
=
"二次绩效配置"
,
Value
=
"agains"
},
};
...
...
performance/Performance.DtoModels/PerAttendanceIssueDto.cs
View file @
62001c29
...
...
@@ -14,6 +14,7 @@ public PerAttendanceIssueDto()
{
}
public
PerAttendanceIssueDto
(
AttendanceStatistics
item
)
{
Id
=
0
;
Code
=
item
.
Code
;
UnitType
=
item
.
UnitType
;
AccountingUnit
=
item
.
AccountingUnit
;
...
...
@@ -32,6 +33,7 @@ public PerAttendanceIssueDto(AttendanceStatistics item)
public
PerAttendanceIssueDto
(
per_attendance_issue
item
)
{
Id
=
item
.
Id
;
Code
=
item
.
Code
;
UnitType
=
item
.
UnitType
;
AccountingUnit
=
item
.
AccountingUnit
;
...
...
@@ -50,6 +52,7 @@ public PerAttendanceIssueDto(per_attendance_issue item)
//public int HospitalId { get; set; } //医院Id
//public int AllotId { get; set; } //绩效Id
public
int
Id
{
get
;
set
;
}
public
string
Code
{
get
;
set
;
}
//核算单元编码
/// <summary>
/// 人员类别
...
...
performance/Performance.Services/AttendanceService.cs
View file @
62001c29
using
AutoMapper
;
using
GraphQL
;
using
MassTransit
;
using
MassTransit.Internals.Extensions
;
using
Microsoft.AspNetCore.Routing
;
using
Microsoft.Extensions.Logging
;
...
...
@@ -377,6 +378,10 @@ public ApiResponse AttendanceAdd(int allotId, AttendanceData request)
{
data
.
CallInDate
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
);
}
if
(!
request
.
CallInDate
.
HasValue
||
request
.
CallInDate
.
Value
<
new
DateTime
(
1970
,
1
,
1
))
{
data
.
CallInDate
=
new
DateTime
(
allot
.
Year
,
allot
.
Month
,
1
);
}
perforPerAttendanceRepository
.
Add
(
data
);
return
new
ApiResponse
(
ResponseType
.
OK
);
...
...
@@ -1019,6 +1024,7 @@ public ApiResponse<List<AttendanceAuditDetail>> AuditDetail(int allotId, string
}
stat
.
Detial
.
InsertRange
(
0
,
detail
);
}
items
=
items
.
OrderBy
(
w
=>
w
.
PersonnelNumber
).
ThenBy
(
w
=>
w
.
BeginDate
).
ToList
();
return
new
ApiResponse
<
List
<
AttendanceAuditDetail
>>(
ResponseType
.
OK
,
items
);
}
// 最终考勤结果下发(预确认显示)
...
...
@@ -1044,32 +1050,51 @@ public ApiResponse<List<PerAttendanceIssueDto>> PreConfirmationDisplay(int allot
issue
.
NoDeductionDays
==
statistic
.
Detial
.
Where
(
w
=>
!
w
.
Remark
.
Equals
(
"核减"
)).
Sum
(
w
=>
w
.
Value
);
return
result
;
};
foreach
(
var
item
in
statistics
.
Select
(
w
=>
new
{
PersonnelNumber
=
w
.
PersonnelNumber
,
Code
=
w
.
Code
}
))
foreach
(
var
personnelNumber
in
statistics
.
Select
(
w
=>
w
.
PersonnelNumber
).
Distinct
(
))
{
var
staticPersonnel
=
statistics
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
item
.
PersonnelNumber
&&
w
.
Code
==
item
.
Code
);
var
issuePersonnel
=
issues
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
item
.
PersonnelNumber
&&
w
.
Code
==
item
.
Code
);
// 按在科时间排序,重要
var
staticPersonnels
=
statistics
.
Where
(
w
=>
w
.
PersonnelNumber
==
personnelNumber
).
OrderBy
(
w
=>
w
.
BeginDate
).
ToList
();
var
issuePersonnels
=
issues
.
Where
(
w
=>
w
.
PersonnelNumber
==
personnelNumber
).
OrderBy
(
w
=>
w
.
BeginDate
).
ToList
();
if
(
issuePersonnel
==
null
)
foreach
(
var
item
in
staticPersonnels
.
Select
((
sp
,
index
)
=>
(
sp
,
index
))
)
{
issuedates
.
Add
(
new
PerAttendanceIssueDto
(
staticPersonnel
));
// 按索引下标来判断 额外多出的都是要删除的
var
deleteIndex
=
issuePersonnels
.
Count
()
-
staticPersonnels
.
Count
();
if
(
deleteIndex
>
0
)
{
var
deleteIssuePersonnels
=
issuePersonnels
.
Skip
(
staticPersonnels
.
Count
()).
Take
(
deleteIndex
).
ToList
();
scStatistics
.
AddRange
(
deleteIssuePersonnels
);
}
}
else
if
(
staticPersonnel
!=
null
&&
issuePersonnel
!=
null
)
{
if
(
func
(
issuePersonnel
,
staticPersonnel
))
continue
;
issuedates
.
Add
(
new
PerAttendanceIssueDto
(
staticPersonnel
)
// 条数满足修改条件
if
(
issuePersonnels
.
Count
()
>
item
.
index
)
{
PersonnelName
=
issuePersonnel
.
PersonnelName
,
PersonnelNumber
=
issuePersonnel
.
PersonnelNumber
,
OperationType
=
(
int
)
Attendance
.
OperationType
.
修改
,
Remarks
=
"修改数据"
,
});
var
issuePersonnel
=
issuePersonnels
.
ElementAt
(
item
.
index
);
if
(
func
(
issuePersonnel
,
item
.
sp
))
continue
;
issuedates
.
Add
(
new
PerAttendanceIssueDto
(
item
.
sp
)
{
Id
=
issuePersonnel
.
Id
,
PersonnelName
=
issuePersonnel
.
PersonnelName
,
PersonnelNumber
=
issuePersonnel
.
PersonnelNumber
,
OperationType
=
(
int
)
Attendance
.
OperationType
.
修改
,
Remarks
=
"修改数据"
,
});
}
// 否则新增
else
{
issuedates
.
Add
(
new
PerAttendanceIssueDto
(
item
.
sp
));
}
}
}
if
(
scStatistics
.
Any
())
{
foreach
(
var
report
in
scStatistics
)
issuedates
.
Add
(
new
PerAttendanceIssueDto
(
report
));
foreach
(
var
deleteItem
in
scStatistics
)
{
if
(!
issuedates
.
Any
(
w
=>
w
.
Id
==
deleteItem
.
Id
))
issuedates
.
Add
(
new
PerAttendanceIssueDto
(
deleteItem
));
}
}
if
(!
string
.
IsNullOrEmpty
(
unitType
))
issuedates
=
issuedates
.
Where
(
w
=>
w
.
UnitType
.
Contains
(
unitType
)).
ToList
();
...
...
@@ -1094,7 +1119,7 @@ public ApiResponse IssueStatistics(int allotId, int userid, string realName, str
var
insertIssues
=
preConfirmationDisplay
.
Where
(
w
=>
w
.
OperationType
==
(
int
)
Attendance
.
OperationType
.
新增
).
ToList
();
var
updateIssues
=
preConfirmationDisplay
.
Where
(
w
=>
w
.
OperationType
==
(
int
)
Attendance
.
OperationType
.
修改
).
ToList
();
var
deleteIssues
=
preConfirmationDisplay
.
Where
(
w
=>
w
.
OperationType
==
(
int
)
Attendance
.
OperationType
.
删除
).
Select
(
s
=>
s
.
PersonnelNumber
).
ToList
();
var
deleteIssues
=
preConfirmationDisplay
.
Where
(
w
=>
w
.
OperationType
==
(
int
)
Attendance
.
OperationType
.
删除
).
Select
(
w
=>
w
.
Id
).
ToList
();
if
(
insertIssues
.
Any
())
{
var
inserts
=
insertIssues
.
Select
(
item
=>
...
...
@@ -1127,30 +1152,33 @@ public ApiResponse IssueStatistics(int allotId, int userid, string realName, str
List
<
per_attendance_issue
>
updateIssuedates
=
new
List
<
per_attendance_issue
>();
foreach
(
var
item
in
updateIssues
)
{
var
issuePersonnel
=
issues
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
item
.
PersonnelNumber
&&
w
.
Code
==
item
.
Code
);
issuePersonnel
.
UnitType
=
item
.
UnitType
;
issuePersonnel
.
AccountingUnit
=
item
.
AccountingUnit
;
issuePersonnel
.
PermanentStaff
=
item
.
PermanentStaff
;
issuePersonnel
.
Code
=
item
.
Code
;
issuePersonnel
.
BeginDate
=
item
.
BeginDate
;
issuePersonnel
.
EndDate
=
item
.
EndDate
;
issuePersonnel
.
DeductionDays
=
item
.
DeductionDays
;
issuePersonnel
.
NoDeductionDays
=
item
.
NoDeductionDays
;
issuePersonnel
.
AttendanceDays
=
item
.
AttendanceDays
;
issuePersonnel
.
WorkFullDays
=
item
.
AttendanceDays
+
item
.
DeductionDays
;
issuePersonnel
.
State
=
(
int
)
Attendance
.
State
.
未确认
;
issuePersonnel
.
CreateUser
=
realName
;
issuePersonnel
.
CreateTime
=
DateTime
.
Now
;
issuePersonnel
.
ConfirmUser
=
""
;
issuePersonnel
.
ConfirmTime
=
null
;
issuePersonnel
.
Remarks
=
""
;
updateIssuedates
.
Add
(
issuePersonnel
);
var
issuePersonnel
=
issues
.
FirstOrDefault
(
w
=>
w
.
Id
==
item
.
Id
);
if
(
issuePersonnel
!=
null
)
{
issuePersonnel
.
UnitType
=
item
.
UnitType
;
issuePersonnel
.
AccountingUnit
=
item
.
AccountingUnit
;
issuePersonnel
.
PermanentStaff
=
item
.
PermanentStaff
;
issuePersonnel
.
Code
=
item
.
Code
;
issuePersonnel
.
BeginDate
=
item
.
BeginDate
;
issuePersonnel
.
EndDate
=
item
.
EndDate
;
issuePersonnel
.
DeductionDays
=
item
.
DeductionDays
;
issuePersonnel
.
NoDeductionDays
=
item
.
NoDeductionDays
;
issuePersonnel
.
AttendanceDays
=
item
.
AttendanceDays
;
issuePersonnel
.
WorkFullDays
=
item
.
AttendanceDays
+
item
.
DeductionDays
;
issuePersonnel
.
State
=
(
int
)
Attendance
.
State
.
未确认
;
issuePersonnel
.
CreateUser
=
realName
;
issuePersonnel
.
CreateTime
=
DateTime
.
Now
;
issuePersonnel
.
ConfirmUser
=
""
;
issuePersonnel
.
ConfirmTime
=
null
;
issuePersonnel
.
Remarks
=
""
;
updateIssuedates
.
Add
(
issuePersonnel
);
}
}
perforPerAttendanceIssueRepository
.
UpdateRange
(
updateIssuedates
.
ToArray
());
}
if
(
deleteIssues
.
Any
())
{
var
deletePersonnel
=
issues
.
Where
(
w
=>
deleteIssues
.
Contains
(
w
.
PersonnelNumber
)).
ToList
();
var
deletePersonnel
=
issues
.
Where
(
w
=>
deleteIssues
.
Contains
(
w
.
Id
)).
ToList
();
perforPerAttendanceIssueRepository
.
RemoveRange
(
deletePersonnel
.
ToArray
());
}
...
...
performance/Performance.Services/ConfigService.cs
View file @
62001c29
...
...
@@ -738,7 +738,11 @@ public ApiResponse BatchSaveAccounting(int allotId, SaveCollectData request)
/// <param name="iD"></param>
public
void
Copy
(
per_allot
allot
)
{
NewCopy
(
new
CopyRequest
()
{
AllotId
=
allot
.
ID
,
Type
=
new
[]
{
"personnels"
,
"workItems"
,
"drugTypeDisburses"
,
"drugTypeFactors"
,
"deptTypes"
,
"agains"
,
"accountings"
,
"department"
}
});
NewCopy
(
new
CopyRequest
()
{
AllotId
=
allot
.
ID
,
Type
=
new
[]
{
"personnels"
,
"workItems"
,
"drugTypeDisburses"
,
"drugTypeFactors"
,
"deptTypes"
,
"agains"
,
"accountings"
,
"department"
,
"attendanceType"
}
});
}
//todo:新copy
...
...
@@ -764,6 +768,7 @@ public void NewCopy(CopyRequest request)
{
"deptTypes"
,
(
allot
,
prevAllotId
)
=>
_copyService
.
Copy_DeptTypes
(
allot
,
prevAllotId
,
delHistotyData
:
true
)
},
{
"agains"
,
(
allot
,
prevAllotId
)
=>
_copyService
.
Copy_Agains
(
allot
,
prevAllotId
,
delHistotyData
:
true
)
},
{
"accountings"
,
(
allot
,
prevAllotId
)
=>
_copyService
.
Copy_Accountings
(
allot
,
prevAllotId
,
delHistotyData
:
true
)
},
{
"attendanceType"
,
(
allot
,
prevAllotId
)
=>
_copyService
.
Copy_AttendanceType
(
allot
,
prevAllotId
,
delHistotyData
:
true
)
},
{
"department"
,
(
allot
,
prevAllotId
)
=>
_copyService
.
Copy_DeptDic
(
allot
,
prevAllotId
,
delHistotyData
:
true
)
},
};
...
...
performance/Performance.Services/CopyService.cs
View file @
62001c29
using
Microsoft.Extensions.Logging
;
using
Performance.EntityModels
;
using
Performance.EntityModels.Entity
;
using
Performance.Repository
;
using
Performance.Repository.Repository
;
using
System
;
using
System.Linq
;
using
static
Performance
.
DtoModels
.
Attendance
;
namespace
Performance.Services
{
...
...
@@ -18,6 +20,7 @@ public class CopyService : IAutoInjection
private
readonly
PerforCofaccountingRepository
_cofaccountingRepository
;
private
readonly
PerforCofdrugtypeDisburseRepository
_drugtypeDisburseRepository
;
private
readonly
PerforCofdrugtypefactorRepository
_cofdrugtypefactorRepository
;
private
readonly
PerfoPperAttendanceTypeRepository
_pperAttendanceTypeRepository
;
public
CopyService
(
ILogger
<
ConfigService
>
logger
,
...
...
@@ -28,7 +31,8 @@ public class CopyService : IAutoInjection
PerforCofdepttypeRepository
perforCofdepttypeRepository
,
PerforCofaccountingRepository
cofaccountingRepository
,
PerforCofdrugtypeDisburseRepository
drugtypeDisburseRepository
,
PerforCofdrugtypefactorRepository
cofdrugtypefactorRepository
)
PerforCofdrugtypefactorRepository
cofdrugtypefactorRepository
,
PerfoPperAttendanceTypeRepository
pperAttendanceTypeRepository
)
{
_logger
=
logger
;
_perdeptdicRepository
=
perdeptdicRepository
;
...
...
@@ -39,6 +43,7 @@ public class CopyService : IAutoInjection
_cofaccountingRepository
=
cofaccountingRepository
;
_drugtypeDisburseRepository
=
drugtypeDisburseRepository
;
_cofdrugtypefactorRepository
=
cofdrugtypefactorRepository
;
_pperAttendanceTypeRepository
=
pperAttendanceTypeRepository
;
}
...
...
@@ -235,5 +240,30 @@ public void Copy_DeptDic(per_allot allot, int prevAllotId, bool delHistotyData =
}
}
public
void
Copy_AttendanceType
(
per_allot
allot
,
int
prevAllotId
,
bool
delHistotyData
=
false
)
{
var
flag
=
delHistotyData
;
_logger
.
LogInformation
(
$"copy attendanceType"
);
var
attendanceTypes
=
_pperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allot
.
ID
);
if
(
delHistotyData
&&
attendanceTypes
!=
null
&&
attendanceTypes
.
Any
())
flag
=
_pperAttendanceTypeRepository
.
RemoveRange
(
attendanceTypes
.
ToArray
());
if
(
flag
||
attendanceTypes
==
null
||
!
attendanceTypes
.
Any
())
{
attendanceTypes
=
_pperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
prevAllotId
)
??
_pperAttendanceTypeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
-
1
);
if
(
attendanceTypes
!=
null
&&
attendanceTypes
.
Any
())
{
var
newAttendanceTypes
=
attendanceTypes
.
Select
(
t
=>
new
per_attendance_type
{
AllotId
=
allot
.
ID
,
AttendanceName
=
t
.
AttendanceName
,
HospitalId
=
t
.
HospitalId
,
IsDeduction
=
t
.
IsDeduction
});
_pperAttendanceTypeRepository
.
AddRange
(
newAttendanceTypes
.
ToArray
());
}
}
}
}
}
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