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
3cea149b
Commit
3cea149b
authored
Jul 20, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据录入权限来源
parent
919bd101
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
performance/Performance.EntityModels/Entity/collect_data.cs
+15
-0
performance/Performance.Services/CollectService.cs
+19
-9
No files found.
performance/Performance.EntityModels/Entity/collect_data.cs
View file @
3cea149b
...
...
@@ -79,5 +79,20 @@ public class collect_data
/// 单元格value
/// </summary>
public
string
CellValue
{
get
;
set
;
}
/// <summary>
/// 1 保存 2 提交 3 审核通过 4 驳回
/// </summary>
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 保存数据的用户
/// </summary>
public
int
SavedUser
{
get
;
set
;
}
/// <summary>
/// 保存数据的时间
/// </summary>
public
int
SavedTime
{
get
;
set
;
}
}
}
performance/Performance.Services/CollectService.cs
View file @
3cea149b
...
...
@@ -31,6 +31,8 @@ public class CollectService : IAutoInjection
private
readonly
PerforUserroleRepository
userroleRepository
;
private
readonly
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
private
readonly
PerforPerdeptdicRepository
perforPerdeptdicRepository
;
private
readonly
PerforExmoduleRepository
exmoduleRepository
;
private
readonly
PerforExitemRepository
exitemRepository
;
private
readonly
SheetSevice
sheetSevice
;
private
readonly
Application
options
;
...
...
@@ -48,6 +50,8 @@ public class CollectService : IAutoInjection
PerforUserroleRepository
userroleRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
,
PerforPerdeptdicRepository
perforPerdeptdicRepository
,
PerforExmoduleRepository
exmoduleRepository
,
PerforExitemRepository
exitemRepository
,
SheetSevice
sheetSevice
,
IOptions
<
Application
>
options
)
{
...
...
@@ -64,6 +68,8 @@ public class CollectService : IAutoInjection
this
.
userroleRepository
=
userroleRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
this
.
perforPerdeptdicRepository
=
perforPerdeptdicRepository
;
this
.
exmoduleRepository
=
exmoduleRepository
;
this
.
exitemRepository
=
exitemRepository
;
this
.
sheetSevice
=
sheetSevice
;
this
.
options
=
options
.
Value
;
}
...
...
@@ -92,37 +98,38 @@ public IEnumerable<CollectPermission> GetCollectContent(int hospitalId, int user
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
BudgetRatio
,
(
int
)
SheetType
.
AssessBeforeOtherFee
};
var
sheets
=
perforPersheetRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
types
.
Contains
((
w
.
SheetType
??
0
)));
var
headers
=
perforImheaderRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
);
var
permissions
=
perforcollectpermissionRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
w
.
UserId
==
userId
);
var
sheets
=
exmoduleRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
types
.
Contains
(
w
.
SheetType
??
0
));
if
(
sheets
==
null
||
!
sheets
.
Any
())
return
null
;
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
m
=>
m
.
Id
).
Contains
(
w
.
ModuleId
??
0
));
if
(
headers
==
null
||
!
headers
.
Any
())
return
null
;
var
permissions
=
perforcollectpermissionRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
w
.
UserId
==
userId
);
// 查询sheet和列头对应
var
sheetHeads
=
from
sheet
in
sheets
join
head
in
headers
on
sheet
.
I
D
equals
head
.
SheetID
select
new
{
sheet
.
SheetName
,
sheet
.
SheetType
,
HeadName
=
head
.
CellValu
e
};
join
head
in
headers
on
sheet
.
I
d
equals
head
.
ModuleId
select
new
{
sheet
.
ModuleName
,
sheet
.
SheetType
,
HeadName
=
head
.
ItemNam
e
};
List
<
CollectPermission
>
result
;
// 查询列头和权限对应
if
(
permissions
==
null
)
{
result
=
sheetHeads
.
Select
(
sh
=>
new
CollectPermission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
Sheet
Name
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
})?.
ToList
();
result
=
sheetHeads
.
Select
(
sh
=>
new
CollectPermission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
Module
Name
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
})?.
ToList
();
}
else
{
result
=
(
from
sh
in
sheetHeads
join
pmss
in
permissions
on
new
{
sh
.
Sheet
Name
,
sh
.
HeadName
}
equals
new
{
pmss
.
SheetName
,
pmss
.
HeadName
}
join
pmss
in
permissions
on
new
{
SheetName
=
sh
.
Module
Name
,
sh
.
HeadName
}
equals
new
{
pmss
.
SheetName
,
pmss
.
HeadName
}
into
emppmss
from
item
in
emppmss
.
DefaultIfEmpty
()
select
new
CollectPermission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
Sheet
Name
,
SheetName
=
sh
.
Module
Name
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
,
PermissionId
=
item
?.
Id
,
...
...
@@ -655,7 +662,10 @@ public void SaveCollectData(int allotId, SaveCollectData request)
||
!
string
.
IsNullOrEmpty
(
data
.
AccountingUnitNurse
)
||
!
string
.
IsNullOrEmpty
(
data
.
AccountingUnitDoctor
)
||
!
string
.
IsNullOrEmpty
(
data
.
Department
))
{
data
.
Status
=
1
;
datas
.
Add
(
data
);
}
}
perforcollectdataRepository
.
Execute
(
"delete from collect_data where allotid = @allotid and sheetname=@sheetname"
,
new
{
allotId
,
request
.
SheetName
});
perforcollectdataRepository
.
AddRange
(
datas
.
ToArray
());
...
...
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