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
99a0d356
Commit
99a0d356
authored
Jun 01, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工作量显示修改
parent
5e1d10de
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
23 deletions
+37
-23
performance/Performance.Services/ComputeService.UniteDeptDetail.cs
+37
-23
No files found.
performance/Performance.Services/ComputeService.UniteDeptDetail.cs
View file @
99a0d356
...
...
@@ -27,9 +27,10 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效月信息错误"
);
var
account
=
perforResaccountRepository
.
GetEntity
(
t
=>
t
.
UnitType
==
(
int
)
unitType
&&
t
.
AccountingUnit
==
accountingUnit
);
var
account
=
perforResaccountRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
UnitType
==
(
int
)
unitType
&&
t
.
AccountingUnit
==
accountingUnit
);
account
??=
new
res_account
{
AllotID
=
allotId
,
UnitType
=
(
int
)
unitType
,
AccountingUnit
=
accountingUnit
,
Number
=
0
,
...
...
@@ -46,9 +47,9 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
};
var
ignore
=
new
string
[]
{
"合计"
,
"汇总"
,
"总计"
};
var
persheet
=
_perforPerSheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
ccount
.
AllotID
)
??
new
List
<
per_sheet
>();
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
ccount
.
AllotID
)
??
new
List
<
im_header
>();
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
ccount
.
AllotID
&&
t
.
AccountingUnit
==
account
.
A
ccountingUnit
)
??
new
List
<
im_data
>();
var
persheet
=
_perforPerSheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
llotId
)
??
new
List
<
per_sheet
>();
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
llotId
)
??
new
List
<
im_header
>();
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
llotId
&&
t
.
AccountingUnit
==
a
ccountingUnit
)
??
new
List
<
im_data
>();
var
response
=
new
UniteDeptDetailResponse
{
...
...
@@ -64,7 +65,7 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
#
region
补全行政工勤人员明细
{
var
items
=
new
List
<
Dictionary
<
string
,
object
>>();
var
computes
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
ccount
.
AllotID
&&
t
.
AccountType
==
AccountUnitType
.
行政工勤
.
ToString
()
&&
t
.
AccountingUnit
==
account
.
A
ccountingUnit
)
??
new
List
<
res_compute
>();
var
computes
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
llotId
&&
t
.
AccountType
==
AccountUnitType
.
行政工勤
.
ToString
()
&&
t
.
AccountingUnit
==
a
ccountingUnit
)
??
new
List
<
res_compute
>();
foreach
(
var
item
in
computes
)
{
items
.
Add
(
new
Dictionary
<
string
,
object
>
...
...
@@ -216,7 +217,7 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
var
type
=
TypeConversion
(
account
.
UnitType
);
var
workitems
=
cofworkitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
ccount
.
AllotID
);
var
workitems
=
cofworkitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
a
llotId
);
var
medicineFactor
=
GetFactors
(
persheet
,
basicData
,
type
,
SheetType
.
WorkloadMedicineProp
);
var
cmiFactor
=
GetFactors
(
persheet
,
basicData
,
type
,
SheetType
.
WorkloadCMI
);
var
inclineFactor
=
GetFactors
(
persheet
,
basicData
,
type
,
SheetType
.
WorkloadIncline
);
...
...
@@ -233,38 +234,51 @@ public UniteDeptDetailResponse UniteDeptDetail(int allotId, UnitType unitType, s
{
if
(
ignore
.
Contains
(
post
.
Key
.
TypeName
))
continue
;
var
row
=
new
Dictionary
<
string
,
object
>();
row
.
Add
(
"项目"
,
post
.
Key
.
TypeName
);
row
.
Add
(
"数量"
,
ValueFormating
(
post
.
Sum
(
group
=>
group
.
CellValue
),
""
));
row
.
Add
(
"系数"
,
ValueFormating
(
post
.
FirstOrDefault
().
FactorValue
,
""
));
var
itemValue
=
post
.
Sum
(
group
=>
group
.
IsFactor
==
1
?
(
group
.
CellValue
*
(
group
.
FactorValue
??
0
))
:
group
.
CellValue
);
itemValue
=
itemValue
*
(
medicineFactor
??
1
)
*
(
cmiFactor
??
1
)
*
(
inclineFactor
??
1
);
var
row
=
new
Dictionary
<
string
,
object
>
{
{
"项目"
,
post
.
Key
.
TypeName
},
{
"数量"
,
ValueFormating
(
post
.
Sum
(
group
=>
group
.
CellValue
),
""
)
},
{
"系数"
,
ValueFormating
(
post
.
FirstOrDefault
().
FactorValue
,
""
)
},
{
"药占比系数"
,
""
},
{
"CMI系数"
,
""
},
{
"工作量倾斜"
,
""
},
{
"金额"
,
ValueFormating
(
itemValue
,
""
)
}
};
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
1
&&
a
.
Item
==
post
.
Key
.
TypeName
)
&&
medicineFactor
!=
null
)
row
.
Add
(
"药占比系数"
,
ValueFormating
(
medicineFactor
,
""
));
row
.
Add
OrUpdate
(
"药占比系数"
,
ValueFormating
(
medicineFactor
,
""
));
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
2
&&
a
.
Item
==
post
.
Key
.
TypeName
)
&&
cmiFactor
!=
null
)
row
.
Add
(
"CMI系数"
,
ValueFormating
(
cmiFactor
,
""
));
row
.
Add
OrUpdate
(
"CMI系数"
,
ValueFormating
(
cmiFactor
,
""
));
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
3
&&
a
.
Item
==
post
.
Key
.
TypeName
)
&&
inclineFactor
!=
null
)
row
.
Add
(
"工作量倾斜"
,
ValueFormating
(
inclineFactor
,
""
));
row
.
Add
OrUpdate
(
"工作量倾斜"
,
ValueFormating
(
inclineFactor
,
""
));
var
itemValue
=
post
.
Sum
(
group
=>
group
.
IsFactor
==
1
?
(
group
.
CellValue
*
(
group
.
FactorValue
??
0
))
:
group
.
CellValue
);
itemValue
=
itemValue
*
(
medicineFactor
??
1
)
*
(
cmiFactor
??
1
)
*
(
inclineFactor
??
1
);
row
.
Add
(
"金额"
,
ValueFormating
(
itemValue
,
""
));
items
.
Add
(
row
);
}
items
.
Add
(
new
Dictionary
<
string
,
object
>
{
{
"项目"
,
"核算分值合计"
},
{
"数量"
,
""
},
{
"系数"
,
""
},
{
"药占比系数"
,
""
},
{
"CMI系数"
,
""
},
{
"工作量倾斜"
,
""
},
{
"金额"
,
ValueFormating
(
postDatas
.
Sum
(
w
=>
w
.
IsFactor
==
1
?
(
w
.
CellValue
*
(
w
.
FactorValue
??
0
))
:
w
.
CellValue
),
""
)
},
});
// 保证Key数量一致
var
keys
=
items
.
SelectMany
(
dict
=>
dict
.
Keys
).
Distinct
();
foreach
(
var
k
in
keys
)
{
var
values
=
items
.
SelectMany
(
dict
=>
dict
.
Where
(
kvp
=>
kvp
.
Key
==
k
).
Select
(
kvp
=>
kvp
.
Value
));
if
(!
values
.
Any
(
w
=>
!
string
.
IsNullOrEmpty
(
w
?.
ToString
())))
{
foreach
(
var
item
in
items
)
{
if
(!
item
.
ContainsKey
(
k
))
item
.
Add
(
k
,
""
);
item
.
Remove
(
k
);
}
}
}
items
.
Add
(
new
Dictionary
<
string
,
object
>
{
{
"项目"
,
"核算分值合计"
},
{
"金额"
,
postDatas
.
Sum
(
w
=>
w
.
IsFactor
==
1
?
(
w
.
CellValue
*
(
w
.
FactorValue
??
0
))
:
w
.
CellValue
)
},
});
var
amount
=
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
type
&&
t
.
IsTotal
!=
1
)?.
Sum
(
t
=>
t
.
IsFactor
==
1
?
t
.
CellValue
*
(
t
.
FactorValue
??
0
)
:
t
.
CellValue
)
??
0
;
detailItemWorkloads
.
Add
(
new
DeptDetailItem
{
Title
=
sheetName
,
Total
=
amount
,
Items
=
items
});
...
...
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