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
dd7ebb36
Commit
dd7ebb36
authored
Jul 30, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回sheet中只有特殊配置时,未返回;headers添加数据时为null
parent
aefa4cc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
performance/Performance.Services/CollectService.cs
+22
-21
No files found.
performance/Performance.Services/CollectService.cs
View file @
dd7ebb36
...
...
@@ -104,7 +104,7 @@ public IEnumerable<CollectPermission> GetCollectContent(int hospitalId, int user
if
((
sheets
==
null
||
!
sheets
.
Any
())
&&
(
specials
==
null
||
!
specials
.
Any
()))
return
null
;
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
m
=>
m
.
Id
).
Contains
(
w
.
ModuleId
??
0
));
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
m
=>
m
.
Id
).
Contains
(
w
.
ModuleId
??
0
))
??
new
List
<
ex_item
>()
;
if
((
headers
==
null
||
!
headers
.
Any
())
&&
(
specials
==
null
||
!
specials
.
Any
()))
return
null
;
...
...
@@ -249,18 +249,18 @@ public IEnumerable<collect_permission> GetCollectSheet(int hospitalId, int userI
private
IEnumerable
<
collect_permission
>
GetCollectSheetByAllot
(
int
hospitalId
,
int
userId
,
string
sheetName
=
""
)
{
var
states
=
new
[]
{
(
int
)
AllotStates
.
Archive
,
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
GenerateAccomplish
};
var
allotList
=
perforPerallotRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
states
.
Contains
(
w
.
States
))
?.
OrderByDescending
(
w
=>
w
.
Year
).
ThenByDescending
(
w
=>
w
.
Month
).
ToList
();
if
(
allotList
==
null
||
!
allotList
.
Any
())
return
null
;
//
var states = new[] { (int)AllotStates.Archive, (int)AllotStates.GenerateSucceed, (int)AllotStates.GenerateAccomplish };
//
var allotList = perforPerallotRepository.GetEntities(w => w.HospitalId == hospitalId && states.Contains(w.States))
//
?.OrderByDescending(w => w.Year).ThenByDescending(w => w.Month).ToList();
//
if (allotList == null || !allotList.Any())
//
return null;
var
allot
=
allotList
.
First
();
//
var allot = allotList.First();
var
types
=
new
[]
{
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
SpecialUnit
};
var
sheets
=
exmoduleRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
types
.
Contains
(
w
.
SheetType
??
0
))
??
new
List
<
ex_module
>();
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
ModuleId
??
0
));
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
ModuleId
??
0
))
??
new
List
<
ex_item
>()
;
var
specials
=
exspecialRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
Expression
<
Func
<
collect_permission
,
bool
>>
exp
=
(
w
)
=>
w
.
HospitalId
==
hospitalId
&&
w
.
UserId
==
userId
;
...
...
@@ -274,28 +274,29 @@ private IEnumerable<collect_permission> GetCollectSheetByAllot(int hospitalId, i
if
(
sheets
==
null
||
!
sheets
.
Any
())
return
null
;
if
(
headers
==
null
||
!
headers
.
Any
(
))
if
(
(
headers
==
null
||
!
headers
.
Any
())
&&
(
specials
==
null
||
!
specials
.
Any
()
))
return
null
;
// 查询sheet和列头对应
var
sheetHeads
=
from
sheet
in
sheets
join
head
in
headers
on
sheet
.
Id
equals
head
.
ModuleId
select
new
{
sheet
.
ModuleName
,
sheet
.
SheetType
,
HeadName
=
head
.
ItemName
};
var
result
=
sheetHeads
.
Select
(
sh
=>
new
collect_permission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
ModuleName
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
,
AttachLast
=
0
,
Visible
=
1
})?.
ToList
();
if
(
specials
!=
null
&&
specials
.
Any
())
{
result
.
AddRange
(
specials
.
Select
(
sh
=>
new
collect_permission
sheets
.
Add
(
new
ex_module
{
HospitalId
=
hospitalId
,
SheetName
=
"4.2 特殊核算单元绩效测算表"
,
SheetType
=
(
int
)
SheetType
.
SpecialUnit
,
HeadName
=
sh
.
Target
,
AttachLast
=
0
,
Visible
=
1
}));
ModuleName
=
"4.2 特殊核算单元绩效测算表"
,
Id
=
0
,
});
headers
.
AddRange
(
specials
.
Select
(
t
=>
new
ex_item
{
ItemName
=
t
.
Target
,
ModuleId
=
0
}));
}
// 查询sheet和列头对应
var
sheetHeads
=
from
sheet
in
sheets
join
head
in
headers
on
sheet
.
Id
equals
head
.
ModuleId
select
new
{
sheet
.
ModuleName
,
sheet
.
SheetType
,
HeadName
=
head
.
ItemName
};
var
result
=
sheetHeads
.
Select
(
sh
=>
new
collect_permission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
ModuleName
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
,
AttachLast
=
0
,
Visible
=
1
})?.
ToList
();
if
(
result
!=
null
&&
result
.
Any
())
{
foreach
(
var
item
in
result
)
...
...
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