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
95de7014
Commit
95de7014
authored
Nov 12, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效方案添加配置失败
parent
8fc32b31
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
16 deletions
+87
-16
performance/Performance.Services/CollectService.cs
+2
-1
performance/Performance.Services/ExConfigService.cs
+1
-1
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+4
-13
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+8
-1
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+17
-0
performance/Performance.Services/ExtractExcelService/SheetDataWrite/OtherWorkloadDataWrite.cs
+55
-0
No files found.
performance/Performance.Services/CollectService.cs
View file @
95de7014
...
...
@@ -293,7 +293,8 @@ public HandsonTable GetCollectData(int userId, int allotId, string sheetName)
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
.
AccountDrugAssess
,
(
int
)
SheetType
.
AccountMaterialsAssess
,
(
int
)
SheetType
.
AccountScoreAverage
,
(
int
)
SheetType
.
BudgetRatio
,
(
int
)
SheetType
.
AssessBeforeOtherFee
};
var
sheet
=
perforPersheetRepository
.
GetEntity
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
w
.
SheetName
==
sheetName
&&
types
.
Contains
((
w
.
SheetType
??
0
)));
...
...
performance/Performance.Services/ExConfigService.cs
View file @
95de7014
...
...
@@ -139,7 +139,7 @@ public ex_module AddModule(ModModuleRequest request)
{
var
incomeList
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
SheetType
==
(
int
)
SheetType
.
OtherWorkload
);
if
(
incomeList
.
Any
(
t
=>
Regex
.
Replace
(
t
.
ModuleName
,
@"\d"
,
""
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
)
==
request
.
ModuleName
))
if
(
incomeList
!=
null
&&
incomeList
.
Any
(
t
=>
Regex
.
Replace
(
t
.
ModuleName
,
@"\d"
,
""
).
Replace
(
"."
,
""
).
Replace
(
" "
,
""
)
==
request
.
ModuleName
))
throw
new
PerformanceException
(
"绩效模板已存在!"
);
var
moduleList
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
ModuleName
.
IndexOf
(
"3."
)
!=
-
1
);
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
95de7014
...
...
@@ -43,43 +43,34 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
pairs
.
Add
(
workbook
.
GetSheetAt
(
i
).
SheetName
,
i
);
}
int
sheetIndex
=
0
;
int
newSheetCount
=
0
;
foreach
(
var
module
in
modulesList
.
Where
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
Income
)?.
OrderBy
(
t
=>
t
.
ModuleName
))
{
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
);
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
())
;
if
(
sheet
==
null
)
{
string
[]
keyArray
=
new
string
[]
{
"开单"
,
"执行"
};
if
(
keyArray
.
Any
(
key
=>
module
.
ModuleName
.
Contains
(
key
)))
{
var
item
=
pairs
.
Where
(
t
=>
t
.
Key
.
StartsWith
(
"1."
)).
OrderByDescending
(
t
=>
t
.
Key
).
First
();
if
(
sheetIndex
==
0
)
sheetIndex
=
item
.
Value
+
1
;
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
var
newSheet
=
copysheet
.
CopySheet
(
module
.
ModuleName
,
true
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
sheetIndex
);
sheetIndex
++;
newSheetCount
++;
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
}
}
}
sheetIndex
=
0
;
foreach
(
var
module
in
modulesList
.
Where
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
Workload
)?.
OrderBy
(
t
=>
t
.
ModuleName
))
{
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
);
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
())
;
if
(
sheet
==
null
)
{
string
key
=
"工作量"
;
if
(
module
.
ModuleName
.
Contains
(
key
))
{
var
item
=
pairs
.
Where
(
t
=>
t
.
Key
.
StartsWith
(
"3."
)).
OrderByDescending
(
t
=>
t
.
Key
).
First
();
if
(
sheetIndex
==
0
)
sheetIndex
=
item
.
Value
+
newSheetCount
+
1
;
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
var
newSheet
=
copysheet
.
CopySheet
(
module
.
ModuleName
,
true
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
sheetIndex
);
sheetIndex
++;
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
}
}
}
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
95de7014
...
...
@@ -301,7 +301,7 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
{
var
departments
=
data
.
Select
(
s
=>
s
.
Department
).
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
)).
Distinct
().
ToList
();
var
filed
=
sheet
.
SheetName
.
Contains
(
"工作量"
)
?
collectWork
:
collectIncome
;
var
filed
=
sheet
Type
==
SheetType
.
Workload
?
collectWork
:
new
SheetType
[]
{
SheetType
.
OtherIncome
,
SheetType
.
Expend
}.
Contains
(
sheetType
)
?
collectIncome
:
collectDept
;
var
deptStyle
=
style
.
GetCellStyle
();
var
cellStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
数据
);
...
...
@@ -349,6 +349,13 @@ public static void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType
{
"核算单元"
,
(
dto
)
=>
dto
.
AccountingUnitDoctor
},
};
/// <summary> 科室详情数据固定列 </summary>
private
static
readonly
Dictionary
<
string
,
Func
<
collect_data
,
string
>>
collectDept
=
new
Dictionary
<
string
,
Func
<
collect_data
,
string
>>
{
{
"科室名称"
,
(
dto
)
=>
dto
.
Department
},
{
"核算单元类型"
,
(
dto
)
=>
dto
.
UnitType
},
};
#
endregion
}
}
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
95de7014
...
...
@@ -215,5 +215,22 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re
return
groupdata
.
ToList
();
}
//public void ProgressBar(int allotId, decimal ratio, int level = 1)
//{
// if (!string.IsNullOrEmpty(GroupName))
// {
// logService.ReturnTheLog(allotId, GroupName, 3, "", Math.Round(ratio, 2, MidpointRounding.AwayFromZero), level);
// }
//}
//public void Message(int allotId, string tag, string message, int level = 1)
//{
// if (!string.IsNullOrEmpty(GroupName))
// {
// logService.ReturnTheLog(allotId, GroupName, 2, tag, message, level);
// }
//}
}
}
performance/Performance.Services/ExtractExcelService/SheetDataWrite/OtherWorkloadDataWrite.cs
0 → 100644
View file @
95de7014
using
NPOI.SS.UserModel
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services.ExtractExcelService.SheetDataWrite
{
public
class
OtherWorkloadDataWrite
:
ISheetDataWrite
{
public
void
WriteCollectData
(
ISheet
sheet
,
PerSheetPoint
point
,
SheetType
sheetType
,
ExcelStyle
style
,
List
<
collect_data
>
collects
)
{
if
(
collects
==
null
||
!
collects
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
TypeName
)))
return
;
var
columns
=
collects
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
.
TypeName
)).
Select
(
t
=>
t
.
TypeName
).
Distinct
().
OrderBy
(
t
=>
t
).
ToList
();
var
headers
=
columns
.
Select
(
t
=>
new
ExcelHeader
{
ColumnName
=
t
.
Trim
(),
DoctorFactor
=
0
,
NurseFactor
=
0
,
TechnicianFactor
=
0
}).
ToList
();
WriteDataHelper
.
WriteSheetHeader
(
sheet
,
point
,
sheetType
,
style
,
headers
);
WriteDataHelper
.
WriteCollectData
(
sheet
,
point
,
sheetType
,
style
,
columns
,
collects
);
}
public
void
WriteSheetData
(
ISheet
sheet
,
PerSheetPoint
point
,
SheetType
sheetType
,
ExcelStyle
style
,
object
data
,
Dictionary
<
ExDataDict
,
object
>
exdict
=
null
)
{
var
modules
=
exdict
[
ExDataDict
.
ExModule
]
as
List
<
ex_module
>;
var
module
=
modules
?.
FirstOrDefault
(
t
=>
t
.
SheetType
==
(
int
)
sheetType
&&
t
.
ModuleName
.
NoBlank
()
==
sheet
.
SheetName
.
NoBlank
());
if
(
module
==
null
)
return
;
var
items
=
exdict
[
ExDataDict
.
ExItem
]
as
List
<
ex_item
>;
var
modelItems
=
items
?.
Where
(
t
=>
t
.
ModuleId
==
module
.
Id
);
if
(
modelItems
==
null
||
!
modelItems
.
Any
())
return
;
var
headers
=
modelItems
.
Select
(
t
=>
new
ExcelHeader
{
ColumnName
=
t
.
ItemName
,
WorkloadFactor
=
t
.
FactorValue1
??
0
}).
ToList
();
WriteDataHelper
.
WriteSheetHeader
(
sheet
,
point
,
sheetType
,
style
,
headers
);
if
(
data
is
List
<
ExtractTransDto
>
extractDto
&&
extractDto
.
Any
())
{
var
columns
=
headers
.
Select
(
t
=>
t
.
ColumnName
).
Intersect
(
extractDto
.
Select
(
t
=>
t
.
Category
))?.
ToList
();
WriteDataHelper
.
WriteSheetData
(
sheet
,
point
,
sheetType
,
style
,
columns
,
extractDto
);
}
}
}
}
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