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
10253693
Commit
10253693
authored
Jul 01, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
划拨汇总、明细拆分
parent
f2dade06
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
42 deletions
+82
-42
performance/Performance.Api/Controllers/CostTransferController.cs
+23
-0
performance/Performance.DtoModels/Response/TransferReportResponse.cs
+6
-3
performance/Performance.Services/CostTransfer/CostTransferService.cs
+53
-39
No files found.
performance/Performance.Api/Controllers/CostTransferController.cs
View file @
10253693
...
...
@@ -68,6 +68,29 @@ public ApiResponse Common(int hospitalId, int allotId, [FromBody] DepartmentDeta
}
/// <summary>
/// 当前科室、类别
/// </summary>
/// <returns></returns>
[
Route
(
"deptdetial/{hospitalId}/allot/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
DeptDetial
(
int
hospitalId
,
int
allotId
)
{
if
(
hospitalId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数HospitalId无效!"
);
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
var
userid
=
claim
.
GetUserId
();
var
user
=
userService
.
GetUser
(
userid
);
var
role
=
roleService
.
GetARole
(
user
.
UserID
);
var
result
=
costTransferService
.
DeptDetial
(
allotId
,
hospitalId
,
role
.
Type
.
Value
,
user
.
Department
);
result
.
Item2
.
Department
=
user
.
Department
??
""
;
return
new
ApiResponse
(
ResponseType
.
OK
,
result
.
Item2
);
}
/// <summary>
/// 撤回提交
/// </summary>
/// <param name="itemId"></param>
...
...
performance/Performance.DtoModels/Response/TransferReportResponse.cs
View file @
10253693
...
...
@@ -7,8 +7,13 @@ namespace Performance.DtoModels
{
public
class
TransferReportResponse
{
public
int
Id
{
get
;
set
;
}
public
List
<
Transfer
>
Transfers
{
get
;
set
;
}
public
List
<
TransferItem
>
Items
{
get
;
set
;
}
}
public
class
Transfer
{
public
string
ApplicantUnitType
{
get
;
set
;
}
public
string
ApplicantDepartment
{
get
;
set
;
}
...
...
@@ -20,8 +25,6 @@ public class TransferReportResponse
public
string
AdoptedDepartment
{
get
;
set
;
}
public
decimal
?
PassAmountSum
{
get
;
set
;
}
public
List
<
TransferItem
>
Items
{
get
;
set
;
}
}
public
class
TransferItem
:
cost_transfer_item
...
...
performance/Performance.Services/CostTransfer/CostTransferService.cs
View file @
10253693
...
...
@@ -170,19 +170,9 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
common
.
account
=
cofaccountingRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
?.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
AccountingUnit
,
Value
=
t
.
AccountingUnit
}).
ToDistinct
().
ToList
();
var
prevAllotList
=
PrevAllotList
(
hospitalId
,
allotId
);
if
(
prevAllotList
!=
null
&&
prevAllotList
.
Any
())
{
foreach
(
var
prevAllot
in
prevAllotList
)
{
string
unittype
=
GetAccounting
(
prevAllot
.
ID
,
roleType
,
deparment
)?.
UnitType
;
if
(!
string
.
IsNullOrEmpty
(
unittype
))
{
common
.
unitType
=
unittype
;
break
;
}
}
}
var
(
prevAllotList
,
deptDetail
)
=
DeptDetial
(
allotId
,
hospitalId
,
roleType
,
deparment
);
common
.
unitType
=
deptDetail
.
UnitType
??
""
;
var
sheets
=
persheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetType
==
(
int
)
SheetType
.
Income
);
if
(
sheets
!=
null
&&
sheets
.
Any
())
...
...
@@ -233,6 +223,25 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
return
common
;
}
public
(
List
<
per_allot
>,
DepartmentDetail
)
DeptDetial
(
int
allotId
,
int
hospitalId
,
int
roleType
,
string
deparment
)
{
var
detail
=
new
DepartmentDetail
();
var
prevAllotList
=
PrevAllotList
(
hospitalId
,
allotId
);
if
(
prevAllotList
!=
null
&&
prevAllotList
.
Any
())
{
foreach
(
var
prevAllot
in
prevAllotList
)
{
string
unittype
=
GetAccounting
(
prevAllot
.
ID
,
roleType
,
deparment
)?.
UnitType
;
if
(!
string
.
IsNullOrEmpty
(
unittype
))
{
detail
.
UnitType
=
unittype
;
break
;
}
}
}
return
(
prevAllotList
,
detail
);
}
/// <summary>
/// 申请划拨
/// </summary>
...
...
@@ -427,7 +436,7 @@ public void DeleteApplicat(int transferId)
public
bool
CostTransferAudit
(
AuditRequest
request
,
bool
isAdmin
)
{
if
(
request
.
TransferItemId
.
Length
<=
0
)
throw
new
PerformanceException
(
"
没有可以审核的记录
"
);
throw
new
PerformanceException
(
"
科室未审核或已驳回,不能一键通过
"
);
var
costItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
request
.
TransferItemId
.
Contains
(
t
.
Id
));
var
transferId
=
costItems
?.
Select
(
t
=>
t
.
TransferId
).
Distinct
();
...
...
@@ -648,55 +657,60 @@ public void UpdateCostTransferStatus(int transferId)
#
region
划拨报表
public
List
<
TransferReportResponse
>
TransferContent
(
int
allotId
,
int
auditType
,
DepartmentDetail
detail
)
public
TransferReportResponse
TransferContent
(
int
allotId
,
int
auditType
,
DepartmentDetail
detail
)
{
var
transfers
=
costtransferRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
!=
3
&&
t
.
AdminStatus
!=
3
);
if
(
transfers
==
null
||
!
transfers
.
Any
())
return
new
List
<
TransferReportResponse
>
();
if
(
transfers
==
null
||
!
transfers
.
Any
())
return
new
TransferReportResponse
();
var
transferItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
transfers
.
Select
(
w
=>
w
.
Id
).
Contains
(
t
.
TransferId
));
switch
(
auditType
)
{
case
1
:
transfers
=
transfers
.
Where
(
t
=>
t
.
AdoptedDepartment
==
detail
.
Department
&&
t
.
AdoptedUnitType
==
detail
?.
UnitType
).
ToList
();
break
;
case
2
:
transfers
=
transfers
.
Where
(
t
=>
t
.
ApplicantDepartment
==
detail
.
Department
&&
t
.
ApplicantUnitType
==
detail
?.
UnitType
).
ToList
();
break
;
default
:
break
;
}
if
(
transferItems
==
null
||
!
transferItems
.
Any
())
return
new
List
<
TransferReportResponse
>();
var
transferItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
transfers
.
Select
(
w
=>
w
.
Id
).
Contains
(
t
.
TransferId
));
if
(
transferItems
==
null
||
!
transferItems
.
Any
())
return
new
TransferReportResponse
();
var
allItems
=
transferItems
.
Where
(
t
=>
t
.
Status
==
1
&&
t
.
AdminStatus
==
1
);
var
finalTransfer
=
transfers
.
Where
(
t
=>
allItems
.
Select
(
w
=>
w
.
TransferId
).
Distinct
().
Contains
(
t
.
Id
));
var
transferContent
=
finalTransfer
.
Select
(
t
=>
new
TransferReportResponse
var
result
=
new
TransferReportResponse
();
result
.
Transfers
=
finalTransfer
.
Select
(
t
=>
new
Transfer
{
ApplicantDepartment
=
t
.
ApplicantDepartment
,
ApplicantUnitType
=
t
.
ApplicantUnitType
,
AmountSum
=
transferItems
.
Where
(
w
=>
w
.
TransferId
==
t
.
Id
)?.
Sum
(
w
=>
w
.
CalculationAmount
.
Value
),
AmountSum
=
transferItems
.
Where
(
w
=>
w
.
TransferId
==
t
.
Id
)?.
Sum
(
w
=>
w
.
CalculationAmount
.
Value
),
AdoptedDepartment
=
t
.
AdoptedDepartment
,
AdoptedUnitType
=
t
.
AdoptedUnitType
,
PassAmountSum
=
allItems
.
Where
(
w
=>
w
.
TransferId
==
t
.
Id
)?.
Sum
(
w
=>
w
.
CalculationAmount
.
Value
),
Items
=
allItems
.
Where
(
c
=>
c
.
TransferId
==
t
.
Id
).
Select
(
c
=>
new
TransferItem
}).
ToList
();
result
.
Items
=
allItems
.
Select
(
c
=>
new
TransferItem
{
ApplicantDepartment
=
t
.
ApplicantDepartment
,
ApplicantUnitType
=
t
.
ApplicantUnitType
,
AdoptedDepartment
=
t
.
AdoptedDepartment
,
AdoptedUnitType
=
t
.
AdoptedUnitType
,
ApplicantDepartment
=
transfers
.
FirstOrDefault
(
t
=>
t
.
Id
==
c
.
TransferId
)?
.
ApplicantDepartment
,
ApplicantUnitType
=
transfers
.
FirstOrDefault
(
t
=>
t
.
Id
==
c
.
TransferId
)?
.
ApplicantUnitType
,
AdoptedDepartment
=
transfers
.
FirstOrDefault
(
t
=>
t
.
Id
==
c
.
TransferId
)?
.
AdoptedDepartment
,
AdoptedUnitType
=
transfers
.
FirstOrDefault
(
t
=>
t
.
Id
==
c
.
TransferId
)?
.
AdoptedUnitType
,
IsUseRatio
=
c
.
IsUseRatio
,
Source
=
c
.
Source
,
Category
=
c
.
Category
,
Ratio
=
c
.
Ratio
,
CalculationAmount
=
c
.
CalculationAmount
}).
OrderBy
(
c
=>
c
.
TransferId
).
ToList
()
}).
OrderBy
(
c
=>
c
.
TransferId
).
ToList
();
}).
ToList
();
switch
(
auditType
)
{
case
1
:
transferContent
=
transferContent
.
Where
(
t
=>
t
.
AdoptedDepartment
==
detail
.
Department
&&
t
.
AdoptedUnitType
==
detail
?.
UnitType
).
ToList
();
break
;
case
2
:
transferContent
=
transferContent
.
Where
(
t
=>
t
.
ApplicantDepartment
==
detail
.
Department
&&
t
.
ApplicantUnitType
==
detail
?.
UnitType
).
ToList
();
break
;
default
:
break
;
return
result
;
}
return
transferContent
;
}
#
endregion
...
...
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