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
c9acd34c
Commit
c9acd34c
authored
Jun 25, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效划拨审核、状态,列表问题修改
parent
d46c8d42
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
142 additions
and
72 deletions
+142
-72
performance/Performance.Api/Controllers/CostTransferController.cs
+5
-5
performance/Performance.Api/wwwroot/Performance.Api.xml
+3
-2
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+1
-1
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+6
-1
performance/Performance.DtoModels/Request/CostTransferRequest.cs
+9
-1
performance/Performance.DtoModels/Response/CostTransferResponse.cs
+3
-1
performance/Performance.EntityModels/Entity/cost_transfer.cs
+4
-1
performance/Performance.Services/CostTransfer/CostTransferService.cs
+107
-57
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CostTransferDataWrite.cs
+4
-3
No files found.
performance/Performance.Api/Controllers/CostTransferController.cs
View file @
c9acd34c
...
@@ -63,7 +63,6 @@ public ApiResponse Common(int hospitalId, int allotId)
...
@@ -63,7 +63,6 @@ public ApiResponse Common(int hospitalId, int allotId)
var
result
=
costTransferService
.
Common
(
allotId
,
hospitalId
,
role
.
Type
.
Value
,
user
.
Department
);
var
result
=
costTransferService
.
Common
(
allotId
,
hospitalId
,
role
.
Type
.
Value
,
user
.
Department
);
result
.
deparment
=
user
.
Department
??
""
;
result
.
deparment
=
user
.
Department
??
""
;
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
}
...
@@ -72,10 +71,11 @@ public ApiResponse Common(int hospitalId, int allotId)
...
@@ -72,10 +71,11 @@ public ApiResponse Common(int hospitalId, int allotId)
/// 审核列表
/// 审核列表
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <param name="menuType"></param>
/// <returns></returns>
/// <returns></returns>
[
Route
(
"auditlist/{allotId}"
)]
[
Route
(
"auditlist/{allotId}
/menuType/{menuType}
"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
AuditList
(
int
allotId
)
public
ApiResponse
AuditList
(
int
allotId
,
int
menuType
)
{
{
if
(
allotId
<=
0
)
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
...
@@ -83,7 +83,7 @@ public ApiResponse AuditList(int allotId)
...
@@ -83,7 +83,7 @@ public ApiResponse AuditList(int allotId)
var
userid
=
claim
.
GetUserId
();
var
userid
=
claim
.
GetUserId
();
var
user
=
userService
.
GetUser
(
userid
);
var
user
=
userService
.
GetUser
(
userid
);
var
role
=
roleService
.
GetARole
(
user
.
UserID
);
var
role
=
roleService
.
GetARole
(
user
.
UserID
);
var
result
=
costTransferService
.
GetAuditList
(
allotId
,
role
.
Type
.
Value
,
user
.
Department
);
var
result
=
costTransferService
.
GetAuditList
(
allotId
,
menuType
,
role
.
Type
.
Value
,
user
.
Department
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
...
@@ -96,7 +96,7 @@ public ApiResponse AuditList(int allotId)
...
@@ -96,7 +96,7 @@ public ApiResponse AuditList(int allotId)
/// <returns></returns>
/// <returns></returns>
[
Route
(
"costtransferaudit"
)]
[
Route
(
"costtransferaudit"
)]
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
Audit
([
FromBody
]
CostTransferUpdate
Request
request
)
public
ApiResponse
Audit
([
FromBody
]
Audit
Request
request
)
{
{
if
(
request
.
AllotId
<=
0
)
if
(
request
.
AllotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
c9acd34c
...
@@ -709,14 +709,15 @@
...
@@ -709,14 +709,15 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.CostTransferController.AuditList(System.Int32)"
>
<member
name=
"M:Performance.Api.Controllers.CostTransferController.AuditList(System.Int32
,System.Int32
)"
>
<summary>
<summary>
审核列表
审核列表
</summary>
</summary>
<param
name=
"allotId"
></param>
<param
name=
"allotId"
></param>
<param
name=
"menuType"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.CostTransferController.Audit(Performance.DtoModels.
CostTransferUpdate
Request)"
>
<member
name=
"M:Performance.Api.Controllers.CostTransferController.Audit(Performance.DtoModels.
Audit
Request)"
>
<summary>
<summary>
划拨审核
划拨审核
</summary>
</summary>
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
c9acd34c
...
@@ -2980,7 +2980,7 @@
...
@@ -2980,7 +2980,7 @@
</member>
</member>
<member
name=
"P:Performance.DtoModels.CostTransferResponse.Status"
>
<member
name=
"P:Performance.DtoModels.CostTransferResponse.Status"
>
<summary>
<summary>
0 未审核 1 部分审核 2 全部审核
3 未含有划拨明细
0 未审核 1 部分审核 2 全部审核
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.DtoModels.DeptDataDetails`1.Pandect"
>
<member
name=
"P:Performance.DtoModels.DeptDataDetails`1.Pandect"
>
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
c9acd34c
...
@@ -2266,7 +2266,12 @@
...
@@ -2266,7 +2266,12 @@
</member>
</member>
<member
name=
"P:Performance.EntityModels.cost_transfer.Status"
>
<member
name=
"P:Performance.EntityModels.cost_transfer.Status"
>
<summary>
<summary>
0 未审核 1 部分审核 2 全部审核 3 未含有划拨明细
0 未审核 1 全部通过 2 部分通过 3 全部驳回
</summary>
</member>
<member
name=
"P:Performance.EntityModels.cost_transfer.AdminStatus"
>
<summary>
0 未审核 1 全部通过 2 部分通过 3 全部驳回
</summary>
</summary>
</member>
</member>
<member
name=
"T:Performance.EntityModels.cost_transfer_item"
>
<member
name=
"T:Performance.EntityModels.cost_transfer_item"
>
...
...
performance/Performance.DtoModels/Request/CostTransferRequest.cs
View file @
c9acd34c
...
@@ -27,10 +27,18 @@ public class CostTransferUpdateRequest : CostTransferRequest
...
@@ -27,10 +27,18 @@ public class CostTransferUpdateRequest : CostTransferRequest
{
{
public
int
TransferId
{
get
;
set
;
}
public
int
TransferId
{
get
;
set
;
}
public
new
List
<
cost_transfer_item
>
Items
{
get
;
set
;
}
}
public
class
AuditRequest
{
public
int
AllotId
{
get
;
set
;
}
public
int
[]
TransferItemId
{
get
;
set
;
}
public
int
[]
TransferItemId
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
public
new
List
<
cost_transfer_item
>
Items
{
get
;
set
;
}
public
string
Remake
{
get
;
set
;
}
}
}
}
}
performance/Performance.DtoModels/Response/CostTransferResponse.cs
View file @
c9acd34c
...
@@ -63,7 +63,9 @@ public class Common
...
@@ -63,7 +63,9 @@ public class Common
public
class
Option
:
cost_transfer_item
public
class
Option
:
cost_transfer_item
{
{
public
string
[]
options
{
get
;
set
;
}
public
string
[]
options
{
get
;
set
;
}
public
string
ApplicantDepartment
{
get
;
set
;
}
public
string
AdoptedDepartment
{
get
;
set
;
}
}
}
}
}
performance/Performance.EntityModels/Entity/cost_transfer.cs
View file @
c9acd34c
...
@@ -46,10 +46,13 @@ public class cost_transfer
...
@@ -46,10 +46,13 @@ public class cost_transfer
public
string
AdoptedDepartment
{
get
;
set
;
}
public
string
AdoptedDepartment
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 0 未审核 1
部分审核 2 全部审核
/// 0 未审核 1
全部通过 2 部分通过 3 全部驳回 4 含有下发驳回
/// </summary>
/// </summary>
public
int
Status
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 0 未审核 1 全部通过 2 部分通过 3 全部驳回 4 含有下发驳回
/// </summary>
public
int
AdminStatus
{
get
;
set
;
}
public
int
AdminStatus
{
get
;
set
;
}
}
}
}
}
performance/Performance.Services/CostTransfer/CostTransferService.cs
View file @
c9acd34c
...
@@ -58,9 +58,11 @@ PerforImdataRepository imdataRepository
...
@@ -58,9 +58,11 @@ PerforImdataRepository imdataRepository
/// 审核页面
/// 审核页面
/// </summary>
/// </summary>
/// <param name="allotId"></param>
/// <param name="allotId"></param>
/// <param name="menuType">1:申请 2:审核</param>
/// <param name="roleType"></param>
/// <param name="Department"></param>
/// <param name="Department"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
CostTransferResponse
>
GetAuditList
(
int
allotId
,
int
roleType
,
string
Department
)
public
List
<
CostTransferResponse
>
GetAuditList
(
int
allotId
,
int
menuType
,
int
roleType
,
string
Department
)
{
{
var
roleTypes
=
new
[]
{
1
,
2
,
5
}.
Contains
(
roleType
);
var
roleTypes
=
new
[]
{
1
,
2
,
5
}.
Contains
(
roleType
);
var
account
=
GetAccounting
(
allotId
,
roleType
,
Department
);
var
account
=
GetAccounting
(
allotId
,
roleType
,
Department
);
...
@@ -78,7 +80,11 @@ public List<CostTransferResponse> GetAuditList(int allotId, int roleType, string
...
@@ -78,7 +80,11 @@ public List<CostTransferResponse> GetAuditList(int allotId, int roleType, string
var
costTransfers
=
costtransferRepository
.
GetEntities
(
exp
);
var
costTransfers
=
costtransferRepository
.
GetEntities
(
exp
);
if
(!
roleTypes
)
if
(!
roleTypes
)
costTransfers
=
costTransfers
?.
FindAll
(
t
=>
t
.
AdoptedDepartment
==
Department
);
if
(
menuType
==
1
)
costTransfers
=
costTransfers
?.
FindAll
(
t
=>
t
.
ApplicantDepartment
==
Department
);
else
costTransfers
=
costTransfers
?.
FindAll
(
t
=>
t
.
AdoptedDepartment
==
Department
);
if
(
costTransfers
==
null
||
!
costTransfers
.
Any
())
if
(
costTransfers
==
null
||
!
costTransfers
.
Any
())
return
new
List
<
CostTransferResponse
>();
return
new
List
<
CostTransferResponse
>();
...
@@ -98,6 +104,7 @@ public List<CostTransferResponse> GetAuditList(int allotId, int roleType, string
...
@@ -98,6 +104,7 @@ public List<CostTransferResponse> GetAuditList(int allotId, int roleType, string
result
.
Items
=
costItem
.
Where
(
t
=>
t
.
TransferId
==
item
.
Id
)?.
Select
(
t
=>
new
Option
result
.
Items
=
costItem
.
Where
(
t
=>
t
.
TransferId
==
item
.
Id
)?.
Select
(
t
=>
new
Option
{
{
Id
=
t
.
Id
,
Id
=
t
.
Id
,
TransferId
=
t
.
TransferId
,
Source
=
t
.
Source
,
Source
=
t
.
Source
,
Category
=
t
.
Category
,
Category
=
t
.
Category
,
Amount
=
t
.
Amount
,
Amount
=
t
.
Amount
,
...
@@ -106,13 +113,15 @@ public List<CostTransferResponse> GetAuditList(int allotId, int roleType, string
...
@@ -106,13 +113,15 @@ public List<CostTransferResponse> GetAuditList(int allotId, int roleType, string
Status
=
t
.
Status
,
Status
=
t
.
Status
,
AdminStatus
=
t
.
AdminStatus
,
AdminStatus
=
t
.
AdminStatus
,
Remark
=
t
.
Remark
,
Remark
=
t
.
Remark
,
options
=
new
string
[]
{
}
options
=
new
string
[]
{
},
ApplicantDepartment
=
result
.
ApplicantDepartment
,
AdoptedDepartment
=
result
.
AdoptedDepartment
}).
OrderBy
(
t
=>
t
.
Status
).
ThenBy
(
t
=>
t
.
AdminStatus
).
ToList
();
}).
ToList
();
response
.
Add
(
result
);
response
.
Add
(
result
);
}
}
return
response
.
OrderBy
(
t
=>
t
.
Status
).
ToList
();
return
response
.
OrderBy
(
t
=>
t
.
Status
).
T
henBy
(
t
=>
t
.
AdminStatus
).
T
oList
();
}
}
...
@@ -147,6 +156,22 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
...
@@ -147,6 +156,22 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
?.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
AccountingUnit
,
Value
=
t
.
AccountingUnit
}).
ToDistinct
().
ToList
();
?.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
AccountingUnit
,
Value
=
t
.
AccountingUnit
}).
ToDistinct
().
ToList
();
var
sheets
=
persheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetType
==
(
int
)
SheetType
.
Income
);
var
sheets
=
persheetRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetType
==
(
int
)
SheetType
.
Income
);
common
.
unitType
=
GetAccounting
(
allotId
,
roleType
,
deparment
)?.
UnitType
;
if
(
common
.
unitType
==
null
)
{
var
prevAllot
=
PrevAllot
(
hospitalId
,
allotId
);
if
(
prevAllot
==
null
)
return
common
;
common
.
unitType
=
GetAccounting
(
prevAllot
.
ID
,
roleType
,
deparment
)?.
UnitType
;
to
:
if
(
common
.
unitType
==
null
)
{
var
prevAllotId
=
prevAllot
.
ID
--;
if
(
prevAllotId
<=
0
)
return
common
;
common
.
unitType
=
GetAccounting
(
prevAllot
.
ID
,
roleType
,
deparment
)?.
UnitType
;
goto
to
;
}
}
if
(
sheets
==
null
||
!
sheets
.
Any
())
if
(
sheets
==
null
||
!
sheets
.
Any
())
{
{
var
data
=
new
List
<
Common
>()
var
data
=
new
List
<
Common
>()
...
@@ -160,8 +185,7 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
...
@@ -160,8 +185,7 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
return
common
;
return
common
;
}
}
var
unitType
=
GetAccounting
(
allotId
,
roleType
,
deparment
)?.
UnitType
;
var
unitValue
=
EnumHelper
.
GetItems
<
UnitType
>().
Find
(
t
=>
t
.
Name
==
common
.
unitType
)?.
Value
;
var
unitValue
=
EnumHelper
.
GetItems
<
UnitType
>().
Find
(
t
=>
t
.
Name
==
unitType
).
Value
;
var
sheetId
=
sheets
.
Select
(
t
=>
t
.
ID
);
var
sheetId
=
sheets
.
Select
(
t
=>
t
.
ID
);
var
imData
=
imdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
sheetId
.
Contains
(
t
.
SheetID
.
Value
)
&&
t
.
UnitType
==
unitValue
);
var
imData
=
imdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
sheetId
.
Contains
(
t
.
SheetID
.
Value
)
&&
t
.
UnitType
==
unitValue
);
...
@@ -177,7 +201,6 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
...
@@ -177,7 +201,6 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
}).
ToList
();
}).
ToList
();
common
.
Data
=
commons
;
common
.
Data
=
commons
;
common
.
unitType
=
unitType
;
#
region
#
region
/*
/*
var drugType = cofdrugtypeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotID == allotId)
var drugType = cofdrugtypeRepository.GetEntities(t => t.HospitalId == hospitalId && t.AllotID == allotId)
...
@@ -197,19 +220,7 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
...
@@ -197,19 +220,7 @@ public CommonResponse Common(int allotId, int hospitalId, int roleType, string d
?.Select(t => new TitleValue { Title = t.AccountingUnit, Value = t.AccountingUnit }).ToDistinct();
?.Select(t => new TitleValue { Title = t.AccountingUnit, Value = t.AccountingUnit }).ToDistinct();
*/
*/
#
endregion
#
endregion
if
(
unitType
==
null
)
{
var
prevAllot
=
PrevAllot
(
hospitalId
,
allotId
);
common
.
unitType
=
GetAccounting
(
prevAllot
.
ID
,
roleType
,
deparment
)?.
UnitType
;
to
:
if
(
common
.
unitType
==
null
)
{
var
prevAllotId
=
prevAllot
.
ID
--;
if
(
prevAllotId
<=
0
)
return
common
;
common
.
unitType
=
GetAccounting
(
prevAllot
.
ID
,
roleType
,
deparment
)?.
UnitType
;
goto
to
;
}
}
return
common
;
return
common
;
}
}
...
@@ -226,7 +237,7 @@ public bool Applicat(CostTransferRequest request)
...
@@ -226,7 +237,7 @@ public bool Applicat(CostTransferRequest request)
throw
new
PerformanceException
(
"参数错误,申请/被划拨科室信息缺失"
);
throw
new
PerformanceException
(
"参数错误,申请/被划拨科室信息缺失"
);
if
(
string
.
IsNullOrEmpty
(
request
.
Applicant
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Applicant
.
Department
))
if
(
string
.
IsNullOrEmpty
(
request
.
Applicant
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Applicant
.
Department
))
throw
new
PerformanceException
(
"
参数错误,申请科室信息缺失
"
);
throw
new
PerformanceException
(
"
当前科室未配置科室类别,无法提交申请
"
);
if
(
string
.
IsNullOrEmpty
(
request
.
Adopted
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Adopted
.
Department
))
if
(
string
.
IsNullOrEmpty
(
request
.
Adopted
.
UnitType
)
||
string
.
IsNullOrEmpty
(
request
.
Adopted
.
Department
))
throw
new
PerformanceException
(
"参数错误,被划拨科室信息缺失"
);
throw
new
PerformanceException
(
"参数错误,被划拨科室信息缺失"
);
...
@@ -251,7 +262,7 @@ public bool Applicat(CostTransferRequest request)
...
@@ -251,7 +262,7 @@ public bool Applicat(CostTransferRequest request)
AdoptedDepartment
=
request
.
Adopted
.
Department
,
AdoptedDepartment
=
request
.
Adopted
.
Department
,
AdoptedUnitType
=
request
.
Adopted
.
UnitType
,
AdoptedUnitType
=
request
.
Adopted
.
UnitType
,
Status
=
0
,
Status
=
0
,
AdminStatus
=
0
AdminStatus
=
0
};
};
var
result
=
costtransferRepository
.
Add
(
transfer
);
var
result
=
costtransferRepository
.
Add
(
transfer
);
...
@@ -287,7 +298,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -287,7 +298,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
var
transfer
=
costtransferRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
TransferId
);
var
transfer
=
costtransferRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
TransferId
);
if
(
transfer
==
null
)
if
(
transfer
==
null
)
throw
new
PerformanceException
(
"划拨申请记录不存在"
);
throw
new
PerformanceException
(
"划拨申请记录不存在"
);
/*
transfer.AllotId = request.AllotId;
transfer.AllotId = request.AllotId;
transfer.ApplicantDepartment = request.Applicant.Department;
transfer.ApplicantDepartment = request.Applicant.Department;
transfer.ApplicantUnitType = request.Applicant.UnitType;
transfer.ApplicantUnitType = request.Applicant.UnitType;
...
@@ -296,7 +307,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -296,7 +307,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
var result = costtransferRepository.Update(transfer);
var result = costtransferRepository.Update(transfer);
if (!result)
if (!result)
throw
new
PerformanceException
(
"修改划拨申请记录失败"
);
throw new PerformanceException("修改划拨申请记录失败");
*/
var
items
=
costtransferitemRepository
.
GetEntities
(
t
=>
t
.
TransferId
==
request
.
TransferId
);
var
items
=
costtransferitemRepository
.
GetEntities
(
t
=>
t
.
TransferId
==
request
.
TransferId
);
if
(
items
==
null
)
if
(
items
==
null
)
...
@@ -321,11 +332,11 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -321,11 +332,11 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
if
(
request
.
Items
.
Any
(
t
=>
t
.
Id
>
0
))
if
(
request
.
Items
.
Any
(
t
=>
t
.
Id
>
0
))
{
{
var
hasPrimaryValueItmes
=
request
.
Items
.
Where
(
t
=>
t
.
Id
>
0
).
ToList
();
var
hasPrimaryValueItmes
=
request
.
Items
.
Where
(
t
=>
t
.
Id
>
0
).
ToList
();
/*
// 删除
// 删除
var notExistItems = items.Where(item => !hasPrimaryValueItmes.Select(t => t.Id).Contains(item.Id));
var notExistItems = items.Where(item => !hasPrimaryValueItmes.Select(t => t.Id).Contains(item.Id));
if (notExistItems != null && notExistItems.Any())
if (notExistItems != null && notExistItems.Any())
costtransferitemRepository
.
RemoveRange
(
notExistItems
.
ToArray
());
costtransferitemRepository.RemoveRange(notExistItems.ToArray());
*/
// 更新
// 更新
var
updateItems
=
items
.
Where
(
item
=>
hasPrimaryValueItmes
.
Select
(
t
=>
t
.
Id
).
Contains
(
item
.
Id
));
var
updateItems
=
items
.
Where
(
item
=>
hasPrimaryValueItmes
.
Select
(
t
=>
t
.
Id
).
Contains
(
item
.
Id
));
...
@@ -334,7 +345,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -334,7 +345,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
var
item
=
hasPrimaryValueItmes
.
FirstOrDefault
(
t
=>
t
.
Id
==
update
.
Id
);
var
item
=
hasPrimaryValueItmes
.
FirstOrDefault
(
t
=>
t
.
Id
==
update
.
Id
);
update
.
Source
=
item
.
Source
;
update
.
Source
=
item
.
Source
;
update
.
Category
=
item
.
Source
;
update
.
Category
=
item
.
Category
;
update
.
Amount
=
item
.
Amount
;
update
.
Amount
=
item
.
Amount
;
update
.
Ratio
=
item
.
Ratio
;
update
.
Ratio
=
item
.
Ratio
;
update
.
CalculationAmount
=
item
.
CalculationAmount
;
update
.
CalculationAmount
=
item
.
CalculationAmount
;
...
@@ -345,7 +356,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -345,7 +356,7 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
hasPrimaryValueItmes
.
Remove
(
item
);
hasPrimaryValueItmes
.
Remove
(
item
);
}
}
costtransferitemRepository
.
UpdateRange
(
updateItems
.
ToArray
());
costtransferitemRepository
.
UpdateRange
(
updateItems
.
ToArray
());
/*
// 添加
// 添加
if (hasPrimaryValueItmes != null && hasPrimaryValueItmes.Any())
if (hasPrimaryValueItmes != null && hasPrimaryValueItmes.Any())
{
{
...
@@ -356,13 +367,13 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
...
@@ -356,13 +367,13 @@ public void UpdateApplicat(CostTransferUpdateRequest request)
t.Status = 0;
t.Status = 0;
});
});
costtransferitemRepository.AddRange(hasPrimaryValueItmes.ToArray());
costtransferitemRepository.AddRange(hasPrimaryValueItmes.ToArray());
}
}
*/
}
}
/*
if (request.Items.Any(t => t.Id == 0)) // 添加
if (request.Items.Any(t => t.Id == 0)) // 添加
{
{
costtransferitemRepository.AddRange(request.Items.Where(t => t.Id == 0).ToArray());
costtransferitemRepository.AddRange(request.Items.Where(t => t.Id == 0).ToArray());
}
}
*/
}
}
}
}
...
@@ -392,8 +403,11 @@ public void DeleteApplicat(int transferId)
...
@@ -392,8 +403,11 @@ public void DeleteApplicat(int transferId)
/// <summary>
/// <summary>
/// 划拨审核
/// 划拨审核
/// </summary>
/// </summary>
public
bool
CostTransferAudit
(
CostTransferUpdate
Request
request
,
bool
isAdmin
)
public
bool
CostTransferAudit
(
Audit
Request
request
,
bool
isAdmin
)
{
{
if
(
request
.
TransferItemId
.
Length
<=
0
)
throw
new
PerformanceException
(
"没有可以审核的记录"
);
var
costItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
request
.
TransferItemId
.
Contains
(
t
.
Id
));
var
costItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
request
.
TransferItemId
.
Contains
(
t
.
Id
));
var
transferId
=
costItems
?.
Select
(
t
=>
t
.
TransferId
).
Distinct
();
var
transferId
=
costItems
?.
Select
(
t
=>
t
.
TransferId
).
Distinct
();
var
transfers
=
costtransferRepository
.
GetEntities
(
t
=>
transferId
.
Contains
(
t
.
Id
));
var
transfers
=
costtransferRepository
.
GetEntities
(
t
=>
transferId
.
Contains
(
t
.
Id
));
...
@@ -401,13 +415,21 @@ public bool CostTransferAudit(CostTransferUpdateRequest request, bool isAdmin)
...
@@ -401,13 +415,21 @@ public bool CostTransferAudit(CostTransferUpdateRequest request, bool isAdmin)
if
(
isAdmin
)
if
(
isAdmin
)
{
{
costItems
=
costItems
?.
FindAll
(
t
=>
t
.
AdminStatus
==
0
);
costItems
.
ForEach
(
t
=>
costItems
.
ForEach
(
t
=>
t
.
AdminStatus
=
request
.
Status
);
{
t
.
AdminStatus
=
request
.
Status
;
t
.
Remark
=
request
.
Remake
;
});
}
}
else
else
{
{
costItems
=
costItems
?.
FindAll
(
t
=>
t
.
Status
==
0
);
costItems
.
ForEach
(
t
=>
costItems
.
ForEach
(
t
=>
t
.
Status
=
request
.
Status
);
{
if
(
request
.
Status
==
2
&&
t
.
AdminStatus
!=
0
)
t
.
AdminStatus
=
2
;
t
.
Status
=
request
.
Status
;
t
.
Remark
=
request
.
Remake
;
});
}
}
//if (costItems == null || !costItems.Any()) return;
//if (costItems == null || !costItems.Any()) return;
...
@@ -428,13 +450,13 @@ public bool CostTransferAudit(CostTransferUpdateRequest request, bool isAdmin)
...
@@ -428,13 +450,13 @@ public bool CostTransferAudit(CostTransferUpdateRequest request, bool isAdmin)
/// <param name="transferId"></param>
/// <param name="transferId"></param>
/// <param name="issue"></param>
/// <param name="issue"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
RejectedApplicat
(
int
allotId
,
int
transferId
=
0
,
bool
issue
=
false
)
public
bool
RejectedApplicat
(
int
allotId
)
{
{
var
costTransfers
=
costtransferRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
(
t
.
Status
==
0
||
t
.
Status
==
1
));
var
costTransfers
=
costtransferRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
&&
new
[]
{
0
,
2
}.
Contains
(
t
.
AdminStatus
));
if
(
costTransfers
==
null
||
!
costTransfers
.
Any
())
return
true
;
if
(
costTransfers
==
null
||
!
costTransfers
.
Any
())
return
true
;
var
costId
=
costTransfers
?.
Select
(
t
=>
t
.
Id
);
var
costId
=
costTransfers
?.
Select
(
t
=>
t
.
Id
);
var
costItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
costId
.
Contains
(
t
.
TransferId
));
var
costItems
=
costtransferitemRepository
.
GetEntities
(
t
=>
costId
.
Contains
(
t
.
TransferId
)
&&
t
.
AdminStatus
==
0
);
costItems
.
ForEach
(
t
=>
costItems
.
ForEach
(
t
=>
{
{
...
@@ -444,13 +466,13 @@ public bool RejectedApplicat(int allotId, int transferId = 0, bool issue = false
...
@@ -444,13 +466,13 @@ public bool RejectedApplicat(int allotId, int transferId = 0, bool issue = false
costTransfers
.
ForEach
(
t
=>
costTransfers
.
ForEach
(
t
=>
{
{
t
.
Status
=
2
;
t
.
Status
=
4
;
t
.
AdminStatus
=
2
;
t
.
AdminStatus
=
4
;
});
});
costtransferitemRepository
.
UpdateRange
(
costItems
.
ToArray
());
costtransferitemRepository
.
UpdateRange
(
costItems
.
ToArray
());
costtransferRepository
.
UpdateRange
(
costTransfers
.
ToArray
());
costtransferRepository
.
UpdateRange
(
costTransfers
.
ToArray
());
return
fals
e
;
return
tru
e
;
}
}
/// <summary>
/// <summary>
...
@@ -493,7 +515,7 @@ public void IntoLastTiemData(int hospitalId, int allotId)
...
@@ -493,7 +515,7 @@ public void IntoLastTiemData(int hospitalId, int allotId)
Remark
=
t
.
Remark
,
Remark
=
t
.
Remark
,
Status
=
0
,
Status
=
0
,
AdminStatus
=
0
,
AdminStatus
=
0
,
IsWrited
=
t
.
IsWrited
IsWrited
=
0
}).
ToArray
();
}).
ToArray
();
costtransferitemRepository
.
AddRange
(
newCostItem
);
costtransferitemRepository
.
AddRange
(
newCostItem
);
}
}
...
@@ -535,29 +557,57 @@ public void UpdateCostTransferStatus(int transferId)
...
@@ -535,29 +557,57 @@ public void UpdateCostTransferStatus(int transferId)
transfer
.
Status
=
3
;
transfer
.
Status
=
3
;
transfer
.
AdminStatus
=
0
;
transfer
.
AdminStatus
=
0
;
break
;
break
;
//科室部分通过,绩效办待审核
case
var
data
when
!
data
.
Any
(
t
=>
t
.
Status
==
0
):
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
Status
!=
1
)
&&
data
.
Any
(
t
=>
t
.
Admin
Status
==
0
):
transfer
.
Status
=
2
;
transfer
.
Status
=
2
;
transfer
.
AdminStatus
=
0
;
transfer
.
AdminStatus
=
0
;
break
;
break
;
//科室部分通过,绩效办部分通过
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
0
)
&&
!
data
.
Any
(
t
=>
t
.
Status
==
0
):
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
Status
!=
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
!=
1
):
transfer
.
Status
=
1
;
transfer
.
Status
=
2
;
transfer
.
AdminStatus
=
0
;
transfer
.
AdminStatus
=
2
;
break
;
break
;
//科室部分通过,绩效办全部驳回
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
0
):
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
Status
!=
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
2
):
transfer
.
Status
=
0
;
transfer
.
Status
=
2
;
transfer
.
AdminStatus
=
2
;
break
;
//科室全部通过,绩效办待审核
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
0
):
transfer
.
Status
=
1
;
transfer
.
AdminStatus
=
0
;
transfer
.
AdminStatus
=
0
;
break
;
break
;
case
var
data
when
!
data
.
Any
(
t
=>
t
.
Status
==
0
)
&&
!
data
.
Any
(
t
=>
t
.
AdminStatus
==
0
):
//科室全部通过,绩效办部分通过
transfer
.
Status
=
2
;
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
!=
1
):
transfer
.
Status
=
1
;
transfer
.
AdminStatus
=
2
;
transfer
.
AdminStatus
=
2
;
break
;
break
;
case
var
data
when
!
data
.
Any
(
t
=>
t
.
Status
==
0
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
0
)
&&
!
data
.
Any
(
t
=>
t
.
AdminStatus
==
0
):
//科室全部通过,绩效办全部通过
transfer
.
Status
=
2
;
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
1
):
transfer
.
Status
=
1
;
transfer
.
AdminStatus
=
1
;
transfer
.
AdminStatus
=
1
;
break
;
break
;
//科室全部通过,绩效办全部驳回
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
1
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
2
):
transfer
.
Status
=
1
;
transfer
.
AdminStatus
=
3
;
break
;
//科室全部驳回,绩效办待审核
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
2
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
0
):
transfer
.
Status
=
3
;
transfer
.
AdminStatus
=
0
;
break
;
//科室全部驳回,绩效办全部驳回
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
2
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
2
):
transfer
.
Status
=
3
;
transfer
.
AdminStatus
=
3
;
break
;
//科室待审核,绩效办待审核
case
var
data
when
data
.
Any
(
t
=>
t
.
Status
==
0
)
&&
data
.
Any
(
t
=>
t
.
AdminStatus
==
0
):
transfer
.
Status
=
0
;
transfer
.
AdminStatus
=
0
;
break
;
default
:
default
:
break
;
break
;
}
}
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CostTransferDataWrite.cs
View file @
c9acd34c
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
{
{
public
class
CostTransferDataWrite
public
class
CostTransferDataWrite
:
IAutoInjection
{
{
private
readonly
ILogger
logger
;
private
readonly
ILogger
logger
;
private
readonly
PerforCosttransferRepository
costtransferRepository
;
private
readonly
PerforCosttransferRepository
costtransferRepository
;
...
@@ -75,7 +75,7 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
...
@@ -75,7 +75,7 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
var
column
=
header
.
GetCell
(
i
)?.
GetDecodeEscapes
().
Replace
(
"("
,
"("
).
Replace
(
")"
,
")"
);
var
column
=
header
.
GetCell
(
i
)?.
GetDecodeEscapes
().
Replace
(
"("
,
"("
).
Replace
(
")"
,
")"
);
if
(!
string
.
IsNullOrEmpty
(
column
)
&&
fixedColumns
.
Any
(
t
=>
t
==
column
))
if
(!
string
.
IsNullOrEmpty
(
column
)
&&
fixedColumns
.
Any
(
t
=>
t
==
column
))
{
{
if
(
pairs
.
ContainsKey
(
column
))
if
(
!
pairs
.
ContainsKey
(
column
))
pairs
.
Add
(
column
,
i
);
pairs
.
Add
(
column
,
i
);
fixedColumns
.
Remove
(
column
);
fixedColumns
.
Remove
(
column
);
...
@@ -90,7 +90,8 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
...
@@ -90,7 +90,8 @@ public void WriteSheetData(ISheet sheet, PerSheetPoint point, ExcelStyle style,
var
cell
=
header
.
CreateCell
(
index
);
var
cell
=
header
.
CreateCell
(
index
);
cell
.
SetCellValue
(
column
);
cell
.
SetCellValue
(
column
);
if
(
pairs
.
ContainsKey
(
column
))
pairs
.
Add
(
column
,
index
);
if
(!
pairs
.
ContainsKey
(
column
))
pairs
.
Add
(
column
,
index
);
index
++;
index
++;
}
}
...
...
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