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
551d51f3
Commit
551d51f3
authored
Mar 08, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报表数据导入删除历史数据方法调整,dbset添加his_script
parent
8adb1960
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
26 deletions
+23
-26
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+3
-1
performance/Performance.Services/ReportGlobalService.cs
+20
-25
No files found.
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
551d51f3
...
...
@@ -108,7 +108,9 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
public
virtual
DbSet
<
his_import_summary
>
his_import_summary
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
his_importdata
>
his_importdata
{
get
;
set
;
}
/// <summary> </summary>
/// <summary> </summary>
public
virtual
DbSet
<
his_script
>
his_script
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
hos_personfee
>
hos_personfee
{
get
;
set
;
}
/// <summary> 科室核算导入信息 </summary>
public
virtual
DbSet
<
im_accountbasic
>
im_accountbasic
{
get
;
set
;
}
...
...
performance/Performance.Services/ReportGlobalService.cs
View file @
551d51f3
...
...
@@ -266,11 +266,10 @@ private void ImportBasicData(ISheet sheet, List<string> columns, int hospitalId,
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
var
entities
=
hisimportdataRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
)
&&
t
.
Category
==
sheetName
);
if
(
entities
!=
null
&&
entities
.
Any
())
hisimportdataRepository
.
BulkDelete
(
entities
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportdataRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Category
==
sheetName
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportdataRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
...
...
@@ -302,11 +301,10 @@ private void ImporSummaryData(ISheet sheet, List<string> columns, int hospitalId
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
var
entities
=
hisimportsummaryRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
if
(
entities
!=
null
&&
entities
.
Any
())
hisimportsummaryRepository
.
BulkDelete
(
entities
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportsummaryRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportsummaryRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
...
...
@@ -340,11 +338,10 @@ private void ImporAccountData(ISheet sheet, List<string> columns, int hospitalId
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
var
entities
=
hisimportaccountRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
if
(
entities
!=
null
&&
entities
.
Any
())
hisimportaccountRepository
.
BulkDelete
(
entities
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportaccountRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportaccountRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
...
...
@@ -415,11 +412,10 @@ private void ImporClinicData(ISheet sheet, List<string> columns, int hospitalId,
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
var
entities
=
hisimportclinicRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
if
(
entities
!=
null
&&
entities
.
Any
())
hisimportclinicRepository
.
BulkDelete
(
entities
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportclinicRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportclinicRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
...
...
@@ -489,11 +485,10 @@ private void ImporBasicnormData(ISheet sheet, List<string> columns, int hospital
t
.
CreateTime
=
dateTime
;
});
var
yearMonths
=
data
.
Select
(
t
=>
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
).
Distinct
();
var
entities
=
hisimportbaiscnormRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
yearMonths
.
Contains
(
$"
{
t
.
Year
}
-
{
t
.
Month
}
"
));
if
(
entities
!=
null
&&
entities
.
Any
())
hisimportbaiscnormRepository
.
BulkDelete
(
entities
);
foreach
(
var
item
in
data
.
Select
(
t
=>
new
{
t
.
Year
,
t
.
Month
}).
Distinct
())
{
hisimportbaiscnormRepository
.
DeleteFromQuery
(
t
=>
t
.
HospitalId
==
hospitalId
&&
t
.
Year
==
item
.
Year
&&
t
.
Month
==
item
.
Month
);
}
hisimportbaiscnormRepository
.
BulkInsert
(
data
.
Where
(
t
=>
t
.
Year
!=
0
&&
t
.
Month
!=
0
));
}
...
...
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