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
1fa1003f
Commit
1fa1003f
authored
Jan 18, 2021
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2020morge' into v2020morge-graphql
parents
17ba6438
2a027676
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
65 deletions
+128
-65
performance/Performance.Infrastructure/Helper/ConvertHelper.cs
+4
-11
performance/Performance.Services/ComputeService.cs
+15
-1
performance/Performance.Services/Details/SecondAllotDetails.cs
+90
-52
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadDeptAccounting.cs
+1
-1
performance/Performance.Services/UserService.cs
+18
-0
No files found.
performance/Performance.Infrastructure/Helper/ConvertHelper.cs
View file @
1fa1003f
...
...
@@ -5,11 +5,10 @@
namespace
Performance.Infrastructure
{
/// <summary>
/// 类型转换
/// 类型转换
/// </summary>
public
static
class
ConvertHelper
{
public
static
int
TryInt
(
string
inValue
,
int
defaultValue
=
default
(
int
))
{
int
ret
=
defaultValue
;
...
...
@@ -27,7 +26,7 @@ public static long TryLong(string inValue, long defaultValue = default(int))
public
static
decimal
TryDecimal
(
string
inValue
,
decimal
defaultValue
=
default
(
decimal
))
{
decimal
ret
=
defaultValue
;
decimal
.
TryParse
(
inValue
,
out
ret
);
decimal
.
TryParse
(
inValue
,
System
.
Globalization
.
NumberStyles
.
Float
,
default
,
out
ret
);
return
ret
;
}
...
...
@@ -38,7 +37,6 @@ public static DateTime TryDateTime(string inValue, DateTime defaultValue = defau
return
ret
;
}
/// <summary>
/// 返回默认值
/// </summary>
...
...
@@ -70,10 +68,8 @@ public static T To<T>(object value, T defaultValue = default(T))
}
}
/// <summary>
///
///
/// </summary>
/// <typeparam name = "T"></typeparam>
/// <param name = "value">The value.</param>
...
...
@@ -95,7 +91,5 @@ public static T To<T>(object value, T defaultValue, bool ignoreException)
}
return
To
<
T
>(
value
);
}
}
}
\ No newline at end of file
}
performance/Performance.Services/ComputeService.cs
View file @
1fa1003f
...
...
@@ -560,7 +560,21 @@ private List<ComputeResponse> GetSecondPerformance(int allotId)
var
again
=
_perforAgcomputeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
if
(
again
!=
null
&&
again
.
Any
())
{
var
group
=
again
var
disAgains
=
again
.
Select
(
w
=>
new
{
w
.
AllotId
,
w
.
SecondId
,
w
.
UnitType
,
w
.
Department
,
w
.
WorkPost
,
w
.
JobNumber
,
w
.
PersonName
,
w
.
PerforSumFee
,
w
.
OthePerfor
,
w
.
NightWorkPerfor
,
w
.
RealGiveFee
}).
Distinct
();
var
group
=
disAgains
.
GroupBy
(
t
=>
new
{
t
.
UnitType
,
t
.
Department
,
t
.
WorkPost
,
t
.
JobNumber
,
t
.
PersonName
})
.
Select
(
t
=>
{
...
...
performance/Performance.Services/Details/SecondAllotDetails.cs
View file @
1fa1003f
using
AutoMapper
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
...
...
@@ -14,6 +16,8 @@ namespace Performance.Services
public
class
SecondAllotDetails
:
IAutoInjection
{
private
readonly
ILogger
<
SecondAllotDetails
>
_logger
;
private
readonly
PerforImemployeelogisticsRepository
_imemployeelogisticsRepository
;
private
readonly
Application
_application
;
private
readonly
PerforAgsecondallotRepository
agsecondallotRepository
;
private
readonly
PerforAgusetempRepository
agusetempRepository
;
private
readonly
PerforAgtempitemRepository
agtempitemRepository
;
...
...
@@ -26,9 +30,12 @@ public class SecondAllotDetails : IAutoInjection
private
readonly
PerforPerapramountRepository
perapramountRepository
;
private
readonly
PerforRescomputeRepository
rescomputeRepository
;
private
readonly
PersonService
personService
;
private
readonly
UserService
_userService
;
public
SecondAllotDetails
(
ILogger
<
SecondAllotDetails
>
logger
,
IOptions
<
Application
>
application
,
PerforImemployeelogisticsRepository
imemployeelogisticsRepository
,
PerforAgsecondallotRepository
agsecondallotRepository
,
PerforAgusetempRepository
agusetempRepository
,
PerforAgtempitemRepository
agtempitemRepository
,
...
...
@@ -40,10 +47,13 @@ public class SecondAllotDetails : IAutoInjection
PerforCofagainRepository
cofagainRepository
,
PerforPerapramountRepository
perapramountRepository
,
PerforRescomputeRepository
rescomputeRepository
,
PersonService
personService
PersonService
personService
,
UserService
userService
)
{
_logger
=
logger
;
_imemployeelogisticsRepository
=
imemployeelogisticsRepository
;
_application
=
application
.
Value
;
this
.
agsecondallotRepository
=
agsecondallotRepository
;
this
.
agusetempRepository
=
agusetempRepository
;
this
.
agtempitemRepository
=
agtempitemRepository
;
...
...
@@ -56,6 +66,7 @@ PersonService personService
this
.
perapramountRepository
=
perapramountRepository
;
this
.
rescomputeRepository
=
rescomputeRepository
;
this
.
personService
=
personService
;
_userService
=
userService
;
}
#
region
横向纵向模板详情
...
...
@@ -580,45 +591,69 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
var
employees
=
personService
.
GetPersons
(
secondAllot
.
AllotId
.
Value
,
userId
)?.
Where
(
t
=>
t
.
UnitType
==
secondAllot
.
UnitType
).
ToList
();
switch
(
employeeSource
)
var
role
=
_userService
.
GetUserFirstRole
(
userId
);
//行政科室 只有两种逻辑,或从保存中加载,或加载EXCEL表
if
(
role
?.
Type
==
_application
.
OfficeRole
)
{
case
(
int
)
EmployeeSource
.
Initial
:
// 如果已经保存>>走保存加载逻辑
if
(
employeeSource
==
(
int
)
EmployeeSource
.
Initial
)
{
result
=
savedDataList
.
OrderBy
(
t
=>
t
.
Id
).
ToList
();
break
;
case
(
int
)
EmployeeSource
.
EmployeeDict
:
if
(
employees
==
null
||
!
employees
.
Any
())
return
new
List
<
ag_othersource
>();
result
=
employees
.
Select
(
t
=>
new
ag_othersource
}
// 如果没保存>>走加载im_employee_logistics人员名单逻辑
else
{
var
types
=
new
string
[]
{
"行政后勤"
,
"行政工勤"
};
var
logistics
=
_imemployeelogisticsRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
secondAllot
.
AllotId
&&
types
.
Contains
(
w
.
AccountType
)
&&
w
.
AccountingUnit
==
secondAllot
.
Department
);
result
=
(
logistics
??
new
List
<
im_employee_logistics
>()).
Select
(
w
=>
new
ag_othersource
{
SecondId
=
secondId
,
WorkNumber
=
t
.
PersonnelNumber
,
Name
=
t
.
DoctorName
,
Department
=
t
.
Department
,
WorkPost
=
t
.
JobTitle
,
}).
ToList
();
break
;
case
(
int
)
EmployeeSource
.
PrevSecondAllot
:
var
prevSavedDataList
=
agothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
prevSecondAllot
.
Id
);
isSupplementTitlePerformance
=
prevSavedDataList
==
null
||
!
prevSavedDataList
.
Any
();
if
(
prevSavedDataList
!=
null
&&
prevSavedDataList
.
Any
())
{
result
=
prevSavedDataList
.
OrderBy
(
t
=>
t
.
Id
)
.
Select
(
t
=>
new
ag_othersource
{
SecondId
=
secondId
,
WorkNumber
=
t
.
WorkNumber
,
Name
=
t
.
Name
,
Department
=
t
.
Department
,
WorkPost
=
t
.
WorkPost
,
}).
ToList
();
}
break
;
default
:
break
;
WorkNumber
=
w
.
PersonnelNumber
,
Name
=
w
.
DoctorName
,
Department
=
w
.
AccountingUnit
,
WorkPost
=
w
.
JobTitle
,
}).
ToDistinct
().
ToList
();
}
}
//非行政科室 有三种逻辑,或从保存中加载,或从人员字典加载,或从上次绩效中加载
else
{
switch
(
employeeSource
)
{
case
(
int
)
EmployeeSource
.
Initial
:
result
=
savedDataList
.
OrderBy
(
t
=>
t
.
Id
).
ToList
();
break
;
case
(
int
)
EmployeeSource
.
EmployeeDict
:
if
(
employees
==
null
||
!
employees
.
Any
())
return
new
List
<
ag_othersource
>();
result
=
employees
.
Select
(
t
=>
new
ag_othersource
{
SecondId
=
secondId
,
WorkNumber
=
t
.
PersonnelNumber
,
Name
=
t
.
DoctorName
,
Department
=
t
.
Department
,
WorkPost
=
t
.
JobTitle
,
}).
ToList
();
break
;
case
(
int
)
EmployeeSource
.
PrevSecondAllot
:
var
prevSavedDataList
=
agothersourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
prevSecondAllot
.
Id
);
isSupplementTitlePerformance
=
prevSavedDataList
==
null
||
!
prevSavedDataList
.
Any
();
if
(
prevSavedDataList
!=
null
&&
prevSavedDataList
.
Any
())
{
result
=
prevSavedDataList
.
OrderBy
(
t
=>
t
.
Id
)
.
Select
(
t
=>
new
ag_othersource
{
SecondId
=
secondId
,
WorkNumber
=
t
.
WorkNumber
,
Name
=
t
.
Name
,
Department
=
t
.
Department
,
WorkPost
=
t
.
WorkPost
,
}).
ToList
();
}
break
;
}
}
var
originalEmployees
=
personService
.
GetPerEmployee
(
secondAllot
.
AllotId
.
Value
);
SupplementSecondDetail
(
secondAllot
,
originalEmployees
,
result
,
isSupplementTitlePerformance
);
...
...
@@ -634,30 +669,33 @@ public List<ag_othersource> GetOtherTempDetails(int userId, int secondId, int is
/// <param name="isTitlePerformance">是否补全职称绩效</param>
private
void
SupplementSecondDetail
(
ag_secondallot
second
,
List
<
per_employee
>
employees
,
List
<
ag_othersource
>
result
,
bool
isTitlePerformance
=
true
)
{
//if (employees == null || !employees.Any(t => t.UnitType == second.UnitType))
// return;
// 补充医院其他绩效 及 预留比例
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
second
.
AllotId
&&
t
.
Status
==
3
);
Func
<
per_employee
,
decimal
?>
getAprAmount
=
(
t
)
=>
second
.
Department
==
t
.
AccountingUnit
?
perapramounts
?.
Where
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
())
?.
Sum
(
w
=>
w
.
Amount
)
:
0
;
var
distPerformance
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
&&
employees
.
Select
(
s
=>
s
.
PersonnelNumber
).
Contains
(
t
.
JobNumber
));
Func
<
per_employee
,
decimal
?>
getDistPerformance
=
(
t
)
=>
0
;
if
(
second
.
UnitType
==
UnitType
.
行政后勤
.
ToString
())
getDistPerformance
=
(
t
)
=>
second
.
Department
==
t
.
AccountingUnit
?
distPerformance
?.
Where
(
w
=>
w
.
JobNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
())
?.
Sum
(
w
=>
w
.
GiveFee
)
:
0
;
var
distPerformance
=
rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
);
foreach
(
var
item
in
result
)
{
var
empl
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
());
if
(
empl
!=
null
)
var
empl
=
employees
?.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
());
item
.
ReservedRatio
=
empl
?.
ReservedRatio
??
0
;
// 如果是行政后勤,则把绩效放在工作量上
if
(
isTitlePerformance
&&
second
.
UnitType
==
UnitType
.
行政后勤
.
ToString
())
{
item
.
WorkPerformance
=
distPerformance
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Department
&&
w
.
JobNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
GiveFee
);
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
item
.
WorkPerformance
=
distPerformance
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Department
&&
w
.
JobNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
EmployeeName
?.
Trim
()
==
item
.
Name
?.
Trim
())?.
Sum
(
w
=>
w
.
GiveFee
);
}
if
(
second
.
UnitType
==
UnitType
.
行政后勤
.
ToString
())
{
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Department
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
}
else
if
(!
string
.
IsNullOrEmpty
(
empl
?.
AccountingUnit
))
{
item
.
ReservedRatio
=
empl
.
ReservedRatio
;
item
.
OtherPerformance
=
getAprAmount
(
empl
);
if
(
isTitlePerformance
)
item
.
TitlePerformance
=
getDistPerformance
(
empl
);
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
empl
?.
AccountingUnit
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
if
(
string
.
IsNullOrEmpty
(
item
.
WorkNumber
))
item
.
OtherPerformance
=
perapramounts
?.
Where
(
w
=>
w
.
AccountingUnit
==
empl
?.
AccountingUnit
&&
w
.
PersonnelNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
()
&&
w
.
DoctorName
?.
Trim
()
==
item
.
Name
?.
Trim
())?.
Sum
(
w
=>
w
.
Amount
);
}
}
}
...
...
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadDeptAccounting.cs
View file @
1fa1003f
...
...
@@ -41,7 +41,7 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
{
object
@object
=
row
.
GetCell
(
point
).
GetValue
();
if
(
item
.
IsNumber
)
@object
=
ConvertHelper
.
T
o
<
decimal
?>(
@object
);
@object
=
ConvertHelper
.
T
ryDecimal
(
@object
?.
ToString
()
);
if
(
dic
.
Keys
.
Contains
(
item
.
Field
))
dic
[
item
.
Field
]
=
@object
;
...
...
performance/Performance.Services/UserService.cs
View file @
1fa1003f
...
...
@@ -109,6 +109,24 @@ public UserIdentity GetUser(int userId)
}
/// <summary>
/// 获取用户第一个角色
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public
sys_role
GetUserFirstRole
(
int
userId
)
{
var
user
=
_userRepository
.
GetEntity
(
t
=>
t
.
ID
==
userId
);
if
(
user
==
null
)
throw
new
PerformanceException
(
"用户信息查询失败"
);
var
userrole
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userId
);
if
(
userrole
==
null
)
throw
new
PerformanceException
(
"角色信息查询失败"
);
var
role
=
_roleRepository
.
GetEntity
(
t
=>
t
.
ID
==
userrole
.
RoleID
);
return
role
;
}
/// <summary>
/// 查询用户列表
/// </summary>
/// <param name="userID"></param>
...
...
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