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
00bb4dd4
Commit
00bb4dd4
authored
Oct 23, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行政科室明细
parent
4f090183
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
236 additions
and
206 deletions
+236
-206
performance/Performance.Api/Controllers/ComputeController.cs
+5
-0
performance/Performance.DtoModels/Response/DeptDetailResponse.cs
+2
-0
performance/Performance.Services/ComputeService.cs
+229
-206
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
00bb4dd4
...
...
@@ -172,6 +172,11 @@ public ApiResponse DeptDetail([FromBody] DeptDetailRequest request)
var
response
=
_computeService
.
SpecialDeptDetail
(
second
);
return
new
ApiResponse
(
ResponseType
.
OK
,
response
);
}
else
if
(
second
!=
null
&&
second
.
UnitType
==
UnitType
.
行政后勤
.
ToString
())
{
var
response
=
_computeService
.
DeptOfficeDetail
(
request
.
AccountID
);
return
new
ApiResponse
(
ResponseType
.
OK
,
response
);
}
else
{
var
response
=
_computeService
.
DeptDetail
(
request
.
AccountID
);
...
...
performance/Performance.DtoModels/Response/DeptDetailResponse.cs
View file @
00bb4dd4
...
...
@@ -67,6 +67,8 @@ public class DetailDtos : DetailDtos<DetailModule>
public
class
DetailModule
{
/// <summary> 工号 </summary>
public
string
JobNumber
{
get
;
set
;
}
/// <summary> 明细项 </summary>
public
string
ItemName
{
get
;
set
;
}
...
...
performance/Performance.Services/ComputeService.cs
View file @
00bb4dd4
...
...
@@ -706,11 +706,12 @@ public List<res_baiscnorm> GetBaiscnorm(int allotId)
public
DeptDataDetails
<
DetailModuleExtend
>
DeptDetail
(
int
accountId
)
{
var
doctor
=
perforResaccountRepository
.
GetEntity
(
t
=>
t
.
ID
==
accountId
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
doctor
.
AllotID
);
var
persheet
=
_perforPerSheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
);
var
workitems
=
cofworkitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
allotCmi
=
cofcmiRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
doctor
.
AllotID
&&
t
.
UnitType
==
doctor
.
UnitType
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
doctor
.
AllotID
);
DeptDataDetails
deptDetails
=
new
DeptDataDetails
{
ShowFormula
=
allot
.
ShowFormula
,
...
...
@@ -718,150 +719,59 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
Detail
=
new
List
<
DetailDtos
>()
};
var
persheet
=
_perforPerSheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
//科室经济
var
sheetEconomic
=
persheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
ComputeEconomic
);
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
);
var
dataEconomicList
=
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheetEconomic
?.
ID
&&
t
.
IsTotal
!=
1
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
).
ToList
();
string
typeValue
=
EnumHelper
.
GetDescription
((
UnitType
)
doctor
.
UnitType
);
var
economic
=
dataEconomicList
?.
Select
(
t
=>
new
var
sheetType
=
new
List
<
int
>
{
ItemName
=
t
.
TypeName
.
Replace
(
$"(
{
typeValue
}
)"
,
""
),
ItemValue
=
t
.
CellValue
??
0
,
t
.
UnitType
});
Regex
reg
=
new
Regex
(
"[0-9]*"
);
int
type
=
doctor
.
UnitType
.
Value
;
var
docUnitTypes
=
new
List
<
int
>
{
(
int
)
UnitType
.
专家组
,
(
int
)
UnitType
.
其他医生组
,
(
int
)
UnitType
.
其他医技组
};
if
(
docUnitTypes
.
Contains
(
type
))
type
=
1
;
else
if
(
type
==
(
int
)
UnitType
.
其他护理组
)
type
=
2
;
int
groupbasis
=
1
;
string
single
=
""
;
var
sheetType
=
new
List
<
int
>
{
(
int
)
SheetType
.
Income
,
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
AccountAdjustLaterOtherFee
};
int
groupbasis
=
1
;
string
single
=
""
;
foreach
(
var
stype
in
sheetType
)
{
//if (type == 3 && stype == (int)SheetType.Workload) type = 1;
foreach
(
var
sheet
in
persheet
.
Where
(
t
=>
t
.
SheetType
==
stype
))
{
var
type
=
TypeConversion
(
doctor
.
UnitType
);
if
(
single
!=
""
&&
sheet
.
SheetName
.
Substring
(
0
,
3
)
!=
single
)
groupbasis
+=
1
;
single
=
sheet
.
SheetName
.
Substring
(
0
,
3
);
var
sheetName
=
reg
.
Replace
(
sheet
.
SheetName
,
""
,
5
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
);
//var nType = (stype == (int)SheetType.Workload) ? 1 : type;
var
sheetData
=
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
type
&&
t
.
IsTotal
!=
1
).
ToList
();
if
(
sheetData
==
null
||
!
sheetData
.
Any
())
continue
;
var
headerData
=
headers
?.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
var
sheettype
=
1
;
//特殊核算科室 4
var
amount
=
0
m
;
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Income
||
sheet
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
)
{
amount
=
sheetData
?.
Sum
(
t
=>
t
.
IsFactor
==
1
?
t
.
CellValue
*
(
t
.
FactorValue
??
0
)
:
t
.
CellValue
)
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Expend
)
{
sheettype
=
2
;
amount
=
economic
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
Contains
(
sheetName
)
&&
t
.
UnitType
==
type
)?.
ItemValue
??
0
m
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
)
{
sheettype
=
3
;
amount
=
doctor
.
WorkloadFee
??
0
m
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountExtra
)
{
sheettype
=
5
;
amount
=
doctor
?.
Extra
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountDrugAssess
)
{
sheettype
=
6
;
amount
=
doctor
?.
MedicineExtra
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountMaterialsAssess
)
{
sheettype
=
7
;
amount
=
doctor
?.
MaterialsExtra
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountScoreAverage
)
{
sheettype
=
8
;
//amount = Math.Round(doctor?.ScoringAverage ?? 0, 4);
amount
=
Math
.
Round
(
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
type
&&
t
.
IsTotal
==
1
)?.
FirstOrDefault
()?.
CellValue
??
0
,
4
);
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountAdjustLaterOtherFee
)
{
sheettype
=
9
;
amount
=
Math
.
Round
(
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
type
&&
t
.
IsTotal
==
1
)?.
FirstOrDefault
()?.
CellValue
??
0
,
0
);
}
var
item
=
new
DetailDtos
Dictionary
<
SheetType
,
decimal
?>
pairs
=
new
Dictionary
<
SheetType
,
decimal
?>
{
ItemName
=
sheetName
,
IncomeType
=
sheettype
,
Amount
=
amount
,
GroupBasis
=
groupbasis
,
{
SheetType
.
AccountExtra
,
doctor
.
Extra
},
{
SheetType
.
AccountDrugAssess
,
doctor
.
MedicineExtra
},
{
SheetType
.
AccountMaterialsAssess
,
doctor
.
MaterialsExtra
},
};
var
items
=
sheetData
?.
Select
(
t
=>
new
DetailModule
{
ItemName
=
t
.
TypeName
,
CellValue
=
t
.
CellValue
,
Factor
=
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
?
t
.
FactorValue
:
t
.
FactorValue
*
100
,
ItemValue
=
t
.
IsFactor
==
1
?
(
t
.
CellValue
*
(
t
.
FactorValue
??
0
))
:
t
.
CellValue
,
}).
ToList
();
var
sheetName
=
new
Regex
(
"[0-9]*"
).
Replace
(
sheet
.
SheetName
,
""
,
5
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
);
var
(
sheettype
,
amount
)
=
ClinicDepartmentDetail
(
persheet
,
doctor
,
basicData
,
sheet
,
type
,
sheetName
);
(
sheettype
,
amount
)
=
CommonDepartmentDetail
(
basicData
,
sheet
,
type
,
pairs
);
var
items
=
CommonDetailItems
(
basicData
,
headers
,
sheet
,
type
);
if
(
items
!=
null
&&
items
.
Any
()
)
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
)
{
items
=
items
.
GroupBy
(
t
=>
t
.
ItemName
).
Select
(
t
=>
{
var
dto
=
new
DetailModule
{
ItemName
=
t
.
Key
,
CellValue
=
t
.
Sum
(
group
=>
group
.
CellValue
),
Factor
=
t
.
FirstOrDefault
().
Factor
,
ItemValue
=
t
.
Sum
(
group
=>
group
.
ItemValue
),
};
var
workitems
=
cofworkitemRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
allotCmi
=
cofcmiRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
doctor
.
AllotID
&&
t
.
UnitType
==
doctor
.
UnitType
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
);
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
)
foreach
(
var
dto
in
items
)
{
foreach
(
var
name
in
items
.
GroupBy
(
t
=>
t
.
ItemName
))
{
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
1
&&
a
.
Item
==
t
.
Key
))
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
1
&&
a
.
Item
==
name
.
Key
))
dto
.
MediFactor
=
doctor
.
MedicineFactor
;
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
2
&&
a
.
Item
==
t
.
Key
)
&&
allotCmi
!=
null
)
if
(
workitems
!=
null
&&
workitems
.
Any
(
a
=>
a
.
Type
==
2
&&
a
.
Item
==
name
.
Key
)
&&
allotCmi
!=
null
)
dto
.
CMIFactor
=
allotCmi
.
Value
;
dto
.
ItemValue
=
dto
.
ItemValue
*
(
dto
.
MediFactor
??
1
)
*
(
dto
.
CMIFactor
??
1
);
}
return
dto
;
}).
ToList
();
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
)
items
=
items
.
Where
(
t
=>
(
t
.
ItemValue
??
0
)
!=
0
).
ToList
();
}
}
if
(
headerData
!=
null
&&
headerData
.
Any
())
{
items
=
items
?.
OrderBy
(
t
=>
(
headerData
.
FirstOrDefault
(
h
=>
h
.
CellValue
==
t
.
ItemName
)?.
PointCell
)
??
100
)
?.
ThenBy
(
t
=>
t
.
ItemName
).
ToList
();
}
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
)
items
=
items
.
Where
(
t
=>
(
t
.
ItemValue
??
0
)
!=
0
).
ToList
();
item
.
Items
=
items
;
var
item
=
new
DetailDtos
{
ItemName
=
sheetName
,
IncomeType
=
sheettype
,
Amount
=
amount
,
GroupBasis
=
groupbasis
,
Items
=
items
}
;
deptDetails
.
Detail
.
Add
(
item
);
}
}
...
...
@@ -870,6 +780,104 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
//return deptDetails;
}
private
(
int
sheettype
,
decimal
amount
)
ClinicDepartmentDetail
(
List
<
per_sheet
>
persheet
,
res_account
account
,
List
<
im_data
>
basicData
,
per_sheet
sheet
,
UnitType
type
,
string
sheetName
)
{
var
sheettype
=
1
;
var
amount
=
0
m
;
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Income
)
{
sheettype
=
1
;
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
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
)
{
sheettype
=
3
;
amount
=
account
.
WorkloadFee
??
0
m
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
OtherIncome
)
{
sheettype
=
1
;
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
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Expend
)
{
//科室经济
var
sheetEconomic
=
persheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
ComputeEconomic
);
var
dataEconomicList
=
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheetEconomic
?.
ID
&&
t
.
IsTotal
!=
1
&&
t
.
AccountingUnit
==
account
.
AccountingUnit
).
ToList
();
string
typeValue
=
EnumHelper
.
GetDescription
((
UnitType
)
account
.
UnitType
);
var
economic
=
dataEconomicList
?.
Select
(
t
=>
new
{
ItemName
=
t
.
TypeName
.
Replace
(
$"(
{
typeValue
}
)"
,
""
),
ItemValue
=
t
.
CellValue
??
0
,
t
.
UnitType
});
sheettype
=
2
;
amount
=
economic
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
Contains
(
sheetName
)
&&
t
.
UnitType
==
(
int
)
type
)?.
ItemValue
??
0
m
;
}
return
(
sheettype
,
amount
);
}
private
(
int
sheettype
,
decimal
amount
)
CommonDepartmentDetail
(
List
<
im_data
>
basicData
,
per_sheet
sheet
,
UnitType
type
,
Dictionary
<
SheetType
,
decimal
?>
pairs
)
{
var
sheettype
=
1
;
var
amount
=
0
m
;
if
(
pairs
.
ContainsKey
((
SheetType
)
sheet
.
SheetType
))
{
sheettype
=
5
;
amount
=
pairs
[(
SheetType
)
sheet
.
SheetType
]
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountScoreAverage
)
{
sheettype
=
8
;
amount
=
Math
.
Round
(
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
type
&&
t
.
IsTotal
==
1
)?.
FirstOrDefault
()?.
CellValue
??
0
,
4
);
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountAdjustLaterOtherFee
)
{
sheettype
=
9
;
amount
=
Math
.
Round
(
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
type
&&
t
.
IsTotal
==
1
)?.
FirstOrDefault
()?.
CellValue
??
0
,
0
);
}
return
(
sheettype
,
amount
);
}
private
List
<
DetailModule
>
CommonDetailItems
(
List
<
im_data
>
basicData
,
List
<
im_header
>
headers
,
per_sheet
sheet
,
UnitType
type
)
{
var
items
=
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
type
&&
t
.
IsTotal
!=
1
)
?.
Select
(
t
=>
new
DetailModule
{
ItemName
=
t
.
TypeName
,
CellValue
=
t
.
CellValue
,
Factor
=
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
?
t
.
FactorValue
:
t
.
FactorValue
*
100
,
ItemValue
=
t
.
IsFactor
==
1
?
(
t
.
CellValue
*
(
t
.
FactorValue
??
0
))
:
t
.
CellValue
,
}).
ToList
();
if
(
items
!=
null
&&
items
.
Any
())
{
items
=
items
.
GroupBy
(
t
=>
t
.
ItemName
).
Select
(
t
=>
{
var
dto
=
new
DetailModule
{
ItemName
=
t
.
Key
,
CellValue
=
t
.
Sum
(
group
=>
group
.
CellValue
),
Factor
=
t
.
FirstOrDefault
().
Factor
,
ItemValue
=
t
.
Sum
(
group
=>
group
.
ItemValue
),
};
return
dto
;
}).
ToList
();
}
var
headerData
=
headers
?.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
if
(
headerData
!=
null
&&
headerData
.
Any
())
{
items
=
items
?.
OrderBy
(
t
=>
(
headerData
.
FirstOrDefault
(
h
=>
h
.
CellValue
==
t
.
ItemName
)?.
PointCell
)
??
100
)
?.
ThenBy
(
t
=>
t
.
ItemName
).
ToList
();
}
return
items
;
}
private
DeptDataDetails
<
DetailModuleExtend
>
MergeDetails
(
DeptDataDetails
details
)
{
if
(
details
==
null
)
return
new
DeptDataDetails
<
DetailModuleExtend
>();
...
...
@@ -953,6 +961,83 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
return
result
;
}
private
UnitType
TypeConversion
(
int
?
unitType
)
{
UnitType
type
=
(
UnitType
)
unitType
.
Value
;
var
docUnitTypes
=
new
List
<
UnitType
>
{
UnitType
.
专家组
,
UnitType
.
其他医生组
,
UnitType
.
其他医技组
};
if
(
docUnitTypes
.
Contains
(
type
))
type
=
UnitType
.
医生组
;
else
if
(
type
==
UnitType
.
其他护理组
)
type
=
UnitType
.
护理组
;
return
type
;
}
public
DeptDataDetails
DeptOfficeDetail
(
int
accountId
)
{
var
doctor
=
perforResaccountRepository
.
GetEntity
(
t
=>
t
.
ID
==
accountId
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
doctor
.
AllotID
);
var
computes
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
ID
==
doctor
.
AllotID
&&
t
.
UnitType
==
UnitType
.
行政后勤
.
ToString
()
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
);
var
persheet
=
_perforPerSheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
);
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
doctor
.
AllotID
&&
t
.
AccountingUnit
==
doctor
.
AccountingUnit
);
DeptDataDetails
deptDetails
=
new
DeptDataDetails
{
ShowFormula
=
allot
.
ShowFormula
,
Pandect
=
Mapper
.
Map
<
PerDataAccountBaisc
>(
doctor
),
Detail
=
new
List
<
DetailDtos
>()
};
var
sheetType
=
new
List
<
int
>
{
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
AccountAdjustLaterOtherFee
};
var
detail
=
new
DetailDtos
{
ItemName
=
"特殊核算单元绩效测算表"
,
IncomeType
=
4
,
Amount
=
doctor
.
PerforTotal
??
0
,
Items
=
new
List
<
DetailModule
>(),
GroupBasis
=
1
,
};
foreach
(
var
item
in
computes
)
{
detail
.
Items
.
Add
(
new
DetailModule
{
JobNumber
=
item
.
JobNumber
,
ItemName
=
item
.
EmployeeName
,
ItemValue
=
Math
.
Round
(
item
.
PerforSumFee
??
0
,
2
)
});
}
deptDetails
.
Detail
.
Add
(
detail
);
int
groupBasis
=
0
;
foreach
(
var
stype
in
sheetType
)
{
foreach
(
var
sheet
in
persheet
.
Where
(
t
=>
t
.
SheetType
==
stype
))
{
groupBasis
++;
Dictionary
<
SheetType
,
decimal
?>
pairs
=
new
Dictionary
<
SheetType
,
decimal
?>
{
{
SheetType
.
AccountExtra
,
doctor
.
Extra
},
{
SheetType
.
AccountDrugAssess
,
doctor
.
MedicineExtra
},
{
SheetType
.
AccountMaterialsAssess
,
doctor
.
MaterialsExtra
},
};
var
(
sheettype
,
amount
)
=
CommonDepartmentDetail
(
basicData
,
sheet
,
UnitType
.
行政后勤
,
pairs
);
var
items
=
CommonDetailItems
(
basicData
,
headers
,
sheet
,
UnitType
.
行政后勤
);
var
sheetName
=
new
Regex
(
"[0-9]*"
).
Replace
(
sheet
.
SheetName
,
""
,
5
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
);
var
item
=
new
DetailDtos
{
ItemName
=
sheetName
,
IncomeType
=
sheettype
,
Amount
=
amount
,
GroupBasis
=
groupBasis
,
Items
=
items
};
deptDetails
.
Detail
.
Add
(
item
);
}
}
return
deptDetails
;
}
public
DeptDataDetails
SpecialDeptDetail
(
ag_secondallot
second
)
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
second
.
AllotId
);
...
...
@@ -1012,86 +1097,24 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
AccountAdjustLaterOtherFee
};
Regex
reg
=
new
Regex
(
"[0-9]*"
);
int
groupBasis
=
0
;
foreach
(
var
stype
in
sheetType
)
{
foreach
(
var
sheet
in
persheet
.
Where
(
t
=>
t
.
SheetType
==
stype
))
{
groupBasis
++;
var
sheetName
=
reg
.
Replace
(
sheet
.
SheetName
,
""
,
5
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
);
var
sheetData
=
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
UnitType
.
特殊核算组
&&
t
.
IsTotal
!=
1
).
ToList
();
if
(
sheetData
==
null
||
!
sheetData
.
Any
())
continue
;
var
headerData
=
headers
?.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
);
var
sheettype
=
1
;
//特殊核算科室 4
var
amount
=
0
m
;
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountExtra
)
{
sheettype
=
5
;
amount
=
special
.
FirstOrDefault
()?.
Punishment
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountDrugAssess
)
{
sheettype
=
6
;
amount
=
special
.
FirstOrDefault
()?.
MedicineExtra
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountMaterialsAssess
)
{
sheettype
=
7
;
amount
=
special
.
FirstOrDefault
()?.
MaterialsExtra
??
0
;
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountScoreAverage
)
{
sheettype
=
8
;
//amount = Math.Round(special.FirstOrDefault()?.ScoringAverage ?? 0, 4);
amount
=
Math
.
Round
(
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
UnitType
.
特殊核算组
&&
t
.
IsTotal
==
1
)?.
FirstOrDefault
()?.
CellValue
??
0
,
4
);
}
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountAdjustLaterOtherFee
)
Dictionary
<
SheetType
,
decimal
?>
pairs
=
new
Dictionary
<
SheetType
,
decimal
?>
{
sheettype
=
9
;
amount
=
Math
.
Round
(
basicData
.
Where
(
t
=>
t
.
SheetID
==
sheet
.
ID
&&
t
.
UnitType
==
(
int
)
UnitType
.
特殊核算组
&&
t
.
IsTotal
==
1
)?.
FirstOrDefault
()?.
CellValue
??
0
,
0
);
}
var
item
=
new
DetailDtos
{
ItemName
=
sheetName
,
IncomeType
=
sheettype
,
Amount
=
amount
,
GroupBasis
=
groupBasis
,
{
SheetType
.
AccountExtra
,
special
.
FirstOrDefault
()?.
Punishment
},
{
SheetType
.
AccountDrugAssess
,
special
.
FirstOrDefault
()?.
MedicineExtra
},
{
SheetType
.
AccountMaterialsAssess
,
special
.
FirstOrDefault
()?.
MaterialsExtra
},
};
var
(
sheettype
,
amount
)
=
CommonDepartmentDetail
(
basicData
,
sheet
,
UnitType
.
特殊核算组
,
pairs
);
var
items
=
CommonDetailItems
(
basicData
,
headers
,
sheet
,
UnitType
.
特殊核算组
);
var
items
=
sheetData
?.
Select
(
t
=>
new
DetailModule
{
ItemName
=
t
.
TypeName
,
CellValue
=
t
.
CellValue
,
Factor
=
sheet
.
SheetType
==
(
int
)
SheetType
.
Workload
?
t
.
FactorValue
:
t
.
FactorValue
*
100
,
ItemValue
=
t
.
IsFactor
==
1
?
(
t
.
CellValue
*
(
t
.
FactorValue
??
0
))
:
t
.
CellValue
,
}).
ToList
();
if
(
items
!=
null
&&
items
.
Any
())
{
items
=
items
.
GroupBy
(
t
=>
t
.
ItemName
).
Select
(
t
=>
new
DetailModule
{
ItemName
=
t
.
Key
,
CellValue
=
t
.
Sum
(
group
=>
group
.
CellValue
),
Factor
=
t
.
FirstOrDefault
().
Factor
,
ItemValue
=
t
.
Sum
(
group
=>
group
.
ItemValue
),
}
).
ToList
();
}
if
(
headerData
!=
null
&&
headerData
.
Any
())
{
items
=
items
?.
OrderBy
(
t
=>
(
headerData
.
FirstOrDefault
(
h
=>
h
.
CellValue
==
t
.
ItemName
)?.
PointCell
)
??
100
)
?.
ThenBy
(
t
=>
t
.
ItemName
).
ToList
();
}
item
.
Items
=
items
;
var
sheetName
=
new
Regex
(
"[0-9]*"
).
Replace
(
sheet
.
SheetName
,
""
,
5
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
);
var
item
=
new
DetailDtos
{
ItemName
=
sheetName
,
IncomeType
=
sheettype
,
Amount
=
amount
,
GroupBasis
=
groupBasis
,
Items
=
items
};
deptDetails
.
Detail
.
Add
(
item
);
}
}
...
...
@@ -1099,25 +1122,25 @@ public DeptDataDetails SpecialDeptDetail(ag_secondallot second)
return
deptDetails
;
}
private
List
<
DetailModule
>
GetExtraDetail
(
int
allotId
,
int
unitType
,
string
accountingUnit
)
{
var
result
=
new
List
<
DetailModule
>();
var
sheetId
=
_perforPerSheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetType
==
(
int
)
SheetType
.
AccountExtra
)?.
ID
;
if
(!
sheetId
.
HasValue
)
return
result
;
//
private List<DetailModule> GetExtraDetail(int allotId, int unitType, string accountingUnit)
//
{
//
var result = new List<DetailModule>();
//
var sheetId = _perforPerSheetRepository.GetEntity(t => t.AllotID == allotId && t.SheetType == (int)SheetType.AccountExtra)?.ID;
//
if (!sheetId.HasValue) return result;
var
data
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheetId
&&
t
.
UnitType
==
unitType
&&
t
.
AccountingUnit
==
accountingUnit
&&
t
.
IsTotal
!=
1
);
if
(
data
==
null
||
!
data
.
Any
())
return
result
;
//
var data = _perforImDataRepository.GetEntities(t => t.AllotID == allotId && t.SheetID == sheetId && t.UnitType == unitType
//
&& t.AccountingUnit == accountingUnit && t.IsTotal != 1);
//
if (data == null || !data.Any()) return result;
result
=
data
.
Select
(
t
=>
new
DetailModule
{
ItemName
=
t
.
TypeName
,
CellValue
=
t
.
CellValue
,
ItemValue
=
t
.
CellValue
,
}).
ToList
();
//
result = data.Select(t => new DetailModule
//
{
//
ItemName = t.TypeName,
//
CellValue = t.CellValue,
//
ItemValue = t.CellValue,
//
}).ToList();
return
result
;
}
//
return result;
//
}
public
ag_secondallot
GetAccountId
(
int
secondId
,
out
int
accountId
)
{
...
...
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