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
6e6b6493
Commit
6e6b6493
authored
Jun 16, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
户用光伏数据增加静态方法调用
parent
d2ac09c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
HouseholdPvUtils.java
...yeejoin/amos/api/householdapi/Utils/HouseholdPvUtils.java
+19
-0
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+9
-2
No files found.
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/HouseholdPvUtils.java
View file @
6e6b6493
...
...
@@ -4,18 +4,22 @@ import cn.hutool.http.HttpUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvApiDto
;
import
com.yeejoin.amos.api.householdapi.face.model.HouseholdPvProducerInfoDto
;
import
com.yeejoin.amos.api.householdapi.face.orm.entity.HouseholdPvProducerInfo
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvApiServiceImpl
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.HouseholdPvProducerInfoServiceImpl
;
import
com.yeejoin.amos.openapi.enums.PVProducerInfoEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.HashMap
;
@Component
public
class
HouseholdPvUtils
{
private
static
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
;
private
static
HouseholdPvApiServiceImpl
householdPvApiServiceImpl
;
public
HouseholdPvUtils
(
HouseholdPvProducerInfoServiceImpl
householdPvProducerInfoServiceImpl
)
{
this
.
householdPvProducerInfoServiceImpl
=
householdPvProducerInfoServiceImpl
;
...
...
@@ -54,4 +58,19 @@ public class HouseholdPvUtils {
}
return
hashMap
;
}
public
static
String
gerResponseByAPiID
(
Long
seq
){
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
;
}
}
amos-boot-data/amos-boot-data-accessapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
6e6b6493
...
...
@@ -49,8 +49,15 @@ public class HouseholdTestController {
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
=
HttpUtil
.
createPost
(
producerInfo
.
get
(
"apiurl"
)+
householdPvApiDto
.
getApiUrl
()).
headerMap
(
headMap
,
true
).
body
(
householdPvApiDto
.
getParamInfo
()).
execute
().
body
();
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
;
}
}
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