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
b45cc95f
Commit
b45cc95f
authored
Feb 03, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug - 数据抽取时无法获取参数
parent
e940a7c2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
23 deletions
+12
-23
performance/Performance.Api/Controllers/TemplateController.cs
+8
-13
performance/Performance.Extract.Api/Controllers/ExtractController.cs
+4
-10
No files found.
performance/Performance.Api/Controllers/TemplateController.cs
View file @
b45cc95f
...
@@ -214,18 +214,18 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
...
@@ -214,18 +214,18 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
else
else
{
{
var
http
=
new
RestSharpHelper
();
var
http
=
new
RestSharpHelper
();
string
endpoint
=
"extract/extract"
;
var
extractUrl
=
http
.
SetUrl
(
url
.
HttpPost
,
"extract/extract"
);
var
extractUrl
=
http
.
SetUrl
(
url
.
HttpPost
,
endpoint
);
var
obj
=
new
var
obj
=
new
ExtractRequest
{
{
a
llotId
=
request
.
AllotId
,
A
llotId
=
request
.
AllotId
,
h
ospitalId
=
request
.
HospitalId
,
H
ospitalId
=
request
.
HospitalId
,
e
mail
=
email
,
E
mail
=
email
,
u
serId
=
claim
.
GetUserId
()
U
serId
=
claim
.
GetUserId
()
};
};
string
json
=
JsonHelper
.
Serialize
(
obj
);
string
json
=
JsonHelper
.
Serialize
(
obj
);
logger
.
LogInformation
(
"提取绩效数据参数:"
+
json
);
var
parameter
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
object
>>(
json
);
var
parameter
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
object
>>(
json
);
var
restRequest
=
string
.
IsNullOrEmpty
(
filePath
)
?
http
.
CreatePostRequest
(
json
)
:
http
.
CreateFileRequest
(
new
string
[]
{
filePath
},
parameter
);
var
restRequest
=
string
.
IsNullOrEmpty
(
filePath
)
?
http
.
CreatePostRequest
(
json
)
:
http
.
CreateFileRequest
(
new
string
[]
{
filePath
},
parameter
);
Task
.
Run
(()
=>
http
.
GetResponse
(
extractUrl
,
restRequest
));
Task
.
Run
(()
=>
http
.
GetResponse
(
extractUrl
,
restRequest
));
...
@@ -290,12 +290,7 @@ public IActionResult DownFile([FromQuery] AllotRequest request)
...
@@ -290,12 +290,7 @@ public IActionResult DownFile([FromQuery] AllotRequest request)
[
AllowAnonymous
]
[
AllowAnonymous
]
public
ApiResponse
SaveFile
()
public
ApiResponse
SaveFile
()
{
{
Dictionary
<
string
,
object
>
dict
=
new
Dictionary
<
string
,
object
>();
string
json
=
JsonHelper
.
Serialize
(
Request
.
Form
.
ToDictionary
());
foreach
(
var
key
in
Request
.
Form
.
Keys
)
{
dict
.
Add
(
key
,
Request
.
Form
[
key
]);
}
string
json
=
JsonHelper
.
Serialize
(
dict
);
var
request
=
JsonHelper
.
Deserialize
<
ExtractRequest
>(
json
);
var
request
=
JsonHelper
.
Deserialize
<
ExtractRequest
>(
json
);
if
(
Request
.
Form
.
Files
==
null
||
!
Request
.
Form
.
Files
.
Any
())
if
(
Request
.
Form
.
Files
==
null
||
!
Request
.
Form
.
Files
.
Any
())
...
...
performance/Performance.Extract.Api/Controllers/ExtractController.cs
View file @
b45cc95f
...
@@ -44,16 +44,11 @@ public class ExtractController : Controller
...
@@ -44,16 +44,11 @@ public class ExtractController : Controller
[
HttpPost
]
[
HttpPost
]
public
void
ExtractData
()
public
void
ExtractData
()
{
{
Dictionary
<
string
,
object
>
dict
=
new
Dictionary
<
string
,
object
>();
string
json
=
JsonHelper
.
Serialize
(
Request
.
Form
.
ToDictionary
());
foreach
(
var
key
in
Request
.
Form
.
Keys
)
{
dict
.
Add
(
key
,
Request
.
Form
[
key
]);
}
string
json
=
JsonHelper
.
Serialize
(
dict
);
var
request
=
JsonHelper
.
Deserialize
<
ExtractRequest
>(
json
);
logger
.
LogInformation
(
"提取绩效数据请求参数:"
+
json
);
logger
.
LogInformation
(
"提取绩效数据请求参数:"
+
json
);
var
request
=
JsonHelper
.
Deserialize
<
ExtractRequest
>(
json
);
if
(
request
==
null
||
request
.
AllotId
==
0
||
request
.
HospitalId
==
0
)
if
(
request
==
null
||
request
.
AllotId
==
0
||
request
.
HospitalId
==
0
)
return
;
return
;
...
@@ -109,8 +104,7 @@ private string SaveFileAsTemplate(IFormFile file, int hospitalId)
...
@@ -109,8 +104,7 @@ private string SaveFileAsTemplate(IFormFile file, int hospitalId)
private
void
ImportFileAsAllotExtractFile
(
int
allotId
,
int
hospitalId
,
string
filePath
)
private
void
ImportFileAsAllotExtractFile
(
int
allotId
,
int
hospitalId
,
string
filePath
)
{
{
var
http
=
new
RestSharpHelper
();
var
http
=
new
RestSharpHelper
();
string
endpoint
=
"template/savefile"
;
var
importUrl
=
http
.
SetUrl
(
options
.
ImportFile
,
"template/savefile"
);
var
importUrl
=
http
.
SetUrl
(
options
.
ImportFile
,
endpoint
);
var
obj
=
new
{
allotId
,
hospitalId
};
var
obj
=
new
{
allotId
,
hospitalId
};
...
...
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