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
37a09568
Commit
37a09568
authored
May 10, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改记载职称绩效
parent
424a5b23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
Performance.Subsidy/Performance.Subsidy.Services/SubsidyService.cs
+14
-8
No files found.
Performance.Subsidy/Performance.Subsidy.Services/SubsidyService.cs
View file @
37a09568
...
...
@@ -63,20 +63,21 @@ public void GetAllot(int allotId)
public
void
GetHrpJobTitle
(
int
allotId
,
int
hospitalId
,
bool
isRefresh
)
{
GetAllot
(
allotId
);
var
subsidy
=
_factory
.
CreateDefault
().
Query
<
sub_subsidy
>(
"select * from sub_subsidy where AllotID=@allotId;"
,
new
{
allotId
});
if
(
subsidy
.
Any
()
&&
isRefresh
==
false
)
return
;
var
config
=
_factory
.
CreateDefault
().
QueryFirst
<
ex_config
>(
"select * from ex_config where hospitalId=@hospitalId"
,
new
{
hospitalId
});
var
connectionString
=
builder
.
GetConnectionString
(
config
.
DataBaseType
,
config
.
DbSource
,
config
.
DbName
,
config
.
DbUser
,
config
.
DbPassword
);
var
connection
=
_factory
.
Create
(
config
.
DataBaseType
,
connectionString
);
var
hrp
=
_factory
.
CreateDefault
().
QueryFirst
<
ex_script
>(
"select * from ex_script;"
);
var
res
=
connection
.
Query
<
sub_subsidy
>(
hrp
.
ExecScript
,
commandTimeout
:
_commandTimeout
);
var
subsidy
=
_factory
.
CreateDefault
().
Query
<
sub_subsidy
>(
"select * from sub_subsidy where AllotID=@allotId;"
,
new
{
allotId
});
if
(
subsidy
.
Any
()
&&
isRefresh
==
false
)
return
;
var
res
=
connection
.
Query
<
sub_subsidy
>(
hrp
.
ExecScript
,
allotId
,
commandTimeout
:
_commandTimeout
);
//删除:在点击重新加载时删除记录重新插入
_factory
.
CreateDefault
().
Execute
(
"delete from sub_subsidy where AllotID=@allotId;delete from sub_jobtitle where AllotID=@allotId;"
,
new
{
allotId
});
var
jobtitle
=
res
.
Select
(
t
=>
new
{
t
.
AllotID
,
t
.
JobTitle
}).
Distinct
();
var
jobtitle
=
res
.
Select
(
t
=>
new
{
t
.
AllotID
,
t
.
JobTitle
,
t
.
BasicPerforFee
}).
Distinct
();
var
sql
=
$@"insert into sub_jobtitle(AllotID,JobTitle,BasicPerforFee) values (@allotId,@JobTitle,@BasicPerforFee);"
;
_factory
.
CreateDefault
().
Execute
(
sql
,
jobtitle
);
...
...
@@ -131,6 +132,7 @@ public bool SaveSubsidy(int allotId, List<sub_subsidy> subsidys)
public
bool
SaveJobTitle
(
int
allotId
,
List
<
sub_jobtitle
>
jobtitle
)
{
GetAllot
(
allotId
);
var
CreateDefault
=
_factory
.
CreateDefault
();
var
result
=
jobtitle
.
Select
(
t
=>
new
{
AllotID
=
allotId
,
t
.
BasicPerforFee
,
t
.
JobTitle
});
var
modify
=
CreateDefault
.
Execute
(
$" update `sub_jobtitle` set BasicPerforFee =@BasicPerforFee WHERE AllotID=@allotId and JobTitle=@JobTitle; "
,
result
);
...
...
@@ -140,16 +142,20 @@ public bool SaveJobTitle(int allotId, List<sub_jobtitle> jobtitle)
public
List
<
sub_subsidy
>
GetJobTitleSubsidy
(
int
allotId
)
{
GetAllot
(
allotId
);
IEnumerable
<
sub_subsidy
>
_Subsidies
=
_factory
.
CreateDefault
().
Query
<
sub_subsidy
>(
@"
select
*from sub_subsidy where RealAmount is not null and AllotID=@allotId and RealAmount is not null
"
,
new
{
allotId
});
select
* from sub_subsidy where RealAmount is not null and AllotID=@allotId ;
"
,
new
{
allotId
});
return
_Subsidies
?.
ToList
();
}
public
bool
SaveJobTitleSubsidy
(
int
allotId
,
List
<
sub_subsidy
>
subsidys
)
{
GetAllot
(
allotId
);
var
result
=
subsidys
.
Select
(
t
=>
new
{
t
.
RealAmount
,
AllotID
=
allotId
,
t
.
PersonnelNumber
});
return
_factory
.
CreateDefault
().
Execute
(
@
$"update sub_subsidy set
GiveAmount
=
Attendance
*
BasicPerforFee
,
RealAmount
=
@RealAmount
where
AllotID
=
@allotId
and
PersonnelNumber
=
@PersonnelNumber
;
",result)>0;
_factory
.
CreateDefault
().
Execute
(
@
$"update sub_subsidy set GiveAmount = Attendance * BasicPerforFee, RealAmount = @RealAmount where AllotID=@allotId and PersonnelNumber=@PersonnelNumber;"
,
result
);
_factory
.
CreateDefault
().
Execute
(
$@"call proc_performance_sync(@allotId);"
,
new
{
allotId
});
return
true
;
}
}
}
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