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
0d6c172a
Commit
0d6c172a
authored
Jul 26, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回审核录入数据
parent
3cea149b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
336 additions
and
99 deletions
+336
-99
performance/Performance.Api/Controllers/CollectController.cs
+56
-1
performance/Performance.Api/Job/JobRegistry.cs
+1
-1
performance/Performance.Api/wwwroot/Performance.Api.xml
+20
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+20
-0
performance/Performance.DtoModels/HandsonTable.cs
+6
-5
performance/Performance.EntityModels/Entity/collect_data.cs
+8
-2
performance/Performance.Services/CollectService.cs
+225
-90
No files found.
performance/Performance.Api/Controllers/CollectController.cs
View file @
0d6c172a
...
...
@@ -109,10 +109,65 @@ public ApiResponse SaveCollectData(int allotId, [FromBody] SaveCollectData reque
{
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数无效"
);
collectService
.
SaveCollectData
(
allotId
,
request
);
collectService
.
SaveCollectData
(
allotId
,
request
,
claim
.
GetUserId
()
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 提交采集信息
/// </summary>
[
HttpPost
]
[
Route
(
"submitcollectdata/{allotId}"
)]
public
ApiResponse
SubmitCollectData
(
int
allotId
,
[
FromQuery
]
string
sheetName
)
{
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数无效"
);
collectService
.
SubmitCollectData
(
allotId
,
sheetName
,
claim
.
GetUserId
());
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 数据录入显示列表
/// </summary>
[
HttpPost
]
[
Route
(
"collectdatalist/{hospitalId}"
)]
public
ApiResponse
CollectDataList
(
int
hospitalId
)
{
if
(
hospitalId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数无效"
);
var
data
=
collectService
.
CollectDataList
(
hospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
data
);
}
/// <summary>
/// 核算办显示列表
/// </summary>
[
HttpPost
]
[
Route
(
"performanceforlist/{allotId}"
)]
public
ApiResponse
PerformanceforList
(
int
allotId
)
{
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数无效"
);
var
data
=
collectService
.
PerformanceforList
(
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
data
);
}
/// <summary>
/// 科室显示列表
/// </summary>
[
HttpPost
]
[
Route
(
"departmentlist/{allotId}"
)]
public
ApiResponse
DepartmentList
(
int
allotId
,
[
FromQuery
]
int
userId
)
{
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数无效"
);
var
data
=
collectService
.
DepartmentList
(
allotId
,
userId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
data
);
}
}
}
performance/Performance.Api/Job/JobRegistry.cs
View file @
0d6c172a
...
...
@@ -8,7 +8,7 @@ public JobRegistry()
{
//Schedule<ExtractDataJob>().ToRunNow().AndEvery(1).Days().At(23, 0);
//Schedule<ExtractDataJob>().ToRunEvery(1).Days().At(23, 0);
Schedule
<
ExtractGenerateJob
>().
ToRunEvery
(
1
).
Days
().
At
(
14
,
00
);
Schedule
<
ExtractGenerateJob
>().
ToRunEvery
(
1
).
Days
().
At
(
23
,
00
);
}
}
}
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
0d6c172a
...
...
@@ -397,6 +397,26 @@
保存采集内容
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.CollectController.SubmitCollectData(System.Int32,System.String)"
>
<summary>
提交采集信息
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.CollectController.CollectDataList(System.Int32)"
>
<summary>
数据录入显示列表
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.CollectController.PerformanceforList(System.Int32)"
>
<summary>
核算办显示列表
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.CollectController.DepartmentList(System.Int32,System.Int32)"
>
<summary>
科室显示列表
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetCompute(Performance.DtoModels.ComputerRequest)"
>
<summary>
获取绩效发放列表
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
0d6c172a
...
...
@@ -2276,6 +2276,26 @@
单元格value
</summary>
</member>
<member
name=
"P:Performance.EntityModels.collect_data.Status"
>
<summary>
1 保存 2 提交 3 审核通过 4 驳回 5 部分审核
</summary>
</member>
<member
name=
"P:Performance.EntityModels.collect_data.SavedUser"
>
<summary>
保存数据的用户
</summary>
</member>
<member
name=
"P:Performance.EntityModels.collect_data.SavedTime"
>
<summary>
保存数据的时间
</summary>
</member>
<member
name=
"P:Performance.EntityModels.collect_data.SubmitUser"
>
<summary>
提交数据的用户
</summary>
</member>
<member
name=
"T:Performance.EntityModels.collect_permission"
>
<summary>
...
...
performance/Performance.DtoModels/HandsonTable.cs
View file @
0d6c172a
...
...
@@ -48,11 +48,11 @@ public void SetRowData(IEnumerable<HandsonRowData> datas, bool isTypein)
var
dic
=
CreateDataRow
(
"编号"
,
dt
.
Row
.
ToString
());
foreach
(
var
item
in
dt
.
CellData
)
{
if
(
dic
.
ContainsKey
(
item
.
Name
.
ToLower
())
&&
isTypein
&&
_permissions
.
Any
(
w
=>
w
.
HeadName
.
ToLower
()
==
item
.
Name
.
ToLower
()))
dic
[
item
.
Name
.
ToLower
()]
=
item
.
Value
?.
ToString
()
??
""
;
else
if
(
dic
.
ContainsKey
(
item
.
Name
.
ToLower
())
&&
_permissions
.
Any
(
w
=>
w
.
HeadName
.
ToLower
()
==
item
.
Name
.
ToLower
()
&&
w
.
AttachLast
>
0
))
dic
[
item
.
Name
.
ToLower
()]
=
item
.
Value
?.
ToString
()
??
""
;
else
if
(
dic
.
ContainsKey
(
item
.
Name
.
ToLower
())
&&
_permissions
.
Any
(
w
=>
w
.
HeadName
.
ToLower
()
==
item
.
Name
.
ToLower
()))
//
if (dic.ContainsKey(item.Name.ToLower()) && isTypein && _permissions.Any(w => w.HeadName.ToLower() == item.Name.ToLower()))
//
dic[item.Name.ToLower()] = item.Value?.ToString() ?? "";
//
else if (dic.ContainsKey(item.Name.ToLower()) && _permissions.Any(w => w.HeadName.ToLower() == item.Name.ToLower() && w.AttachLast > 0))
//
dic[item.Name.ToLower()] = item.Value?.ToString() ?? "";
//
else if (dic.ContainsKey(item.Name.ToLower()) && _permissions.Any(w => w.HeadName.ToLower() == item.Name.ToLower()))
dic
[
item
.
Name
.
ToLower
()]
=
item
.
Value
?.
ToString
()
??
""
;
}
Data
.
Add
(
dic
);
...
...
@@ -66,6 +66,7 @@ private void InitColHeaders(int sheetType, string[] cols)
new
DefalutHandsonHeader
{
SheetType
=
SheetType
.
OtherIncome
,
Necessity
=
new
[]
{
"核算单元(医技组)"
,
"核算单元(医生组)"
,
"核算单元(护理组)"
,
"科室名称"
}
},
new
DefalutHandsonHeader
{
SheetType
=
SheetType
.
Expend
,
Necessity
=
new
[]
{
"核算单元(医技组)"
,
"核算单元(医生组)"
,
"核算单元(护理组)"
,
"科室名称"
}
},
new
DefalutHandsonHeader
{
SheetType
=
SheetType
.
Workload
,
Necessity
=
new
[]
{
"核算单元"
,
"科室名称"
}
},
new
DefalutHandsonHeader
{
SheetType
=
SheetType
.
SpecialUnit
,
Necessity
=
new
[]
{
"科室名称"
}
},
//new DefalutHandsonHeader{ SheetType = SheetType.AccountExtra, Necessity = new[] { "核算单元","科室名称" } },
//new DefalutHandsonHeader{ SheetType = SheetType.PersonExtra, Necessity = new[] { "核算单元","科室名称" } },
};
...
...
performance/Performance.EntityModels/Entity/collect_data.cs
View file @
0d6c172a
...
...
@@ -3,6 +3,7 @@
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
...
...
@@ -81,7 +82,7 @@ public class collect_data
public
string
CellValue
{
get
;
set
;
}
/// <summary>
/// 1 保存 2 提交 3 审核通过 4 驳回
/// 1 保存 2 提交
(等待审核)
3 审核通过 4 驳回
/// </summary>
public
int
Status
{
get
;
set
;
}
...
...
@@ -93,6 +94,11 @@ public class collect_data
/// <summary>
/// 保存数据的时间
/// </summary>
public
int
SavedTime
{
get
;
set
;
}
public
Nullable
<
DateTime
>
SavedTime
{
get
;
set
;
}
/// <summary>
/// 提交数据的用户
/// </summary>
public
Nullable
<
int
>
SubmitUser
{
get
;
set
;
}
}
}
performance/Performance.Services/CollectService.cs
View file @
0d6c172a
...
...
@@ -13,6 +13,7 @@
using
System.Text
;
using
Google.Protobuf.WellKnownTypes
;
using
HandsonRowData
=
Performance
.
DtoModels
.
HandsonRowData
;
using
Performance.Services.ExtractExcelService
;
namespace
Performance.Services
{
...
...
@@ -33,6 +34,7 @@ public class CollectService : IAutoInjection
private
readonly
PerforPerdeptdicRepository
perforPerdeptdicRepository
;
private
readonly
PerforExmoduleRepository
exmoduleRepository
;
private
readonly
PerforExitemRepository
exitemRepository
;
private
readonly
PerforExspecialRepository
exspecialRepository
;
private
readonly
SheetSevice
sheetSevice
;
private
readonly
Application
options
;
...
...
@@ -52,6 +54,7 @@ public class CollectService : IAutoInjection
PerforPerdeptdicRepository
perforPerdeptdicRepository
,
PerforExmoduleRepository
exmoduleRepository
,
PerforExitemRepository
exitemRepository
,
PerforExspecialRepository
exspecialRepository
,
SheetSevice
sheetSevice
,
IOptions
<
Application
>
options
)
{
...
...
@@ -70,6 +73,7 @@ public class CollectService : IAutoInjection
this
.
perforPerdeptdicRepository
=
perforPerdeptdicRepository
;
this
.
exmoduleRepository
=
exmoduleRepository
;
this
.
exitemRepository
=
exitemRepository
;
this
.
exspecialRepository
=
exspecialRepository
;
this
.
sheetSevice
=
sheetSevice
;
this
.
options
=
options
.
Value
;
}
...
...
@@ -93,21 +97,31 @@ public IEnumerable<CollectPermission> GetCollectContent(int hospitalId, int user
var
allot
=
allotList
.
First
();
var
types
=
new
[]
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
ClinicEmployee
,
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
LogisticsEmployee
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
BudgetRatio
,
(
int
)
SheetType
.
AssessBeforeOtherFee
};
var
types
=
new
[]
{
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
SpecialUnit
};
var
sheets
=
exmoduleRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
types
.
Contains
(
w
.
SheetType
??
0
));
if
(
sheets
==
null
||
!
sheets
.
Any
())
var
specials
=
exspecialRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
);
if
((
sheets
==
null
||
!
sheets
.
Any
())
&&
(
specials
==
null
||
!
specials
.
Any
()))
return
null
;
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
m
=>
m
.
Id
).
Contains
(
w
.
ModuleId
??
0
));
if
(
headers
==
null
||
!
headers
.
Any
(
))
if
(
(
headers
==
null
||
!
headers
.
Any
())
&&
(
specials
==
null
||
!
specials
.
Any
()
))
return
null
;
var
permissions
=
perforcollectpermissionRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
w
.
UserId
==
userId
);
if
(
specials
!=
null
&&
specials
.
Any
())
{
sheets
.
Add
(
new
ex_module
{
HospitalId
=
allot
.
HospitalId
,
SheetType
=
(
int
)
SheetType
.
SpecialUnit
,
ModuleName
=
"4.2 特殊核算单元绩效测算表"
,
Id
=
0
,
});
headers
.
AddRange
(
specials
.
Select
(
t
=>
new
ex_item
{
ItemName
=
t
.
Target
,
ModuleId
=
0
}));
}
var
permissions
=
perforcollectpermissionRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
w
.
UserId
==
userId
);
// 查询sheet和列头对应
var
sheetHeads
=
from
sheet
in
sheets
...
...
@@ -243,25 +257,20 @@ private IEnumerable<collect_permission> GetCollectSheetByAllot(int hospitalId, i
var
allot
=
allotList
.
First
();
var
types
=
new
[]
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
ClinicEmployee
,
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
LogisticsEmployee
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
BudgetRatio
,
(
int
)
SheetType
.
AssessBeforeOtherFee
,(
int
)
SheetType
.
AccountBasic
};
var
types
=
new
[]
{
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
SpecialUnit
};
var
sheets
=
perforPersheetRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
types
.
Contains
((
w
.
SheetType
??
0
)));
var
headers
=
perforImheaderRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
);
var
sheets
=
exmoduleRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
&&
types
.
Contains
(
w
.
SheetType
??
0
))
??
new
List
<
ex_module
>();
var
headers
=
exitemRepository
.
GetEntities
(
w
=>
sheets
.
Select
(
t
=>
t
.
Id
).
Contains
(
w
.
ModuleId
??
0
));
var
specials
=
exspecialRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
Expression
<
Func
<
collect_permission
,
bool
>>
exp
=
(
w
)
=>
w
.
HospitalId
==
hospitalId
&&
w
.
UserId
==
userId
;
if
(!
string
.
IsNullOrEmpty
(
sheetName
))
{
exp
=
exp
.
And
(
w
=>
w
.
SheetName
==
sheetName
);
sheets
=
sheets
.
Where
(
w
=>
w
.
Sheet
Name
==
sheetName
)?.
ToList
();
sheets
=
sheets
.
Where
(
w
=>
w
.
Module
Name
==
sheetName
)?.
ToList
();
}
var
permissions
=
perforcollectpermissionRepository
.
GetEntities
(
exp
);
// 查询列头和权限对应
if
(
permissions
==
null
)
{
if
(
sheets
==
null
||
!
sheets
.
Any
())
return
null
;
...
...
@@ -270,23 +279,35 @@ private IEnumerable<collect_permission> GetCollectSheetByAllot(int hospitalId, i
// 查询sheet和列头对应
var
sheetHeads
=
from
sheet
in
sheets
join
head
in
headers
on
sheet
.
ID
equals
head
.
SheetID
select
new
{
sheet
.
SheetName
,
sheet
.
SheetType
,
HeadName
=
head
.
CellValue
};
var
result
=
sheetHeads
.
Select
(
sh
=>
new
collect_permission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
SheetName
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
,
AttachLast
=
0
,
Visible
=
1
})?.
ToList
();
//if (result != null && result.Any())
//{
// result.ForEach(w =>
// {
// var criterion = retain.Any(r => r == w.HeadName);
// w.Readnoly = criterion ? 1 : w.Readnoly;
// });
return
result
;
//}
join
head
in
headers
on
sheet
.
Id
equals
head
.
ModuleId
select
new
{
sheet
.
ModuleName
,
sheet
.
SheetType
,
HeadName
=
head
.
ItemName
};
var
result
=
sheetHeads
.
Select
(
sh
=>
new
collect_permission
{
HospitalId
=
hospitalId
,
SheetName
=
sh
.
ModuleName
,
SheetType
=
sh
.
SheetType
.
Value
,
HeadName
=
sh
.
HeadName
,
AttachLast
=
0
,
Visible
=
1
})?.
ToList
();
if
(
specials
!=
null
&&
specials
.
Any
())
{
result
.
AddRange
(
specials
.
Select
(
sh
=>
new
collect_permission
{
HospitalId
=
hospitalId
,
SheetName
=
"4.2 特殊核算单元绩效测算表"
,
SheetType
=
(
int
)
SheetType
.
SpecialUnit
,
HeadName
=
sh
.
Target
,
AttachLast
=
0
,
Visible
=
1
}));
}
if
(
result
!=
null
&&
result
.
Any
())
{
foreach
(
var
item
in
result
)
{
var
permission
=
permissions
?.
FirstOrDefault
(
t
=>
t
.
HospitalId
==
item
.
HospitalId
&&
t
.
SheetName
==
item
.
SheetName
&&
t
.
SheetType
==
item
.
SheetType
&&
t
.
HeadName
==
item
.
HeadName
);
if
(
permission
==
null
)
continue
;
item
.
Visible
=
permission
.
Visible
;
}
}
return
permissions
;
return
result
;
}
#
region
加载采集内容
...
...
@@ -319,46 +340,45 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
if
(
allot
==
null
)
throw
new
PerformanceException
(
"当前医院没有录入项"
);
var
types
=
new
[]
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
ClinicEmployee
,
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
LogisticsEmployee
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
BudgetRatio
,
(
int
)
SheetType
.
AssessBeforeOtherFee
,(
int
)
SheetType
.
AccountBasic
};
var
types
=
new
[]
{
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
SpecialUnit
};
var
sheet
=
perforPersheetRepository
.
GetEntity
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
w
.
SheetName
==
sheetName
&&
types
.
Contains
((
w
.
SheetType
??
0
)));
var
sheet
=
new
ex_module
{
HospitalId
=
allot
.
HospitalId
,
SheetType
=
(
int
)
SheetType
.
SpecialUnit
,
ModuleName
=
"4.2 特殊核算单元绩效测算表"
,
};
var
headers
=
new
List
<
ex_item
>();
if
(
sheetName
.
NoBlank
()
==
sheet
.
ModuleName
.
NoBlank
())
{
var
specials
=
exspecialRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
if
(
specials
==
null
||
!
specials
.
Any
())
throw
new
PerformanceException
(
"SHEET页没有有效列头"
);
headers
=
specials
.
Select
(
t
=>
new
ex_item
{
ItemName
=
t
.
Target
}).
ToList
();
}
else
{
sheet
=
exmoduleRepository
.
GetEntity
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
ModuleName
.
NoBlank
()
==
sheetName
.
NoBlank
()
&&
types
.
Contains
(
w
.
SheetType
??
0
));
if
(
sheet
==
null
)
throw
new
PerformanceException
(
"找不到当前SHEET页信息"
);
var
headers
=
perforImheaderRepository
.
GetEntities
(
w
=>
w
.
SheetID
==
sheet
.
ID
)?.
OrderBy
(
w
=>
w
.
PointCell
);
headers
=
exitemRepository
.
GetEntities
(
w
=>
w
.
ModuleId
==
sheet
.
Id
);
if
(
headers
==
null
||
!
headers
.
Any
())
throw
new
PerformanceException
(
"SHEET页没有有效列头"
);
var
cols
=
headers
.
Select
(
w
=>
w
.
CellValue
).
ToArray
();
}
var
cols
=
headers
.
Select
(
w
=>
w
.
ItemName
).
ToArray
();
var
permissions
=
GetCollectSheet
(
allot
.
HospitalId
,
userId
,
sheetName
)?.
ToList
();
if
(
permissions
==
null
||
!
permissions
.
Any
())
throw
new
PerformanceException
(
"用户没有权限编辑当前SHEET页"
);
List
<
HandsonRowData
>
rowDatas
=
n
ull
;
var
collectdata
=
perforcollectdataRepository
.
GetEntities
(
w
=>
w
.
SheetName
==
sheet
.
Sheet
Name
&&
w
.
AllotID
==
allotId
);
List
<
HandsonRowData
>
rowDatas
=
n
ew
List
<
HandsonRowData
>()
;
var
collectdata
=
perforcollectdataRepository
.
GetEntities
(
w
=>
w
.
SheetName
==
sheet
.
Module
Name
&&
w
.
AllotID
==
allotId
);
if
(
collectdata
!=
null
)
{
Dictionary
<
string
,
string
>
config
=
null
;
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Employee
)
config
=
CollectDataConfig
.
Employee
;
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
ClinicEmployee
)
config
=
CollectDataConfig
.
ClinicEmployee
;
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
LogisticsEmployee
)
config
=
CollectDataConfig
.
LogisticsEmployee
;
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
PersonExtra
)
config
=
CollectDataConfig
.
PersonExtra
;
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountBasic
)
config
=
CollectDataConfig
.
AccountBasic
;
else
if
(
CollectDataConfig
.
AccountExrtaType
.
Contains
(
sheet
.
SheetType
.
Value
))
config
=
CollectDataConfig
.
AccountExtra
;
else
config
=
CollectDataConfig
.
Default
;
Dictionary
<
string
,
string
>
config
=
CollectDataConfig
.
Default
;
rowDatas
=
new
List
<
HandsonRowData
>();
foreach
(
var
rownumber
in
collectdata
.
Select
(
w
=>
w
.
RowNumber
).
Distinct
().
OrderBy
(
t
=>
t
))
{
var
first
=
collectdata
.
FirstOrDefault
(
w
=>
w
.
RowNumber
==
rownumber
);
...
...
@@ -376,35 +396,6 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
rowDatas
.
Add
(
new
HandsonRowData
(
rownumber
,
cells
));
}
}
else
{
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
Employee
)
rowDatas
=
GerEmployee
(
sheet
);
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
ClinicEmployee
)
rowDatas
=
GetClinicEmployee
(
sheet
);
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
LogisticsEmployee
)
rowDatas
=
GetLogisticsEmployee
(
sheet
);
else
if
(
sheet
.
SheetType
==
(
int
)
SheetType
.
AccountBasic
)
{
List
<
HandsonCellData
>
cells
=
new
List
<
HandsonCellData
>();
var
dept
=
perforPerdeptdicRepository
.
GetAccountBasicAccountingUnit
(
allot
.
HospitalId
);
rowDatas
=
GetAccountBasic
(
sheet
,
dept
,
cells
);
}
else
rowDatas
=
GetCommonData
(
sheet
);
}
//补全核算单元和类型
var
sTypes
=
new
[]
{
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
};
var
sTypeName
=
new
[]
{
"6.1目标考核"
,
"6.6 科室预算比例"
};
if
(
sTypes
.
Contains
((
int
)
sheet
.
SheetType
)
||
sTypeName
.
Contains
(
sheet
.
SheetName
))
{
List
<
HandsonCellData
>
cells
=
new
List
<
HandsonCellData
>();
var
perSheet
=
perforPersheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetName
==
"4.1 临床科室医护绩效测算表"
);
var
dept
=
perforPerdeptdicRepository
.
GetAccountBasicAccountingUnit
(
allot
.
HospitalId
);
GetAccountBasic
(
perSheet
,
dept
,
cells
);
UnitFit
(
rowDatas
,
cells
,
sheet
);
}
if
(
rowDatas
==
null
||
!
rowDatas
.
Any
())
rowDatas
=
GetAccountExtra
(
allot
,
sheet
.
SheetType
.
Value
);
...
...
@@ -622,10 +613,9 @@ private void GetUnitClassification(List<HandsonCellData> setdata, UnitType unitT
#
endregion
加载采集内容
public
void
SaveCollectData
(
int
allotId
,
SaveCollectData
request
)
public
void
SaveCollectData
(
int
allotId
,
SaveCollectData
request
,
int
userId
)
{
var
types
=
new
List
<
int
>
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
ClinicEmployee
,
(
int
)
SheetType
.
AccountExtra
,
(
int
)
SheetType
.
PersonExtra
,
(
int
)
SheetType
.
LogisticsEmployee
};
var
types
=
new
List
<
int
>
{
(
int
)
SheetType
.
OtherIncome
,
(
int
)
SheetType
.
Expend
,
(
int
)
SheetType
.
Workload
,
(
int
)
SheetType
.
SpecialUnit
};
types
.
AddRange
(
CollectDataConfig
.
AccountExrtaType
);
...
...
@@ -652,6 +642,7 @@ public void SaveCollectData(int allotId, SaveCollectData request)
else
config
=
CollectDataConfig
.
Default
;
DateTime
date
=
DateTime
.
Now
;
var
dicData
=
CreateDataRow
(
allotId
,
request
,
config
);
List
<
collect_data
>
datas
=
new
List
<
collect_data
>();
foreach
(
var
item
in
dicData
)
...
...
@@ -664,6 +655,8 @@ public void SaveCollectData(int allotId, SaveCollectData request)
||
!
string
.
IsNullOrEmpty
(
data
.
Department
))
{
data
.
Status
=
1
;
data
.
SavedUser
=
userId
;
data
.
SavedTime
=
date
;
datas
.
Add
(
data
);
}
}
...
...
@@ -820,6 +813,148 @@ private void UnitFit(List<HandsonRowData> rowDatas, List<HandsonCellData> cellDa
}
rowDatas
.
AddRange
(
suppRowDatas
);
}
public
void
SubmitCollectData
(
int
allotId
,
string
sheetName
,
int
userId
)
{
var
data
=
perforcollectdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetName
==
sheetName
);
if
(
data
==
null
||
!
data
.
Any
())
return
;
data
.
ForEach
(
t
=>
{
t
.
Status
=
2
;
t
.
SubmitUser
=
userId
;
});
perforcollectdataRepository
.
UpdateRange
(
data
.
ToArray
());
}
/// <summary>
/// 数据录入显示列表
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
public
List
<
per_allot
>
CollectDataList
(
int
hospitalId
)
{
var
allots
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
if
(
allots
==
null
||
!
allots
.
Any
())
return
new
List
<
per_allot
>();
allots
=
allots
.
OrderByDescending
(
t
=>
t
.
Year
).
ThenByDescending
(
t
=>
t
.
Month
).
ToList
();
return
allots
;
}
/// <summary>
/// 核算办显示列表
/// </summary>
/// <returns></returns>
public
dynamic
PerformanceforList
(
int
allotId
)
{
var
data
=
perforcollectdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SubmitUser
.
HasValue
);
if
(
data
==
null
||
!
data
.
Any
())
return
new
int
[]
{
};
var
users
=
userRepository
.
GetEntities
();
var
list
=
data
.
GroupBy
(
t
=>
new
{
t
.
SubmitUser
}).
Select
(
t
=>
new
{
UserId
=
t
.
Key
.
SubmitUser
,
User
=
users
.
FirstOrDefault
(
u
=>
u
.
ID
==
t
.
Key
.
SubmitUser
)?.
RealName
??
""
,
Total
=
t
.
Sum
(
s
=>
ConvertHelper
.
To
<
decimal
>(
s
.
CellValue
)),
Status
=
(
t
.
Where
(
g
=>
g
.
Status
==
3
)?.
Count
()
??
0
)
==
t
.
Count
()
?
3
:
(
t
.
Where
(
g
=>
g
.
Status
==
4
)?.
Count
()
??
0
)
==
t
.
Count
()
?
4
:
2
});
return
list
;
}
/// <summary>
/// 科室显示列表
/// </summary>
/// <returns></returns>
public
HandsonTableBase
DepartmentList
(
int
allotId
,
int
userId
)
{
HandsonTableBase
table
=
new
HandsonTableBase
();
var
data
=
perforcollectdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SubmitUser
==
userId
);
if
(
data
==
null
||
!
data
.
Any
())
return
table
;
data
.
ForEach
(
t
=>
{
t
.
AccountingUnitDoctor
=
t
.
AccountingUnitDoctor
??
""
;
t
.
AccountingUnitNurse
=
t
.
AccountingUnitNurse
??
""
;
t
.
AccountingUnitTechnician
=
t
.
AccountingUnitTechnician
??
""
;
});
#
region
headers
columns
var
sheets
=
data
.
Select
(
t
=>
t
.
SheetName
).
Distinct
();
var
mergeCells
=
new
List
<
NestedHeader
>
{
new
NestedHeader
(
""
,
1
),
new
NestedHeader
(
""
,
1
),
new
NestedHeader
(
""
,
1
),
new
NestedHeader
(
""
,
1
),
};
var
cells
=
new
List
<
string
>
{
"核算单元(医技组)"
,
"核算单元(医生组)"
,
"核算单元(护理组)"
,
"科室名称"
,
};
var
headers
=
new
List
<
string
>();
var
columns
=
new
List
<
HandsonColumn
>
{
new
HandsonColumn
(
"核算单元(医技组)"
,
false
),
new
HandsonColumn
(
"核算单元(医生组)"
,
false
),
new
HandsonColumn
(
"核算单元(护理组)"
,
false
),
new
HandsonColumn
(
"科室名称"
,
false
),
};
foreach
(
var
sheet
in
sheets
)
{
var
sheetColumns
=
data
.
Where
(
t
=>
t
.
SheetName
==
sheet
).
Select
(
t
=>
t
.
TypeName
).
Distinct
().
OrderBy
(
t
=>
t
);
headers
.
AddRange
(
sheetColumns
);
mergeCells
.
Add
(
new
NestedHeader
(
sheet
,
sheetColumns
.
Count
()));
columns
.
AddRange
(
sheetColumns
.
Select
(
t
=>
new
HandsonColumn
(
t
,
false
,
DataFormat
.
小数
)));
}
cells
.
AddRange
(
headers
);
#
endregion
#
region
data
List
<
Dictionary
<
string
,
object
>>
tableData
=
new
List
<
Dictionary
<
string
,
object
>>();
var
groupData
=
data
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnitTechnician
,
t
.
AccountingUnitDoctor
,
t
.
AccountingUnitNurse
,
t
.
Department
});
foreach
(
var
item
in
groupData
.
OrderBy
(
t
=>
t
.
Key
.
Department
))
{
var
dic
=
new
Dictionary
<
string
,
object
>();
dic
.
Add
(
"核算单元(医技组)"
,
item
.
Key
.
AccountingUnitTechnician
);
dic
.
Add
(
"核算单元(医生组)"
,
item
.
Key
.
AccountingUnitDoctor
);
dic
.
Add
(
"核算单元(护理组)"
,
item
.
Key
.
AccountingUnitNurse
);
dic
.
Add
(
"科室名称"
,
item
.
Key
.
Department
);
foreach
(
var
header
in
headers
)
{
if
(
dic
.
ContainsKey
(
header
))
continue
;
var
value
=
item
.
FirstOrDefault
(
t
=>
t
.
TypeName
==
header
)?.
CellValue
;
dic
.
Add
(
header
,
value
);
}
tableData
.
Add
(
dic
);
}
#
endregion
table
.
Columns
=
columns
;
table
.
NestedHeadersArray
=
new
object
[]
{
mergeCells
,
cells
};
table
.
ColHeaders
=
cells
;
table
.
Data
=
tableData
;
return
table
;
}
}
public
class
CollectDataConfig
...
...
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