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
f6061aaf
Commit
f6061aaf
authored
Apr 14, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容sheetname就诊
parent
bed6a05a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
11 deletions
+28
-11
performance/Performance.Services/ComputeService.cs
+21
-5
performance/Performance.Services/ExConfigService.cs
+5
-4
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+2
-2
No files found.
performance/Performance.Services/ComputeService.cs
View file @
f6061aaf
...
...
@@ -11,6 +11,7 @@
using
System.Text.RegularExpressions
;
using
Performance.DtoModels.Request
;
using
Performance.DtoModels.Response
;
using
Performance.Services.ExtractExcelService
;
namespace
Performance.Services
{
...
...
@@ -1043,6 +1044,20 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
var
headers
=
_perforImheaderRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
account
.
AllotID
);
var
basicData
=
_perforImDataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
account
.
AllotID
&&
t
.
AccountingUnit
==
account
.
AccountingUnit
);
Func
<
string
,
string
>
getShowKey
=
(
name
)
=>
{
string
_key
=
"开单"
;
if
(
string
.
IsNullOrEmpty
(
name
))
return
_key
;
if
(
name
.
IndexOf
(
"就诊"
)
>
-
1
)
_key
=
"就诊"
;
return
_key
;
};
string
key
=
getShowKey
.
Invoke
(
persheet
.
FirstOrDefault
(
t
=>
t
.
SheetName
.
NoBlank
().
StartsWith
(
"1.1.1"
))?.
SheetName
);
DeptDataDetails
deptDetails
=
new
DeptDataDetails
{
ShowFormula
=
allot
.
ShowFormula
,
...
...
@@ -1050,7 +1065,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
Detail
=
new
List
<
DetailDtos
>()
};
if
(
basicData
==
null
||
!
basicData
.
Any
())
return
MergeDetails
(
deptDetails
);
if
(
basicData
==
null
||
!
basicData
.
Any
())
return
MergeDetails
(
deptDetails
,
key
);
var
sheetType
=
new
List
<
int
>
{
...
...
@@ -1118,7 +1133,7 @@ public DeptDataDetails<DetailModuleExtend> DeptDetail(int accountId)
deptDetails
.
Pandect
.
MaterialsExtra
=
deptDetails
.
Detail
?.
FirstOrDefault
(
w
=>
w
.
OriginalType
==
(
int
)
SheetType
.
AccountMaterialsAssess
)?.
Amount
??
deptDetails
.
Pandect
.
MaterialsExtra
;
deptDetails
.
Pandect
.
MedicineExtra
=
deptDetails
.
Detail
?.
FirstOrDefault
(
w
=>
w
.
OriginalType
==
(
int
)
SheetType
.
AccountDrugAssess
)?.
Amount
??
deptDetails
.
Pandect
.
MedicineExtra
;
return
MergeDetails
(
deptDetails
);
return
MergeDetails
(
deptDetails
,
key
);
//return deptDetails;
}
...
...
@@ -1243,7 +1258,7 @@ private List<DetailModule> CommonDetailItems(List<im_data> basicData, List<im_he
return
items
;
}
private
DeptDataDetails
<
DetailModuleExtend
>
MergeDetails
(
DeptDataDetails
details
)
private
DeptDataDetails
<
DetailModuleExtend
>
MergeDetails
(
DeptDataDetails
details
,
string
key
)
{
if
(
details
==
null
)
return
new
DeptDataDetails
<
DetailModuleExtend
>();
...
...
@@ -1256,6 +1271,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
if
(
details
.
Detail
==
null
||
!
details
.
Detail
.
Any
(
t
=>
t
.
IncomeType
==
1
))
return
result
;
string
[]
sheetNameKeys
=
new
string
[]
{
"就诊"
,
"开单"
};
foreach
(
var
groupbasis
in
details
.
Detail
.
Select
(
t
=>
t
.
GroupBasis
).
Distinct
())
{
var
items
=
new
List
<
DetailModuleExtend
>();
...
...
@@ -1267,7 +1283,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
{
depts
.
AddRange
(
t
.
Items
.
Select
(
o
=>
o
.
ItemName
));
});
var
billing
=
data
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
Replace
(
"就诊"
,
"开单"
).
IndexOf
(
"开单"
)
>
-
1
);
var
billing
=
data
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
IndexOf
(
key
)
>
-
1
);
var
execute
=
data
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
IndexOf
(
"执行"
)
>
-
1
);
foreach
(
var
dept
in
depts
.
Distinct
().
OrderBy
(
t
=>
t
))
{
...
...
@@ -1316,7 +1332,7 @@ private DeptDataDetails<DetailModuleExtend> MergeDetails(DeptDataDetails details
result
.
Detail
.
Add
(
new
DetailDtos
<
DetailModuleExtend
>
{
ItemName
=
data
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
IndexOf
(
"执行"
)
>
-
1
)
is
null
?
data
.
First
().
ItemName
:
data
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
IndexOf
(
"执行"
)
>
-
1
).
ItemName
?.
Replace
(
"执行"
,
"开单
/执行"
),
data
.
FirstOrDefault
(
t
=>
t
.
ItemName
.
IndexOf
(
"执行"
)
>
-
1
).
ItemName
?.
Replace
(
"执行"
,
$"
{
key
}
/执行"
),
IncomeType
=
data
.
First
()?.
IncomeType
??
0
,
OriginalType
=
data
.
First
()?.
OriginalType
??
0
,
Amount
=
data
.
Sum
(
w
=>
w
.
Amount
),
...
...
performance/Performance.Services/ExConfigService.cs
View file @
f6061aaf
...
...
@@ -72,6 +72,7 @@ public List<ex_module> QueryModule(int hospitalId)
DefaultModules
(
hospitalId
);
var
list
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
).
OrderBy
(
t
=>
t
.
ModuleName
).
ToList
();
list
?.
ForEach
(
t
=>
t
.
ReadOnly
=
t
.
SheetType
==
(
int
)
SheetType
.
Income
?
0
:
1
);
return
list
;
}
...
...
@@ -90,7 +91,7 @@ private void DefaultModules(int hospitalId)
};
var
data
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
inexistence
=
data
==
null
?
moduleList
:
moduleList
.
Where
(
t
=>
!
data
.
Select
(
p
=>
p
.
ModuleName
).
ToArray
().
Contains
(
t
.
ModuleName
));
var
inexistence
=
data
==
null
?
moduleList
:
moduleList
.
Where
(
t
=>
!
data
.
Any
(
w
=>
w
.
ModuleName
.
StartsWith
(
t
.
ModuleName
.
Split
(
' '
)[
0
])
));
if
(
inexistence
!=
null
&&
inexistence
.
Any
())
{
...
...
@@ -102,7 +103,7 @@ private void DefaultModules(int hospitalId)
HospitalId
=
hospitalId
,
ModuleName
=
item
.
ModuleName
,
SheetType
=
(
int
)
item
.
SheetType
,
ReadOnly
=
1
,
ReadOnly
=
item
.
SheetType
==
(
int
)
SheetType
.
Income
?
0
:
1
,
TypeId
=
null
,
};
modules
.
Add
(
module
);
...
...
@@ -121,7 +122,7 @@ public ex_module AddModule(ModModuleRequest request)
if
(
request
.
SheetType
==
(
int
)
SheetType
.
Income
)
{
string
[]
array
=
new
string
[]
{
"开单收入"
,
"执行收入"
};
if
(
request
.
ModuleName
.
IndexOf
(
"开单收入"
)
==
-
1
&&
request
.
ModuleName
.
IndexOf
(
"执行收入"
)
==
-
1
)
if
(
request
.
ModuleName
.
IndexOf
(
"开单收入"
)
==
-
1
&&
request
.
ModuleName
.
IndexOf
(
"
就诊收入"
)
==
-
1
&&
request
.
ModuleName
.
IndexOf
(
"
执行收入"
)
==
-
1
)
throw
new
PerformanceException
(
"模块名称规则错误"
);
//if (!Regex.IsMatch(request.ModuleName, @"^[\u4e00-\u9fa5]+$"))
// throw new PerformanceException("模块名称规则错误,请使用全中文命名");
...
...
@@ -132,7 +133,7 @@ public ex_module AddModule(ModModuleRequest request)
throw
new
PerformanceException
(
"绩效模板已存在!"
);
var
moduleList
=
exmoduleRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
ModuleName
.
IndexOf
(
"1."
)
!=
-
1
);
string
name
=
request
.
ModuleName
.
Replace
(
"开单收入"
,
""
).
Replace
(
"执行收入"
,
""
);
string
name
=
request
.
ModuleName
.
Replace
(
"开单收入"
,
""
).
Replace
(
"
就诊收入"
,
""
).
Replace
(
"
执行收入"
,
""
);
var
exist
=
moduleList
.
Where
(
t
=>
t
.
ModuleName
.
Contains
(
name
));
if
(
exist
!=
null
&&
exist
.
Any
())
{
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
f6061aaf
...
...
@@ -57,7 +57,7 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
var
sheet
=
workbook
.
GetSheet
(
module
.
ModuleName
)
??
workbook
.
GetSheet
(
module
.
ModuleName
.
NoBlank
());
if
(
sheet
==
null
)
{
string
[]
keyArray
=
new
string
[]
{
"开单"
,
"执行"
};
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
();
...
...
@@ -154,7 +154,7 @@ public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetTy
sheet
.
ShiftRows
(
point
.
DataFirstRowNum
.
Value
,
sheet
.
LastRowNum
+
1
,
-
1
);
}
}
public
static
void
CloseAutoFilter
(
string
path
)
{
try
...
...
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