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
fdd84150
Commit
fdd84150
authored
May 06, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取预算比例 添加日志,取消使用预算比例(调节、发放系数)
parent
cff05abc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
10 deletions
+60
-10
performance/Performance.Api/Controllers/BudgetController.cs
+15
-2
performance/Performance.Api/wwwroot/Performance.Api.xml
+8
-1
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+1
-1
performance/Performance.EntityModels/Entity/per_budget_result.cs
+1
-1
performance/Performance.Repository/PerforCofdirectorRepository.cs
+8
-2
performance/Performance.Services/BudgetService.cs
+27
-3
No files found.
performance/Performance.Api/Controllers/BudgetController.cs
View file @
fdd84150
...
...
@@ -121,15 +121,27 @@ public ApiResponse ResultSave([FromBody]List<per_budget_result> request)
/// <summary>
/// 使用预算比例
/// </summary>
/// <param name="
request
"></param>
/// <param name="
id
"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"result/use/{id}"
)]
public
ApiResponse
UseResult
(
int
id
)
{
var
userId
=
claim
.
GetUserId
();
var
result
=
budgetService
.
UseResult
(
id
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
/// <summary>
/// 使用预算比例
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"result/cancel/{id}"
)]
public
ApiResponse
CancelResult
(
int
id
)
{
var
result
=
budgetService
.
CancelResult
(
id
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
,
"操作成功"
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"操作失败"
);
}
}
}
\ No newline at end of file
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
fdd84150
...
...
@@ -247,7 +247,14 @@
<summary>
使用预算比例
</summary>
<param
name=
"request"
></param>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.BudgetController.CancelResult(System.Int32)"
>
<summary>
使用预算比例
</summary>
<param
name=
"id"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetCompute(Performance.DtoModels.ComputerRequest)"
>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
fdd84150
...
...
@@ -2844,7 +2844,7 @@
</member>
<member
name=
"P:Performance.EntityModels.per_budget_result.States"
>
<summary>
1.初始 2.
确认使用发放/调节系数
1.初始 2.
确认使用发放/调节系数 3.取消使用
</summary>
</member>
<member
name=
"P:Performance.EntityModels.per_budget_result.CreateDate"
>
...
...
performance/Performance.EntityModels/Entity/per_budget_result.cs
View file @
fdd84150
...
...
@@ -152,7 +152,7 @@ public class per_budget_result
public
Nullable
<
decimal
>
NoPerformanceExpenditureRatio
{
get
;
set
;
}
/// <summary>
/// 1.初始 2.
确认使用发放/调节系数
/// 1.初始 2.
确认使用发放/调节系数 3.取消使用
/// </summary>
public
int
States
{
get
;
set
;
}
...
...
performance/Performance.Repository/PerforCofdirectorRepository.cs
View file @
fdd84150
...
...
@@ -4,6 +4,8 @@
// * history : Created by T4 2019-03-22 15:48:55
// </copyright>
//-----------------------------------------------------------------------
using
Dapper
;
using
Microsoft.EntityFrameworkCore
;
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -63,15 +65,19 @@ public int DelAgain(int againid)
/// <returns></returns>
public
int
SupplementaryData
(
int
allotid
)
{
using
(
var
connection
=
context
.
Database
.
GetDbConnection
())
{
var
sql
=
@"insert into cof_drugtype(allotid,charge) select
distinct @allotid allotid,typename charge
from per_sheet sheet
inner join im_data im on sheet.id = im.sheetid
inner join cof_drugtype dtype on sheet.allotid = dtype.allotid
and im.typename != dtype.charge
where sheet.allotid = @allotid and sheet.sheettype = 3 "
;
where sheet.allotid = @allotid and sheet.sheettype = 3 and im.typename not in
(select charge from cof_drugtype where allotid = @allotid)"
;
return
Execute
(
sql
,
new
{
allotid
});
return
connection
.
Execute
(
sql
,
new
{
allotid
},
commandTimeout
:
60
*
60
);
}
}
}
}
performance/Performance.Services/BudgetService.cs
View file @
fdd84150
using
AutoMapper
;
using
Microsoft.EntityFrameworkCore.Internal
;
using
Microsoft.Extensions.Logging
;
using
NPOI.SS.Formula.Functions
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
...
...
@@ -17,16 +18,19 @@ public class BudgetService : IAutoInjection
private
readonly
PerforPerbudgetratioRepository
perbudgetratioRepository
;
private
readonly
PerforPerbudgetresultRepository
perbudgetresultRepository
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
ILogger
logger
;
public
BudgetService
(
PerforPerbudgetamountRepository
perbudgetamountRepository
,
PerforPerbudgetratioRepository
perbudgetratioRepository
,
PerforPerbudgetresultRepository
perbudgetresultRepository
,
PerforPerallotRepository
perallotRepository
)
PerforPerallotRepository
perallotRepository
,
ILogger
<
BudgetService
>
logger
)
{
this
.
perbudgetamountRepository
=
perbudgetamountRepository
;
this
.
perbudgetratioRepository
=
perbudgetratioRepository
;
this
.
perbudgetresultRepository
=
perbudgetresultRepository
;
this
.
perallotRepository
=
perallotRepository
;
this
.
logger
=
logger
;
}
/// <summary>
...
...
@@ -277,10 +281,28 @@ public bool UseResult(int id)
var
result
=
perbudgetresultRepository
.
GetEntity
(
t
=>
t
.
Id
==
id
);
if
(
result
==
null
)
throw
new
PerformanceException
(
"所选数据不存在!"
);
if
(
result
.
MedicalIncome
==
0
||
result
.
MedicineProportion
==
0
||
result
.
TheNewPerformance
==
0
)
{
throw
new
PerformanceException
(
"请保证医疗收入, 新绩效, 药占比收入等值正确录入 或 使用系数前请先保存填写的数据"
);
}
result
.
States
=
2
;
return
perbudgetresultRepository
.
Update
(
result
);
}
/// <summary>
/// 修改发放系数、调节系数使用状态
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
bool
CancelResult
(
int
id
)
{
var
result
=
perbudgetresultRepository
.
GetEntity
(
t
=>
t
.
Id
==
id
);
if
(
result
==
null
)
throw
new
PerformanceException
(
"所选数据不存在!"
);
result
.
States
=
3
;
return
perbudgetresultRepository
.
Update
(
result
);
}
public
bool
GetAdjustAndGrant
(
int
allotId
,
out
decimal
adjust
,
out
decimal
grant
)
{
adjust
=
1
m
;
grant
=
1
m
;
...
...
@@ -297,12 +319,14 @@ public bool GetAdjustAndGrant(int allotId, out decimal adjust, out decimal grant
public
bool
GetAdjustAndGrant
(
per_allot
allot
,
out
decimal
adjust
,
out
decimal
grant
)
{
logger
.
LogInformation
(
"获取发放系数、调节系数"
);
adjust
=
1
m
;
grant
=
1
m
;
var
result
=
perbudgetresultRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
);
if
(
result
==
null
||
result
.
States
!=
2
)
return
false
;
adjust
=
result
.
Adjust
.
Value
;
grant
=
result
.
Grant
.
Value
;
logger
.
LogInformation
(
"使用预算管理中生成的发放系数、调节系数"
);
adjust
=
result
.
Adjust
.
Value
/
100
;
grant
=
result
.
Grant
.
Value
/
100
;
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