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
37f14e43
Commit
37f14e43
authored
Jul 24, 2024
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
碳银接口对接 - 对接告警信息接口
parent
468edd36
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
36 deletions
+66
-36
TanYinCustomerInfoMapper.java
...pi/face/orm/mapper/tdengine/TanYinCustomerInfoMapper.java
+1
-1
TanYinDataAcquisitionService.java
...useholdapi/face/service/TanYinDataAcquisitionService.java
+2
-7
TanYinDataAcquisitionServiceImpl.java
...i/face/service/impl/TanYinDataAcquisitionServiceImpl.java
+47
-16
application-dev.properties
...-housepvapi/src/main/resources/application-dev.properties
+7
-6
application-dev1.properties
...housepvapi/src/main/resources/application-dev1.properties
+3
-2
application-kingbase8.properties
...pvapi/src/main/resources/application-kingbase8.properties
+3
-2
application-qa.properties
...a-housepvapi/src/main/resources/application-qa.properties
+3
-2
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/mapper/tdengine/TanYinCustomerInfoMapper.java
View file @
37f14e43
...
@@ -8,7 +8,7 @@ import java.util.List;
...
@@ -8,7 +8,7 @@ import java.util.List;
public
interface
TanYinCustomerInfoMapper
extends
BaseMapper
<
TanYinCustomerInfo
>
{
public
interface
TanYinCustomerInfoMapper
extends
BaseMapper
<
TanYinCustomerInfo
>
{
@Select
(
"select project_no from tanyin_customer_info"
)
@Select
(
"select project_no from tanyin_customer_info
group by project_no
"
)
List
<
String
>
listProjectNo
();
List
<
String
>
listProjectNo
();
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/TanYinDataAcquisitionService.java
View file @
37f14e43
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
;
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverter
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation
;
/**
/**
* <p>
* <p>
* ProjectName: amos-boot-zx-biz
* ProjectName: amos-boot-zx-biz
...
@@ -49,12 +46,10 @@ public interface TanYinDataAcquisitionService {
...
@@ -49,12 +46,10 @@ public interface TanYinDataAcquisitionService {
/**
/**
* 告警信息
* 告警信息
*
*
*
* @param sn sn
* @return {@link }
* @return {@link }
* @author yangyang
* @throws
* @throws
* @author yangyang
* @date 2024/7/24 09:44
* @date 2024/7/24 09:44
*/
*/
void
inverAlramInfo
(
JpInverter
jpInverter
,
JpStation
jpStation
);
void
inverAlramInfo
();
}
}
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/TanYinDataAcquisitionServiceImpl.java
View file @
37f14e43
...
@@ -179,24 +179,28 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
...
@@ -179,24 +179,28 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
@Scheduled
(
cron
=
"${dataRequestScheduled.tanYin}"
)
@Scheduled
(
cron
=
"${dataRequestScheduled.tanYin}"
)
@Override
@Override
public
void
customerInfoList
()
{
public
void
customerInfoList
()
{
long
ts
=
System
.
currentTimeMillis
();
try
{
log
.
info
(
"-------碳银同步项目信息开始: {} ------- "
,
ts
);
log
.
info
(
"-------碳银同步项目信息开始: {} ------- "
,
sdf
.
format
(
new
Date
()));
Map
<
String
,
Object
>
params
=
MapBuilder
.<
String
,
Object
>
create
()
Map
<
String
,
Object
>
params
=
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"pageNo"
,
pageNo
)
.
put
(
"pageNo"
,
pageNo
)
.
put
(
"pageSize"
,
pageSize
)
// 每页行数
.
put
(
"pageSize"
,
pageSize
)
// 每页行数
.
put
(
"startDate"
,
LocalDate
.
now
().
minusYears
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
// 开始时间 YYYY-MM-dd
.
put
(
"startDate"
,
LocalDate
.
now
().
minusYears
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
// 开始时间 YYYY-MM-dd
.
put
(
"endDate"
,
LocalDate
.
now
().
plusDays
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
// 结束时间 YYYY-MM-dd
.
put
(
"endDate"
,
LocalDate
.
now
().
plusDays
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
)))
// 结束时间 YYYY-MM-dd
.
build
();
.
build
();
PageInfo
<
TanYinCustomerInfo
>
tanYinCustomerInfos
=
tanYinApiUtils
.
postPage
(
"客户信息"
,
apiUrl
+
TanYinConstant
.
customerInfoUrl
,
JSON
.
toJSONString
(
params
),
null
,
TanYinCustomerInfo
.
class
);
PageInfo
<
TanYinCustomerInfo
>
tanYinCustomerInfos
=
tanYinApiUtils
.
postPage
(
"客户信息"
,
apiUrl
+
TanYinConstant
.
customerInfoUrl
,
JSON
.
toJSONString
(
params
),
null
,
TanYinCustomerInfo
.
class
);
if
(
tanYinCustomerInfos
==
null
||
CollectionUtils
.
isEmpty
(
tanYinCustomerInfos
.
getList
()))
{
if
(
tanYinCustomerInfos
==
null
||
CollectionUtils
.
isEmpty
(
tanYinCustomerInfos
.
getList
()))
{
return
;
log
.
warn
(
"-------碳银同步项目信息结束: 未获取到项目信息 ------- "
);
}
return
;
for
(
TanYinCustomerInfo
tanYinCustomerInfo
:
tanYinCustomerInfos
.
getList
())
{
}
if
(
tanYinCustomerInfoMapper
.
update
(
tanYinCustomerInfo
,
new
QueryWrapper
<
TanYinCustomerInfo
>().
lambda
().
eq
(
TanYinCustomerInfo:
:
getProjectNo
,
tanYinCustomerInfo
.
getProjectNo
()))
==
0
)
{
for
(
TanYinCustomerInfo
tanYinCustomerInfo
:
tanYinCustomerInfos
.
getList
())
{
tanYinCustomerInfo
.
setCreateTime
(
System
.
currentTimeMillis
());
tanYinCustomerInfoMapper
.
insert
(
tanYinCustomerInfo
);
tanYinCustomerInfoMapper
.
insert
(
tanYinCustomerInfo
);
}
}
log
.
info
(
"-------碳银同步项目信息结束: {} ------- "
,
sdf
.
format
(
new
Date
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"-------碳银同步项目信息异常: {} ------- "
,
e
);
}
}
log
.
info
(
"-------碳银同步项目信息结束: {} ------- "
,
ts
,
sdf
.
format
(
new
Date
()));
}
}
/**
/**
...
@@ -427,7 +431,29 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
...
@@ -427,7 +431,29 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
}
}
@Scheduled
(
cron
=
"${dataRequestScheduled.tanYin.warn}"
)
@Override
@Override
public
void
inverAlramInfo
()
{
log
.
info
(
"-------碳银同步逆变器告警开始: {} ------- "
,
sdf
.
format
(
new
Date
()));
// region 先获取逆变器数据
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
TANYIN
.
getCode
()));
if
(
CollectionUtils
.
isEmpty
(
jpInverters
))
{
log
.
warn
(
"-------碳银同步逆变器告警结束: 未获取到逆变器信息 ------- "
);
return
;
}
List
<
String
>
stationIds
=
jpInverters
.
stream
().
map
(
JpInverter:
:
getThirdStationId
).
collect
(
Collectors
.
toList
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
TANYIN
.
getCode
()).
in
(
"third_station_id"
,
stationIds
));
Map
<
String
,
JpStation
>
jpStationMap
=
jpStations
.
stream
().
collect
(
Collectors
.
toMap
(
JpStation:
:
getThirdStationId
,
Function
.
identity
()));
for
(
JpInverter
inverter
:
jpInverters
)
{
JpStation
jpStation
=
jpStationMap
.
get
(
inverter
.
getThirdStationId
());
if
(
jpStation
==
null
)
{
continue
;
}
this
.
inverAlramInfo
(
inverter
,
jpStation
);
}
log
.
info
(
"-------碳银同步逆变器告警结束: {} ------- "
,
sdf
.
format
(
new
Date
()));
}
@Async
@Async
public
void
inverAlramInfo
(
JpInverter
jpInverter
,
JpStation
jpStation
)
{
public
void
inverAlramInfo
(
JpInverter
jpInverter
,
JpStation
jpStation
)
{
if
(
jpInverter
==
null
||
StringUtils
.
isEmpty
(
jpInverter
.
getSnCode
()))
{
if
(
jpInverter
==
null
||
StringUtils
.
isEmpty
(
jpInverter
.
getSnCode
()))
{
...
@@ -435,7 +461,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
...
@@ -435,7 +461,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
}
}
String
startDate
=
LocalDate
.
now
().
minusYears
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
startDate
=
LocalDate
.
now
().
minusYears
(
1
).
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
String
endDate
=
LocalDate
.
now
().
plusDays
(
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
()).
put
(
"pageNo"
,
pageNo
).
put
(
"pageSize"
,
pageSize
).
put
(
"startDate"
,
startDate
).
put
(
"endDate"
,
endDate
).
build
();
Map
<
String
,
Object
>
params
=
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"sn"
,
jpInverter
.
getSnCode
())
.
put
(
"pageNo"
,
pageNo
)
.
put
(
"pageSize"
,
pageSize
)
.
put
(
"startDate"
,
startDate
)
.
put
(
"endDate"
,
endDate
).
build
();
PageInfo
<
TanYinAlramInfo
>
tanYinInveterInfo
=
tanYinApiUtils
.
postPage
(
"电站逆变器故障信息"
,
apiUrl
+
TanYinConstant
.
inverterAlramUrl
,
JSON
.
toJSONString
(
params
),
null
,
TanYinAlramInfo
.
class
);
PageInfo
<
TanYinAlramInfo
>
tanYinInveterInfo
=
tanYinApiUtils
.
postPage
(
"电站逆变器故障信息"
,
apiUrl
+
TanYinConstant
.
inverterAlramUrl
,
JSON
.
toJSONString
(
params
),
null
,
TanYinAlramInfo
.
class
);
List
<
TanYinAlramInfo
>
tanYinAlramInfos
=
tanYinInveterInfo
.
getList
();
List
<
TanYinAlramInfo
>
tanYinAlramInfos
=
tanYinInveterInfo
.
getList
();
for
(
TanYinAlramInfo
tanYinAlramInfo
:
tanYinAlramInfos
)
{
for
(
TanYinAlramInfo
tanYinAlramInfo
:
tanYinAlramInfos
)
{
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/resources/application-dev.properties
View file @
37f14e43
## DB properties hygf
## DB properties hygf
## db1-production database
## db1-production database
spring.db1.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url
=
jdbc:mysql://47.92.234.253:3306/amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.url
=
jdbc:mysql://47.92.234.253:
1
3306/amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username
=
root
spring.db1.datasource.username
=
root
spring.db1.datasource.password
=
Yeejoin
@2020
spring.db1.datasource.password
=
Yeejoin
_1234
spring.db1.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.db1.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
## db2-sync_data
## db2-sync_data
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url
=
jdbc:mysql://47.92.234.253:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.url
=
jdbc:mysql://47.92.234.253:
1
3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username
=
root
spring.db2.datasource.username
=
root
spring.db2.datasource.password
=
Yeejoin
@2020
spring.db2.datasource.password
=
Yeejoin
_1234
spring.db2.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.db2.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
## db3-taosiData
## db3-taosiData
spring.db3.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
...
@@ -78,4 +78,5 @@ dataRequstScheduled.Sofar=0 0/50 * * * *
...
@@ -78,4 +78,5 @@ dataRequstScheduled.Sofar=0 0/50 * * * *
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientKey
=
yx10001
tanYin.api.clientKey
=
yx10001
dataRequestScheduled.tanYin
=
0 0/10 * * * *
dataRequestScheduled.tanYin
=
0 0/10 * * * *
\ No newline at end of file
dataRequestScheduled.tanYin.warn
=
0 0/1 * * * *
\ No newline at end of file
amos-boot-data/amos-boot-data-housepvapi/src/main/resources/application-dev1.properties
View file @
37f14e43
...
@@ -50,4 +50,5 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
...
@@ -50,4 +50,5 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientKey
=
yx10001
tanYin.api.clientKey
=
yx10001
dataRequestScheduled.tanYin
=
0 0/10 * * * *
dataRequestScheduled.tanYin
=
0 0/10 * * * *
\ No newline at end of file
dataRequestScheduled.tanYin.warn
=
0 0/1 * * * *
\ No newline at end of file
amos-boot-data/amos-boot-data-housepvapi/src/main/resources/application-kingbase8.properties
View file @
37f14e43
...
@@ -78,4 +78,5 @@ dataRequstScheduled.Sofar=0 0/50 * * * *
...
@@ -78,4 +78,5 @@ dataRequstScheduled.Sofar=0 0/50 * * * *
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientKey
=
yx10001
tanYin.api.clientKey
=
yx10001
dataRequestScheduled.tanYin
=
0 0/10 * * * *
dataRequestScheduled.tanYin
=
0 0/10 * * * *
\ No newline at end of file
dataRequestScheduled.tanYin.warn
=
0 0/1 * * * *
\ No newline at end of file
amos-boot-data/amos-boot-data-housepvapi/src/main/resources/application-qa.properties
View file @
37f14e43
...
@@ -52,4 +52,5 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
...
@@ -52,4 +52,5 @@ biz.lxyd.lift.url=http://39.106.181.149:8088/elevatorapi
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.apiUrl
=
https://userauth.tanwin.cn
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientSecret
=
rKrWVa2sXsSZeNAOW43v
tanYin.api.clientKey
=
yx10001
tanYin.api.clientKey
=
yx10001
dataRequestScheduled.tanYin
=
0 0/10 * * * *
dataRequestScheduled.tanYin
=
0 0/10 * * * *
\ No newline at end of file
dataRequestScheduled.tanYin.warn
=
0 0/1 * * * *
\ No newline at end of file
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