Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
691e403e
Commit
691e403e
authored
Sep 19, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改电站监控数据不一致问题
parent
d7721b58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
16 deletions
+51
-16
SofarDataAcquisitionServiceImpl.java
...pi/face/service/impl/SofarDataAcquisitionServiceImpl.java
+26
-6
SunlightServiceImpl.java
...i/householdapi/face/service/impl/SunlightServiceImpl.java
+25
-10
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SofarDataAcquisitionServiceImpl.java
View file @
691e403e
...
...
@@ -12,10 +12,7 @@ import java.util.Map;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
javax.annotation.PostConstruct
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.yeejoin.amos.api.householdapi.face.dto.GoodWeStationMonitorDto
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -127,8 +124,8 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
sunlight
.
setCreatedTime
(
System
.
currentTimeMillis
());
sofarStationListMapper
.
insert
(
sunlight
);
}
//删除多余的
电站
deleteSH
Station
(
jsonObject
);
//删除多余的
信息
deleteSH
Message
(
jsonObject
);
// mysql电站信息
this
.
stationDetail
(
jsonObject
);
}
...
...
@@ -137,12 +134,13 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
* 删除多余的首航场站
* @param sofarStationLists
*/
private
void
deleteSH
Station
(
List
<
SofarStationList
>
sofarStationLists
)
{
private
void
deleteSH
Message
(
List
<
SofarStationList
>
sofarStationLists
)
{
if
(
CollectionUtil
.
isNotEmpty
(
sofarStationLists
)){
List
<
String
>
stationIds
=
new
ArrayList
<>();
for
(
SofarStationList
sofarStationList
:
sofarStationLists
)
{
stationIds
.
add
(
sofarStationList
.
getId
().
toString
());
}
//场站
QueryWrapper
<
JpStation
>
wrapper
=
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
SH
.
getCode
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
jpStations
)){
...
...
@@ -153,6 +151,28 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
}
}
}
//采集器
QueryWrapper
<
JpCollector
>
wrapper1
=
new
QueryWrapper
<
JpCollector
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
SH
.
getCode
());
List
<
JpCollector
>
jpCollectors
=
jpCollectorMapper
.
selectList
(
wrapper1
);
if
(
CollectionUtil
.
isNotEmpty
(
jpCollectors
)){
for
(
JpCollector
jpCollector
:
jpCollectors
)
{
if
(!
stationIds
.
contains
(
jpCollector
.
getThirdStationId
())){
//删除多余数据
jpCollectorMapper
.
deleteById
(
jpCollector
.
getSequenceNbr
());
}
}
}
//逆变器
QueryWrapper
<
JpInverter
>
wrapper2
=
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
SH
.
getCode
());
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
wrapper2
);
if
(
CollectionUtil
.
isNotEmpty
(
jpInverters
)){
for
(
JpInverter
jpInverter
:
jpInverters
)
{
if
(!
stationIds
.
contains
(
jpInverter
.
getThirdStationId
())){
//删除多余数据
jpInverterMapper
.
deleteById
(
jpInverter
.
getSequenceNbr
());
}
}
}
}
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SunlightServiceImpl.java
View file @
691e403e
...
...
@@ -8,13 +8,8 @@ import cn.hutool.json.JSONUtil;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.gson.JsonObject
;
import
com.qiniu.util.Json
;
import
com.yeejoin.amos.api.householdapi.Utils.SunlightUtil
;
import
com.yeejoin.amos.api.householdapi.constant.ImasterConstant
;
import
com.yeejoin.amos.api.householdapi.constant.KSolarConstant
;
import
com.yeejoin.amos.api.householdapi.face.dto.Device
;
import
com.yeejoin.amos.api.householdapi.face.dto.KsolarAlarmDto
;
import
com.yeejoin.amos.api.householdapi.face.dto.SunlightDto
;
import
com.yeejoin.amos.api.householdapi.face.dto.SunlightWarm
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpCollector
;
...
...
@@ -38,7 +33,6 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.text.SimpleDateFormat
;
...
...
@@ -47,8 +41,6 @@ import java.util.concurrent.TimeUnit;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
/**
* @description:
* @author: tw
...
...
@@ -117,7 +109,7 @@ public class SunlightServiceImpl implements SunlightService {
JSONObject
data
=
SunlightUtil
.
getDataList
(
SunlightUtil
.
getPowerStationList
,
bodyparam
);
List
<
Sunlight
>
list
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
data
.
get
(
"pageList"
)),
Sunlight
.
class
);
//删除多余的场站
deleteYG
Station
(
data
);
deleteYG
Message
(
data
);
this
.
stationDetail
(
data
);
for
(
Sunlight
sunlight
:
list
)
{
...
...
@@ -131,7 +123,7 @@ public class SunlightServiceImpl implements SunlightService {
* 删除多余的阳光场站
* @param data
*/
private
void
deleteYG
Station
(
JSONObject
data
)
{
private
void
deleteYG
Message
(
JSONObject
data
)
{
// 所有场站信息
List
<
SunlightDto
>
sunlightDtos
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
data
.
get
(
"pageList"
)),
SunlightDto
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
sunlightDtos
)){
...
...
@@ -139,6 +131,7 @@ public class SunlightServiceImpl implements SunlightService {
for
(
SunlightDto
sunlightDto
:
sunlightDtos
)
{
stationIds
.
add
(
sunlightDto
.
getPs_id
().
toString
());
}
//场站
QueryWrapper
<
JpStation
>
wrapper
=
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
YG
.
getCode
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
jpStations
)){
...
...
@@ -149,6 +142,28 @@ public class SunlightServiceImpl implements SunlightService {
}
}
}
//采集器
QueryWrapper
<
JpCollector
>
wrapper1
=
new
QueryWrapper
<
JpCollector
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
YG
.
getCode
());
List
<
JpCollector
>
jpCollectors
=
jpCollectorMapper
.
selectList
(
wrapper1
);
if
(
CollectionUtil
.
isNotEmpty
(
jpCollectors
)){
for
(
JpCollector
jpCollector
:
jpCollectors
)
{
if
(!
stationIds
.
contains
(
jpCollector
.
getThirdStationId
())){
//删除多余数据
jpCollectorMapper
.
deleteById
(
jpCollector
.
getSequenceNbr
());
}
}
}
//逆变器
QueryWrapper
<
JpInverter
>
wrapper2
=
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
YG
.
getCode
());
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
wrapper2
);
if
(
CollectionUtil
.
isNotEmpty
(
jpInverters
)){
for
(
JpInverter
jpInverter
:
jpInverters
)
{
if
(!
stationIds
.
contains
(
jpInverter
.
getThirdStationId
())){
//删除多余数据
jpInverterMapper
.
deleteById
(
jpInverter
.
getSequenceNbr
());
}
}
}
}
}
...
...
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