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
7eed7aed
Commit
7eed7aed
authored
Oct 23, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并
parent
3fd45c0f
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
136 additions
and
41 deletions
+136
-41
performance/Performance.Api/Controllers/ComputeController.cs
+28
-19
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+5
-0
performance/Performance.EntityModels/Entity/sys_hospital.cs
+5
-0
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+1
-0
performance/Performance.Services/ComputeService.cs
+42
-3
performance/Performance.Services/DFExtractService.cs
+19
-10
performance/Performance.Services/HistoryService.cs
+24
-5
performance/Performance.Services/PerExcelService/PerSheetService.cs
+3
-1
performance/Performance.Services/PersonService.cs
+1
-1
performance/Performance.Services/SecondAllotService.cs
+8
-2
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
7eed7aed
...
@@ -212,31 +212,40 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
...
@@ -212,31 +212,40 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
List
<
res_baiscnorm
>
avgs
=
new
List
<
res_baiscnorm
>();
var
isShowManage
=
_computeService
.
IsShowManage
(
request
.
AllotId
);
var
isShowManage
=
_computeService
.
IsShowManage
(
request
.
AllotId
);
var
list
=
_computeService
.
AllCompute
(
request
.
AllotId
,
isShowManage
);
var
list
=
_computeService
.
AllCompute
(
request
.
AllotId
,
isShowManage
);
List
<
res_baiscnorm
>
avgs
=
new
List
<
res_baiscnorm
>();
if
(
list
!=
null
)
{
avgs
=
_computeService
.
AllComputeAvg
(
request
.
AllotId
,
list
);
}
var
gc
=
list
.
Where
(
w
=>
w
.
UnitType
!=
UnitType
.
行政高层
.
ToString
()
);
//List<res_baiscnorm> avgs = new List<res_baiscnorm>(
);
avgs
.
Add
(
new
res_baiscnorm
{
PositionName
=
"不含行政高层人均绩效"
,
TotelNumber
=
gc
.
Select
(
w
=>
new
{
w
.
JobNumber
,
w
.
EmployeeName
}).
Distinct
().
Count
(),
TotelValue
=
Math
.
Round
(
gc
.
Sum
(
s
=>
s
.
RealGiveFee
)
??
0
),
AvgValue
=
gc
.
Select
(
p
=>
new
{
p
.
JobNumber
,
p
.
EmployeeName
}).
Distinct
().
Count
()
==
0
?
0
:
Math
.
Round
(
gc
.
Sum
(
s
=>
s
.
RealGiveFee
)
/
gc
.
Select
(
p
=>
new
{
p
.
JobNumber
,
p
.
EmployeeName
}).
Distinct
().
Count
()
??
0
)
});
avgs
.
AddRange
(
//var gc = list.Where(w => w.UnitType != UnitType.行政高层.ToString());
list
.
GroupBy
(
w
=>
w
.
UnitType
).
Select
(
w
=>
new
res_baiscnorm
{
PositionName
=
$"
{
w
.
Key
}
人均绩效"
,
//avgs.Add(new res_baiscnorm
TotelNumber
=
w
.
Count
(),
//{
TotelValue
=
Math
.
Round
(
w
.
Sum
(
s
=>
s
.
RealGiveFee
)
??
0
),
// PositionName = "不含行政高层人均绩效",
AvgValue
=
gc
.
Select
(
p
=>
new
{
p
.
JobNumber
,
p
.
EmployeeName
}).
Distinct
().
Count
()
==
0
// TotelNumber = gc.Select(w => new { w.JobNumber, w.EmployeeName }).Distinct().Count(),
?
0
:
Math
.
Round
(
gc
.
Sum
(
s
=>
s
.
RealGiveFee
)
/
gc
.
Select
(
p
=>
new
{
p
.
JobNumber
,
p
.
EmployeeName
}).
Distinct
().
Count
()
??
0
)
// TotelValue = Math.Round(gc.Sum(s => s.RealGiveFee) ?? 0),
}));
// AvgValue = gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() == 0
// ? 0 : Math.Round(gc.Sum(s => s.RealGiveFee) / gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() ?? 0)
//});
//avgs.AddRange(
// list.GroupBy(w => w.UnitType).Select(w => new res_baiscnorm
// {
// PositionName = $"{w.Key}人均绩效",
// TotelNumber = w.Count(),
// TotelValue = Math.Round(w.Sum(s => s.RealGiveFee) ?? 0),
// AvgValue = gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() == 0
// ? 0 : Math.Round(gc.Sum(s => s.RealGiveFee) / gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() ?? 0)
// }));
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
avgs
.
Select
(
w
=>
new
{
w
.
PositionName
,
w
.
TotelNumber
,
w
.
TotelValue
,
w
.
AvgValue
}));
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
avgs
.
Select
(
w
=>
new
{
w
.
PositionName
,
w
.
TotelNumber
,
w
.
TotelValue
,
w
.
AvgValue
}));
}
}
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
7eed7aed
...
@@ -5283,6 +5283,11 @@
...
@@ -5283,6 +5283,11 @@
是否开启护理部审核 1 启用 2 禁用
是否开启护理部审核 1 启用 2 禁用
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.sys_hospital.IsShowSecondDirector"
>
<summary>
是否显示二次绩效科主任1 启用 2 禁用
</summary>
</member>
<member
name=
"T:Performance.EntityModels.sys_hospitalconfig"
>
<member
name=
"T:Performance.EntityModels.sys_hospitalconfig"
>
<summary>
<summary>
...
...
performance/Performance.EntityModels/Entity/sys_hospital.cs
View file @
7eed7aed
...
@@ -95,5 +95,10 @@ public class sys_hospital
...
@@ -95,5 +95,10 @@ public class sys_hospital
/// 是否开启护理部审核 1 启用 2 禁用
/// 是否开启护理部审核 1 启用 2 禁用
/// </summary>
/// </summary>
public
Nullable
<
int
>
IsOpenNursingDeptAudit
{
get
;
set
;
}
public
Nullable
<
int
>
IsOpenNursingDeptAudit
{
get
;
set
;
}
/// <summary>
/// 是否显示二次绩效科主任1 启用 2 禁用
/// </summary>
public
Nullable
<
int
>
IsShowSecondDirector
{
get
;
set
;
}
}
}
}
}
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
7eed7aed
...
@@ -255,6 +255,7 @@ public class ResultComputeService : IAutoInjection
...
@@ -255,6 +255,7 @@ public class ResultComputeService : IAutoInjection
Scale
=
sumValue
*
(
empolyee
.
Scale
??
0
),
Scale
=
sumValue
*
(
empolyee
.
Scale
??
0
),
};
};
compute
.
Avg
=
(
group
.
Number
==
0
?
0
:
(
sumValue
/
group
.
Number
))
*
(
empolyee
.
Basics
??
0
)
*
compute
.
Attendance
;
compute
.
Avg
=
(
group
.
Number
==
0
?
0
:
(
sumValue
/
group
.
Number
))
*
(
empolyee
.
Basics
??
0
)
*
compute
.
Attendance
;
// 考核前管理绩效
// 考核前管理绩效
compute
.
ShouldGiveFee
=
Math
.
Round
((
compute
.
Efficiency
+
compute
.
Scale
)
*
compute
.
Grant
+
compute
.
OtherManagePerfor
??
0
);
compute
.
ShouldGiveFee
=
Math
.
Round
((
compute
.
Efficiency
+
compute
.
Scale
)
*
compute
.
Grant
+
compute
.
OtherManagePerfor
??
0
);
...
...
performance/Performance.Services/ComputeService.cs
View file @
7eed7aed
...
@@ -208,6 +208,29 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
...
@@ -208,6 +208,29 @@ public List<ResComputeResponse> GetCompute(int allotId, int type)
}
}
}
}
public
List
<
res_baiscnorm
>
AllComputeAvg
(
int
allotId
,
List
<
ComputeResponse
>
list
)
{
List
<
res_baiscnorm
>
avgs
=
new
List
<
res_baiscnorm
>();
var
emps
=
perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
var
jobCategory
=
emps
?.
Select
(
w
=>
string
.
IsNullOrEmpty
(
w
.
JobCategory
)
?
"未知"
:
w
.
JobCategory
).
Distinct
()
??
new
List
<
string
>();
foreach
(
var
item
in
jobCategory
)
{
var
sumfee
=
(
from
com
in
list
join
emp
in
emps
?.
Where
(
w
=>
w
.
JobCategory
==
item
)
on
com
.
JobNumber
equals
emp
.
PersonnelNumber
select
com
.
ShouldGiveFee
).
Sum
(
w
=>
w
);
var
count
=
emps
?.
Where
(
w
=>
w
.
JobCategory
==
item
).
Select
(
emp
=>
emp
.
PersonnelNumber
).
Distinct
().
Count
()
??
0
;
avgs
.
Add
(
new
res_baiscnorm
{
PositionName
=
item
,
TotelNumber
=
count
,
TotelValue
=
sumfee
,
AvgValue
=
count
==
0
?
0
:
Math
.
Round
(
sumfee
/
count
??
0
),
});
}
return
avgs
;
}
/// <summary>
/// <summary>
/// 返回特殊科室发放列表
/// 返回特殊科室发放列表
/// </summary>
/// </summary>
...
@@ -542,11 +565,27 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co
...
@@ -542,11 +565,27 @@ private List<ComputeResponse> AddAprAmount(int allotId, List<ComputeResponse> co
if
(
list
==
null
||
!
list
.
Any
())
if
(
list
==
null
||
!
list
.
Any
())
return
computes
;
return
computes
;
foreach
(
var
emp
in
computes
)
foreach
(
var
item
in
computes
.
GroupBy
(
w
=>
new
{
w
.
AccountingUnit
,
w
.
JobNumber
})
)
{
{
var
apramount
=
list
.
Where
(
t
=>
t
.
AccountingUnit
==
emp
.
AccountingUnit
&&
!
string
.
IsNullOrEmpty
(
t
.
PersonnelNumber
)
&&
emp
.
JobNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
());
// 补充过一次就不在补充了
emp
.
OthePerfor
=
apramount
?.
Sum
(
w
=>
w
.
Amount
);
var
emp
=
computes
.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Key
.
AccountingUnit
&&
w
.
JobNumber
==
item
.
Key
.
JobNumber
)
.
OrderByDescending
(
w
=>
w
.
Source
).
FirstOrDefault
();
var
apramount
=
list
.
Where
(
t
=>
t
.
AccountingUnit
==
emp
.
AccountingUnit
&&
!
string
.
IsNullOrEmpty
(
t
.
PersonnelNumber
)
&&
emp
.
JobNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
());
emp
.
OthePerfor
=
apramount
?.
Sum
(
w
=>
w
.
Amount
)
??
0
;
//foreach (var emp in computes)
//{
// if (!emp.OthePerfor.HasValue || emp.OthePerfor == 0)
// {
// var apramount = list.Where(t => t.AccountingUnit == emp.AccountingUnit
// && !string.IsNullOrEmpty(t.PersonnelNumber) && emp.JobNumber?.Trim() == t.PersonnelNumber?.Trim());
// emp.OthePerfor = apramount?.Sum(w => w.Amount) ?? 0;
// }
//}
}
}
return
computes
;
return
computes
;
}
}
...
...
performance/Performance.Services/DFExtractService.cs
View file @
7eed7aed
...
@@ -527,10 +527,14 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
...
@@ -527,10 +527,14 @@ public string AlllotExecute(string email, sys_hospital hospital, List<sys_hospit
WriteExpend
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
sheetCollectData
,
false
);
WriteExpend
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
sheetCollectData
,
false
);
break
;
break
;
case
SheetType
.
Workload
:
case
SheetType
.
Workload
:
case
SheetType
.
OtherWorkload
:
ClearData
(
sheet
,
3
,
3
);
ClearData
(
sheet
,
3
,
3
);
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
sheetCollectData
,
false
);
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
sheetCollectData
,
false
);
break
;
break
;
case
SheetType
.
OtherWorkload
:
ClearData
(
sheet
,
1
,
3
,
true
);
sheetRead
=
PerSheetDataFactory
.
GetDataRead
(
SheetType
.
Workload
);
WriteWorkload
(
sheet
,
sheetRead
,
modules
,
items
,
extracts
,
sheetCollectData
,
false
);
break
;
//case SheetType.AccountBasic:
//case SheetType.AccountBasic:
// WriteAccountBasic(sheet, sheetRead, false);
// WriteAccountBasic(sheet, sheetRead, false);
// break;
// break;
...
@@ -831,8 +835,8 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
...
@@ -831,8 +835,8 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
var
newSheet
=
copysheet
.
CopySheet
(
item
.
Key
+
Guid
.
NewGuid
().
ToString
(
"N"
),
true
);
var
newSheet
=
copysheet
.
CopySheet
(
item
.
Key
+
Guid
.
NewGuid
().
ToString
(
"N"
),
true
);
logger
.
LogInformation
(
$"newSheet:
{
newSheet
.
SheetName
}
"
);
logger
.
LogInformation
(
$"newSheet:
{
newSheet
.
SheetName
}
"
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
sheetIndex
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
workbook
.
SetSheetName
(
sheetIndex
,
module
.
ModuleName
);
workbook
.
SetSheetName
(
workbook
.
NumberOfSheets
-
1
,
module
.
ModuleName
);
sheetIndex
++;
newSheetCount
++;
sheetIndex
++;
newSheetCount
++;
}
}
}
}
...
@@ -845,19 +849,19 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
...
@@ -845,19 +849,19 @@ private void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook workbook
if
(
sheet
==
null
)
if
(
sheet
==
null
)
{
{
logger
.
LogInformation
(
$"CreateNotExistSheet:
{
module
.
ModuleName
}
"
);
logger
.
LogInformation
(
$"CreateNotExistSheet:
{
module
.
ModuleName
}
"
);
string
key
=
"工作量"
;
//
string key = "工作量";
if
(
module
.
ModuleName
.
Contains
(
key
))
//
if (module.ModuleName.Contains(key))
{
//
{
var
item
=
pairs
.
Where
(
t
=>
t
.
Key
.
StartsWith
(
"3."
)).
OrderByDescending
(
t
=>
t
.
Key
).
First
();
var
item
=
pairs
.
Where
(
t
=>
t
.
Key
.
StartsWith
(
"3."
)).
OrderByDescending
(
t
=>
t
.
Key
).
First
();
if
(
sheetIndex
==
0
)
if
(
sheetIndex
==
0
)
sheetIndex
=
item
.
Value
+
newSheetCount
+
1
;
sheetIndex
=
item
.
Value
+
newSheetCount
+
1
;
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
var
newSheet
=
copysheet
.
CopySheet
(
item
.
Key
+
Guid
.
NewGuid
().
ToString
(
"N"
),
true
);
var
newSheet
=
copysheet
.
CopySheet
(
item
.
Key
+
Guid
.
NewGuid
().
ToString
(
"N"
),
true
);
logger
.
LogInformation
(
$"newSheet:
{
newSheet
.
SheetName
}
"
);
logger
.
LogInformation
(
$"newSheet:
{
newSheet
.
SheetName
}
"
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
sheetIndex
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
workbook
.
SetSheetName
(
sheetIndex
,
module
.
ModuleName
);
workbook
.
SetSheetName
(
workbook
.
NumberOfSheets
-
1
,
module
.
ModuleName
);
sheetIndex
++;
sheetIndex
++;
}
//
}
}
}
}
}
}
}
...
@@ -1476,7 +1480,12 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
...
@@ -1476,7 +1480,12 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
var
extractdata
=
data
.
Where
(
t
=>
t
.
SheetName
==
specialname
).
ToList
();
var
extractdata
=
data
.
Where
(
t
=>
t
.
SheetName
==
specialname
).
ToList
();
var
merges
=
mergefunc
.
Invoke
(
sheet
,
sheetRead
.
Point
.
DataFirstRowNum
);
var
merges
=
mergefunc
.
Invoke
(
sheet
,
sheetRead
.
Point
.
DataFirstRowNum
);
if
(
merges
==
null
||
!
merges
.
Any
())
return
;
if
(
merges
==
null
||
!
merges
.
Any
())
{
WriteSpecialUnit
(
sheet
,
sheetRead
,
speaialList
,
data
,
sheetRead
.
Point
.
DataFirstRowNum
.
Value
,
lastAllot
,
false
);
return
;
}
merges
=
merges
.
OrderBy
(
t
=>
t
.
FirstRow
).
ToList
();
merges
=
merges
.
OrderBy
(
t
=>
t
.
FirstRow
).
ToList
();
int
startRowIndex
=
sheetRead
.
Point
.
DataFirstRowNum
??
2
;
int
startRowIndex
=
sheetRead
.
Point
.
DataFirstRowNum
??
2
;
...
...
performance/Performance.Services/HistoryService.cs
View file @
7eed7aed
...
@@ -20,17 +20,20 @@ public class HistoryService : IAutoInjection
...
@@ -20,17 +20,20 @@ public class HistoryService : IAutoInjection
private
readonly
PerforReportoriginalsurgeryRepository
reportoriginalsurgeryRepository
;
private
readonly
PerforReportoriginalsurgeryRepository
reportoriginalsurgeryRepository
;
private
readonly
PerforReportoriginalstaysRepository
reportoriginalstaysRepository
;
private
readonly
PerforReportoriginalstaysRepository
reportoriginalstaysRepository
;
private
readonly
PerforReportoriginalpersontimeRepository
reportoriginalpersontimeRepository
;
private
readonly
PerforReportoriginalpersontimeRepository
reportoriginalpersontimeRepository
;
private
readonly
PerforPerdeptdicRepository
perdeptdicRepository
;
public
HistoryService
(
public
HistoryService
(
ILogger
<
EmployeeService
>
logger
,
ILogger
<
EmployeeService
>
logger
,
PerforReportoriginalsurgeryRepository
reportoriginalsurgeryRepository
,
PerforReportoriginalsurgeryRepository
reportoriginalsurgeryRepository
,
PerforReportoriginalstaysRepository
reportoriginalstaysRepository
,
PerforReportoriginalstaysRepository
reportoriginalstaysRepository
,
PerforReportoriginalpersontimeRepository
reportoriginalpersontimeRepository
)
PerforReportoriginalpersontimeRepository
reportoriginalpersontimeRepository
,
PerforPerdeptdicRepository
perdeptdicRepository
)
{
{
this
.
logger
=
logger
;
this
.
logger
=
logger
;
this
.
reportoriginalsurgeryRepository
=
reportoriginalsurgeryRepository
;
this
.
reportoriginalsurgeryRepository
=
reportoriginalsurgeryRepository
;
this
.
reportoriginalstaysRepository
=
reportoriginalstaysRepository
;
this
.
reportoriginalstaysRepository
=
reportoriginalstaysRepository
;
this
.
reportoriginalpersontimeRepository
=
reportoriginalpersontimeRepository
;
this
.
reportoriginalpersontimeRepository
=
reportoriginalpersontimeRepository
;
this
.
perdeptdicRepository
=
perdeptdicRepository
;
}
}
public
void
ImportHistoryData
(
int
hospitalid
,
string
path
)
public
void
ImportHistoryData
(
int
hospitalid
,
string
path
)
{
{
...
@@ -80,9 +83,9 @@ private List<HistoryData> ReadExcelData(int hospitalid, string path)
...
@@ -80,9 +83,9 @@ private List<HistoryData> ReadExcelData(int hospitalid, string path)
var
entities
=
new
List
<
HistoryData
>();
var
entities
=
new
List
<
HistoryData
>();
var
config
=
new
[]
var
config
=
new
[]
{
{
new
{
sheetName
=
"工作量"
,
columnNames
=
new
string
[]
{
"年份"
,
"月份"
,
"来源"
,
"
核算单元"
,
"
科室"
,
"数量"
}
},
new
{
sheetName
=
"工作量"
,
columnNames
=
new
string
[]
{
"年份"
,
"月份"
,
"来源"
,
"科室"
,
"数量"
}
},
new
{
sheetName
=
"手术量"
,
columnNames
=
new
string
[]
{
"年份"
,
"月份"
,
"来源"
,
"
核算单元"
,
"
科室"
,
"数量"
}
},
new
{
sheetName
=
"手术量"
,
columnNames
=
new
string
[]
{
"年份"
,
"月份"
,
"来源"
,
"科室"
,
"数量"
}
},
new
{
sheetName
=
"住院天数"
,
columnNames
=
new
string
[]
{
"年份"
,
"月份"
,
"来源"
,
"
核算单元"
,
"
科室"
,
"数量"
}
},
new
{
sheetName
=
"住院天数"
,
columnNames
=
new
string
[]
{
"年份"
,
"月份"
,
"来源"
,
"科室"
,
"数量"
}
},
};
};
IWorkbook
workbook
=
null
;
IWorkbook
workbook
=
null
;
...
@@ -140,13 +143,29 @@ private List<HistoryData> ReadExcelData(int hospitalid, string path)
...
@@ -140,13 +143,29 @@ private List<HistoryData> ReadExcelData(int hospitalid, string path)
Year
=
ConvertHelper
.
To
<
int
>(
row
.
GetCell
(
dict
[
"年份"
]).
GetValue
()),
Year
=
ConvertHelper
.
To
<
int
>(
row
.
GetCell
(
dict
[
"年份"
]).
GetValue
()),
Month
=
ConvertHelper
.
To
<
int
>(
row
.
GetCell
(
dict
[
"月份"
]).
GetValue
()),
Month
=
ConvertHelper
.
To
<
int
>(
row
.
GetCell
(
dict
[
"月份"
]).
GetValue
()),
SourceType
=
row
.
GetCell
(
dict
[
"来源"
]).
GetValue
(),
SourceType
=
row
.
GetCell
(
dict
[
"来源"
]).
GetValue
(),
AccountingUnit
=
row
.
GetCell
(
dict
[
"核算单元"
]).
GetValue
(),
Department
=
row
.
GetCell
(
dict
[
"科室"
]).
GetValue
(),
Department
=
row
.
GetCell
(
dict
[
"科室"
]).
GetValue
(),
ResultData
=
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"数量"
]).
GetValue
()),
ResultData
=
ConvertHelper
.
To
<
decimal
>(
row
.
GetCell
(
dict
[
"数量"
]).
GetValue
()),
};
};
//if (dict.ContainsKey("核算单元"))
// entity.AccountingUnit = row.GetCell(dict["核算单元"]).GetValue();
entities
.
Add
(
entity
);
entities
.
Add
(
entity
);
}
}
}
}
var
departmentDict
=
perdeptdicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalid
);
if
(
departmentDict
!=
null
&&
departmentDict
.
Any
())
{
var
unittype
=
EnumHelper
.
GetItems
<
UnitType
>();
entities
.
ForEach
(
t
=>
{
var
accountingUnits
=
departmentDict
.
Where
(
w
=>
w
.
Department
==
t
.
Department
&&
w
.
Source
==
t
.
SourceType
);
if
(
accountingUnits
!=
null
&&
accountingUnits
.
Any
())
{
var
accountingUnit
=
accountingUnits
.
OrderBy
(
o
=>
(
unittype
.
FirstOrDefault
(
f
=>
f
.
Name
==
o
.
UnitType
)?.
Value
)
??
int
.
MaxValue
).
FirstOrDefault
(
f
=>
!
string
.
IsNullOrEmpty
(
f
.
AccountingUnit
))?.
AccountingUnit
;
t
.
AccountingUnit
=
accountingUnit
;
}
});
}
return
entities
;
return
entities
;
}
}
}
}
...
...
performance/Performance.Services/PerExcelService/PerSheetService.cs
View file @
7eed7aed
...
@@ -90,8 +90,10 @@ public SheetType GetSheetType(string sheetName)
...
@@ -90,8 +90,10 @@ public SheetType GetSheetType(string sheetName)
return
SheetType
.
Income
;
return
SheetType
.
Income
;
else
if
(
sheetName
.
StartsWith
(
"2."
))
else
if
(
sheetName
.
StartsWith
(
"2."
))
return
SheetType
.
Expend
;
return
SheetType
.
Expend
;
else
if
(
sheetName
.
StartsWith
(
"3."
))
else
if
(
sheetName
.
StartsWith
(
"3.
1"
)
||
sheetName
.
StartsWith
(
"3.2
"
))
return
SheetType
.
Workload
;
return
SheetType
.
Workload
;
else
if
(
sheetName
.
StartsWith
(
"3."
))
return
SheetType
.
OtherWorkload
;
else
if
(
sheetName
.
StartsWith
(
"4.1"
))
else
if
(
sheetName
.
StartsWith
(
"4.1"
))
return
SheetType
.
AccountBasic
;
return
SheetType
.
AccountBasic
;
else
if
(
sheetName
.
StartsWith
(
"4.2"
))
else
if
(
sheetName
.
StartsWith
(
"4.2"
))
...
...
performance/Performance.Services/PersonService.cs
View file @
7eed7aed
...
@@ -74,7 +74,7 @@ public void CreateAllotPersons(int hospitalId, int allotId, int prevAllotId = -1
...
@@ -74,7 +74,7 @@ public void CreateAllotPersons(int hospitalId, int allotId, int prevAllotId = -1
if
(
isExist
)
return
;
if
(
isExist
)
return
;
List
<
per_employee
>
persons
=
new
List
<
per_employee
>();
List
<
per_employee
>
persons
=
new
List
<
per_employee
>();
if
(
new
int
[]
{
-
1
,
0
}.
Contains
(
prevAllotId
))
if
(
!
new
int
[]
{
-
1
,
0
}.
Contains
(
prevAllotId
))
{
{
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
prevAllotId
);
persons
=
peremployeeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
AllotId
==
prevAllotId
);
if
(
persons
==
null
||
!
persons
.
Any
())
if
(
persons
==
null
||
!
persons
.
Any
())
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
7eed7aed
...
@@ -372,13 +372,16 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, int allotId, i
...
@@ -372,13 +372,16 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, int allotId, i
//var employees = personService.GetPersons(allotId, userId);
//var employees = personService.GetPersons(allotId, userId);
if
(
employees
==
null
||
!
employees
.
Any
(
t
=>
t
.
UnitType
==
unittype
))
return
list
;
if
(
employees
==
null
||
!
employees
.
Any
(
t
=>
t
.
UnitType
==
unittype
))
return
list
;
var
hospital
=
hospitalRepository
.
GetEntity
(
t
=>
t
.
ID
==
employees
.
First
().
HospitalId
);
if
(
hospital
==
null
)
return
list
;
if
(
string
.
IsNullOrEmpty
(
empName
)
&&
string
.
IsNullOrEmpty
(
jobNumber
))
if
(
string
.
IsNullOrEmpty
(
empName
)
&&
string
.
IsNullOrEmpty
(
jobNumber
))
employees
=
employees
.
Where
(
t
=>
t
.
UnitType
==
unittype
).
ToList
();
employees
=
employees
.
Where
(
t
=>
t
.
UnitType
==
unittype
).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
empName
))
if
(!
string
.
IsNullOrEmpty
(
empName
))
employees
=
employees
?.
Where
(
w
=>
w
.
DoctorName
?.
Trim
()
==
empName
?.
Trim
()).
ToList
();
employees
=
employees
?.
Where
(
w
=>
w
.
DoctorName
?.
Trim
()
==
empName
?.
Trim
()).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
jobNumber
))
if
(!
string
.
IsNullOrEmpty
(
jobNumber
))
employees
=
employees
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
PersonnelNumber
.
Contains
(
jobNumber
.
Trim
()
)).
ToList
();
employees
=
employees
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
PersonnelNumber
==
jobNumber
.
Trim
(
)).
ToList
();
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
allotId
);
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
AllotId
==
allotId
);
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
...
@@ -413,6 +416,9 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, int allotId, i
...
@@ -413,6 +416,9 @@ private List<BodyItem> GetEmployees(List<per_employee> employees, int allotId, i
rowNumber
++;
rowNumber
++;
}
}
if
(
hospital
.
IsShowSecondDirector
==
2
)
list
=
list
.
Where
(
t
=>
t
.
FiledName
==
"岗位"
&&
t
.
FiledId
==
"Post"
&&
t
.
Value
==
"其他"
)?.
ToList
();
return
list
;
return
list
;
}
}
...
@@ -1519,7 +1525,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user
...
@@ -1519,7 +1525,7 @@ public List<ag_othersource> OtherAutoComplete(SecondEmpRequest request, int user
if
(!
string
.
IsNullOrEmpty
(
request
.
EmployeeName
))
if
(!
string
.
IsNullOrEmpty
(
request
.
EmployeeName
))
employees
=
employees
?.
Where
(
w
=>
w
.
DoctorName
?.
Trim
()
==
request
.
EmployeeName
?.
Trim
()).
ToList
();
employees
=
employees
?.
Where
(
w
=>
w
.
DoctorName
?.
Trim
()
==
request
.
EmployeeName
?.
Trim
()).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
request
.
JobNumber
))
if
(!
string
.
IsNullOrEmpty
(
request
.
JobNumber
))
employees
=
employees
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
PersonnelNumber
.
Contains
(
request
.
JobNumber
.
Trim
()
)).
ToList
();
employees
=
employees
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
PersonnelNumber
==
request
.
JobNumber
.
Trim
(
)).
ToList
();
List
<
ag_othersource
>
result
=
employees
List
<
ag_othersource
>
result
=
employees
.
Select
(
t
=>
new
ag_othersource
.
Select
(
t
=>
new
ag_othersource
...
...
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