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
c0ac0241
Commit
c0ac0241
authored
Nov 30, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
锦浪云数据采集问题处理
parent
4353e002
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
14 deletions
+24
-14
HouseholdTestController.java
.../api/householdapi/controller/HouseholdTestController.java
+2
-2
GoLangDataAcquisitionServiceImpl.java
...i/face/service/impl/GoLangDataAcquisitionServiceImpl.java
+11
-1
ImasterDataServiceImpl.java
...ouseholdapi/face/service/impl/ImasterDataServiceImpl.java
+3
-0
KsolarDataAcquisitionServiceImpl.java
...i/face/service/impl/KsolarDataAcquisitionServiceImpl.java
+8
-11
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/controller/HouseholdTestController.java
View file @
c0ac0241
...
...
@@ -59,8 +59,8 @@ public class HouseholdTestController {
@PostMapping
(
value
=
"/golangnew"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"锦浪云"
,
notes
=
"锦浪云"
)
public
void
golangnew
()
throws
IOException
{
goLangDataAcquisitionService
.
stationList
();
//
goLangDataAcquisitionService.stationDetail();
//
goLangDataAcquisitionService.stationList();
goLangDataAcquisitionService
.
stationDetail
();
// goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoLangDataAcquisitionServiceImpl.java
View file @
c0ac0241
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.api.householdapi.face.service.impl;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.log.Log
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil
;
import
com.yeejoin.amos.api.householdapi.constant.GoLangConstant
;
...
...
@@ -143,6 +144,11 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
GoLangConstant
.
resovleRule_data
,
GolangStationDetail
.
class
);
if
(
result
.
size
()
>
0
)
{
}
else
{
System
.
out
.
println
(
stationIds
.
get
(
i
));
}
for
(
int
j
=
0
;
j
<
result
.
size
();
j
++)
{
GolangStationDetail
golangStationDetail
=
result
.
get
(
j
);
golangStationDetail
.
setCreatedTime
(
System
.
currentTimeMillis
());
...
...
@@ -163,8 +169,9 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation
.
setUserName
(
golangStationDetail
.
getUsername
());
jpStation
.
setUserPhone
(
String
.
valueOf
(
golangStationDetail
.
getUsermobile
()));
jpStation
.
setStationContact
(
String
.
valueOf
(
golangStationDetail
.
getMobile
()).
toLowerCase
().
replace
(
"null"
,
""
));
if
(!
ObjectUtils
.
isEmpty
(
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
.
setThirdStationId
(
String
.
valueOf
(
golangStationDetail
.
getId
()));
jpStation
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
...
...
@@ -189,6 +196,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation
.
setCreateTime
(
new
Date
(
golangStationDetail
.
getCreatedate
()));
jpStation
.
setRatedPower
(
Double
.
valueOf
(
golangStationDetail
.
getInverterpower
()));
jpStation
.
setType
(
"家庭户用"
);
jpStation
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jpStation
.
getSequenceNbr
()))
{
jpStationMapper
.
updateById
(
jpStation
);
}
else
{
...
...
@@ -371,6 +379,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpCollector
.
setName
(
collectorDetailDto
.
getName
());
//信号强度
jpCollector
.
setSignalStrength
(
collectorDetailDto
.
getRssiLevel
());
jpCollector
.
setRecDate
(
new
Date
());
if
(
ObjectUtils
.
isEmpty
(
jpCollector
.
getSequenceNbr
()))
{
jpCollectorMapper
.
insert
(
jpCollector
);
}
else
{
...
...
@@ -466,6 +475,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpInverter
.
setThirdStationId
(
String
.
valueOf
(
inverterDetailDto
.
getStationId
()));
jpInverter
.
setThirdCode
(
PVProducerInfoEnum
.
JLY
.
getCode
());
jpInverter
.
setStationName
(
inverterDetailDto
.
getStationName
());
jpInverter
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
jpInverterMapper
.
updateById
(
jpInverter
);
}
else
{
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/ImasterDataServiceImpl.java
View file @
c0ac0241
...
...
@@ -290,6 +290,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
// jpStation.setAccessTime(new Date(imasterStationDetail.getFisgeneratetime()));
// jpStation.setCreateTime(new Date(imasterStationDetail.getCreatedate()));
// jpStation.setRatedPower(Double.valueOf(imasterStationDetail.getInverterpower()));
jpStation
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jpStation
.
getSequenceNbr
()))
{
jpStationMapper
.
updateById
(
jpStation
);
}
else
{
...
...
@@ -457,6 +458,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
jpCollector
.
setVersion
(
imasterCollectorList
.
getSoftwareVersion
());
// jpCollector.setAddr(collectorDetailDto.getAddr());
// jpCollector.setName(collectorDetailDto.getName());
jpCollector
.
setRecDate
(
new
Date
());
if
(
ObjectUtils
.
isEmpty
(
jpCollector
.
getSequenceNbr
()))
{
jpCollectorMapper
.
insert
(
jpCollector
);
}
else
{
...
...
@@ -647,6 +649,7 @@ public class ImasterDataServiceImpl implements ImasterDataService {
jpInverter
.
setThirdStationId
(
String
.
valueOf
(
imasterInverterList
.
getStationCode
()));
jpInverter
.
setThirdCode
(
PVProducerInfoEnum
.
HUAWEI
.
getCode
());
jpInverter
.
setStationName
(
imasterInverterList
.
getStationName
());
jpInverter
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
jpInverterMapper
.
updateById
(
jpInverter
);
}
else
{
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/KsolarDataAcquisitionServiceImpl.java
View file @
c0ac0241
...
...
@@ -230,7 +230,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
// jpStation.setStationContact(String.valueOf(golangStationDetail.getMobile()).toLowerCase().replace("null", ""));
// 组件数量
// jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(golangStationDetail.getModule()))?0:Math.toIntExact(golangStationDetail.getModule()));
jpStation
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jpStation
.
getSequenceNbr
()))
{
jpStationMapper
.
updateById
(
jpStation
);
}
else
{
...
...
@@ -474,13 +474,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpCollector
.
setType
(
ksolarStationCollectList
.
getDeviceModel
());
//信号强度
jpCollector
.
setSignalStrength
(
String
.
valueOf
(
ksolarStationCollectList
.
getSignal
()));
jpCollector
.
setRecDate
(
new
Date
());
if
(
ObjectUtils
.
isEmpty
(
jpCollector
.
getSequenceNbr
()))
{
jpCollectorMapper
.
insert
(
jpCollector
);
}
else
{
jpCollectorMapper
.
updateById
(
jpCollector
);
}
HYGFJPCollectorHistory
hygfjpCollectorHistory
=
new
HYGFJPCollectorHistory
();
hygfjpCollectorHistory
.
setTime
(
System
.
currentTimeMillis
());
hygfjpCollectorHistory
.
setCreatedTime
(
System
.
currentTimeMillis
());
...
...
@@ -500,8 +499,6 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
List
<
JpCollector
>
jpCollectorlist
=
jpCollectorMapper
.
selectList
(
new
QueryWrapper
<
JpCollector
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
KSOLAR
.
getCode
()));
List
<
String
>
collectIds
=
ksolarStationCollectListMapper
.
getCollectIds
();
if
(!
CollectionUtils
.
isEmpty
(
collectIds
))
{
collectIds
.
forEach
(
collectId
->
{
...
...
@@ -518,7 +515,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>(
1
);
String
requestParaminfo
=
JSON
.
toJSONString
(
requestInfo
);
String
url
=
KSolarConstant
.
stationCollectDataUrl
+
"?collectId="
+
ksolarStationCollectList
.
getCollectId
()
;
String
url
=
KSolarConstant
.
stationCollectDataUrl
+
"?collectId="
+
collectId
;
List
<
KsolarStationCollectData
>
result
=
kSolarRequestUtil
.
getResPonse
(
url
,
KSolarConstant
.
requestGET
,
...
...
@@ -526,12 +523,11 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
KSolarConstant
.
resovle_data
,
KsolarStationCollectData
.
class
);
if
(
jpCollectorlist
!=
null
&&
jpCollectorlist
.
size
()
>
0
)
{
JpCollector
jpCollectorflag
=
null
;
for
(
JpCollector
jpCollector
:
jpCollectorlist
)
{
if
(
jpCollector
.
getSnCode
().
equals
(
ksolarStationCollectList
.
getCollectId
().
trim
())
&&
KSolarConstant
.
station
Staus
.
get
(
"1"
).
equals
(
jpCollector
.
getState
()))
{
if
(
jpCollector
.
getSnCode
().
equals
(
ksolarStationCollectList
.
getCollectId
().
trim
())
&&
KSolarConstant
.
collect
Staus
.
get
(
"1"
).
equals
(
jpCollector
.
getState
()))
{
jpCollectorflag
=
jpCollector
;
break
;
}
...
...
@@ -563,6 +559,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
jpInverter
.
setThirdCode
(
PVProducerInfoEnum
.
KSOLAR
.
getCode
());
jpInverter
.
setStationName
(
ksolarStationCollectList
.
getStationName
());
jpInverter
.
setAddr
(
ksolarStationCollectList
.
getAddress
());
jpInverter
.
setRecDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
jpInverterMapper
.
updateById
(
jpInverter
);
}
else
{
...
...
@@ -710,7 +707,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
List
<
JpInverter
>
jpInverterList
=
jpInverterMapper
.
selectList
(
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_station_id"
,
ksolarStationCollectList
.
getThirdStationId
()).
eq
(
"third_code"
,
PVProducerInfoEnum
.
KSOLAR
.
getCode
()).
eq
(
"sn_code"
,
ksolarStationCollectData
.
getInverterId
().
trim
())
like
(
"sn_code"
,
ksolarStationCollectData
.
getInverterId
().
trim
())
.
isNotNull
(
"sn_code"
)
.
orderByDesc
(
"update_time"
));
JpInverter
jpInverter
=
jpInverterList
.
get
(
0
);
...
...
@@ -735,7 +732,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
jpInverter
.
setSnCode
(
ksolarStationCollectData
.
getInverterId
().
trim
());
jpInverter
.
setId
(
ksolarStationCollectData
.
getInverterId
().
trim
());
jpInverter
.
setState
(
KSolarConstant
.
station
Staus
.
get
(
ksolarStationCollectData
.
getStatus
()));
jpInverter
.
setState
(
KSolarConstant
.
collect
Staus
.
get
(
ksolarStationCollectData
.
getStatus
()));
jpInverter
.
setCollectorId
(
ksolarStationCollectList
.
getCollectId
().
trim
());
jpInverter
.
setCollectorSnCode
(
ksolarStationCollectList
.
getCollectId
().
trim
());
jpInverter
.
setUpdateTime
(
new
Date
());
...
...
@@ -810,7 +807,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
JpInverterElectricity
jpInverterElectricityS
=
jpInverterElectricityMapper
.
selectOne
(
new
QueryWrapper
<
JpInverterElectricity
>().
eq
(
"sn_code"
,
ksolarStationCollectData
.
getInverterId
()).
eq
(
"sn_code"
,
ksolarStationCollectData
.
getInverterId
()
.
trim
()
).
eq
(
"type"
,
"交流"
).
eq
(
"name"
,
"ST"
)
);
...
...
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