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
6071cb0b
Commit
6071cb0b
authored
Mar 04, 2024
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增首航请求工具类
parent
e70fe2d5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
13 deletions
+69
-13
HousevPVapiApplication.java
...rc/main/java/com/yeejoin/amos/HousevPVapiApplication.java
+3
-3
SofarRequestUtil.java
...yeejoin/amos/api/householdapi/Utils/SofarRequestUtil.java
+4
-4
SoFarConstant.java
...yeejoin/amos/api/householdapi/constant/SoFarConstant.java
+1
-1
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+5
-5
SofarDataAcquisitionServiceImpl.java
...pi/face/service/impl/SofarDataAcquisitionServiceImpl.java
+56
-0
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/HousevPVapiApplication.java
View file @
6071cb0b
...
@@ -34,10 +34,10 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
...
@@ -34,10 +34,10 @@ import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
@EnableTransactionManagement
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableConfigurationProperties
@ServletComponentScan
@ServletComponentScan
@EnableDiscoveryClient
//
@EnableDiscoveryClient
@EnableFeignClients
//
@EnableFeignClients
@EnableAsync
@EnableAsync
@EnableEurekaClient
//
@EnableEurekaClient
@EnableScheduling
@EnableScheduling
@MapperScan
(
value
=
{
"org.typroject.tyboot.*.*.face.orm.dao"
,
"com.yeejoin.amos.api.*.face.orm.dao"
,
@MapperScan
(
value
=
{
"org.typroject.tyboot.*.*.face.orm.dao"
,
"com.yeejoin.amos.api.*.face.orm.dao"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
"org.typroject.tyboot.face.*.orm.dao*"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
})
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/SofarRequestUtil.java
View file @
6071cb0b
...
@@ -31,7 +31,7 @@ public class SofarRequestUtil {
...
@@ -31,7 +31,7 @@ public class SofarRequestUtil {
public
HashMap
<
String
,
String
>
getHeaderOfSofar
()
{
public
HashMap
<
String
,
String
>
getHeaderOfSofar
()
{
HashMap
<
String
,
String
>
requestHeader
=
new
HashMap
<>();
HashMap
<
String
,
String
>
requestHeader
=
new
HashMap
<>();
if
(
ObjectUtil
.
isNotEmpty
(
redisUtils
.
get
(
redisKey
))){
if
(
ObjectUtil
.
isNotEmpty
(
redisUtils
.
get
(
redisKey
))){
requestHeader
.
put
(
"
toke
n"
,
redisUtils
.
get
(
redisKey
).
toString
());
requestHeader
.
put
(
"
authorizatio
n"
,
redisUtils
.
get
(
redisKey
).
toString
());
return
requestHeader
;
return
requestHeader
;
}
}
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
...
@@ -45,8 +45,7 @@ public class SofarRequestUtil {
...
@@ -45,8 +45,7 @@ public class SofarRequestUtil {
String
response
=
HttpUtil
.
createPost
(
url
).
body
(
body
).
execute
().
body
();
String
response
=
HttpUtil
.
createPost
(
url
).
body
(
body
).
execute
().
body
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
if
(
jsonObject
.
getString
(
"msg"
).
equals
(
"success"
)){
if
(
jsonObject
.
getString
(
"msg"
).
equals
(
"success"
)){
JSONObject
jsonObject1
=
jsonObject
.
getJSONObject
(
"data"
);
String
token
=
jsonObject
.
getString
(
"data"
);
String
token
=
jsonObject1
.
getString
(
"token"
);
requestHeader
.
put
(
"authorization"
,
token
);
requestHeader
.
put
(
"authorization"
,
token
);
redisUtils
.
set
(
redisKey
,
token
,
5183900
);
redisUtils
.
set
(
redisKey
,
token
,
5183900
);
}
}
...
@@ -72,8 +71,9 @@ public class SofarRequestUtil {
...
@@ -72,8 +71,9 @@ public class SofarRequestUtil {
try
{
try
{
HashMap
<
String
,
String
>
headMap
=
getHeaderOfSofar
();
HashMap
<
String
,
String
>
headMap
=
getHeaderOfSofar
();
String
url
=
GoodWe
Constant
.
baseurl
+
apiurl
;
String
url
=
SoFar
Constant
.
baseurl
+
apiurl
;
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
respone
);
// jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
// jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
// if (!ObjectUtils.isEmpty(jsonArray)) {
// if (!ObjectUtils.isEmpty(jsonArray)) {
// result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
// result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/constant/SoFarConstant.java
View file @
6071cb0b
...
@@ -25,7 +25,7 @@ public class SoFarConstant {
...
@@ -25,7 +25,7 @@ public class SoFarConstant {
public
static
String
password
=
"ZXNK123456.."
;
public
static
String
password
=
"ZXNK123456.."
;
public
static
String
tokenurl
=
"/account/auth/createToken"
;
public
static
String
tokenurl
=
"/account/auth/createToken"
;
public
static
String
stationListUrl
=
"/
api/OpenApi/GetUserPowerStation
"
;
public
static
String
stationListUrl
=
"/
station/v1.0/list
"
;
public
static
String
stationListStatusUrl
=
"/api/OpenApi/QueryPowerStationMonitor"
;
public
static
String
stationListStatusUrl
=
"/api/OpenApi/QueryPowerStationMonitor"
;
public
static
String
stationDetailUrl
=
"/api/OpenApi/GetPowerStationMonitorDetail"
;
public
static
String
stationDetailUrl
=
"/api/OpenApi/GetPowerStationMonitorDetail"
;
public
static
String
collectorListUrl
=
"/v1/api/collectorList"
;
public
static
String
collectorListUrl
=
"/v1/api/collectorList"
;
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
6071cb0b
...
@@ -2,11 +2,9 @@ package com.yeejoin.amos.api.householdapi.controller;
...
@@ -2,11 +2,9 @@ package com.yeejoin.amos.api.householdapi.controller;
import
com.yeejoin.amos.api.householdapi.Utils.GoodWeRequestUtil
;
import
com.yeejoin.amos.api.householdapi.Utils.GoodWeRequestUtil
;
import
com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils
;
import
com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils
;
import
com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService
;
import
com.yeejoin.amos.api.householdapi.face.service.*
;
import
com.yeejoin.amos.api.householdapi.face.service.GoodWeDataAcquisitionService
;
import
com.yeejoin.amos.api.householdapi.face.service.ImasterDataService
;
import
com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl
;
import
com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl
;
import
fastjson.JSON
;
import
fastjson.JSON
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -40,6 +38,8 @@ public class HouseholdTestController {
...
@@ -40,6 +38,8 @@ public class HouseholdTestController {
private
ImasterDataService
imasterDataService
;
private
ImasterDataService
imasterDataService
;
@Autowired
@Autowired
private
GoodWeDataAcquisitionService
goodWeDataAcquisitionService
;
private
GoodWeDataAcquisitionService
goodWeDataAcquisitionService
;
@Autowired
private
SofarDataAcquisitionService
sofarDataAcquisitionService
;
/**
/**
...
@@ -83,7 +83,7 @@ public class HouseholdTestController {
...
@@ -83,7 +83,7 @@ public class HouseholdTestController {
@PostMapping
(
value
=
"/sofarnew"
)
@PostMapping
(
value
=
"/sofarnew"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"首航"
,
notes
=
"首航"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"首航"
,
notes
=
"首航"
)
public
void
sofarnew
()
throws
IOException
{
public
void
sofarnew
()
throws
IOException
{
// goLang
DataAcquisitionService.stationList();
sofar
DataAcquisitionService
.
stationList
();
// goLangDataAcquisitionService.stationDetail();
// goLangDataAcquisitionService.stationDetail();
// goLangDataAcquisitionService.collectorList();
// goLangDataAcquisitionService.collectorList();
// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.inverterList();
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SofarDataAcquisitionServiceImpl.java
0 → 100644
View file @
6071cb0b
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
com.yeejoin.amos.api.householdapi.Utils.SofarRequestUtil
;
import
com.yeejoin.amos.api.householdapi.constant.SoFarConstant
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangStationList
;
import
com.yeejoin.amos.api.householdapi.face.service.SofarDataAcquisitionService
;
import
fastjson.JSON
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
@Service
public
class
SofarDataAcquisitionServiceImpl
implements
SofarDataAcquisitionService
{
@Autowired
private
SofarRequestUtil
requestUtil
;
@Override
public
void
stationList
()
{
Map
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
requestInfo
.
put
(
"page"
,
1
);
requestInfo
.
put
(
"size"
,
1000
);
String
param
=
JSON
.
toJSONString
(
requestInfo
);
requestUtil
.
getResPonse
(
SoFarConstant
.
stationListUrl
,
SoFarConstant
.
requestPost
,
param
,
SoFarConstant
.
resovleRule_data
,
GolangStationList
.
class
);
}
@Override
public
void
stationDetail
()
{
}
@Override
public
void
collectorList
()
{
}
@Override
public
void
collectorDetail
()
{
}
@Override
public
void
inverterList
()
{
}
@Override
public
void
inverterDetail
()
{
}
@Override
public
void
inverAlramInfo
()
{
}
}
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