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
d5c6b79f
Commit
d5c6b79f
authored
Apr 27, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取空行问题处理
parent
96a24bf5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
46 deletions
+26
-46
performance/Performance.Api/Controllers/AgainAllotController.cs
+0
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+0
-25
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExcelHelper.cs
+6
-0
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+12
-12
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+0
-0
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+6
-8
performance/Performance.Services/ExtractExcelService/SheetDataWrite/IncomeDataWrite.cs
+2
-1
No files found.
performance/Performance.Api/Controllers/AgainAllotController.cs
View file @
d5c6b79f
This diff is collapsed.
Click to expand it.
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
d5c6b79f
...
...
@@ -149,31 +149,6 @@
</summary>
<returns></returns>
</member>
<member
name=
"T:Performance.Api.Controllers.AgainAllotController"
>
<summary>
科室二次分配
</summary>
</member>
<member
name=
"M:Performance.Api.Controllers.AgainAllotController.AllotList"
>
<summary>
返回当前用户医院下绩效列表
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AgainAllotController.Import(Microsoft.AspNetCore.Http.IFormCollection)"
>
<summary>
上传文件
</summary>
<param
name=
"form"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AgainAllotController.Detail(Performance.DtoModels.AgainAllotRequest)"
>
<summary>
查看绩效详情
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.List(Performance.DtoModels.AllotRequest)"
>
<summary>
绩效列表
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExcelHelper.cs
View file @
d5c6b79f
...
...
@@ -225,6 +225,12 @@ public static string NoBlank(this string @string)
return
@string
.
Replace
(
"\n"
,
""
).
Replace
(
"\r"
,
""
).
Replace
(
" "
,
""
).
Trim
();
}
public
static
string
GetNo
(
this
string
@string
)
{
var
match
=
Regex
.
Match
(
@string
,
"^(1.[1-9].[1-9])|(^[1-9]+.[1-9]+)"
);
return
match
.
Value
;
}
public
static
IWorkbook
GetWorkbook
(
string
filePath
)
{
IWorkbook
workbook
=
null
;
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
d5c6b79f
...
...
@@ -54,38 +54,38 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
try
{
var
sheetNames
=
workbook
.
GetAllNames
().
Select
(
w
=>
w
.
SheetName
);
foreach
(
var
module
in
modulesList
.
Where
(
t
=>
t
.
SheetType
==
(
int
)
SheetType
.
Income
)?.
OrderBy
(
t
=>
t
.
ModuleName
))
{
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
());
var
no
=
module
.
ModuleName
.
GetNo
();
var
name
=
sheetNames
.
FirstOrDefault
(
name
=>
name
.
StartsWith
(
no
))
??
module
.
ModuleName
;
var
sheet
=
workbook
.
GetSheet
(
name
)
??
workbook
.
GetSheet
(
module
.
ModuleName
);
if
(
sheet
==
null
)
{
string
[]
keyArray
=
new
string
[]
{
"开单"
,
"就诊"
,
"执行"
};
if
(
keyArray
.
Any
(
key
=>
module
.
ModuleN
ame
.
Contains
(
key
)))
if
(
keyArray
.
Any
(
key
=>
n
ame
.
Contains
(
key
)))
{
var
item
=
pairs
.
Where
(
t
=>
t
.
Key
.
ToString
().
NoBlank
().
StartsWith
(
"1."
)).
OrderByDescending
(
t
=>
t
.
Key
).
First
();
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
if
(
copysheet
==
null
)
continue
;
try
{
var
newSheet
=
copysheet
.
CopySheet
(
module
.
ModuleName
,
true
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
}
catch
(
Exception
)
{
}
var
newSheet
=
copysheet
.
CopySheet
(
name
,
true
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
}
}
}
foreach
(
var
module
in
modulesList
.
Where
(
t
=>
new
int
[]
{
(
int
)
SheetType
.
OtherWorkload
,
(
int
)
SheetType
.
Assess
}.
Contains
(
t
.
SheetType
.
Value
))?.
OrderBy
(
t
=>
t
.
ModuleName
))
{
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
());
var
no
=
module
.
ModuleName
.
GetNo
();
var
name
=
sheetNames
.
FirstOrDefault
(
name
=>
name
.
StartsWith
(
no
))
??
module
.
ModuleName
;
var
sheet
=
workbook
.
GetSheet
(
name
)
??
workbook
.
GetSheet
(
module
.
ModuleName
);
if
(
sheet
==
null
)
{
var
item
=
pairs
.
Where
(
t
=>
t
.
Key
.
ToString
().
NoBlank
().
StartsWith
(
"3."
)).
OrderByDescending
(
t
=>
t
.
Key
).
First
();
var
copysheet
=
workbook
.
GetSheet
(
item
.
Key
);
if
(
copysheet
==
null
)
continue
;
var
newSheet
=
copysheet
.
CopySheet
(
module
.
ModuleN
ame
,
true
);
var
newSheet
=
copysheet
.
CopySheet
(
n
ame
,
true
);
workbook
.
SetSheetOrder
(
newSheet
.
SheetName
,
workbook
.
NumberOfSheets
-
1
);
var
point
=
PerSheetDataFactory
.
GetDataRead
(
SheetType
.
Workload
)?.
Point
;
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
d5c6b79f
This diff is collapsed.
Click to expand it.
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
d5c6b79f
...
...
@@ -107,13 +107,10 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
var
data
=
exresultRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
data
.
AddRange
(
queryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
,
ref
dict
));
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"提取数据"
,
$"开始格式化数据"
,
1
,
isSingle
);
var
standData
=
StandDataFormat
(
hospitalId
,
data
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"提取数据"
,
$"格式化完成"
,
1
,
isSingle
);
var
standData
=
StandDataFormat
(
hospitalId
,
allotId
,
data
);
dictionaryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"准备写入"
,
$"数据提取结束准备写入"
,
1
,
isSingle
);
var
statesArray
=
new
int
[]
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
Archive
};
var
templateFilePath
=
ExtractHelper
.
GetExtractFile
(
hospitalId
,
allot
,
ref
extractFilePath
,
filePath
);
...
...
@@ -236,10 +233,10 @@ private void WriteDataToFile(IWorkbook workbook, per_allot allot, Dictionary<ExD
var
customer
=
factory
.
GetWriteData
(
sheetType
,
logger
);
if
(
customer
!=
null
)
{
var
collects
=
collectData
?.
Where
(
t
=>
t
.
SheetName
.
NoBlank
()
==
sheetName
).
ToList
();
var
collects
=
collectData
?.
Where
(
t
=>
t
.
SheetName
.
StartsWith
(
sheetName
.
GetNo
())
).
ToList
();
customer
.
WriteCollectData
(
sheet
,
point
,
sheetType
,
style
,
collects
,
exdict
);
var
exdata
=
extractDto
.
Where
(
t
=>
t
.
SheetName
.
NoBlank
()
==
sheetName
)?.
ToList
();
var
exdata
=
extractDto
.
Where
(
t
=>
t
.
SheetName
.
StartsWith
(
sheetName
.
GetNo
())
)?.
ToList
();
if
(
exdata
!=
null
)
{
logger
.
LogInformation
(
$"
{
sheetName
}
: 总金额 -
{
exdata
.
Sum
(
s
=>
s
.
Value
??
0
)}
; 科室 -
{
string
.
Join
(
","
,
exdata
.
Select
(
s
=>
s
.
Department
).
Distinct
())}
"
);
...
...
@@ -278,10 +275,11 @@ private object GetDataBySheetType(int hospitalId, SheetType sheetType, List<Extr
/// <summary>
/// 标准数据格式, 匹配科室字典
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <param name="results"></param>
/// <returns></returns>
private
List
<
ExtractTransDto
>
StandDataFormat
(
int
hospitalId
,
List
<
ex_result
>
results
)
private
List
<
ExtractTransDto
>
StandDataFormat
(
int
hospitalId
,
int
allotId
,
List
<
ex_result
>
results
)
{
if
(
results
==
null
||
!
results
.
Any
())
return
new
List
<
ExtractTransDto
>();
...
...
@@ -293,7 +291,7 @@ private List<ExtractTransDto> StandDataFormat(int hospitalId, List<ex_result> re
var
types
=
extypeRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
hospitalId
)
??
new
List
<
ex_type
>();
var
dict
=
personService
.
GetDepartments
(
hospital
Id
)?.
ToList
();
var
dict
=
personService
.
GetDepartments
(
allot
Id
)?.
ToList
();
if
(
dict
==
null
||
!
dict
.
Any
())
{
return
results
.
GroupBy
(
t
=>
new
{
t
.
Department
,
t
.
Category
,
t
.
Source
}).
Select
(
t
=>
new
ExtractTransDto
...
...
performance/Performance.Services/ExtractExcelService/SheetDataWrite/IncomeDataWrite.cs
View file @
d5c6b79f
...
...
@@ -39,7 +39,8 @@ public void WriteCollectData(ISheet sheet, PerSheetPoint point, SheetType sheetT
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
());
var
no
=
sheet
.
SheetName
.
GetNo
();
var
module
=
modules
?.
FirstOrDefault
(
t
=>
t
.
SheetType
==
(
int
)
sheetType
&&
t
.
ModuleName
.
StartsWith
(
no
));
if
(
module
==
null
)
return
;
if
(
data
is
List
<
ExtractTransDto
>
extractDto
&&
extractDto
.
Any
())
...
...
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