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
554a1b0c
Commit
554a1b0c
authored
May 28, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改采集报错问题
parent
1268801e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
22 deletions
+35
-22
ImasterUtils.java
...com/yeejoin/amos/api/householdapi/Utils/ImasterUtils.java
+1
-4
KsolarDataAcquisitionServiceImpl.java
...i/face/service/impl/KsolarDataAcquisitionServiceImpl.java
+18
-10
SunlightServiceImpl.java
...i/householdapi/face/service/impl/SunlightServiceImpl.java
+16
-8
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/ImasterUtils.java
View file @
554a1b0c
...
...
@@ -212,7 +212,7 @@ public class ImasterUtils {
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
response
);
JSONArray
jsonArray
=
new
JSONArray
();
JSONArray
jsonArrayRet
=
new
JSONArray
();
if
(
ObjectUtil
.
isNotEmpty
(
resultResovle
))
{
if
(
ObjectUtil
.
isNotEmpty
(
resultResovle
)
&&
ObjectUtil
.
isNotEmpty
(
jsonObject
)
)
{
String
[]
rules
=
resultResovle
.
split
(
","
);
if
(
rules
.
length
>
0
)
{
for
(
int
i
=
0
;
i
<
rules
.
length
;
i
++)
{
...
...
@@ -222,9 +222,6 @@ public class ImasterUtils {
}
try
{
jsonObject
=
(
JSONObject
)
jsonObject
.
get
(
rules
[
i
]);
if
(
jsonObject
==
null
)
{
jsonArray
=
(
JSONArray
)
jsonObject
.
get
(
rules
[
i
]);
}
}
catch
(
Exception
exception
)
{
try
{
jsonArray
=
(
JSONArray
)
jsonObject
.
get
(
rules
[
i
]);
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/KsolarDataAcquisitionServiceImpl.java
View file @
554a1b0c
...
...
@@ -46,6 +46,8 @@ import java.util.concurrent.TimeUnit;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
/**
* @author DELL
*/
...
...
@@ -549,12 +551,13 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
}
}
}
logger
.
info
(
"-------科士达同步采集器
开始
"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
logger
.
info
(
"-------科士达同步采集器
结束
"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
}
@Scheduled
(
cron
=
"${dataRequstScheduled.keshida}"
)
@Override
@Async
@PostConstruct
public
void
collectorDetail
()
{
long
ts
=
System
.
currentTimeMillis
();
logger
.
info
(
"-------科士达同步采集器详情/逆变器开始"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
...
...
@@ -623,10 +626,9 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
jpInverterMapper
.
updateById
(
jpInverter
);
}
else
{
if
(
StringUtils
.
isNotEmpty
(
jpInverter
.
getSnCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
jpInverter
.
getSnCode
()
.
trim
()
))
{
jpInverterMapper
.
insert
(
jpInverter
);
}
}
for
(
int
k1
=
1
;
k1
<
13
;
k1
++)
{
...
...
@@ -734,10 +736,16 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
hygfjpInverterElecHistoryMapper
.
insert
(
hygfjpInverterElecHistory
);
// 逆变器历史
String
today
=
DateUtil
.
today
();
HYGFJPInverterHistory
hygfjpInverterHistory
=
hygfjpInverterHistoryMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPInverterHistory
>()
.
eq
(
"sn_code"
,
jpInverter
.
getSnCode
().
trim
()).
eq
(
"date"
,
today
));
String
today
=
DateUtil
.
today
();
HYGFJPInverterHistory
hygfjpInverterHistory
=
null
;
try
{
hygfjpInverterHistory
=
hygfjpInverterHistoryMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPInverterHistory
>()
.
eq
(
"sn_code"
,
jpInverter
.
getSnCode
().
trim
()).
eq
(
"date"
,
today
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
"科士达逆变器日历史数据错误:"
+
jpInverter
.
getSnCode
().
trim
()+
","
+
today
);
}
if
(
ObjectUtils
.
isEmpty
(
hygfjpInverterHistory
))
{
hygfjpInverterHistory
=
new
HYGFJPInverterHistory
();
}
...
...
@@ -764,8 +772,8 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
.
eq
(
"third_station_id"
,
ksolarStationCollectList
.
getThirdStationId
())
.
eq
(
"third_code"
,
PVProducerInfoEnum
.
KSOLAR
.
getCode
())
.
like
(
"sn_code"
,
ksolarStationCollectData
.
getInverterId
().
trim
())
.
isNotNull
(
"sn_code"
).
orderByDesc
(
"update_time"
));
.
eq
(
"sn_code"
,
ksolarStationCollectData
.
getInverterId
().
trim
())
.
orderByDesc
(
"update_time"
));
JpInverter
jpInverter
=
new
JpInverter
();
if
(
jpInverterList
.
size
()
>
0
)
{
jpInverter
=
jpInverterList
.
get
(
0
);
...
...
@@ -812,7 +820,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
if
(!
ObjectUtils
.
isEmpty
(
jpInverter
.
getSequenceNbr
()))
{
jpInverterMapper
.
updateById
(
jpInverter
);
}
else
{
if
(
StringUtils
.
isNotEmpty
(
jpInverter
.
getSnCode
()))
{
if
(
StringUtils
.
isNotEmpty
(
jpInverter
.
getSnCode
()
.
trim
()
))
{
jpInverterMapper
.
insert
(
jpInverter
);
}
}
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SunlightServiceImpl.java
View file @
554a1b0c
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.json.JSONObject
;
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
;
...
...
@@ -45,6 +46,8 @@ import java.util.concurrent.TimeUnit;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
/**
* @description:
* @author: tw
...
...
@@ -242,13 +245,14 @@ public class SunlightServiceImpl implements SunlightService {
e
.
printStackTrace
();
logger
.
error
(
"阳光数据错误:"
+
com
.
alibaba
.
fastjson
.
JSONObject
.
toJSONString
(
sunlightDto
));
}
// 0离线 1在线
// 1故障 2告警 4正常
// 0离线 1在线
// 1故障 2告警 4正常
if
(
"0"
.
equals
(
sunlightDto
.
getPs_status
().
toString
()))
{
jpStation
.
setState
(
"离线"
);
}
else
if
(
"1"
.
equals
(
sunlightDto
.
getPs_status
().
toString
()))
{
if
(
"1"
.
equals
(
sunlightDto
.
getPs_fault_status
().
toString
())
||
"2"
.
equals
(
sunlightDto
.
getPs_fault_status
().
toString
()))
{
if
(
"1"
.
equals
(
sunlightDto
.
getPs_fault_status
().
toString
())
||
"2"
.
equals
(
sunlightDto
.
getPs_fault_status
().
toString
()))
{
jpStation
.
setState
(
"报警"
);
}
else
if
(
"4"
.
equals
(
sunlightDto
.
getPs_fault_status
().
toString
()))
{
jpStation
.
setState
(
"在线"
);
...
...
@@ -402,17 +406,21 @@ public class SunlightServiceImpl implements SunlightService {
// tdJpStationMapper.insert(tdJpStation);
// }
}
if
(!
ObjectUtils
.
isEmpty
(
jpStation
.
getSequenceNbr
()))
{
JpStation
jpStationOld
=
jpStationMapper
.
selectOne
(
new
LambdaQueryWrapper
<
JpStation
>().
eq
(
JpStation:
:
getThirdStationId
,
jpStation
.
getThirdStationId
())
.
eq
(
JpStation:
:
getThirdCode
,
PVProducerInfoEnum
.
YG
.
getCode
()));
if
(
jpStationOld
!=
null
)
{
jpStation
.
setSequenceNbr
(
jpStationOld
.
getSequenceNbr
());
jpStationMapper
.
updateById
(
jpStation
);
}
else
{
jpStationMapper
.
insert
(
jpStation
);
}
this
.
setJpInverte
(
listd
,
jpStation
,
listdtx
);
this
.
collectorDetail
(
listd
,
jpStation
);
// 电站报表
// 户用场站日发电量
Date
today1
=
new
Date
();
...
...
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