Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
277586cc
Commit
277586cc
authored
Jun 16, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
户用光伏数据调用工具调整
parent
6e6b6493
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
26 deletions
+12
-26
HouseholdPvUtils.java
...yeejoin/amos/api/householdapi/Utils/HouseholdPvUtils.java
+9
-10
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+3
-16
No files found.
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/HouseholdPvUtils.java
View file @
277586cc
...
...
@@ -18,17 +18,16 @@ import java.util.HashMap;
@Component
public
class
HouseholdPvUtils
{
private
static
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
;
private
static
HouseholdPvApiServiceImpl
householdPvApiServiceImpl
;
@Autowired
private
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
;
@Autowired
private
HouseholdPvApiServiceImpl
householdPvApiServiceImpl
;
public
HouseholdPvUtils
(
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
)
{
this
.
householdPvProducerInfoServiceImpl
=
householdPvProducerInfoServiceImpl
;
}
public
static
HashMap
<
String
,
Object
>
getHeaderByProducerCode
(
String
code
)
{
public
HashMap
<
String
,
Object
>
getHeaderByProducerCode
(
String
code
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
hashMaphead
=
new
HashMap
<>();
HouseholdPvProducerInfo
householdPvProducerInfo
=
householdPvProducerInfoServiceImpl
.
queryForHouseholdPvProducerInfoByCode
(
code
);
HouseholdPvProducerInfo
householdPvProducerInfo
=
this
.
householdPvProducerInfoServiceImpl
.
queryForHouseholdPvProducerInfoByCode
(
code
);
String
url
=
householdPvProducerInfo
.
getProdcerUrl
()
+
householdPvProducerInfo
.
getTokenUrl
();
hashMap
.
put
(
"apiurl"
,
householdPvProducerInfo
.
getProdcerUrl
());
if
(
PVProducerInfoEnum
.
GDW
.
getCode
().
equals
(
code
))
{
...
...
@@ -58,9 +57,9 @@ public class HouseholdPvUtils {
}
return
hashMap
;
}
public
static
String
gerResponseByAPiID
(
Long
seq
){
HouseholdPvApiDto
householdPvApiDto
=
householdPvApiServiceImpl
.
queryBySeq
(
seq
);
HashMap
<
String
,
Object
>
producerInfo
=
HouseholdPvUtil
s
.
getHeaderByProducerCode
(
householdPvApiDto
.
getProducerId
());
public
String
gerResponseByAPiID
(
Long
seq
){
HouseholdPvApiDto
householdPvApiDto
=
this
.
householdPvApiServiceImpl
.
queryBySeq
(
seq
);
HashMap
<
String
,
Object
>
producerInfo
=
thi
s
.
getHeaderByProducerCode
(
householdPvApiDto
.
getProducerId
());
HashMap
<
String
,
String
>
headMap
=
(
HashMap
<
String
,
String
>)
producerInfo
.
get
(
"header"
);
String
respone
=
""
;
if
(
householdPvApiDto
.
getRequestMethod
().
equals
(
"POST"
)){
...
...
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
277586cc
...
...
@@ -33,9 +33,8 @@ import java.util.Map;
@RequestMapping
(
value
=
"/household-pv-api-test1"
)
public
class
HouseholdTestController
{
@Autowired
private
HouseholdPvApiServiceImpl
householdPvApiServiceImpl
;
@Autowired
private
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
;
private
HouseholdPvUtils
householdPvUtils
;
/**
* 新增户用光伏-厂商API haders
...
...
@@ -46,18 +45,6 @@ public class HouseholdTestController {
@PostMapping
(
value
=
"/gdwdemo"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"固德威示例"
,
notes
=
"固德威示例"
)
public
String
save
(
Long
seq
)
throws
IOException
{
HouseholdPvApiDto
householdPvApiDto
=
householdPvApiServiceImpl
.
queryBySeq
(
seq
);
HashMap
<
String
,
Object
>
producerInfo
=
HouseholdPvUtils
.
getHeaderByProducerCode
(
householdPvApiDto
.
getProducerId
());
HashMap
<
String
,
String
>
headMap
=
(
HashMap
<
String
,
String
>)
producerInfo
.
get
(
"header"
);
String
respone
=
""
;
if
(
householdPvApiDto
.
getRequestMethod
().
equals
(
"POST"
)){
respone
=
HttpUtil
.
createPost
(
producerInfo
.
get
(
"apiurl"
)+
householdPvApiDto
.
getApiUrl
()).
headerMap
(
headMap
,
true
).
body
(
householdPvApiDto
.
getParamInfo
()).
execute
().
body
();
}
if
(
householdPvApiDto
.
getRequestMethod
().
equals
(
"GET"
)){
respone
=
HttpUtil
.
createGet
(
producerInfo
.
get
(
"apiurl"
)+
householdPvApiDto
.
getApiUrl
()).
headerMap
(
headMap
,
true
).
body
(
householdPvApiDto
.
getParamInfo
()).
execute
().
body
();
}
return
respone
;
return
householdPvUtils
.
gerResponseByAPiID
(
seq
);
}
}
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