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
b1c6884e
Commit
b1c6884e
authored
Oct 23, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.对于主变高压侧、主变低压侧增加排序操作。
2.社会贡献汉字进行常量抽取。
parent
ba8d57bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
186 deletions
+178
-186
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+7
-0
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+4
-4
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+163
-178
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+4
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
View file @
b1c6884e
...
...
@@ -158,4 +158,11 @@ public class CommonConstans {
put
(
"前万线"
,
Arrays
.
asList
(
"313光差保护_总正向有功电度"
,
"313光差保护_总反向有功电度"
,
"313光差保护_总感性无功电度"
,
"313光差保护_总容性无功电度"
));
}
};
public
static
final
String
XIAZAO_ZHUBIANGAOYACE
=
"1主变高压侧"
;
public
static
final
String
XIAZAO_ZHUBIANDIYACE
=
"1主变低压侧"
;
public
static
final
String
ER_YANG_HUA_TAN_JIANPAILIANG
=
"二氧化碳减排量(t)"
;
public
static
final
String
BIAO_ZHUN_MEI_JIANPAILIANG
=
"节约标准煤(t)"
;
public
static
final
String
TAN_FEN_CHEN_ZHUBIANDIYACE
=
"碳粉尘减排量(t)"
;
public
static
final
String
ER_YANG_HUA_LIU_ZHUBIANDIYACE
=
"二氧化硫减排量(t)"
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
b1c6884e
...
...
@@ -364,16 +364,16 @@ public class CommonServiceImpl {
二氧化硫减排量(t)=发电量(万kW·h)*1.51
氮氧化物减排量(t)=发电量(万kW·h)*1.69
*/
co2
.
setUnit
(
"二氧化碳减排量(t)"
);
co2
.
setUnit
(
CommonConstans
.
ER_YANG_HUA_TAN_JIANPAILIANG
);
co2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
CommonConstans
.
carbonDioxide
));
socialContributionDtoList
.
add
(
co2
);
coal
.
setUnit
(
"节约标准煤(t)"
);
coal
.
setUnit
(
CommonConstans
.
BIAO_ZHUN_MEI_JIANPAILIANG
);
coal
.
setTitle
(
String
.
format
(
"%.2f"
,
(
totalSocialContribution
*
CommonConstans
.
standardCoal
)));
socialContributionDtoList
.
add
(
coal
);
toner
.
setUnit
(
"碳粉尘减排量(t)"
);
toner
.
setUnit
(
CommonConstans
.
TAN_FEN_CHEN_ZHUBIANDIYACE
);
toner
.
setTitle
(
String
.
format
(
"%.2f"
,
(
totalSocialContribution
*
CommonConstans
.
toner
)));
socialContributionDtoList
.
add
(
toner
);
so2
.
setUnit
(
"二氧化硫减排量(t)"
);
so2
.
setUnit
(
CommonConstans
.
ER_YANG_HUA_LIU_ZHUBIANDIYACE
);
so2
.
setTitle
(
String
.
format
(
"%.2f"
,
(
totalSocialContribution
*
CommonConstans
.
sulfurDioxide
)));
socialContributionDtoList
.
add
(
so2
);
socialContributionDtoPage
.
setRecords
(
socialContributionDtoList
);
...
...
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 @
b1c6884e
...
...
@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
import
javax.annotation.PostConstruct
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
...
...
@@ -102,6 +103,8 @@ import lombok.extern.slf4j.Slf4j;
public
class
MonitorFanIndicatorImpl
implements
IMonitorFanIndicator
{
private
final
static
List
<
String
>
fanStatesList
=
Arrays
.
asList
(
"报警状态"
,
"停机状态"
,
"故障状态"
,
"待机状态"
,
"维护状态"
,
"正常发电状态"
);
@Autowired
private
static
Map
<
String
,
EquipmentSpecificIndex
>
map
;
@Autowired
SystemEnumMapper
systemEnumMapper
;
@Autowired
SwitchPictureMapper
switchPictureMapper
;
...
...
@@ -142,19 +145,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private
String
fanStatusImagePathPrefix
;
@Value
(
"classpath:/json/topic.json"
)
private
Resource
topic
;
@Value
(
"classpath:/json/fanlocation.json"
)
private
Resource
fanlocation
;
@Autowired
private
IndicatorDataMapper
indicatorDataMapper
;
private
List
<
Map
>
list
;
@Autowired
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
@Autowired
private
static
Map
<
String
,
EquipmentSpecificIndex
>
map
;
@Override
public
ResultsData
getNationWideInfo
(
int
current
,
int
size
,
String
gateway
,
String
equipmentNumber
)
{
...
...
@@ -266,9 +263,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
});
}
result
.
stream
().
forEach
(
e
->
{
if
(
powerOther
.
contains
(
e
.
getEquipmentIndexName
())||
e
.
getEquipmentIndexName
().
equals
(
"日发电量"
))
{
if
(
powerOther
.
contains
(
e
.
getEquipmentIndexName
())
||
e
.
getEquipmentIndexName
().
equals
(
"日发电量"
))
{
e
.
setValue
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
e
.
getValueF
()));
}
else
{
}
else
{
e
.
setValue
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
e
.
getValueF
()));
}
...
...
@@ -339,172 +336,155 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
stationBasicMapper
.
selectById
(
stationId
);
}
public
List
<
ESEquipmentsDTO
>
getFanStatusList
(
String
stationId
)
{
StationBasic
stationBasic
=
getOneByStationNumber
(
stationId
);
if
(
stationBasic
.
getStationName
().
contains
(
"GFDZ"
))
{
return
new
ArrayList
<
ESEquipmentsDTO
>();
}
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"风机状态"
,
"有功功率"
,
"发电状态"
,
"报警状态"
,
"停机状态"
,
"故障状态"
,
"待机状态"
,
"维护状态"
,
"发电机转速"
,
"正常发电状态"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
queryCondtion1
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"风机状态"
));
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
equipNumList
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
Map
<
String
,
String
>
likeMap
=
new
HashMap
<
String
,
String
>();
queryCondtion
.
remove
(
CommonConstans
.
QueryStringEquipmentIndexName
);
likeMap
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
"实时故障"
);
List
<
ESEquipments
>
resultWarn
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeMap
);
result
.
addAll
(
resultWarn
);
// list测点转风机map并且计算风机状态
Map
<
String
,
List
<
ESEquipments
>>
listMap
=
result
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
po
->
po
.
getEquipmentNumber
()));
Map
<
String
,
String
>
equipMap
=
new
HashMap
<>();
for
(
Entry
<
String
,
List
<
ESEquipments
>>
entry
:
listMap
.
entrySet
())
{
equipMap
.
put
(
entry
.
getKey
(),
"正常运行"
);
if
(
entry
.
getValue
()
==
null
)
{
continue
;
}
Map
<
String
,
String
>
objMap
=
entry
.
getValue
().
stream
()
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentIndexName
,
ESEquipments:
:
getValue
));
Map
<
String
,
Date
>
timeMap
=
entry
.
getValue
().
stream
()
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentIndexName
,
ESEquipments:
:
getCreatedTime
));
Map
<
String
,
String
>
warnMap
=
entry
.
getValue
().
stream
()
.
filter
(
i
->
i
.
getEquipmentIndexName
().
contains
(
"实时故障"
))
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentSpecificName
,
ESEquipments:
:
getValue
));
String
fanStatus
=
objMap
.
get
(
"风机状态"
);
Double
power
=
Double
.
valueOf
(
objMap
.
get
(
"有功功率"
));
String
elecStatus
=
objMap
.
get
(
"发电状态"
)
!=
null
?
objMap
.
get
(
"发电状态"
)
:
objMap
.
get
(
"正常发电状态"
);
String
fault22
=
objMap
.
get
(
"实时故障22"
);
String
warnStatus
=
objMap
.
get
(
"报警状态"
);
String
standbyStatus
=
objMap
.
get
(
"待机状态"
);
String
stopStatus
=
objMap
.
get
(
"停机状态"
);
String
faultStatus
=
objMap
.
get
(
"故障状态"
);
String
mainStatus
=
objMap
.
get
(
"维护状态"
);
boolean
isWarn
=
isWarn
(
warnMap
);
Double
fdjSpeed
=
Double
.
valueOf
(
objMap
.
get
(
"发电机转速"
));
Date
fdjTime
=
timeMap
.
get
(
"发电机转速"
);
Long
min
=
null
;
if
(
fdjTime
!=
null
)
{
long
start
=
fdjTime
.
getTime
();
//获取当前时间毫秒值
long
current
=
System
.
currentTimeMillis
();
min
=
(
current
-
start
)/
1000
/
60
;
}
//正常运行
//1.发电状态=true(遥信)
//2.风机状态=8(遥测)
//3.有功功率>0(遥测)
//4.实时故障:枚举值匹配不上,以及匹配为备留信号的为正常运行
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
elecStatus
)&&
"8.0"
.
equals
(
fanStatus
)&&
power
>
0
&&!
isWarn
)
{
equipMap
.
put
(
entry
.
getKey
(),
"正常运行"
);
}
else
if
(
"11.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"限功率"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
warnStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"报警运行"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
standbyStatus
)&&
"3.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"待机状态"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
stopStatus
)&&
"1.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"停机状态"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
stopStatus
)&&
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
faultStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"故障状态"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
mainStatus
)&&
"2.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"维护状态"
);
}
else
if
(
fdjSpeed
>
0
&&
min
!=
null
&&
min
>=
10
)
{
equipMap
.
put
(
entry
.
getKey
(),
"通讯中断"
);
}
}
HashMap
<
String
,
String
>
colorMap
=
new
HashMap
<>();
colorMap
.
put
(
"正常运行"
,
"#00aa00"
);
colorMap
.
put
(
"报警运行"
,
"#ffc400"
);
colorMap
.
put
(
"停机状态"
,
"#a3f5aa"
);
colorMap
.
put
(
"故障状态"
,
"#ff0000"
);
colorMap
.
put
(
"限功率"
,
"#0055ff"
);
colorMap
.
put
(
"待机状态"
,
"#00aaff"
);
colorMap
.
put
(
"维护状态"
,
"#ff00ff"
);
colorMap
.
put
(
"通讯中断"
,
"#7d8e95"
);
List
<
ESEquipmentsDTO
>
resultList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
equipNumList
))
{
equipNumList
.
forEach
(
item
->
{
String
status
=
equipMap
.
get
(
item
.
getEquipmentNumber
());
item
.
setAddress
(
status
);
ESEquipmentsDTO
esEquipmentsDTO
=
new
ESEquipmentsDTO
();
BeanUtil
.
copyProperties
(
item
,
esEquipmentsDTO
);
String
color
=
colorMap
.
get
(
status
);
esEquipmentsDTO
.
setState
(
status
);
esEquipmentsDTO
.
setColor
(
color
);
resultList
.
add
(
esEquipmentsDTO
);
});
}
return
resultList
;
}
@PostConstruct
public
void
init
()
{
QueryWrapper
<
EquipmentSpecificIndex
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"is_alarm"
,
1
);
List
<
EquipmentSpecificIndex
>
list
=
equipmentSpecificIndexMapper
.
selectList
(
wrapper
);
map
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
EquipmentSpecificIndex:
:
getEquipmentSpecificName
,
Function
.
identity
(),
(
key1
,
key2
)
->
key2
));
}
private
boolean
isWarn
(
Map
<
String
,
String
>
warnMap
)
{
boolean
result
=
false
;
for
(
Entry
<
String
,
String
>
entry
:
warnMap
.
entrySet
())
{
EquipmentSpecificIndex
equipmentSpecificIndex
=
map
.
get
(
entry
.
getKey
());
if
(
equipmentSpecificIndex
==
null
||
entry
.
getValue
()
==
null
)
{
continue
;
}
String
valueEnum
=
equipmentSpecificIndex
.
getValueEnum
();
JSONArray
arr
=
JSONObject
.
parseArray
(
valueEnum
);
if
(
arr
==
null
)
{
continue
;
}
for
(
Object
o
:
arr
)
{
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
if
(
json
.
containsKey
(
"key"
)
&&
entry
.
getValue
().
equals
(
json
.
get
(
"key"
)))
{
String
warn
=
json
.
getString
(
"label"
);
if
(
warn
.
indexOf
(
"备留"
)
==
-
1
)
{
result
=
true
;
break
;
}
}
}
if
(
result
)
{
break
;
}
}
return
result
;
}
public
List
<
ESEquipmentsDTO
>
getFanStatusList
(
String
stationId
)
{
StationBasic
stationBasic
=
getOneByStationNumber
(
stationId
);
if
(
stationBasic
.
getStationName
().
contains
(
"GFDZ"
))
{
return
new
ArrayList
<
ESEquipmentsDTO
>();
}
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"风机状态"
,
"有功功率"
,
"发电状态"
,
"报警状态"
,
"停机状态"
,
"故障状态"
,
"待机状态"
,
"维护状态"
,
"发电机转速"
,
"正常发电状态"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
queryCondtion1
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"风机状态"
));
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
equipNumList
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
Map
<
String
,
String
>
likeMap
=
new
HashMap
<
String
,
String
>();
queryCondtion
.
remove
(
CommonConstans
.
QueryStringEquipmentIndexName
);
likeMap
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
"实时故障"
);
List
<
ESEquipments
>
resultWarn
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeMap
);
result
.
addAll
(
resultWarn
);
// list测点转风机map并且计算风机状态
Map
<
String
,
List
<
ESEquipments
>>
listMap
=
result
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
po
->
po
.
getEquipmentNumber
()));
Map
<
String
,
String
>
equipMap
=
new
HashMap
<>();
for
(
Entry
<
String
,
List
<
ESEquipments
>>
entry
:
listMap
.
entrySet
())
{
equipMap
.
put
(
entry
.
getKey
(),
"正常运行"
);
if
(
entry
.
getValue
()
==
null
)
{
continue
;
}
Map
<
String
,
String
>
objMap
=
entry
.
getValue
().
stream
()
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentIndexName
,
ESEquipments:
:
getValue
));
Map
<
String
,
Date
>
timeMap
=
entry
.
getValue
().
stream
()
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentIndexName
,
ESEquipments:
:
getCreatedTime
));
Map
<
String
,
String
>
warnMap
=
entry
.
getValue
().
stream
()
.
filter
(
i
->
i
.
getEquipmentIndexName
().
contains
(
"实时故障"
))
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentSpecificName
,
ESEquipments:
:
getValue
));
String
fanStatus
=
objMap
.
get
(
"风机状态"
);
Double
power
=
Double
.
valueOf
(
objMap
.
get
(
"有功功率"
));
String
elecStatus
=
objMap
.
get
(
"发电状态"
)
!=
null
?
objMap
.
get
(
"发电状态"
)
:
objMap
.
get
(
"正常发电状态"
);
String
fault22
=
objMap
.
get
(
"实时故障22"
);
String
warnStatus
=
objMap
.
get
(
"报警状态"
);
String
standbyStatus
=
objMap
.
get
(
"待机状态"
);
String
stopStatus
=
objMap
.
get
(
"停机状态"
);
String
faultStatus
=
objMap
.
get
(
"故障状态"
);
String
mainStatus
=
objMap
.
get
(
"维护状态"
);
boolean
isWarn
=
isWarn
(
warnMap
);
Double
fdjSpeed
=
Double
.
valueOf
(
objMap
.
get
(
"发电机转速"
));
Date
fdjTime
=
timeMap
.
get
(
"发电机转速"
);
Long
min
=
null
;
if
(
fdjTime
!=
null
)
{
long
start
=
fdjTime
.
getTime
();
//获取当前时间毫秒值
long
current
=
System
.
currentTimeMillis
();
min
=
(
current
-
start
)
/
1000
/
60
;
}
//正常运行
//1.发电状态=true(遥信)
//2.风机状态=8(遥测)
//3.有功功率>0(遥测)
//4.实时故障:枚举值匹配不上,以及匹配为备留信号的为正常运行
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
elecStatus
)
&&
"8.0"
.
equals
(
fanStatus
)
&&
power
>
0
&&
!
isWarn
)
{
equipMap
.
put
(
entry
.
getKey
(),
"正常运行"
);
}
else
if
(
"11.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"限功率"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
warnStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"报警运行"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
standbyStatus
)
&&
"3.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"待机状态"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
stopStatus
)
&&
"1.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"停机状态"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
stopStatus
)
&&
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
faultStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"故障状态"
);
}
else
if
(
Boolean
.
TRUE
.
toString
().
equalsIgnoreCase
(
mainStatus
)
&&
"2.0"
.
equals
(
fanStatus
))
{
equipMap
.
put
(
entry
.
getKey
(),
"维护状态"
);
}
else
if
(
fdjSpeed
>
0
&&
min
!=
null
&&
min
>=
10
)
{
equipMap
.
put
(
entry
.
getKey
(),
"通讯中断"
);
}
}
HashMap
<
String
,
String
>
colorMap
=
new
HashMap
<>();
colorMap
.
put
(
"正常运行"
,
"#00aa00"
);
colorMap
.
put
(
"报警运行"
,
"#ffc400"
);
colorMap
.
put
(
"停机状态"
,
"#a3f5aa"
);
colorMap
.
put
(
"故障状态"
,
"#ff0000"
);
colorMap
.
put
(
"限功率"
,
"#0055ff"
);
colorMap
.
put
(
"待机状态"
,
"#00aaff"
);
colorMap
.
put
(
"维护状态"
,
"#ff00ff"
);
colorMap
.
put
(
"通讯中断"
,
"#7d8e95"
);
List
<
ESEquipmentsDTO
>
resultList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
equipNumList
))
{
equipNumList
.
forEach
(
item
->
{
String
status
=
equipMap
.
get
(
item
.
getEquipmentNumber
());
item
.
setAddress
(
status
);
ESEquipmentsDTO
esEquipmentsDTO
=
new
ESEquipmentsDTO
();
BeanUtil
.
copyProperties
(
item
,
esEquipmentsDTO
);
String
color
=
colorMap
.
get
(
status
);
esEquipmentsDTO
.
setState
(
status
);
esEquipmentsDTO
.
setColor
(
color
);
resultList
.
add
(
esEquipmentsDTO
);
});
}
return
resultList
;
}
@PostConstruct
public
void
init
()
{
QueryWrapper
<
EquipmentSpecificIndex
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"is_alarm"
,
1
);
List
<
EquipmentSpecificIndex
>
list
=
equipmentSpecificIndexMapper
.
selectList
(
wrapper
);
map
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
EquipmentSpecificIndex:
:
getEquipmentSpecificName
,
Function
.
identity
(),
(
key1
,
key2
)
->
key2
));
}
private
boolean
isWarn
(
Map
<
String
,
String
>
warnMap
)
{
boolean
result
=
false
;
for
(
Entry
<
String
,
String
>
entry
:
warnMap
.
entrySet
())
{
EquipmentSpecificIndex
equipmentSpecificIndex
=
map
.
get
(
entry
.
getKey
());
if
(
equipmentSpecificIndex
==
null
||
entry
.
getValue
()
==
null
)
{
continue
;
}
String
valueEnum
=
equipmentSpecificIndex
.
getValueEnum
();
JSONArray
arr
=
JSONObject
.
parseArray
(
valueEnum
);
if
(
arr
==
null
)
{
continue
;
}
for
(
Object
o
:
arr
)
{
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
o
));
if
(
json
.
containsKey
(
"key"
)
&&
entry
.
getValue
().
equals
(
json
.
get
(
"key"
)))
{
String
warn
=
json
.
getString
(
"label"
);
if
(
warn
.
indexOf
(
"备留"
)
==
-
1
)
{
result
=
true
;
break
;
}
}
}
if
(
result
)
{
break
;
}
}
return
result
;
}
public
List
<
IndexDto
>
getFanStatusStatistics
(
String
stationId
)
{
List
<
ESEquipmentsDTO
>
equipNumList
=
getFanStatusList
(
stationId
);
...
...
@@ -606,7 +586,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentNumberKeyword
,
Arrays
.
asList
(
equipNum
));
List
<
ESEquipments
>
equipNumList
=
commonServiceImpl
.
getListDataByCondtionsAndLike
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeMap
);
if
(
ObjectUtils
.
isEmpty
(
frontModule
))
{
if
(
ObjectUtils
.
isEmpty
(
frontModule
))
{
equipNumList
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
}
if
(
CollectionUtils
.
isNotEmpty
(
equipNumList
)
&&
!
ObjectUtils
.
isEmpty
(
equipNumList
.
get
(
0
).
getValueF
()))
{
...
...
@@ -1381,13 +1361,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
// queryCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
likeMap
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
map
.
get
(
"boosterName"
));
likeMap
.
put
(
CommonConstans
.
QueryStringSystemTypeKeyword
,
"模拟量"
);
if
(
"1主变高压侧"
.
equals
(
map
.
get
(
"boosterName"
))
||
"1主变低压侧"
.
equals
(
map
.
get
(
"boosterName"
)))
{
if
(
CommonConstans
.
XIAZAO_ZHUBIANGAOYACE
.
equals
(
map
.
get
(
"boosterName"
))
||
CommonConstans
.
XIAZAO_ZHUBIANDIYACE
.
equals
(
map
.
get
(
"boosterName"
)))
{
likeMap
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"压侧"
);
List
<
ESEquipments
>
listData
=
commonServiceImpl
.
getListDataByCondtions
(
queryCodtion
,
null
,
ESEquipments
.
class
,
likeMap
);
Integer
traceIdCount
=
listData
.
stream
().
filter
(
esEquipments
->
!
StringUtils
.
isEmpty
(
esEquipments
.
getTraceId
())).
collect
(
Collectors
.
toList
()).
size
();
if
(
traceIdCount
>
0
)
{
listData
=
listData
.
stream
().
filter
(
esEquipments
->
!
StringUtils
.
isEmpty
(
esEquipments
.
getTraceId
())).
collect
(
Collectors
.
toList
());
}
// 主变高压侧
Map
<
String
,
String
>
zbGYC
=
listData
.
stream
().
filter
(
t
->
t
.
getFrontModule
().
contains
(
"1主变高压侧"
)).
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getDisplayName
,
ESEquipments:
:
getValue
));
Map
<
String
,
String
>
zbGYC
=
listData
.
stream
().
filter
(
t
->
t
.
getFrontModule
().
contains
(
CommonConstans
.
XIAZAO_ZHUBIANGAOYACE
)).
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getDisplayName
,
ESEquipments:
:
getValue
));
List
<
Map
<
String
,
String
>>
zbList
=
new
ArrayList
<>();
listData
.
stream
().
filter
(
t
->
t
.
getFrontModule
().
contains
(
"1主变低压侧"
)).
forEach
(
item
->
{
listData
.
stream
().
filter
(
t
->
t
.
getFrontModule
().
contains
(
CommonConstans
.
XIAZAO_ZHUBIANDIYACE
)).
forEach
(
item
->
{
HashMap
<
String
,
String
>
zbMap
=
new
HashMap
<>();
zbMap
.
put
(
"traceId"
,
item
.
getTraceId
());
zbMap
.
put
(
"title"
,
item
.
getDisplayName
());
...
...
@@ -1395,6 +1379,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
zbMap
.
put
(
"grade2"
,
keepTwoDecimalPlaces
(
zbGYC
.
getOrDefault
(
item
.
getDisplayName
(),
"0.0"
)));
zbList
.
add
(
zbMap
);
});
zbList
.
sort
(
Comparator
.
comparingInt
(
o
->
Integer
.
parseInt
(
o
.
get
(
"traceId"
).
toString
())));
IPage
<
Map
<
String
,
String
>>
zbResult
=
new
Page
<>();
zbResult
.
setRecords
(
zbList
);
zbResult
.
setCurrent
(
1
);
...
...
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 @
b1c6884e
...
...
@@ -1052,19 +1052,19 @@ public class MonitoringServiceImpl {
Double
totalAnnual
=
(
powerOfAnnualFD
+
powerOfAnnualGF
);
HashMap
<
String
,
String
>
stringHashMap13
=
new
HashMap
<>();
stringHashMap13
.
put
(
"title1"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
carbonDioxide
)));
stringHashMap13
.
put
(
"title2"
,
"二氧化碳减排量(t)"
);
stringHashMap13
.
put
(
"title2"
,
CommonConstans
.
ER_YANG_HUA_TAN_JIANPAILIANG
);
list3
.
add
(
stringHashMap13
);
HashMap
<
String
,
String
>
stringHashMap14
=
new
HashMap
<>();
stringHashMap14
.
put
(
"title1"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
standardCoal
)));
stringHashMap14
.
put
(
"title2"
,
"节约标准煤(t)"
);
stringHashMap14
.
put
(
"title2"
,
CommonConstans
.
BIAO_ZHUN_MEI_JIANPAILIANG
);
list3
.
add
(
stringHashMap14
);
HashMap
<
String
,
String
>
stringHashMap15
=
new
HashMap
<>();
stringHashMap15
.
put
(
"title1"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
toner
)));
stringHashMap15
.
put
(
"title2"
,
"碳粉尘减排量(t)"
);
stringHashMap15
.
put
(
"title2"
,
CommonConstans
.
TAN_FEN_CHEN_ZHUBIANDIYACE
);
list3
.
add
(
stringHashMap15
);
HashMap
<
String
,
String
>
stringHashMap16
=
new
HashMap
<>();
stringHashMap16
.
put
(
"title1"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
sulfurDioxide
)));
stringHashMap16
.
put
(
"title2"
,
"二氧化硫减排量(t)"
);
stringHashMap16
.
put
(
"title2"
,
CommonConstans
.
ER_YANG_HUA_LIU_ZHUBIANDIYACE
);
list3
.
add
(
stringHashMap16
);
page3
.
setRecords
(
list3
);
try
{
...
...
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