Commit be23e7d0 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents a69432c3 1f1ba4de
......@@ -4,7 +4,7 @@
<select id="getHealthScoreInfo" resultType="java.math.BigDecimal">
SELECT
round(avg( a.avgHealthIndex ), 2) AS healthIndex
CEILING(avg( a.avgHealthIndex )) AS healthIndex
FROM
(
SELECT
......@@ -57,7 +57,7 @@
<select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal">
SELECT
round(IFNULL( HEALTH_INDEX , 100 ), 2) AS healthIndex
CEILING(IFNULL( HEALTH_INDEX , 100 )) AS healthIndex
FROM
${tableName}
<where>
......@@ -74,7 +74,7 @@
<select id="getHealthListInfo" resultType="java.util.Map">
SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
DATE_ADD( a.date, INTERVAL - 1 DAY ) as date
FROM
(
......@@ -141,7 +141,8 @@
count(1) as num
FROM
${tableName} a
where a.DISPOSOTION_STATE == '未处置'
where (a.DISPOSOTION_STATE = '未处置')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )
group by ARAE,
WARNING_NAME
</select>
......@@ -190,11 +191,16 @@
STATION AS station,
WARNING_NAME AS warningName,
count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record wr WHERE wr.DISPOSOTION_STATE = '未处置' AND wr.STATION = STATION ) AS allNum
( SELECT count( 1 ) FROM idx_biz_fan_warning_record wr WHERE
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.STATION = STATION
) AS allNum
FROM
idx_biz_fan_warning_record
WHERE
DISPOSOTION_STATE = '未处置'
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
GROUP BY
STATION,
WARNING_NAME UNION ALL
......@@ -202,11 +208,16 @@
STATION AS station,
WARNING_NAME AS warningName,
count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record wr WHERE wr.DISPOSOTION_STATE = '未处置' AND wr.STATION = STATION ) AS allNum
( SELECT count( 1 ) FROM idx_biz_pv_warning_record wr WHERE
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.STATION = STATION
) AS allNum
FROM
idx_biz_pv_warning_record
WHERE
DISPOSOTION_STATE = '未处置'
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
GROUP BY
STATION,
WARNING_NAME
......@@ -271,8 +282,10 @@
FROM
idx_biz_fan_warning_record
<where>
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''">
GATEWAY_ID = #{stationCode}
and GATEWAY_ID = #{stationCode}
</if>
</where>
UNION ALL
......@@ -281,8 +294,10 @@
FROM
idx_biz_pv_warning_record
<where>
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''">
GATEWAY_ID = #{stationCode}
and GATEWAY_ID = #{stationCode}
</if>
</where>
) a
......@@ -307,7 +322,8 @@
FROM
${tableName} a
<where>
a.DISPOSOTION_STATE = '未处置'
((a.DISPOSOTION_STATE = '未处置')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''">
and a.ARAE like concat('%', #{areaCode}, '%')
</if>
......@@ -330,7 +346,9 @@
count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record
<where>
DISPOSOTION_STATE = '未处置' AND wr.POINT_NAME = POINT_NAME
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%')
</if>
......@@ -340,7 +358,8 @@
FROM
idx_biz_pv_warning_record wr
<where>
wr.DISPOSOTION_STATE = '未处置'
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%')
</if>
......@@ -354,7 +373,9 @@
count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record
<where>
DISPOSOTION_STATE = '未处置' AND wr.POINT_NAME = POINT_NAME
((DISPOSOTION_STATE = '未处置')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%')
</if>
......@@ -364,7 +385,8 @@
FROM
idx_biz_fan_warning_record wr
<where>
wr.DISPOSOTION_STATE = '未处置'
((wr.DISPOSOTION_STATE = '未处置')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%')
</if>
......
......@@ -38,7 +38,7 @@
idx_biz_fan_warning_record
) a
<where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND DATE_FORMAT( a.disposotionDate, '%Y-%m-%d' ) = CURRENT_DATE))
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%')
</if>
......@@ -99,7 +99,7 @@
idx_biz_fan_warning_record
) a
<where>
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND DATE_FORMAT( a.disposotionDate, '%Y-%m-%d' ) = CURRENT_DATE))
((a.disposotionState = '未处置') or (a.disposotionState = '已处置' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%')
</if>
......
......@@ -72,16 +72,6 @@ public class StationBasicServiceImpl extends BaseService<StationBasicDto, Statio
}
/**
* 列表查询 示例
*/
public List<StationBasicDto> queryForStationBasicList() {
return this.queryForList("", false);
}
private CompanyModel addCompanyModel(CompanyModel companyModel) {
FeignClientResult<CompanyModel> Model = Privilege.companyClient.create(companyModel);
CompanyModel user = new CompanyModel();
......
package com.yeejoin.amos.boot.module.jxiop.biz.tasks;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DeviceDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.StationTaksDto;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationDataTaskImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @description: 定时获取场站最新数据
* @author: tw
* @createDate: 2023/7/3
*/
@Component
@EnableScheduling
public class StationDataTask {
@Autowired
StationDataTaskImpl stationDataTask;
//定时获取场站指标最新数据
// @Scheduled(cron = "${station.task.cron}")
// public void getStationDataTask(){
// //获取所有场站信息
// List<StationTaksDto> list=stationDataTask.getListStationBasic();
// for (StationTaksDto stationTaksDto : list) {
// //获取分机
// List<DeviceDto> listDeviceDto= stationDataTask.getListDevice(stationTaksDto);
// if(listDeviceDto!=null&&listDeviceDto.size()>0){
// for (DeviceDto deviceDto : listDeviceDto) {
// List<IndexDto> listIndexDto = stationDataTask.getIndexDto(deviceDto);
// }
// }
// }
// }
}
......@@ -206,7 +206,7 @@
IFNULL(SCCJ, '') as source,
'' as stationName,
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor,
IFNULL(UPDATE_TIME, '') AS recDate
IFNULL(UPDATE_STAMP, '') AS recDate
FROM
sjgl_zsj_zsbtz
where SBBM = #{objectId}
......
......@@ -222,24 +222,24 @@ public class DemoController extends BaseController {
equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> {
ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get();
esEquipments.setEquipmentIndexName(equipmentsJxiopDocMysql.getEquipmentIndexName());
esEquipments.setEquipmentNumber(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getEquipmentNumber())?"":equipmentsJxiopDocMysql.getEquipmentNumber());
esEquipments.setEquipmentNumber(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getEquipmentNumber()) ? "" : equipmentsJxiopDocMysql.getEquipmentNumber());
esEquipments.setIsAlarm(equipmentsJxiopDocMysql.getIsAlarm());
esEquipments.setDataType(equipmentsJxiopDocMysql.getDataType());
esEquipments.setGatewayId(equipmentsJxiopDocMysql.getGatewayId());
esEquipments.setAddress(equipmentsJxiopDocMysql.getAddress());
esEquipments.setEquipmentSpecificName(equipmentsJxiopDocMysql.getEquipmentSpecificName());
//更新显示名称
esEquipments.setDisplayName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getDisplayName())?"":equipmentsJxiopDocMysql.getDisplayName());
esEquipments.setDisplayName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getDisplayName()) ? "" : equipmentsJxiopDocMysql.getDisplayName());
//更新排序号
esEquipments.setTraceId(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getTraceId())?"":equipmentsJxiopDocMysql.getTraceId());
esEquipments.setTraceId(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getTraceId()) ? "" : equipmentsJxiopDocMysql.getTraceId());
//更新单位
esEquipments.setUnit(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getUnit())?"":equipmentsJxiopDocMysql.getUnit());
esEquipments.setUnit(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getUnit()) ? "" : equipmentsJxiopDocMysql.getUnit());
//更新frontModule
esEquipments.setFrontModule(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getFrontModule())?"":equipmentsJxiopDocMysql.getFrontModule());
esEquipments.setFrontModule(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getFrontModule()) ? "" : equipmentsJxiopDocMysql.getFrontModule());
//更新systemType
esEquipments.setSystemType(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getSystemType())?"":equipmentsJxiopDocMysql.getSystemType());
esEquipments.setSystemType(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getSystemType()) ? "" : equipmentsJxiopDocMysql.getSystemType());
//更新图片名称
esEquipments.setPictureName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getPictureName())?"":equipmentsJxiopDocMysql.getPictureName());
esEquipments.setPictureName(ObjectUtils.isEmpty(equipmentsJxiopDocMysql.getPictureName()) ? "" : equipmentsJxiopDocMysql.getPictureName());
equipmentsRepository.save(esEquipments);
});
......@@ -254,16 +254,20 @@ public class DemoController extends BaseController {
List<Object> pointImportDtoList = EasyExcel.read(inputStream).head(PointImportDto.class).sheet(0).headRowNumber(1).doReadSync();
pointImportDtoList.forEach(o -> {
PointImportDto pointImportDto = (PointImportDto) o;
List<EquipmentsJxiopDocMysql> equipmentsJxiopDocMysqlList = equipmentsJxiopDocMysqlMapper.selectList(new QueryWrapper<EquipmentsJxiopDocMysql>().eq("gateway_id", pointImportDto.getGatewayId()).eq("equipment_index_name",pointImportDto.getEquipmentIndexName()));
if(!ObjectUtils.isEmpty(equipmentsJxiopDocMysqlList)){
List<EquipmentsJxiopDocMysql> equipmentsJxiopDocMysqlList = equipmentsJxiopDocMysqlMapper.selectList(new QueryWrapper<EquipmentsJxiopDocMysql>().eq("gateway_id", pointImportDto.getGatewayId()).eq("equipment_index_name", pointImportDto.getEquipmentIndexName()));
if (!ObjectUtils.isEmpty(equipmentsJxiopDocMysqlList)) {
equipmentsJxiopDocMysqlList.forEach(equipmentsJxiopDocMysql -> {
ESEquipments esEquipments = equipmentsRepository.findById(equipmentsJxiopDocMysql.getId()).get();
//更新模块
equipmentsJxiopDocMysql.setFrontModule(pointImportDto.getFrontModule());
esEquipments.setFrontModule(pointImportDto.getFrontModule());
if (equipmentsJxiopDocMysql.getFrontModule().contains(pointImportDto.getFrontModule())) {
equipmentsJxiopDocMysql.setFrontModule(equipmentsJxiopDocMysql.getFrontModule() + "," + pointImportDto.getFrontModule());
esEquipments.setFrontModule(equipmentsJxiopDocMysql.getFrontModule() + "," + pointImportDto.getFrontModule());
}
//更新类型
equipmentsJxiopDocMysql.setSystemType(pointImportDto.getSystemType());
esEquipments.setSystemType(pointImportDto.getSystemType());
if (equipmentsJxiopDocMysql.getSystemType().contains(pointImportDto.getSystemType())) {
equipmentsJxiopDocMysql.setSystemType(equipmentsJxiopDocMysql.getSystemType()+","+pointImportDto.getSystemType());
esEquipments.setSystemType(equipmentsJxiopDocMysql.getSystemType()+","+pointImportDto.getSystemType());
}
//更新排序号
equipmentsJxiopDocMysql.setTraceId(pointImportDto.getTraceId());
esEquipments.setTraceId(pointImportDto.getTraceId());
......@@ -271,7 +275,7 @@ public class DemoController extends BaseController {
equipmentsJxiopDocMysql.setDisplayName(pointImportDto.getDisplayName());
esEquipments.setDisplayName(pointImportDto.getDisplayName());
//更新单位 如果单位为空或者单位超过周期性数据存储长度则丢弃单位更新操作
if(!ObjectUtils.isEmpty(pointImportDto.getUnit())&&(pointImportDto.getUnit().toCharArray().length<24)){
if (!ObjectUtils.isEmpty(pointImportDto.getUnit()) && (pointImportDto.getUnit().toCharArray().length < 24)) {
equipmentsJxiopDocMysql.setUnit(pointImportDto.getUnit());
esEquipments.setUnit(pointImportDto.getUnit());
}
......
......@@ -403,7 +403,7 @@ public class MonitorFanIdxController extends BaseController {
result.setCurrent(1);
result.setTotal(statusMonitoring.size());
try {
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, frontModule, stringStringEntry.getKey()), JSON.toJSONString(result).getBytes(), 0, false);
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, frontModule, stringStringEntry.getKey()), JSON.toJSONString(result).getBytes(), 1, true);
} catch (MqttException e) {
e.printStackTrace();
}
......
......@@ -408,26 +408,32 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
if(Boolean.TRUE.toString().equalsIgnoreCase(elecStatus)&&"8.0".equals(fanStatus)&&power>0&&!isWarn)
{
equipMap.put(entry.getKey(), "正常运行");
}else if(Boolean.TRUE.toString().equalsIgnoreCase(warnStatus))
{
equipMap.put(entry.getKey(), "报警运行");
}
else if("9.0".equals(fault22))
{
equipMap.put(entry.getKey(), "限功率");
}else if(Boolean.TRUE.toString().equalsIgnoreCase(standbyStatus)&&"3.0".equals(fanStatus))
}
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))
}
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))
}
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))
}
else if(Boolean.TRUE.toString().equalsIgnoreCase(mainStatus)&&"2.0".equals(fanStatus))
{
equipMap.put(entry.getKey(), "维护状态");
}else if(fdjSpeed>0&&min!=null&&min>=10)
}
else if(fdjSpeed>0&&min!=null&&min>=10)
{
equipMap.put(entry.getKey(), "通讯中断");
}
......@@ -600,6 +606,9 @@ 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)){
equipNumList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
}
if (CollectionUtils.isNotEmpty(equipNumList) && !ObjectUtils.isEmpty(equipNumList.get(0).getValueF())) {
return equipNumList.get(0).getValueF().toString();
} else {
......@@ -1093,14 +1102,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for (String s : collect.keySet()) {
Map<String, Object> statusMap = new HashMap<>();
if (frontModule.equals("前光")) {
likeCodtion.remove(CommonConstans.QueryStringDisplayName + ".keyword");
likeCodtion.put(CommonConstans.QueryStringSystemType + ".keyword", "模拟量");
likeCodtion.remove(CommonConstans.QueryStringDisplayNameKeyword);
likeCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, "模拟量");
List<ESEquipments> value = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeCodtion);
for (ESEquipments indicatorsDto : value) {
Double aDouble = Double.valueOf(indicatorsDto.getValue());
statusMap.put(indicatorsDto.getDisplayName() + "Value", String.format(CommonConstans.Twodecimalplaces, aDouble));
statusMap.put(indicatorsDto.getDisplayName().split("\\(")[0] + "Value", String.format(CommonConstans.Twodecimalplaces, aDouble));
}
}
List<ESEquipments> indicatorsDtos = collect.get(s);
......@@ -1371,22 +1379,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Map<String, String> likeMap = new HashMap<>();
queryCodtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCodtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, map.get("boosterName"));
likeMap.put(CommonConstans.QueryStringFrontMoudle, map.get("boosterName"));
if ("1主变高压侧".equals(map.get("boosterName")) || "1主变低压侧".equals(map.get("boosterName"))) {
likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, map.get("压侧"));
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtionsAndLike(queryCodtion, null, ESEquipments.class, likeMap);
likeMap.put(CommonConstans.QueryStringFrontMoudle, "压侧");
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCodtion, null, ESEquipments.class, likeMap);
// 主变高压侧
Map<String, String> zbGYC = listData.stream().filter(t -> t.getFrontModule().contains("1主变高压侧")).collect(Collectors.toMap(ESEquipments::getDisplayName, ESEquipments::getValue));
List<Map<String, String>> zbList = new ArrayList<>();
listData.stream().filter(t -> t.getFrontModule().contains("1主变低压侧")).forEach(item -> {
HashMap<String, String> zbMap = new HashMap<>();
zbMap.put("traceId", item.getTraceId());
zbMap.put("title", item.getDisplayName());
zbMap.put("grade1", keepTwoDecimalPlaces(item.getValue()));
zbMap.put("grade2", keepTwoDecimalPlaces(zbGYC.getOrDefault(item.getDisplayName(), "0.0")));
if (StringUtils.isNotEmpty(item.getUnit())) {
zbMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
}
zbList.add(zbMap);
});
IPage<Map<String, String>> zbResult = new Page<>();
......@@ -1395,21 +1400,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
zbResult.setTotal(zbList.size());
try {
log.info("主变消息内容:{}", JSON.toJSONString(zbResult));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(zbResult).getBytes(), 2, false);
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(zbResult).getBytes(), 1, true);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
}
} else {
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtionsAndLike(queryCodtion, null, ESEquipments.class, likeMap);
List<ESEquipments> listData = commonServiceImpl.getListDataByCondtions(queryCodtion, null, ESEquipments.class, likeMap);
ArrayList<Map<String, String>> resultList = new ArrayList<>();
listData.forEach(item -> {
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("traceId", item.getTraceId());
stringStringHashMap.put("title", item.getDisplayName());
stringStringHashMap.put("value", keepTwoDecimalPlaces(item.getValue()));
if (StringUtils.isNotEmpty(item.getUnit())) {
stringStringHashMap.put("title", String.format("%s(%s)", item.getDisplayName(), item.getUnit()));
}
resultList.add(stringStringHashMap);
});
......@@ -1419,7 +1422,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
result.setTotal(resultList.size());
try {
log.info("消息内容:{}", JSON.toJSONString(result));
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(result).getBytes(), 2, false);
emqKeeper.getMqttClient().publish(String.format("%s/%s/%s", stationId, routeName, "mnl"), JSON.toJSONString(result).getBytes(), 1, true);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment