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
d0e724a2
Commit
d0e724a2
authored
Dec 01, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增请求记录表
parent
64cf02cb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
162 additions
and
54 deletions
+162
-54
GolangRequestUtil.java
...eejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
+15
-0
ImasterUtils.java
...com/yeejoin/amos/api/householdapi/Utils/ImasterUtils.java
+15
-1
KsolarRequestUtil.java
...eejoin/amos/api/householdapi/Utils/KsolarRequestUtil.java
+16
-5
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+1
-1
HousepvapiRecords.java
.../face/orm/houseapi/entity/houseapi/HousepvapiRecords.java
+59
-0
HousepvapiRecordsMapper.java
...api/face/orm/mapper/houseapi/HousepvapiRecordsMapper.java
+7
-0
GoLangDataAcquisitionServiceImpl.java
...i/face/service/impl/GoLangDataAcquisitionServiceImpl.java
+49
-47
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
View file @
d0e724a2
...
@@ -7,6 +7,10 @@ import cn.hutool.http.HttpUtil;
...
@@ -7,6 +7,10 @@ import cn.hutool.http.HttpUtil;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords
;
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper
;
import
com.yeejoin.amos.openapi.enums.PVProducerInfoEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -16,6 +20,8 @@ import java.util.*;
...
@@ -16,6 +20,8 @@ import java.util.*;
public
class
GolangRequestUtil
{
public
class
GolangRequestUtil
{
@Autowired
HousepvapiRecordsMapper
housepvapiRecordsMapper
;
/**
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
...
@@ -100,6 +106,13 @@ public class GolangRequestUtil {
...
@@ -100,6 +106,13 @@ public class GolangRequestUtil {
}
}
public
String
sendRequest
(
String
requestMethod
,
String
url
,
String
params
,
HashMap
<
String
,
String
>
headMap
)
{
public
String
sendRequest
(
String
requestMethod
,
String
url
,
String
params
,
HashMap
<
String
,
String
>
headMap
)
{
HousepvapiRecords
housepvapiRecords
=
new
HousepvapiRecords
();
housepvapiRecords
.
setRecDate
(
new
Date
());
housepvapiRecords
.
setRequestUrl
(
url
);
housepvapiRecords
.
setRequestMothed
(
requestMethod
);
housepvapiRecords
.
setRequestHeaders
(
JSONObject
.
toJSONString
(
headMap
));
housepvapiRecords
.
setRequestParams
(
params
);
housepvapiRecords
.
setThridCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
String
respone
=
""
;
String
respone
=
""
;
if
(
requestMethod
.
equals
(
"POST"
))
{
if
(
requestMethod
.
equals
(
"POST"
))
{
respone
=
HttpUtil
.
createPost
(
url
).
headerMap
(
headMap
,
false
).
respone
=
HttpUtil
.
createPost
(
url
).
headerMap
(
headMap
,
false
).
...
@@ -109,6 +122,8 @@ public class GolangRequestUtil {
...
@@ -109,6 +122,8 @@ public class GolangRequestUtil {
respone
=
HttpUtil
.
createGet
(
url
).
headerMap
(
headMap
,
true
).
respone
=
HttpUtil
.
createGet
(
url
).
headerMap
(
headMap
,
true
).
body
(
params
).
execute
().
body
();
body
(
params
).
execute
().
body
();
}
}
housepvapiRecords
.
setResponse
(
respone
);
housepvapiRecordsMapper
.
insert
(
housepvapiRecords
);
return
respone
;
return
respone
;
}
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/ImasterUtils.java
View file @
d0e724a2
...
@@ -9,6 +9,9 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -9,6 +9,9 @@ import com.alibaba.fastjson.JSONObject;
import
com.yeejoin.amos.api.householdapi.constant.ImasterConstant
;
import
com.yeejoin.amos.api.householdapi.constant.ImasterConstant
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords
;
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper
;
import
com.yeejoin.amos.openapi.enums.PVProducerInfoEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -22,6 +25,8 @@ public class ImasterUtils {
...
@@ -22,6 +25,8 @@ public class ImasterUtils {
private
String
redisKey
=
"XSRF-TOKEN"
;
private
String
redisKey
=
"XSRF-TOKEN"
;
@Autowired
@Autowired
HousepvapiRecordsMapper
housepvapiRecordsMapper
;
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
/**
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
...
@@ -228,7 +233,14 @@ public class ImasterUtils {
...
@@ -228,7 +233,14 @@ public class ImasterUtils {
return
jsonArrayRet
;
return
jsonArrayRet
;
}
}
public
static
String
sendRequest
(
String
requestMethod
,
String
url
,
String
params
,
HashMap
<
String
,
String
>
headMap
)
{
public
String
sendRequest
(
String
requestMethod
,
String
url
,
String
params
,
HashMap
<
String
,
String
>
headMap
)
{
HousepvapiRecords
housepvapiRecords
=
new
HousepvapiRecords
();
housepvapiRecords
.
setRecDate
(
new
Date
());
housepvapiRecords
.
setRequestUrl
(
url
);
housepvapiRecords
.
setRequestMothed
(
requestMethod
);
housepvapiRecords
.
setRequestHeaders
(
JSONObject
.
toJSONString
(
headMap
));
housepvapiRecords
.
setRequestParams
(
params
);
housepvapiRecords
.
setThridCode
(
PVProducerInfoEnum
.
HUAWEI
.
getCode
());
String
respone
=
""
;
String
respone
=
""
;
if
(
requestMethod
.
equals
(
"POST"
))
{
if
(
requestMethod
.
equals
(
"POST"
))
{
respone
=
HttpUtil
.
createPost
(
url
).
headerMap
(
headMap
,
false
).
respone
=
HttpUtil
.
createPost
(
url
).
headerMap
(
headMap
,
false
).
...
@@ -238,6 +250,8 @@ public class ImasterUtils {
...
@@ -238,6 +250,8 @@ public class ImasterUtils {
respone
=
HttpUtil
.
createGet
(
url
).
headerMap
(
headMap
,
true
).
respone
=
HttpUtil
.
createGet
(
url
).
headerMap
(
headMap
,
true
).
body
(
params
).
execute
().
body
();
body
(
params
).
execute
().
body
();
}
}
housepvapiRecords
.
setResponse
(
respone
);
housepvapiRecordsMapper
.
insert
(
housepvapiRecords
);
return
respone
;
return
respone
;
}
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/KsolarRequestUtil.java
View file @
d0e724a2
...
@@ -7,6 +7,9 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -7,6 +7,9 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
import
com.yeejoin.amos.api.householdapi.constant.KSolarConstant
;
import
com.yeejoin.amos.api.householdapi.constant.KSolarConstant
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords
;
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper
;
import
com.yeejoin.amos.openapi.enums.PVProducerInfoEnum
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.bouncycastle.jcajce.provider.symmetric.AES
;
import
org.bouncycastle.jcajce.provider.symmetric.AES
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -14,16 +17,15 @@ import org.springframework.stereotype.Component;
...
@@ -14,16 +17,15 @@ import org.springframework.stereotype.Component;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Base64
;
import
java.util.HashMap
;
import
java.util.List
;
@Component
@Component
@Slf4j
@Slf4j
public
class
KsolarRequestUtil
{
public
class
KsolarRequestUtil
{
@Autowired
HousepvapiRecordsMapper
housepvapiRecordsMapper
;
/**
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @deprecated 根据厂商编码获取厂商的hearer
* @deprecated 根据厂商编码获取厂商的hearer
...
@@ -114,6 +116,13 @@ public class KsolarRequestUtil {
...
@@ -114,6 +116,13 @@ public class KsolarRequestUtil {
}
}
public
String
sendRequest
(
String
requestMethod
,
String
url
,
String
params
,
HashMap
<
String
,
String
>
headMap
)
{
public
String
sendRequest
(
String
requestMethod
,
String
url
,
String
params
,
HashMap
<
String
,
String
>
headMap
)
{
HousepvapiRecords
housepvapiRecords
=
new
HousepvapiRecords
();
housepvapiRecords
.
setRecDate
(
new
Date
());
housepvapiRecords
.
setRequestUrl
(
url
);
housepvapiRecords
.
setRequestMothed
(
requestMethod
);
housepvapiRecords
.
setRequestHeaders
(
JSONObject
.
toJSONString
(
headMap
));
housepvapiRecords
.
setRequestParams
(
params
);
housepvapiRecords
.
setThridCode
(
PVProducerInfoEnum
.
KSOLAR
.
getCode
());
String
respone
=
""
;
String
respone
=
""
;
if
(
requestMethod
.
equals
(
"POST"
))
{
if
(
requestMethod
.
equals
(
"POST"
))
{
respone
=
HttpUtil
.
createPost
(
url
).
headerMap
(
headMap
,
false
).
respone
=
HttpUtil
.
createPost
(
url
).
headerMap
(
headMap
,
false
).
...
@@ -123,6 +132,8 @@ public class KsolarRequestUtil {
...
@@ -123,6 +132,8 @@ public class KsolarRequestUtil {
respone
=
HttpUtil
.
createGet
(
url
).
headerMap
(
headMap
,
true
).
respone
=
HttpUtil
.
createGet
(
url
).
headerMap
(
headMap
,
true
).
body
(
params
).
execute
().
body
();
body
(
params
).
execute
().
body
();
}
}
housepvapiRecords
.
setResponse
(
respone
);
housepvapiRecordsMapper
.
insert
(
housepvapiRecords
);
return
respone
;
return
respone
;
}
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
d0e724a2
...
@@ -139,7 +139,7 @@ public class HouseholdTestController {
...
@@ -139,7 +139,7 @@ public class HouseholdTestController {
public
void
imasterNew
()
throws
IOException
{
public
void
imasterNew
()
throws
IOException
{
// imasterDataService.stationList();
// imasterDataService.stationList();
// imasterDataService.stationDetail();
// imasterDataService.stationDetail();
//
imasterDataService.collectorList();
imasterDataService
.
collectorList
();
// imasterDataService.inverterList(null);
// imasterDataService.inverterList(null);
// imasterDataService.inverterDetail(null);
// imasterDataService.inverterDetail(null);
kSolarDataAcquisitionService
.
collectorDetail
();
kSolarDataAcquisitionService
.
collectorDetail
();
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/houseapi/HousepvapiRecords.java
0 → 100644
View file @
d0e724a2
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
houseapi
.
entity
.
houseapi
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
/**
* 请求记录url
*
* @author system_generator
* @date 2023-06-07
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"housepvapi_records"
)
public
class
HousepvapiRecords
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 请求url
*/
@TableField
(
"request_url"
)
private
String
requestUrl
;
/**
* 请求参数
*/
@TableField
(
"request_params"
)
private
String
requestParams
;
/**
* 请求方式
*/
@TableField
(
"request_mothed"
)
private
String
requestMothed
;
/**
* 请求返回
*/
@TableField
(
"response"
)
private
String
response
;
/**
* 请求厂商
*/
@TableField
(
"thrid_code"
)
private
String
thridCode
;
/**
* 请求厂商
*/
@TableField
(
"request_headers"
)
private
String
requestHeaders
;
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/houseapi/HousepvapiRecordsMapper.java
0 → 100644
View file @
d0e724a2
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
orm
.
mapper
.
houseapi
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords
;
public
interface
HousepvapiRecordsMapper
extends
BaseMapper
<
HousepvapiRecords
>
{
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoLangDataAcquisitionServiceImpl.java
View file @
d0e724a2
...
@@ -169,7 +169,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -169,7 +169,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
if
(!
ObjectUtils
.
isEmpty
(
golangStationDetail
.
getModule
()))
{
if
(!
ObjectUtils
.
isEmpty
(
golangStationDetail
.
getModule
()))
{
jpStation
.
setModuleCount
(
ObjectUtils
.
isEmpty
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()))
?
0
:
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
jpStation
.
setModuleCount
(
ObjectUtils
.
isEmpty
(
Math
.
toIntExact
(
golangStationDetail
.
getModule
()))
?
0
:
Math
.
toIntExact
(
golangStationDetail
.
getModule
()));
}
//并网类型
}
//并网类型
jpStation
.
setState
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
jpStation
.
setState
(
GoLangConstant
.
stationStaus
.
get
(
String
.
valueOf
(
golangStationDetail
.
getState
())));
...
@@ -299,27 +299,27 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -299,27 +299,27 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
public
void
collectorList
()
{
public
void
collectorList
()
{
// List<String> stationIds = golangStationMapper.getStationIds();
// List<String> stationIds = golangStationMapper.getStationIds();
// for (int i = 0; i < stationIds.size(); i++) {
// for (int i = 0; i < stationIds.size(); i++) {
try
{
try
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
TimeUnit
.
SECONDS
.
sleep
(
1
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
// requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
// requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
requestInfo
.
put
(
"pageNo"
,
1
);
requestInfo
.
put
(
"pageNo"
,
1
);
requestInfo
.
put
(
"pageSize"
,
100
);
requestInfo
.
put
(
"pageSize"
,
100
);
String
requestParaminfo
=
JSON
.
toJSONString
(
requestInfo
);
String
requestParaminfo
=
JSON
.
toJSONString
(
requestInfo
);
List
<
GolangCollectorList
>
result
=
golangRequestUtil
.
getResPonse
(
GoLangConstant
.
collectorListUrl
,
List
<
GolangCollectorList
>
result
=
golangRequestUtil
.
getResPonse
(
GoLangConstant
.
collectorListUrl
,
GoLangConstant
.
requestPost
,
GoLangConstant
.
requestPost
,
requestParaminfo
,
requestParaminfo
,
GoLangConstant
.
resovleRule_data_page_records
,
GoLangConstant
.
resovleRule_data_page_records
,
GolangCollectorList
.
class
GolangCollectorList
.
class
);
);
for
(
int
j
=
0
;
j
<
result
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
result
.
size
();
j
++)
{
GolangCollectorList
golangCollectorList
=
result
.
get
(
j
);
GolangCollectorList
golangCollectorList
=
result
.
get
(
j
);
golangCollectorList
.
setCreatedTime
(
System
.
currentTimeMillis
());
golangCollectorList
.
setCreatedTime
(
System
.
currentTimeMillis
());
golangCollectorListMapper
.
insert
(
golangCollectorList
);
golangCollectorListMapper
.
insert
(
golangCollectorList
);
}
}
// }
// }
}
}
...
@@ -403,27 +403,27 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -403,27 +403,27 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
public
void
inverterList
()
{
public
void
inverterList
()
{
// List<String> stationIds = golangStationMapper.getStationIds();
// List<String> stationIds = golangStationMapper.getStationIds();
// for (int i = 0; i < stationIds.size(); i++) {
// for (int i = 0; i < stationIds.size(); i++) {
try
{
try
{
TimeUnit
.
SECONDS
.
sleep
(
1
);
TimeUnit
.
SECONDS
.
sleep
(
1
);
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
// requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
// requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
requestInfo
.
put
(
"pageNo"
,
1
);
requestInfo
.
put
(
"pageNo"
,
1
);
requestInfo
.
put
(
"pageSize"
,
100
);
requestInfo
.
put
(
"pageSize"
,
100
);
String
requestParaminfo
=
JSON
.
toJSONString
(
requestInfo
);
String
requestParaminfo
=
JSON
.
toJSONString
(
requestInfo
);
List
<
GolangInverterList
>
result
=
golangRequestUtil
.
getResPonse
(
GoLangConstant
.
inverterListUrl
,
List
<
GolangInverterList
>
result
=
golangRequestUtil
.
getResPonse
(
GoLangConstant
.
inverterListUrl
,
GoLangConstant
.
requestPost
,
GoLangConstant
.
requestPost
,
requestParaminfo
,
requestParaminfo
,
GoLangConstant
.
resovleRule_data_page_records
,
GoLangConstant
.
resovleRule_data_page_records
,
GolangInverterList
.
class
GolangInverterList
.
class
);
);
for
(
int
j
=
0
;
j
<
result
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
result
.
size
();
j
++)
{
GolangInverterList
golangInverterList
=
result
.
get
(
j
);
GolangInverterList
golangInverterList
=
result
.
get
(
j
);
golangInverterList
.
setCreatedTime
(
System
.
currentTimeMillis
());
golangInverterList
.
setCreatedTime
(
System
.
currentTimeMillis
());
golangInverterListMapper
.
insert
(
golangInverterList
);
golangInverterListMapper
.
insert
(
golangInverterList
);
}
}
// }
// }
}
}
...
@@ -456,21 +456,23 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
...
@@ -456,21 +456,23 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpInverter
=
new
JpInverter
();
jpInverter
=
new
JpInverter
();
}
}
jpInverter
.
setSnCode
(
inverterDetailDto
.
getSn
().
trim
());
jpInverter
.
setSnCode
(
inverterDetailDto
.
getSn
().
trim
());
jpInverter
.
setState
(
golangRequestUtil
.
getInverterState
(
inverterDetailDto
.
getCurrentState
(),
inverterDetailDto
.
getDataTimestamp
()));
jpInverter
.
setState
(
golangRequestUtil
.
getInverterState
(
inverterDetailDto
.
getCurrentState
(),
inverterDetailDto
.
getDataTimestamp
()));
jpInverter
.
setCollectorId
(
String
.
valueOf
(
inverterDetailDto
.
getCollectorId
()));
jpInverter
.
setCollectorId
(
String
.
valueOf
(
inverterDetailDto
.
getCollectorId
()));
jpInverter
.
setCollectorSnCode
(
inverterDetailDto
.
getCollectorsn
());
jpInverter
.
setCollectorSnCode
(
inverterDetailDto
.
getCollectorsn
());
jpInverter
.
setUpdateTime
(
new
Date
());
jpInverter
.
setUpdateTime
(
new
Date
());
jpInverter
.
setCurrentPower
(
inverterDetailDto
.
getPac
());
jpInverter
.
setCurrentPower
(
inverterDetailDto
.
getPac
());
jpInverter
.
setDayPowerGeneration
(
inverterDetailDto
.
getEToday
());
jpInverter
.
setDayPowerGeneration
(
inverterDetailDto
.
getEToday
());
jpInverter
.
setMonthPowerGeneration
(
inverterDetailDto
.
getEMonth
());
jpInverter
.
setMonthPowerGeneration
(
inverterDetailDto
.
getEMonth
());
if
(
inverterDetailDto
.
getEMonthStr
().
toLowerCase
().
equals
(
"mwh"
))
{
if
(
inverterDetailDto
.
getEMonthStr
().
toLowerCase
().
equals
(
"mwh"
))
{
jpInverter
.
setMonthPowerGeneration
(
inverterDetailDto
.
getEMonth
()
*
GoLangConstant
.
mwhTokwh
);
jpInverter
.
setMonthPowerGeneration
(
inverterDetailDto
.
getEMonth
()
*
GoLangConstant
.
mwhTokwh
);
}
}
if
(
inverterDetailDto
.
getEYearStr
().
toLowerCase
().
equals
(
"mwh"
))
{
jpInverter
.
setYearPowerGeneration
(
inverterDetailDto
.
getEYear
());
if
(
inverterDetailDto
.
getEYearStr
().
toLowerCase
().
equals
(
"mwh"
))
{
jpInverter
.
setYearPowerGeneration
(
inverterDetailDto
.
getEYear
()
*
GoLangConstant
.
mwhTokwh
);
jpInverter
.
setYearPowerGeneration
(
inverterDetailDto
.
getEYear
()
*
GoLangConstant
.
mwhTokwh
);
}
}
if
(
inverterDetailDto
.
getETotalStr
().
toLowerCase
().
equals
(
"mwh"
)){
jpInverter
.
setTotalPowerGeneration
(
inverterDetailDto
.
getETotal
());
jpInverter
.
setTotalPowerGeneration
(
inverterDetailDto
.
getETotal
()
*
GoLangConstant
.
mwhTokwh
);
if
(
inverterDetailDto
.
getETotalStr
().
toLowerCase
().
equals
(
"mwh"
))
{
jpInverter
.
setTotalPowerGeneration
(
inverterDetailDto
.
getETotal
()
*
GoLangConstant
.
mwhTokwh
);
}
}
jpInverter
.
setBrand
(
inverterDetailDto
.
getName
());
jpInverter
.
setBrand
(
inverterDetailDto
.
getName
());
jpInverter
.
setModel
(
inverterDetailDto
.
getProductModel
());
jpInverter
.
setModel
(
inverterDetailDto
.
getProductModel
());
...
...
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