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
f0136a39
Commit
f0136a39
authored
Feb 03, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report_global增删的接口完善
parent
bb46a3e8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
201 additions
and
4 deletions
+201
-4
performance/Performance.Api/Controllers/ReportGlobalController.cs
+57
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+28
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+3
-3
performance/Performance.Services/ReportGlobalService.cs
+113
-1
No files found.
performance/Performance.Api/Controllers/ReportGlobalController.cs
View file @
f0136a39
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
using
Microsoft.AspNetCore.Http.Internal
;
using
Microsoft.AspNetCore.Http.Internal
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services
;
using
System
;
using
System
;
...
@@ -33,6 +34,62 @@ ReportGlobalService reportGlobalService
...
@@ -33,6 +34,62 @@ ReportGlobalService reportGlobalService
}
}
/// <summary>
/// <summary>
/// 获取报表配置信息
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
[
HttpGet
]
public
ApiResponse
GetAllReportGlobal
([
FromRoute
]
int
hospitalId
)
{
//reportGlobalService.CopyPreviousGlobalData(new per_allot
//{
// ID = 101,
// HospitalId = 13,
// Year = 2020,
// Month = 8
//});
var
result
=
reportGlobalService
.
GetReportGlobals
(
hospitalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 添加报表配置
/// </summary>
/// <param name="global"></param>
/// <returns></returns>
[
HttpPost
]
public
ApiResponse
CreateReportGlobal
([
FromBody
]
report_global
global
)
{
var
result
=
reportGlobalService
.
CreateReportGlobal
(
global
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 修改报表配置
/// </summary>
/// <param name="global"></param>
/// <returns></returns>
[
HttpPost
(
"update"
)]
public
ApiResponse
UpdateReportGlobal
([
FromBody
]
report_global
global
)
{
var
result
=
reportGlobalService
.
UpdateReportGlobal
(
global
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 删除报表配置
/// </summary>
/// <param name="globalId"></param>
/// <returns></returns>
[
HttpPost
(
"{globalId}"
)]
public
ApiResponse
DeleteReportGlobal
([
FromRoute
]
int
globalId
)
{
var
result
=
reportGlobalService
.
DeleteReportGlobal
(
globalId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 上传人员绩效文件
/// 上传人员绩效文件
/// </summary>
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="hospitalId"></param>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
f0136a39
...
@@ -1094,6 +1094,34 @@
...
@@ -1094,6 +1094,34 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.ReportGlobalController.GetAllReportGlobal(System.Int32)"
>
<summary>
获取报表配置信息
</summary>
<param
name=
"hospitalId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ReportGlobalController.CreateReportGlobal(Performance.EntityModels.report_global)"
>
<summary>
添加报表配置
</summary>
<param
name=
"global"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ReportGlobalController.UpdateReportGlobal(Performance.EntityModels.report_global)"
>
<summary>
修改报表配置
</summary>
<param
name=
"global"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ReportGlobalController.DeleteReportGlobal(System.Int32)"
>
<summary>
删除报表配置
</summary>
<param
name=
"globalId"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ReportGlobalController.Import(System.Int32,Microsoft.AspNetCore.Http.IFormCollection)"
>
<member
name=
"M:Performance.Api.Controllers.ReportGlobalController.Import(System.Int32,Microsoft.AspNetCore.Http.IFormCollection)"
>
<summary>
<summary>
上传人员绩效文件
上传人员绩效文件
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
f0136a39
...
@@ -3856,17 +3856,17 @@
...
@@ -3856,17 +3856,17 @@
类别
类别
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.report_global.
Type
"
>
<member
name=
"P:Performance.EntityModels.report_global.
Year
"
>
<summary>
<summary>
年
年
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.report_global.
InputName
"
>
<member
name=
"P:Performance.EntityModels.report_global.
Month
"
>
<summary>
<summary>
月
月
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.report_global.
InputTyp
e"
>
<member
name=
"P:Performance.EntityModels.report_global.
Valu
e"
>
<summary>
<summary>
值
值
</summary>
</summary>
...
...
performance/Performance.Services/ReportGlobalService.cs
View file @
f0136a39
...
@@ -32,12 +32,124 @@ PerforHisimportdataRepository hisimportdataRepository
...
@@ -32,12 +32,124 @@ PerforHisimportdataRepository hisimportdataRepository
this
.
hisimportdataRepository
=
hisimportdataRepository
;
this
.
hisimportdataRepository
=
hisimportdataRepository
;
}
}
#
region
Report_Global
public
List
<
report_global
>
GetReportGlobals
(
int
hospitalId
)
public
List
<
report_global
>
GetReportGlobals
(
int
hospitalId
)
{
{
var
globals
=
reportglobalRepository
.
GetEntities
(
t
=>
t
.
HospitalID
==
hospitalId
);
var
globals
=
reportglobalRepository
.
GetEntities
(
t
=>
t
.
HospitalID
==
hospitalId
)
?.
OrderBy
(
t
=>
t
.
Category
).
ThenBy
(
t
=>
t
.
Year
).
ThenBy
(
t
=>
t
.
Month
).
ToList
();
return
globals
;
return
globals
;
}
}
public
bool
CreateReportGlobal
(
report_global
global
)
{
return
reportglobalRepository
.
Add
(
global
);
}
public
bool
UpdateReportGlobal
(
report_global
global
)
{
var
entity
=
reportglobalRepository
.
GetEntity
(
t
=>
t
.
Id
==
global
.
Id
);
entity
.
Year
=
global
.
Year
;
entity
.
Month
=
global
.
Month
;
entity
.
Category
=
global
.
Category
;
entity
.
Value
=
global
.
Value
;
return
reportglobalRepository
.
Update
(
entity
);
}
public
bool
DeleteReportGlobal
(
int
globalId
)
{
var
entity
=
reportglobalRepository
.
GetEntity
(
t
=>
t
.
Id
==
globalId
);
return
reportglobalRepository
.
Remove
(
entity
);
}
#
endregion
Report_Global
#
region
Copy
Previous
Report
Data
public
void
CopyPreviousGlobalData
(
per_allot
allot
)
{
var
globals
=
reportglobalRepository
.
GetEntities
(
t
=>
t
.
HospitalID
==
allot
.
HospitalId
);
if
(
globals
==
null
||
!
globals
.
Any
())
return
;
var
onlyYears
=
globals
.
Where
(
t
=>
t
.
Year
.
HasValue
&&
!
t
.
Month
.
HasValue
);
if
(
onlyYears
!=
null
&&
onlyYears
.
Any
())
{
var
year
=
onlyYears
.
Where
(
t
=>
t
.
Year
<
allot
.
Year
)?.
Max
(
t
=>
t
.
Year
);
if
(
year
.
HasValue
)
{
var
current
=
onlyYears
.
Where
(
t
=>
t
.
Year
==
allot
.
Year
)?.
ToList
()
??
new
List
<
report_global
>();
var
previous
=
onlyYears
.
Where
(
t
=>
t
.
Year
==
year
)?.
ToList
()
??
new
List
<
report_global
>();
var
newdata
=
previous
.
Where
(
t
=>
!
current
.
Select
(
s
=>
s
.
Category
).
Contains
(
t
.
Category
))?.
ToList
();
if
(
newdata
!=
null
&&
newdata
.
Any
())
{
newdata
=
newdata
.
Select
(
t
=>
new
report_global
{
HospitalID
=
allot
.
HospitalId
,
Year
=
allot
.
Year
,
Category
=
t
.
Category
,
Value
=
t
.
Value
}).
ToList
();
reportglobalRepository
.
AddRange
(
newdata
.
ToArray
());
}
}
}
var
yearAndMonth
=
globals
.
Where
(
t
=>
t
.
Year
.
HasValue
&&
t
.
Month
.
HasValue
);
if
(
yearAndMonth
!=
null
&&
yearAndMonth
.
Any
())
{
var
month
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
==
allot
.
Year
&&
t
.
Month
<
allot
.
Month
)?.
Max
(
t
=>
t
.
Month
);
if
(
allot
.
Month
==
1
||
!
month
.
HasValue
)
{
var
year
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
<
allot
.
Year
)?.
Max
(
t
=>
t
.
Year
);
month
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
==
year
)?.
Max
(
t
=>
t
.
Month
);
if
(
year
.
HasValue
&&
month
.
HasValue
)
{
var
current
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
)?.
ToList
()
??
new
List
<
report_global
>();
var
previous
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
==
year
&&
t
.
Month
==
month
)?.
ToList
()
??
new
List
<
report_global
>();
var
newdata
=
previous
.
Where
(
t
=>
!
current
.
Select
(
s
=>
s
.
Category
).
Contains
(
t
.
Category
))?.
ToList
();
if
(
newdata
!=
null
&&
newdata
.
Any
())
{
newdata
=
newdata
.
Select
(
t
=>
new
report_global
{
HospitalID
=
allot
.
HospitalId
,
Year
=
allot
.
Year
,
Month
=
allot
.
Month
,
Category
=
t
.
Category
,
Value
=
t
.
Value
}).
ToList
();
reportglobalRepository
.
AddRange
(
newdata
.
ToArray
());
}
}
}
else
{
if
(
month
.
HasValue
)
{
var
current
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
allot
.
Month
)?.
ToList
()
??
new
List
<
report_global
>();
var
previous
=
yearAndMonth
.
Where
(
t
=>
t
.
Year
==
allot
.
Year
&&
t
.
Month
==
month
)?.
ToList
()
??
new
List
<
report_global
>();
var
newdata
=
previous
.
Where
(
t
=>
!
current
.
Select
(
s
=>
s
.
Category
).
Contains
(
t
.
Category
))?.
ToList
();
if
(
newdata
!=
null
&&
newdata
.
Any
())
{
newdata
=
newdata
.
Select
(
t
=>
new
report_global
{
HospitalID
=
allot
.
HospitalId
,
Year
=
allot
.
Year
,
Month
=
allot
.
Month
,
Category
=
t
.
Category
,
Value
=
t
.
Value
}).
ToList
();
reportglobalRepository
.
AddRange
(
newdata
.
ToArray
());
}
}
}
}
}
#
endregion
Copy
Previous
Report
Data
#
region
ImportFile
&&
SaveData
#
region
ImportFile
&&
SaveData
public
void
ImportAllotData
(
int
hospitalId
,
string
filePath
)
public
void
ImportAllotData
(
int
hospitalId
,
string
filePath
)
...
...
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