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
4d2f2329
Commit
4d2f2329
authored
Aug 01, 2024
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
碳银接口对接
parent
a0654fb6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
TanYinDataAcquisitionServiceImpl.java
...i/face/service/impl/TanYinDataAcquisitionServiceImpl.java
+20
-6
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/TanYinDataAcquisitionServiceImpl.java
View file @
4d2f2329
...
...
@@ -178,7 +178,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
@Override
public
void
customerInfoList
()
{
try
{
String
startDate
=
LocalDate
.
now
().
minus
Day
s
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
startDate
=
LocalDate
.
now
().
minus
Month
s
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
endDate
=
LocalDate
.
now
().
plusDays
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
log
.
info
(
"-------碳银同步项目信息开始: {} ------- "
,
sdf
.
format
(
new
Date
()));
Map
<
String
,
Object
>
params
=
MapBuilder
.<
String
,
Object
>
create
()
...
...
@@ -465,7 +465,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
if
(
jpInverter
==
null
||
StringUtils
.
isEmpty
(
jpInverter
.
getSnCode
()))
{
return
;
}
String
startDate
=
LocalDate
.
now
().
minusWeeks
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
startDate
;
if
(
jpInverter
.
getUpdateTime
()
!=
null
)
{
startDate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
jpInverter
.
getUpdateTime
());
}
else
{
startDate
=
LocalDate
.
now
().
minusMonths
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
}
String
endDate
=
LocalDate
.
now
().
plusDays
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
Map
<
String
,
Object
>
params
=
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"sn"
,
jpInverter
.
getSnCode
())
...
...
@@ -474,11 +479,19 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
.
put
(
"startDate"
,
startDate
)
.
put
(
"endDate"
,
endDate
).
build
();
PageInfo
<
TanYinAlramInfo
>
tanYinInveterInfo
=
tanYinApiUtils
.
postPage
(
"电站逆变器故障信息"
,
apiUrl
+
TanYinConstant
.
inverterAlramUrl
,
JSON
.
toJSONString
(
params
),
null
,
TanYinAlramInfo
.
class
);
List
<
TanYinAlramInfo
>
tanYinAlramInfos
=
tanYinInveterInfo
.
getList
();
if
(
CollectionUtils
.
isEmpty
(
tanYinAlramInfos
))
{
if
(
tanYinInveterInfo
==
null
||
CollectionUtils
.
isEmpty
(
tanYinInveterInfo
.
getList
()))
{
log
.
warn
(
"-------碳银同步电站逆变器故障信息结束: 未获取到逆变器故障信息 ------- "
);
return
;
}
List
<
TanYinAlramInfo
>
tanYinAlramInfos
=
new
ArrayList
<>();
tanYinAlramInfos
.
addAll
(
tanYinInveterInfo
.
getList
());
if
(
tanYinInveterInfo
.
getPages
()
>
1
)
{
for
(
int
pageNum
=
2
;
pageNum
<
tanYinInveterInfo
.
getPages
();
pageNum
++)
{
params
.
put
(
"pageNo"
,
pageNum
);
PageInfo
<
TanYinAlramInfo
>
tanYinInveterInfoPage
=
tanYinApiUtils
.
postPage
(
"电站逆变器故障信息"
,
apiUrl
+
TanYinConstant
.
inverterAlramUrl
,
JSON
.
toJSONString
(
params
),
null
,
TanYinAlramInfo
.
class
);
tanYinAlramInfos
.
addAll
(
tanYinInveterInfoPage
.
getList
());
}
}
for
(
TanYinAlramInfo
tanYinAlramInfo
:
tanYinAlramInfos
)
{
tanYinAlramInfo
.
setCreateTime
(
System
.
currentTimeMillis
());
tanYinAlramInfoMapper
.
insert
(
tanYinAlramInfo
);
...
...
@@ -486,7 +499,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
HYGFJPInverterWarn
hygfjpInverterWarn
=
hygfjpInverterWarnMapper
.
selectOne
(
new
QueryWrapper
<
HYGFJPInverterWarn
>().
eq
(
"sn_code"
,
tanYinAlramInfo
.
getSn
())
.
eq
(
"warn_id"
,
tanYinAlramInfo
.
getId
())
.
eq
(
"third_station_id"
,
String
.
valueOf
(
tanYinAlramInfo
.
getProjectNo
())));
.
eq
(
"third_station_id"
,
String
.
valueOf
(
tanYinAlramInfo
.
getProjectNo
()))
.
orderByDesc
(
"created_time"
).
last
(
"limit 1"
)
);
if
(
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
ObjectUtils
.
isEmpty
(
hygfjpInverterWarn
))
{
hygfjpInverterWarn
=
new
HYGFJPInverterWarn
();
}
...
...
@@ -500,7 +515,6 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
hygfjpInverterWarn
.
setRegionalCompaniesCode
(
jpStation
.
getRegionalCompaniesCode
());
hygfjpInverterWarn
.
setStationName
(
jpStation
.
getName
());
hygfjpInverterWarn
.
setStationState
(
jpStation
.
getState
());
hygfjpInverterWarn
.
setCreatedTime
(
System
.
currentTimeMillis
());
hygfjpInverterWarn
.
setThirdCode
(
PVProducerInfoEnum
.
TANYIN
.
getCode
());
hygfjpInverterWarn
.
setContent
(
tanYinAlramInfo
.
getContent
());
hygfjpInverterWarn
.
setTreatment
(
tanYinAlramInfo
.
getSolution
());
...
...
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