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
d453ff66
Commit
d453ff66
authored
Jul 05, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监盘接口相关代码提交
parent
1e732fdf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
1 deletion
+58
-1
MonitorFanIndicatorMapper.java
...ot/module/jxiop/api/mapper/MonitorFanIndicatorMapper.java
+1
-0
MonitorFanIndicatorMapper.xml
...i/src/main/resources/mapper/MonitorFanIndicatorMapper.xml
+6
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+10
-0
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+41
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/MonitorFanIndicatorMapper.java
View file @
d453ff66
...
@@ -28,4 +28,5 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
...
@@ -28,4 +28,5 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
@Param
(
"frontModule"
)
String
frontModule
,
@Param
(
"frontModule"
)
String
frontModule
,
@Param
(
"offset"
)
int
offset
);
@Param
(
"offset"
)
int
offset
);
Object
getIndicatoralueAvage
(
String
gateway
,
String
indicator
);
Object
getIndicatoralueAvage
(
String
gateway
,
String
indicator
);
Object
getIndicatoralueTotal
(
String
gateway
,
String
indicator
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/MonitorFanIndicatorMapper.xml
View file @
d453ff66
...
@@ -72,4 +72,10 @@
...
@@ -72,4 +72,10 @@
WHERE gateway=#{gateway} and
WHERE gateway=#{gateway} and
indicator like concat('%',#{indicator},'%')
indicator like concat('%',#{indicator},'%')
</select>
</select>
<select
id=
"getIndicatoralueAvage"
resultType=
"Object"
>
SELECT SUM(indicator_value) total
FROM monitor_fan_indicator
WHERE gateway=#{gateway} and
indicator like concat('%',#{indicator},'%')
</select>
</mapper>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
d453ff66
...
@@ -104,5 +104,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -104,5 +104,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
Object
getIndicatoralueAvage
(
String
gateway
,
String
indicator
){
public
Object
getIndicatoralueAvage
(
String
gateway
,
String
indicator
){
return
monitorFanIndicatorregionMapper
.
getIndicatoralueAvage
(
gateway
,
indicator
);
return
monitorFanIndicatorregionMapper
.
getIndicatoralueAvage
(
gateway
,
indicator
);
}
}
/**
* 根据网关与指标获取指标的平均值
* @param gateway
* @param indicator
* @return
*/
public
Object
getIndicatoralueTotal
(
String
gateway
,
String
indicator
){
return
monitorFanIndicatorregionMapper
.
getIndicatoralueTotal
(
gateway
,
indicator
);
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
d453ff66
...
@@ -55,6 +55,7 @@ public class MonitoringServiceImpl {
...
@@ -55,6 +55,7 @@ public class MonitoringServiceImpl {
*/
*/
public
List
<
RegionNationWideDto
>
getNationWideInfo
(
String
provinceName
){
public
List
<
RegionNationWideDto
>
getNationWideInfo
(
String
provinceName
){
List
<
RegionNationWideDto
>
regionNationWideDtoList
=
new
ArrayList
<>();
List
<
RegionNationWideDto
>
regionNationWideDtoList
=
new
ArrayList
<>();
//如果 provinceName 为空则表示当前为全国地图 否则则为省份地图
if
(
ObjectUtils
.
isEmpty
(
provinceName
)||
provinceName
.
equals
(
""
)){
if
(
ObjectUtils
.
isEmpty
(
provinceName
)||
provinceName
.
equals
(
""
)){
List
<
Region
>
regionList
=
this
.
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
));
List
<
Region
>
regionList
=
this
.
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
));
for
(
int
i
=
0
;
i
<
regionList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
regionList
.
size
();
i
++)
{
...
@@ -66,6 +67,9 @@ public class MonitoringServiceImpl {
...
@@ -66,6 +67,9 @@ public class MonitoringServiceImpl {
Region
region
=
regionList
.
get
(
i
);
Region
region
=
regionList
.
get
(
i
);
List
<
StationBasic
>
list
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
List
<
StationBasic
>
list
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
list
.
forEach
(
stationBasic
->
{
list
.
forEach
(
stationBasic
->
{
if
(!
ObjectUtils
.
isEmpty
(
stationBasic
.
getGatewayId
())&&!
ObjectUtils
.
isEmpty
(
stationBasic
.
getStationNumber
())){
regionNationWideDto
.
setJsJoin
(
true
);
}
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
fengdianMW
.
set
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
fengdianMW
.
set
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
fengdian
.
getAndSet
(
fengdian
.
get
()
+
1
);
fengdian
.
getAndSet
(
fengdian
.
get
()
+
1
);
...
@@ -88,8 +92,10 @@ public class MonitoringServiceImpl {
...
@@ -88,8 +92,10 @@ public class MonitoringServiceImpl {
RegionNationWideDto
regionNationWideDto
=
new
RegionNationWideDto
();
RegionNationWideDto
regionNationWideDto
=
new
RegionNationWideDto
();
regionNationWideDto
.
setStaitionName
(
stationBasic
.
getStationName
());
regionNationWideDto
.
setStaitionName
(
stationBasic
.
getStationName
());
regionNationWideDto
.
setStaitionType
(
stationBasic
.
getStationType
());
regionNationWideDto
.
setStaitionType
(
stationBasic
.
getStationType
());
String
speendOrirradiate
=
""
;
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
speendOrirradiate
=
(
String
)
getIndicatoralueAvage
(
stationBasic
.
getGatewayId
(),
"30秒平均风速"
);
regionNationWideDto
.
setSpeendOrirradiate
(
speendOrirradiate
);
}
else
{
}
else
{
regionNationWideDto
.
setSpeendOrirradiate
(
String
.
valueOf
(
Math
.
random
()*
1000
));
regionNationWideDto
.
setSpeendOrirradiate
(
String
.
valueOf
(
Math
.
random
()*
1000
));
}
}
...
@@ -112,4 +118,38 @@ public class MonitoringServiceImpl {
...
@@ -112,4 +118,38 @@ public class MonitoringServiceImpl {
public
Double
getStationCaPACITYL
(
String
werks
){
public
Double
getStationCaPACITYL
(
String
werks
){
return
this
.
SjglZsjZsbtzServiceImpl
.
getStationCapactityByStationWerks
(
werks
);
return
this
.
SjglZsjZsbtzServiceImpl
.
getStationCapactityByStationWerks
(
werks
);
}
}
/**
* 根据网关id以及指标值 获取同一网关下指标的平均值
* @param gateway 网关id
* @param indicatorcName 指标名称
* @return 同一网关下指标的平均值
*/
public
Object
getIndicatoralueAvage
(
String
gateway
,
String
indicatorcName
){
return
this
.
monitorFanIndicatorImpl
.
getIndicatoralueAvage
(
gateway
,
indicatorcName
);
}
/**
* 根据网关id以及指标值 同一网关下指标的值总和
* @param gateway 网关id
* @param indicatorcName 指标名称
* @return 同一网关下指标的值总和
*/
public
Object
getIndicatoralueTotal
(
String
gateway
,
String
indicatorcName
){
return
this
.
monitorFanIndicatorImpl
.
getIndicatoralueTotal
(
gateway
,
indicatorcName
);
}
public
void
getTotalSocialContribution
(){
HashMap
<
String
,
Double
>
hashMap
=
new
HashMap
<>();
AtomicReference
<
Double
>
totalSocialContribution
=
new
AtomicReference
<>(
0.0
);
//获取所有网关id不为空的数据
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"gateway_id"
));
stationBasicList
.
forEach
(
stationBasic
->
{
totalSocialContribution
.
updateAndGet
(
v
->
v
+
(
Double
)
monitorFanIndicatorImpl
.
getIndicatoralueTotal
(
stationBasic
.
getStationNumber
(),
"年发电量"
));
});
//
// hashMap.put("CO2",(totalSocialContribution * 0.3049)/1000000);
// hashMap.put("Coal",totalSocialContribution*);
// hashMap.put("Toner",totalSocialContribution*);
// hashMap.put("S02",totalSocialContribution*);
}
}
}
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