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
738cc72f
Commit
738cc72f
authored
Oct 14, 2020
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2020income' into v2020calculate
parents
c557bb9a
30c73c61
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
performance/Performance.Api/Controllers/TemplateController.cs
+23
-0
performance/Performance.Services/ExtractIncomeService.cs
+0
-0
No files found.
performance/Performance.Api/Controllers/TemplateController.cs
View file @
738cc72f
...
@@ -25,6 +25,7 @@ public class TemplateController : Controller
...
@@ -25,6 +25,7 @@ public class TemplateController : Controller
{
{
private
readonly
TemplateService
templateService
;
private
readonly
TemplateService
templateService
;
private
readonly
DFExtractService
extractService
;
private
readonly
DFExtractService
extractService
;
private
readonly
ExtractIncomeService
extractIncomeService
;
private
HospitalService
hospitalService
;
private
HospitalService
hospitalService
;
private
IHostingEnvironment
env
;
private
IHostingEnvironment
env
;
private
ClaimService
claim
;
private
ClaimService
claim
;
...
@@ -37,6 +38,7 @@ public class TemplateController : Controller
...
@@ -37,6 +38,7 @@ public class TemplateController : Controller
public
TemplateController
(
TemplateService
templateService
,
public
TemplateController
(
TemplateService
templateService
,
HospitalService
hospitalService
,
HospitalService
hospitalService
,
DFExtractService
extractService
,
DFExtractService
extractService
,
ExtractIncomeService
extractIncomeService
,
IHostingEnvironment
env
,
IHostingEnvironment
env
,
ClaimService
claim
,
ClaimService
claim
,
IOptions
<
Application
>
options
,
IOptions
<
Application
>
options
,
...
@@ -47,6 +49,7 @@ public class TemplateController : Controller
...
@@ -47,6 +49,7 @@ public class TemplateController : Controller
{
{
this
.
templateService
=
templateService
;
this
.
templateService
=
templateService
;
this
.
extractService
=
extractService
;
this
.
extractService
=
extractService
;
this
.
extractIncomeService
=
extractIncomeService
;
this
.
hospitalService
=
hospitalService
;
this
.
hospitalService
=
hospitalService
;
this
.
env
=
env
;
this
.
env
=
env
;
this
.
claim
=
claim
;
this
.
claim
=
claim
;
...
@@ -407,5 +410,24 @@ public ApiResponse Schedule([FromBody] log_dbug request)
...
@@ -407,5 +410,24 @@ public ApiResponse Schedule([FromBody] log_dbug request)
var
ratio
=
allotService
.
AllotLog
(
allot
,
3
)?.
Max
(
t
=>
ConvertHelper
.
TryDecimal
(
t
.
Message
))
??
0
;
var
ratio
=
allotService
.
AllotLog
(
allot
,
3
)?.
Max
(
t
=>
ConvertHelper
.
TryDecimal
(
t
.
Message
))
??
0
;
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
ratio
});
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
ratio
});
}
}
[
Route
(
"extract/income/{allotId}"
)]
[
AllowAnonymous
]
[
HttpGet
]
public
IActionResult
ExtractIncome
(
int
allotId
)
{
string
filepath
=
extractIncomeService
.
Execture
(
allotId
);
var
memoryStream
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
filepath
,
FileMode
.
Open
))
{
stream
.
CopyToAsync
(
memoryStream
).
Wait
();
}
memoryStream
.
Seek
(
0
,
SeekOrigin
.
Begin
);
string
fileExt
=
Path
.
GetExtension
(
filepath
);
var
provider
=
new
FileExtensionContentTypeProvider
();
var
memi
=
provider
.
Mappings
[
fileExt
];
return
File
(
memoryStream
,
memi
,
Path
.
GetFileName
(
filepath
));
}
}
}
}
}
\ No newline at end of file
performance/Performance.Services/ExtractIncomeService.cs
0 → 100644
View file @
738cc72f
This diff is collapsed.
Click to expand it.
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