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
bec0973f
Commit
bec0973f
authored
Apr 11, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
H5页面接口
parent
f6704bd6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
157 additions
and
105 deletions
+157
-105
performance/Performance.Api/Controllers/AllotController.cs
+1
-90
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+5
-0
performance/Performance.DtoModels/Response/OwnerPerformanceDto.cs
+4
-0
performance/Performance.EntityModels/Entity/per_allot.cs
+4
-0
performance/Performance.EntityModels/Entity/per_batch.cs
+1
-1
performance/Performance.Repository/PerforReportRepository .cs
+1
-1
performance/Performance.Services/AllotService.cs
+136
-13
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
bec0973f
...
...
@@ -575,96 +575,7 @@ public ApiResponse GetOwnerMobilePerformance(string begin = "", string end = "")
throw
new
PerformanceException
(
"您选择的时间范围无效"
);
endDate
=
endDate
.
AddMonths
(
1
);
List
<
OwnerMobilePerformanceDto
>
dtos
=
new
List
<
OwnerMobilePerformanceDto
>();
var
datas
=
_allotService
.
GetOwnerPerformance
(
userid
);
var
groupDatas
=
datas
.
Where
(
w
=>
(
new
DateTime
(
w
.
Year
,
w
.
Month
,
1
))
>=
beginDate
&&
(
new
DateTime
(
w
.
Year
,
w
.
Month
,
1
))
<
endDate
)
.
GroupBy
(
w
=>
w
.
JobNumber
);
foreach
(
var
item
in
groupDatas
)
{
var
perforSumFee
=
new
OwnerMobileItemDto
{
Title
=
"业绩绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
PerforSumFee
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
PerforSumFee
??
0
)
!=
0
)
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
AccountingUnit
,
Amount
=
w
.
PerforSumFee
??
0
,
}).
ToList
()
};
var
perforManagementFee
=
new
OwnerMobileItemDto
{
Title
=
"管理绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
PerforManagementFee
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
PerforManagementFee
??
0
)
!=
0
)
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
AccountingUnit
,
Amount
=
w
.
PerforManagementFee
??
0
,
}).
ToList
()
};
var
nightWorkPerfor
=
new
OwnerMobileItemDto
{
Title
=
"夜班绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
NightWorkPerfor
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
NightWorkPerfor
??
0
)
!=
0
)
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
AccountingUnit
,
Amount
=
w
.
NightWorkPerfor
??
0
,
}).
ToList
()
};
var
otherPerfor
=
new
OwnerMobileItemDto
{
Title
=
"医院其他绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
OtherPerfor
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
OtherPerfor
??
0
)
!=
0
)
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
SourceItem
,
Amount
=
w
.
OtherPerfor
??
0
,
}).
ToList
()
};
var
hideOtherPerfor
=
new
OwnerMobileItemDto
{
Title
=
"不公示其他绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
HideOtherPerfor
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
HideOtherPerfor
??
0
)
!=
0
)
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
SourceItem
,
Amount
=
w
.
HideOtherPerfor
??
0
,
}).
ToList
()
};
var
reservedRatioFee
=
new
OwnerMobileItemDto
{
Title
=
"预留绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
ReservedRatioFee
)
??
0
,
Details
=
new
List
<
OwnerMobileItemDetailDto
>()
};
var
dto
=
new
OwnerMobilePerformanceDto
{
Total
=
item
.
Sum
(
w
=>
w
.
RealGiveFee
),
Items
=
new
List
<
OwnerMobileItemDto
>()
};
if
(
perforSumFee
.
Amount
!=
0
)
dto
.
Items
.
Add
(
perforSumFee
);
if
(
perforManagementFee
.
Amount
!=
0
)
dto
.
Items
.
Add
(
perforManagementFee
);
if
(
nightWorkPerfor
.
Amount
!=
0
)
dto
.
Items
.
Add
(
nightWorkPerfor
);
if
(
otherPerfor
.
Amount
!=
0
)
dto
.
Items
.
Add
(
otherPerfor
);
if
(
hideOtherPerfor
.
Amount
!=
0
)
dto
.
Items
.
Add
(
hideOtherPerfor
);
if
(
reservedRatioFee
.
Amount
!=
0
)
dto
.
Items
.
Add
(
reservedRatioFee
);
dtos
.
Add
(
dto
);
}
var
dtos
=
_allotService
.
GetOwnerMobilePerformance
(
userid
,
beginDate
,
endDate
);
return
new
ApiResponse
(
ResponseType
.
OK
,
dtos
);
}
}
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
bec0973f
...
...
@@ -3594,6 +3594,11 @@
实发绩效
</summary>
</member>
<member
name=
"P:Performance.DtoModels.OwnerPerformanceDto.IssueDate"
>
<summary>
发放时间
</summary>
</member>
<member
name=
"P:Performance.DtoModels.OwnerMobilePerformanceDto.Total"
>
<summary>
绩效发放总额
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
bec0973f
...
...
@@ -5940,6 +5940,11 @@
是否修改过配置 1修改过 0未修改
</summary>
</member>
<member
name=
"P:Performance.EntityModels.per_allot.PigeonholeDate"
>
<summary>
归档日期
</summary>
</member>
<member
name=
"T:Performance.EntityModels.per_apr_amount"
>
<summary>
...
...
performance/Performance.DtoModels/Response/OwnerPerformanceDto.cs
View file @
bec0973f
...
...
@@ -15,6 +15,10 @@ public class OwnerPerformanceDto : view_allot_result
/// 实发绩效
/// </summary>
public
decimal
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 发放时间
/// </summary>
public
string
IssueDate
{
get
;
set
;
}
}
...
...
performance/Performance.EntityModels/Entity/per_allot.cs
View file @
bec0973f
...
...
@@ -105,5 +105,9 @@ public class per_allot
/// 是否修改过配置 1修改过 0未修改
/// </summary>
public
int
IsModifyConfig
{
get
;
set
;
}
/// <summary>
/// 归档日期
/// </summary>
public
Nullable
<
DateTime
>
PigeonholeDate
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/per_batch.cs
View file @
bec0973f
...
...
@@ -39,7 +39,7 @@ public class per_batch
/// <summary>
/// 批次日期
/// </summary>
public
DateTime
BatchDate
{
get
;
set
;
}
public
Nullable
<
DateTime
>
BatchDate
{
get
;
set
;
}
public
string
BankName
{
get
;
set
;
}
/// <summary>
...
...
performance/Performance.Repository/PerforReportRepository .cs
View file @
bec0973f
...
...
@@ -393,7 +393,7 @@ public List<EmployeeReservedDto> GetEmployeeReserved(int hospitalId, int year)
public
List
<
view_allot_result
>
GetOwnerPerformance
(
List
<
int
>
hospitalId
,
string
jobNumber
)
{
string
sql
=
"SELECT * FROM view_allot_result WHERE States
= 8
AND HospitalID IN @HospitalID AND JobNumber=@JobNumber"
;
string
sql
=
"SELECT * FROM view_allot_result WHERE States
IN (6,8)
AND HospitalID IN @HospitalID AND JobNumber=@JobNumber"
;
return
DapperQuery
<
view_allot_result
>(
sql
,
new
{
HospitalID
=
hospitalId
,
JobNumber
=
jobNumber
})?.
ToList
();
}
...
...
performance/Performance.Services/AllotService.cs
View file @
bec0973f
using
AutoMapper
;
using
Dapper
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.SignalR
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
MySql.Data.MySqlClient
;
...
...
@@ -17,17 +16,12 @@
using
System.Data
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Microsoft.Extensions.Caching.Memory
;
namespace
Performance.Services
{
public
class
AllotService
:
IAutoInjection
{
private
BaiscNormService
baiscNormService
;
private
CheckDataService
checkDataService
;
private
ImportDataService
importDataService
;
private
ProcessComputService
processComputService
;
private
ResultComputeService
resultComputeService
;
...
...
@@ -53,8 +47,7 @@ public class AllotService : IAutoInjection
private
PerforCofdirectorRepository
perforCofdirectorRepository
;
private
readonly
PerforReportRepository
_reportRepository
;
private
readonly
PerforPeremployeeRepository
_perforPeremployeeRepository
;
//private readonly IHubContext<AllotLogHub> hubContext;
private
readonly
PerforPerbatchRepository
_batchRepository
;
private
readonly
LogManageService
logManageService
;
private
readonly
ReportService
reportService
;
...
...
@@ -64,7 +57,6 @@ public class AllotService : IAutoInjection
IMapper
mapper
,
PerforPerallotRepository
allotRepository
,
BaiscNormService
baiscNormService
,
CheckDataService
checkDataService
,
ImportDataService
importDataService
,
ProcessComputService
processComputService
,
ResultComputeService
resultComputeService
,
...
...
@@ -82,7 +74,6 @@ public class AllotService : IAutoInjection
PerforHospitalRepository
perforHospitalRepository
,
PerforResbaiscnormRepository
perforResbaiscnormRepository
,
PerforHospitalconfigRepository
perforHospitalconfigRepository
,
//IHubContext<AllotLogHub> hubContext
RoleService
roleService
,
UserService
userService
,
LogManageService
logManageService
,
...
...
@@ -90,6 +81,7 @@ public class AllotService : IAutoInjection
PerforCofdirectorRepository
perforCofdirectorRepository
,
PerforReportRepository
reportRepository
,
PerforPeremployeeRepository
perforPeremployeeRepository
,
PerforPerbatchRepository
batchRepository
,
QueryDataService
queryDataService
)
{
_mapper
=
mapper
;
...
...
@@ -98,7 +90,6 @@ public class AllotService : IAutoInjection
_logger
=
logger
;
_evn
=
evn
;
this
.
baiscNormService
=
baiscNormService
;
this
.
checkDataService
=
checkDataService
;
this
.
importDataService
=
importDataService
;
this
.
processComputService
=
processComputService
;
this
.
resultComputeService
=
resultComputeService
;
...
...
@@ -122,6 +113,7 @@ public class AllotService : IAutoInjection
this
.
perforCofdirectorRepository
=
perforCofdirectorRepository
;
_reportRepository
=
reportRepository
;
_perforPeremployeeRepository
=
perforPeremployeeRepository
;
_batchRepository
=
batchRepository
;
this
.
queryDataService
=
queryDataService
;
}
...
...
@@ -590,6 +582,7 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time)
public
void
Pigeonhole
(
per_allot
allot
)
{
allot
.
States
=
8
;
allot
.
PigeonholeDate
=
DateTime
.
Now
;
allot
.
Remark
=
"归档"
;
_allotRepository
.
Update
(
allot
);
//if (_allotRepository.Update(allot))
...
...
@@ -707,6 +700,27 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid)
return
new
List
<
OwnerPerformanceDto
>();
var
employees
=
_perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
PersonnelNumber
==
jobNumber
);
var
allotIds
=
owner
.
Select
(
w
=>
w
.
AllotId
).
Distinct
().
ToList
();
var
batchs
=
_batchRepository
.
GetEntities
(
w
=>
allotIds
.
Contains
(
w
.
AllotId
));
var
allots
=
_allotRepository
.
GetEntities
(
w
=>
allotIds
.
Contains
(
w
.
ID
));
// 发放时间 归档状态永远显示,如果没有发放时间则使用归档时间,绩效下发状态下显示标记发放时间
Func
<
OwnerPerformanceDto
,
string
>
getIssueDate
=
(
owner
)
=>
{
var
batch
=
batchs
.
FirstOrDefault
(
p
=>
p
.
AllotId
==
owner
.
AllotId
&&
p
.
UnitType
==
owner
.
UnitType
&&
p
.
AccountingUnit
==
owner
.
AccountingUnit
&&
p
.
PersonnelNumber
==
owner
.
JobNumber
);
var
allot
=
allots
.
FirstOrDefault
(
w
=>
w
.
ID
==
owner
.
AllotId
);
if
(
batch
?.
BatchDate
!=
null
&&
batch
.
BatchDate
.
HasValue
)
return
batch
.
BatchDate
.
Value
.
ToString
(
"yyyy年MM月dd日 HH:mm"
);
else
if
(
allot
?.
States
==
(
int
)
AllotStates
.
Archive
)
{
if
(
allot
?.
PigeonholeDate
!=
null
&&
allot
.
PigeonholeDate
.
HasValue
)
return
allot
.
PigeonholeDate
.
Value
.
ToString
(
"yyyy年MM月dd日 HH:mm"
);
return
$"
{
allot
.
Year
}
年
{
allot
}
月"
;
}
return
""
;
};
var
res
=
owner
.
Where
(
w
=>
w
.
States
==
(
int
)
AllotStates
.
Archive
)
...
...
@@ -732,13 +746,15 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid)
{
var
dto
=
_mapper
.
Map
<
OwnerPerformanceDto
>(
detial
);
dto
.
Source
=
string
.
IsNullOrEmpty
(
detial
.
SourceItem
)
?
detial
.
Source
:
$"
{
detial
.
Source
}
-
{
detial
.
SourceItem
}
"
;
dto
.
IssueDate
=
getIssueDate
(
dto
);
// 应发绩效
dto
.
ShouldGiveFee
=
Math
.
Round
((
dto
.
RealPerformance
??
0
)
+
(
dto
.
OtherPerfor
??
0
)
+
(
dto
.
HideOtherPerfor
??
0
)
+
(
dto
.
NightWorkPerfor
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
dto
.
ReservedRatio
=
employees
?.
FirstOrDefault
(
emp
=>
emp
.
AllotId
==
dto
.
AllotId
&&
emp
.
PersonnelNumber
==
jobNumber
)?.
ReservedRatio
??
0
;
// 预留比例
dto
.
ReservedRatioFee
=
Math
.
Round
((
dto
.
RealPerformance
??
0
)
*
(
dto
.
ReservedRatio
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
// 预留绩效
dto
.
RealGiveFee
=
Math
.
Round
(
dto
.
ShouldGiveFee
-
(
dto
.
ReservedRatioFee
??
0
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 实发绩效
return
dto
;
}),
})
.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
IssueDate
)),
})
.
ToList
();
...
...
@@ -758,5 +774,112 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid)
return
res
?.
OrderByDescending
(
w
=>
w
.
Year
).
ThenByDescending
(
w
=>
w
.
Month
).
ToList
();
}
/// <summary>
/// 格式转换
/// </summary>
/// <param name="userid"></param>
/// <param name="beginDate"></param>
/// <param name="endDate"></param>
/// <returns></returns>
public
List
<
OwnerMobilePerformanceDto
>
GetOwnerMobilePerformance
(
int
userid
,
DateTime
beginDate
,
DateTime
endDate
)
{
List
<
OwnerMobilePerformanceDto
>
dtos
=
new
List
<
OwnerMobilePerformanceDto
>();
var
datas
=
GetOwnerPerformance
(
userid
);
if
(
datas
==
null
||
datas
.
Count
==
0
)
return
dtos
;
var
filterDatas
=
datas
.
Where
(
w
=>
(
new
DateTime
(
w
.
Year
,
w
.
Month
,
1
))
>=
beginDate
&&
(
new
DateTime
(
w
.
Year
,
w
.
Month
,
1
))
<
endDate
);
var
groupDatas
=
filterDatas
.
GroupBy
(
w
=>
w
.
JobNumber
);
foreach
(
var
item
in
groupDatas
)
{
var
perforSumFee
=
new
OwnerMobileItemDto
{
Title
=
"业绩绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
PerforSumFee
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
PerforSumFee
??
0
)
!=
0
&&
!
string
.
IsNullOrEmpty
(
w
.
IssueDate
))
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
AccountingUnit
,
Amount
=
w
.
PerforSumFee
??
0
,
Date
=
w
.
IssueDate
,
}).
ToList
()
};
var
perforManagementFee
=
new
OwnerMobileItemDto
{
Title
=
"管理绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
PerforManagementFee
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
PerforManagementFee
??
0
)
!=
0
&&
!
string
.
IsNullOrEmpty
(
w
.
IssueDate
))
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
AccountingUnit
,
Amount
=
w
.
PerforManagementFee
??
0
,
Date
=
w
.
IssueDate
,
}).
ToList
()
};
var
nightWorkPerfor
=
new
OwnerMobileItemDto
{
Title
=
"夜班绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
NightWorkPerfor
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
NightWorkPerfor
??
0
)
!=
0
&&
!
string
.
IsNullOrEmpty
(
w
.
IssueDate
))
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
AccountingUnit
,
Amount
=
w
.
NightWorkPerfor
??
0
,
Date
=
w
.
IssueDate
,
}).
ToList
()
};
var
otherPerfor
=
new
OwnerMobileItemDto
{
Title
=
"医院其他绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
OtherPerfor
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
OtherPerfor
??
0
)
!=
0
&&
!
string
.
IsNullOrEmpty
(
w
.
IssueDate
))
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
SourceItem
,
Amount
=
w
.
OtherPerfor
??
0
,
Date
=
w
.
IssueDate
,
}).
ToList
()
};
var
hideOtherPerfor
=
new
OwnerMobileItemDto
{
Title
=
"不公示其他绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
HideOtherPerfor
)
??
0
,
Details
=
item
.
SelectMany
(
w
=>
w
.
Detail
)
.
Where
(
w
=>
(
w
.
HideOtherPerfor
??
0
)
!=
0
&&
!
string
.
IsNullOrEmpty
(
w
.
IssueDate
))
.
Select
(
w
=>
new
OwnerMobileItemDetailDto
{
Title
=
w
.
SourceItem
,
Amount
=
w
.
HideOtherPerfor
??
0
,
Date
=
w
.
IssueDate
,
}).
ToList
()
};
var
reservedRatioFee
=
new
OwnerMobileItemDto
{
Title
=
"预留绩效"
,
Amount
=
item
.
Sum
(
w
=>
w
.
ReservedRatioFee
)
??
0
,
Details
=
new
List
<
OwnerMobileItemDetailDto
>()
};
var
dto
=
new
OwnerMobilePerformanceDto
{
Total
=
item
.
Sum
(
w
=>
w
.
RealGiveFee
),
Items
=
new
List
<
OwnerMobileItemDto
>()
};
if
(
perforSumFee
.
Amount
!=
0
)
dto
.
Items
.
Add
(
perforSumFee
);
if
(
perforManagementFee
.
Amount
!=
0
)
dto
.
Items
.
Add
(
perforManagementFee
);
if
(
nightWorkPerfor
.
Amount
!=
0
)
dto
.
Items
.
Add
(
nightWorkPerfor
);
if
(
otherPerfor
.
Amount
!=
0
)
dto
.
Items
.
Add
(
otherPerfor
);
if
(
hideOtherPerfor
.
Amount
!=
0
)
dto
.
Items
.
Add
(
hideOtherPerfor
);
if
(
reservedRatioFee
.
Amount
!=
0
)
dto
.
Items
.
Add
(
reservedRatioFee
);
dtos
.
Add
(
dto
);
}
return
dtos
;
}
}
}
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