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
55456a86
Commit
55456a86
authored
Jul 03, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效核算科室来源,抽取bug调整
parent
4f22abef
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
13 deletions
+19
-13
performance/Performance.Extract.Api/Controllers/ExtractController.cs
+2
-2
performance/Performance.Services/AssessService.cs
+5
-2
performance/Performance.Services/DFExtractService1.cs
+9
-6
performance/Performance.Services/ExConfigService.cs
+3
-3
No files found.
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
55456a86
...
@@ -120,11 +120,11 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
...
@@ -120,11 +120,11 @@ public void ExtractData([FromForm] IFormCollection form, int allotId, int hospit
var
path
=
string
.
Empty
;
var
path
=
string
.
Empty
;
#
region
保存历史绩效文件
#
region
保存历史绩效文件
var
file
=
((
FormFileCollection
)
form
.
Files
).
FirstOrDefault
();
if
(
form
.
Files
==
null
||
!
form
.
Files
.
Any
()
||
((
FormFileCollection
)
form
.
Files
).
FirstOrDefault
()
==
null
)
if
(
file
==
null
)
logger
.
LogInformation
(
$"文件为空!"
);
logger
.
LogInformation
(
$"文件为空!"
);
else
else
{
{
var
file
=
((
FormFileCollection
)
form
.
Files
)?.
FirstOrDefault
();
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"HospitalAllot"
,
$"
{
hospitalId
}
"
);
var
dpath
=
Path
.
Combine
(
evn
.
ContentRootPath
,
"Files"
,
"HospitalAllot"
,
$"
{
hospitalId
}
"
);
FileHelper
.
CreateDirectory
(
dpath
);
FileHelper
.
CreateDirectory
(
dpath
);
...
...
performance/Performance.Services/AssessService.cs
View file @
55456a86
...
@@ -18,13 +18,15 @@ public class AssessService : IAutoInjection
...
@@ -18,13 +18,15 @@ public class AssessService : IAutoInjection
private
PerforAstempcolumnsRepository
perforAstempcolumnsRepository
;
private
PerforAstempcolumnsRepository
perforAstempcolumnsRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforImemployeeRepository
perforImemployeeRepository
;
private
PerforImemployeeRepository
perforImemployeeRepository
;
private
PerforImaccountbasicRepository
perforImaccountbasicRepository
;
public
AssessService
(
PerforAsassessRepository
perforAsassessRepository
,
public
AssessService
(
PerforAsassessRepository
perforAsassessRepository
,
PerforAsdataRepository
perforAsdataRepository
,
PerforAsdataRepository
perforAsdataRepository
,
PerforAscolumnsRepository
perforAscolumnsRepository
,
PerforAscolumnsRepository
perforAscolumnsRepository
,
PerforAstempassessRepository
perforAstempassessRepository
,
PerforAstempassessRepository
perforAstempassessRepository
,
PerforAstempcolumnsRepository
perforAstempcolumnsRepository
,
PerforAstempcolumnsRepository
perforAstempcolumnsRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforImemployeeRepository
perforImemployeeRepository
)
PerforImemployeeRepository
perforImemployeeRepository
,
PerforImaccountbasicRepository
perforImaccountbasicRepository
)
{
{
this
.
perforAsassessRepository
=
perforAsassessRepository
;
this
.
perforAsassessRepository
=
perforAsassessRepository
;
this
.
perforAsdataRepository
=
perforAsdataRepository
;
this
.
perforAsdataRepository
=
perforAsdataRepository
;
...
@@ -33,6 +35,7 @@ public class AssessService : IAutoInjection
...
@@ -33,6 +35,7 @@ public class AssessService : IAutoInjection
this
.
perforAstempcolumnsRepository
=
perforAstempcolumnsRepository
;
this
.
perforAstempcolumnsRepository
=
perforAstempcolumnsRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforImaccountbasicRepository
=
perforImaccountbasicRepository
;
}
}
#
region
考核类别
#
region
考核类别
...
@@ -344,7 +347,7 @@ public List<TitleValue> Department(AssessRequest request)
...
@@ -344,7 +347,7 @@ public List<TitleValue> Department(AssessRequest request)
var
result
=
new
List
<
TitleValue
>();
var
result
=
new
List
<
TitleValue
>();
//取到该家医院下所有科室
//取到该家医院下所有科室
var
idList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
).
Select
(
s
=>
s
.
ID
).
ToList
();
var
idList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
).
Select
(
s
=>
s
.
ID
).
ToList
();
var
department
=
perforIm
employee
Repository
.
GetEntities
(
t
=>
t
.
Department
!=
""
&&
idList
.
Contains
(
t
.
AllotID
.
Value
))?.
Select
(
t
=>
t
.
Department
).
Distinct
().
ToList
();
var
department
=
perforIm
accountbasic
Repository
.
GetEntities
(
t
=>
t
.
Department
!=
""
&&
idList
.
Contains
(
t
.
AllotID
.
Value
))?.
Select
(
t
=>
t
.
Department
).
Distinct
().
ToList
();
if
(
department
!=
null
&&
department
.
Count
>
0
)
if
(
department
!=
null
&&
department
.
Count
>
0
)
{
{
...
...
performance/Performance.Services/DFExtractService1.cs
View file @
55456a86
...
@@ -98,7 +98,7 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
...
@@ -98,7 +98,7 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
{
{
typeIds
.
AddRange
(
modules
.
Select
(
t
=>
t
.
TypeId
??
0
));
typeIds
.
AddRange
(
modules
.
Select
(
t
=>
t
.
TypeId
??
0
));
items
=
perforExitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
.
HasValue
items
=
perforExitemRepository
.
GetEntities
(
t
=>
t
.
ModuleId
.
HasValue
&&
modules
.
Where
(
m
=>
m
.
SheetType
!=
(
int
)
SheetType
.
Income
).
Select
(
m
=>
m
.
Id
).
Contains
(
t
.
ModuleId
.
Value
));
&&
modules
.
Select
(
m
=>
m
.
Id
).
Contains
(
t
.
ModuleId
.
Value
));
typeIds
.
AddRange
(
items
?.
Select
(
t
=>
t
.
TypeId
??
0
)
??
new
List
<
int
>());
typeIds
.
AddRange
(
items
?.
Select
(
t
=>
t
.
TypeId
??
0
)
??
new
List
<
int
>());
}
}
...
@@ -110,10 +110,11 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
...
@@ -110,10 +110,11 @@ public string ExtractData(int allotId, string email, int hospitalId, string file
var
data
=
new
List
<
ex_result
>();
var
data
=
new
List
<
ex_result
>();
var
scripts
=
perforExscriptRepository
.
GetEntities
(
t
=>
typeIds
.
Contains
(
t
.
TypeId
));
var
scripts
=
perforExscriptRepository
.
GetEntities
(
t
=>
typeIds
.
Contains
(
t
.
TypeId
));
ClearHistData
(
allot
);
ClearHistData
(
allot
);
var
otherItems
=
items
.
Where
(
t
=>
modules
.
Where
(
m
=>
m
.
SheetType
!=
(
int
)
SheetType
.
Income
).
Select
(
m
=>
m
.
Id
).
Contains
(
t
.
ModuleId
.
Value
)).
ToList
();
if
(
scripts
!=
null
&&
scripts
.
Any
())
if
(
scripts
!=
null
&&
scripts
.
Any
())
{
{
data
.
AddRange
(
ExtractIncome
(
modules
,
scripts
,
configs
,
allot
));
data
.
AddRange
(
ExtractIncome
(
modules
,
scripts
,
configs
,
allot
));
data
.
AddRange
(
ExtractItems
(
i
tems
,
scripts
,
configs
,
allot
,
modules
));
data
.
AddRange
(
ExtractItems
(
otherI
tems
,
scripts
,
configs
,
allot
,
modules
));
data
.
AddRange
(
ExtractSpcial
(
specials
,
scripts
,
configs
,
allot
));
data
.
AddRange
(
ExtractSpcial
(
specials
,
scripts
,
configs
,
allot
));
}
}
...
@@ -419,7 +420,7 @@ private List<ex_result> QueryData(sys_hospitalconfig config, per_allot allot, st
...
@@ -419,7 +420,7 @@ private List<ex_result> QueryData(sys_hospitalconfig config, per_allot allot, st
data
=
result
.
Select
(
t
=>
new
ex_result
data
=
result
.
Select
(
t
=>
new
ex_result
{
{
Department
=
t
.
Department
,
Department
=
t
.
Department
,
Category
=
t
.
Category
,
Category
=
t
.
Category
?.
Trim
()
,
Fee
=
t
.
Value
,
Fee
=
t
.
Value
,
Source
=
source
,
Source
=
source
,
DatabaseType
=
config
.
DataBaseType
,
DatabaseType
=
config
.
DataBaseType
,
...
@@ -636,7 +637,9 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
...
@@ -636,7 +637,9 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
var
itemList
=
items
.
Where
(
t
=>
t
.
ModuleId
==
module
.
Id
).
ToList
();
var
itemList
=
items
.
Where
(
t
=>
t
.
ModuleId
==
module
.
Id
).
ToList
();
logger
.
LogInformation
(
$"item有
{
itemList
?.
Count
??
0
}
个."
);
logger
.
LogInformation
(
$"item有
{
itemList
?.
Count
??
0
}
个."
);
//if (itemList == null || !itemList.Any()) return;
if
(
itemList
==
null
||
!
itemList
.
Any
())
return
;
WriteHeaderAndFactor
(
sheet
,
sheetRead
,
itemList
,
isNewTemp
);
var
extractdata
=
data
.
Where
(
t
=>
t
.
AllotId
==
Allot
.
ID
&&
t
.
Source
==
module
.
ModuleName
);
var
extractdata
=
data
.
Where
(
t
=>
t
.
AllotId
==
Allot
.
ID
&&
t
.
Source
==
module
.
ModuleName
);
if
(
extractdata
==
null
||
!
extractdata
.
Any
())
if
(
extractdata
==
null
||
!
extractdata
.
Any
())
...
@@ -653,7 +656,7 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
...
@@ -653,7 +656,7 @@ private void WriteIncome(ISheet sheet, IPerSheetDataRead sheetRead, List<Account
//logger.LogInformation($"{sheet.SheetName}合计值为: " + allExtract.Sum(t => t.Value));
//logger.LogInformation($"{sheet.SheetName}合计值为: " + allExtract.Sum(t => t.Value));
var
category
=
allExtract
.
Select
(
t
=>
t
.
Category
).
Distinct
().
ToList
();
var
category
=
allExtract
.
Select
(
t
=>
t
.
Category
).
Distinct
().
ToList
();
WriteIncomeHeaderAndFactor
(
sheet
,
sheetRead
,
category
,
isNewTemp
);
//
WriteIncomeHeaderAndFactor(sheet, sheetRead, category, isNewTemp);
WriteSheetData
(
sheet
,
sheetRead
,
unitList
,
allExtract
,
category
,
isNewTemp
,
true
);
WriteSheetData
(
sheet
,
sheetRead
,
unitList
,
allExtract
,
category
,
isNewTemp
,
true
);
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
提取结束."
);
logger
.
LogInformation
(
$"
{
sheet
.
SheetName
}
提取结束."
);
}
}
...
@@ -903,7 +906,7 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
...
@@ -903,7 +906,7 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
if
(
cellItems
==
null
||
!
cellItems
.
Any
())
return
;
if
(
cellItems
==
null
||
!
cellItems
.
Any
())
return
;
#
region
新增模板中不存在的列头
#
region
新增模板中不存在的列头
var
lastcellIndex
=
isNewTemp
?
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
+
3
:
head
.
LastCellNum
;
var
lastcellIndex
=
isNewTemp
?
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
:
head
.
LastCellNum
;
foreach
(
var
item
in
cellItems
)
foreach
(
var
item
in
cellItems
)
{
{
var
headcell
=
GetOrCreate
(
head
,
lastcellIndex
);
var
headcell
=
GetOrCreate
(
head
,
lastcellIndex
);
...
...
performance/Performance.Services/ExConfigService.cs
View file @
55456a86
...
@@ -385,15 +385,15 @@ private bool QueryAndAddItem(List<sys_hospitalconfig> hospitalconfigs, string sq
...
@@ -385,15 +385,15 @@ private bool QueryAndAddItem(List<sys_hospitalconfig> hospitalconfigs, string sq
if
(
items
==
null
&&
(
itemNames
==
null
||
!
itemNames
.
Any
()))
if
(
items
==
null
&&
(
itemNames
==
null
||
!
itemNames
.
Any
()))
return
true
;
return
true
;
if
(
itemNames
!=
null
&&
itemNames
.
Any
())
if
(
itemNames
!=
null
&&
itemNames
.
Any
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)
))
{
{
if
(
items
!=
null
)
if
(
items
!=
null
)
itemNames
=
itemNames
.
Except
(
items
.
Select
(
t
=>
t
.
ItemName
)).
ToList
();
itemNames
=
itemNames
.
Except
(
items
.
Select
(
t
=>
t
.
ItemName
)).
ToList
();
logger
.
LogInformation
(
$"添加默认收费项 去重后数据有
{
itemNames
.
Distinct
().
Count
()}
"
);
logger
.
LogInformation
(
$"添加默认收费项 去重后数据有
{
itemNames
.
Distinct
().
Count
()}
"
);
var
itemList
=
itemNames
.
Distinct
().
Select
(
t
=>
new
ex_item
var
itemList
=
itemNames
.
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
Distinct
().
Select
(
t
=>
new
ex_item
{
{
ItemName
=
t
,
ItemName
=
t
.
Trim
()
,
FactorValue1
=
0
m
,
FactorValue1
=
0
m
,
FactorValue2
=
0
m
,
FactorValue2
=
0
m
,
FactorValue3
=
0
m
,
FactorValue3
=
0
m
,
...
...
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