Compare commits
9 Commits
cd8cf60683
...
2026-02
| Author | SHA1 | Date | |
|---|---|---|---|
| 56c9c69fc9 | |||
| 004de8f307 | |||
| bda31ce52a | |||
| 4d1af87153 | |||
| e34b5ba46e | |||
| 33b9fae9ef | |||
| a369ae6160 | |||
| 6714a6f582 | |||
| 2910770be1 |
@@ -15,7 +15,6 @@ import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
|||||||
import com.njcn.access.enums.AccessEnum;
|
import com.njcn.access.enums.AccessEnum;
|
||||||
import com.njcn.access.enums.AccessResponseEnum;
|
import com.njcn.access.enums.AccessResponseEnum;
|
||||||
import com.njcn.access.enums.TypeEnum;
|
import com.njcn.access.enums.TypeEnum;
|
||||||
import com.njcn.access.mapper.OverlimitMapper;
|
|
||||||
import com.njcn.access.pojo.RspDataDto;
|
import com.njcn.access.pojo.RspDataDto;
|
||||||
import com.njcn.access.pojo.dto.*;
|
import com.njcn.access.pojo.dto.*;
|
||||||
import com.njcn.access.pojo.dto.file.FileDto;
|
import com.njcn.access.pojo.dto.file.FileDto;
|
||||||
@@ -34,6 +33,7 @@ import com.njcn.csdevice.api.*;
|
|||||||
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
import com.njcn.csdevice.pojo.dto.PqsCommunicateDto;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||||
import com.njcn.csdevice.pojo.po.*;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
|
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||||
import com.njcn.mq.message.AppAutoDataMessage;
|
import com.njcn.mq.message.AppAutoDataMessage;
|
||||||
@@ -69,6 +69,8 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@@ -96,7 +98,7 @@ public class MqttMessageHandler {
|
|||||||
private final CsLineFeignClient csLineFeignClient;
|
private final CsLineFeignClient csLineFeignClient;
|
||||||
private final DevCapacityFeignClient devCapacityFeignClient;
|
private final DevCapacityFeignClient devCapacityFeignClient;
|
||||||
private final EquipmentFeignClient equipmentFeignClient;
|
private final EquipmentFeignClient equipmentFeignClient;
|
||||||
private final OverlimitMapper overlimitMapper;
|
private final OverLimitWlMapper overLimitWlMapper;
|
||||||
private final ChannelObjectUtil channelObjectUtil;
|
private final ChannelObjectUtil channelObjectUtil;
|
||||||
private final WaveFeignClient waveFeignClient;
|
private final WaveFeignClient waveFeignClient;
|
||||||
private final RtFeignClient rtFeignClient;
|
private final RtFeignClient rtFeignClient;
|
||||||
@@ -468,8 +470,8 @@ public class MqttMessageHandler {
|
|||||||
//生成监测点限值
|
//生成监测点限值
|
||||||
Overlimit overlimit = COverlimitUtil.globalAssemble(item.getVolGrade().floatValue(),10f,10f,10f,0,0);
|
Overlimit overlimit = COverlimitUtil.globalAssemble(item.getVolGrade().floatValue(),10f,10f,10f,0,0);
|
||||||
overlimit.setId(nDid.concat(item.getClDid().toString()));
|
overlimit.setId(nDid.concat(item.getClDid().toString()));
|
||||||
overlimitMapper.deleteById(nDid.concat(item.getClDid().toString()));
|
overLimitWlMapper.deleteById(nDid.concat(item.getClDid().toString()));
|
||||||
overlimitMapper.insert(overlimit);
|
overLimitWlMapper.insert(overlimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
package com.njcn.access.mapper;
|
//package com.njcn.access.mapper;
|
||||||
|
//
|
||||||
|
//
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
//import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
//import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
//import org.apache.ibatis.annotations.Mapper;
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* <p>
|
// * <p>
|
||||||
* Mapper 接口
|
// * Mapper 接口
|
||||||
* </p>
|
// * </p>
|
||||||
*
|
// *
|
||||||
* @author xy
|
// * @author xy
|
||||||
*/
|
// */
|
||||||
@DS("sjzx")
|
//@DS("sjzx")
|
||||||
@Mapper
|
//@Mapper
|
||||||
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
//public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
@@ -133,8 +133,11 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
if (ObjectUtil.isNotNull(object)) {
|
if (ObjectUtil.isNotNull(object)) {
|
||||||
csLineFeignClient.updateDataByList(devList,csDevModelPo.getId(),object.toString());
|
csLineFeignClient.updateDataByList(devList,csDevModelPo.getId(),object.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//5.清空模板缓存
|
||||||
|
redisUtil.deleteKeysByString(AppRedisKey.DEV_MODEL);
|
||||||
csLogsFeignClient.addUserLog(logDto);
|
csLogsFeignClient.addUserLog(logDto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logDto.setResult(0);
|
logDto.setResult(0);
|
||||||
@@ -964,7 +967,7 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
if(CollectionUtil.isNotEmpty(setList)) {
|
if(CollectionUtil.isNotEmpty(setList)) {
|
||||||
csDataSetService.addList(setList);
|
csDataSetService.addList(setList);
|
||||||
setList.forEach(item->{
|
setList.forEach(item->{
|
||||||
if (Objects.equals(item.getName(),"统计数据")) {
|
if (Objects.equals(item.getName(),"Ds$Pqd$Stat$01")) {
|
||||||
redisUtil.saveByKeyWithExpire("setId:" + pId,item.getId(),30L);
|
redisUtil.saveByKeyWithExpire("setId:" + pId,item.getId(),30L);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1271,19 +1274,26 @@ public class CsDevModelServiceImpl implements ICsDevModelService {
|
|||||||
showName = "APF模块8数据模板";
|
showName = "APF模块8数据模板";
|
||||||
break;
|
break;
|
||||||
case "Ds$Pqd$Stat$01":
|
case "Ds$Pqd$Stat$01":
|
||||||
if (Objects.equals(code, DicDataEnum.CONNECT_DEV.getCode()) || Objects.isNull(code)){
|
if (Objects.equals(code, DicDataEnum.CONNECT_DEV.getCode())){
|
||||||
showName = "电网侧数据模板";
|
showName = "电网侧数据模板";
|
||||||
} else if (Objects.equals(code, DicDataEnum.PORTABLE.getCode())){
|
} else if (Objects.equals(code, DicDataEnum.PORTABLE.getCode())){
|
||||||
showName = "监测1#数据模板";
|
showName = "监测1#数据模板";
|
||||||
|
} else {
|
||||||
|
showName = "统计数据";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Ds$Pqd$Stat$02":
|
case "Ds$Pqd$Stat$02":
|
||||||
if (Objects.equals(code, DicDataEnum.CONNECT_DEV.getCode()) || Objects.isNull(code)){
|
if (Objects.equals(code, DicDataEnum.CONNECT_DEV.getCode())){
|
||||||
showName = "负载侧数据模板";
|
showName = "负载侧数据模板";
|
||||||
} else if (Objects.equals(code, DicDataEnum.PORTABLE.getCode())){
|
} else if (Objects.equals(code, DicDataEnum.PORTABLE.getCode())){
|
||||||
showName = "监测2#数据模板";
|
showName = "监测2#数据模板";
|
||||||
|
} else {
|
||||||
|
showName = "统计数据";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "Ds$Pqd$Rt$01":
|
||||||
|
showName = "实时数据";
|
||||||
|
break;
|
||||||
//波形参数名称
|
//波形参数名称
|
||||||
case "Wave_Param_Position":
|
case "Wave_Param_Position":
|
||||||
showName = "录波记录位置";
|
showName = "录波记录位置";
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class RtServiceImpl implements IRtService {
|
|||||||
long timestamp = item.getDataTimeSec() - 8*3600;
|
long timestamp = item.getDataTimeSec() - 8*3600;
|
||||||
baseRealDataSet.setDataTime(getTime(timestamp));
|
baseRealDataSet.setDataTime(getTime(timestamp));
|
||||||
publisher.send("/Web/RealData/" + lineId, new Gson().toJson(baseRealDataSet), 1, false);
|
publisher.send("/Web/RealData/" + lineId, new Gson().toJson(baseRealDataSet), 1, false);
|
||||||
} else if (dataSet.getName().contains("实时数据")) {
|
} else if (dataSet.getName().contains("实时数据") || dataSet.getName().contains("Ds$Pqd$Rt$01")) {
|
||||||
//用户Id
|
//用户Id
|
||||||
Object redisObject = redisUtil.getObjectByKey("rtDataUserId:"+lineId);
|
Object redisObject = redisUtil.getObjectByKey("rtDataUserId:"+lineId);
|
||||||
if (ObjectUtil.isNotNull(redisObject)) {
|
if (ObjectUtil.isNotNull(redisObject)) {
|
||||||
@@ -225,9 +225,15 @@ public class RtServiceImpl implements IRtService {
|
|||||||
baseRealDataSet.setVRmsC(FloatUtils.get2Float(map.get("Pq_RmsLUCA")));
|
baseRealDataSet.setVRmsC(FloatUtils.get2Float(map.get("Pq_RmsLUCA")));
|
||||||
}
|
}
|
||||||
//基波电压幅值
|
//基波电压幅值
|
||||||
baseRealDataSet.setV1A(FloatUtils.get2Float(map.get("Pq_RmsFundUA")));
|
if (conType == 0) {
|
||||||
baseRealDataSet.setV1B(FloatUtils.get2Float(map.get("Pq_RmsFundUB")));
|
baseRealDataSet.setV1A(FloatUtils.get2Float(map.get("Pq_RmsFundUA")));
|
||||||
baseRealDataSet.setV1C(FloatUtils.get2Float(map.get("Pq_RmsFundUC")));
|
baseRealDataSet.setV1B(FloatUtils.get2Float(map.get("Pq_RmsFundUB")));
|
||||||
|
baseRealDataSet.setV1C(FloatUtils.get2Float(map.get("Pq_RmsFundUC")));
|
||||||
|
} else {
|
||||||
|
baseRealDataSet.setV1A(FloatUtils.get2Float(map.get("Pq_RmsFundLUAB")));
|
||||||
|
baseRealDataSet.setV1B(FloatUtils.get2Float(map.get("Pq_RmsFundLUBC")));
|
||||||
|
baseRealDataSet.setV1C(FloatUtils.get2Float(map.get("Pq_RmsFundLUCA")));
|
||||||
|
}
|
||||||
//电流有效值
|
//电流有效值
|
||||||
baseRealDataSet.setIRmsA(FloatUtils.get2Float(map.get("Pq_RmsIA")));
|
baseRealDataSet.setIRmsA(FloatUtils.get2Float(map.get("Pq_RmsIA")));
|
||||||
baseRealDataSet.setIRmsB(FloatUtils.get2Float(map.get("Pq_RmsIB")));
|
baseRealDataSet.setIRmsB(FloatUtils.get2Float(map.get("Pq_RmsIB")));
|
||||||
@@ -237,21 +243,39 @@ public class RtServiceImpl implements IRtService {
|
|||||||
baseRealDataSet.setI1B(FloatUtils.get2Float(map.get("Pq_RmsFundIB")));
|
baseRealDataSet.setI1B(FloatUtils.get2Float(map.get("Pq_RmsFundIB")));
|
||||||
baseRealDataSet.setI1C(FloatUtils.get2Float(map.get("Pq_RmsFundIC")));
|
baseRealDataSet.setI1C(FloatUtils.get2Float(map.get("Pq_RmsFundIC")));
|
||||||
//电压偏差
|
//电压偏差
|
||||||
baseRealDataSet.setVDevA(FloatUtils.get2Float(map.get("Pq_UDevA")));
|
if (conType == 0) {
|
||||||
baseRealDataSet.setVDevB(FloatUtils.get2Float(map.get("Pq_UDevB")));
|
baseRealDataSet.setVDevA(FloatUtils.get2Float(map.get("Pq_UDevA")));
|
||||||
baseRealDataSet.setVDevC(FloatUtils.get2Float(map.get("Pq_UDevC")));
|
baseRealDataSet.setVDevB(FloatUtils.get2Float(map.get("Pq_UDevB")));
|
||||||
|
baseRealDataSet.setVDevC(FloatUtils.get2Float(map.get("Pq_UDevC")));
|
||||||
|
} else {
|
||||||
|
baseRealDataSet.setVDevA(FloatUtils.get2Float(map.get("Pq_LUDevAB")));
|
||||||
|
baseRealDataSet.setVDevB(FloatUtils.get2Float(map.get("Pq_LUDevBC")));
|
||||||
|
baseRealDataSet.setVDevC(FloatUtils.get2Float(map.get("Pq_LUDevCA")));
|
||||||
|
}
|
||||||
//基波电压相位
|
//基波电压相位
|
||||||
baseRealDataSet.setV1AngA(FloatUtils.get2Float(map.get("Pq_FundUAngA")));
|
if (conType == 0) {
|
||||||
baseRealDataSet.setV1AngB(FloatUtils.get2Float(map.get("Pq_FundUAngB")));
|
baseRealDataSet.setV1AngA(FloatUtils.get2Float(map.get("Pq_FundUAngA")));
|
||||||
baseRealDataSet.setV1AngC(FloatUtils.get2Float(map.get("Pq_FundUAngC")));
|
baseRealDataSet.setV1AngB(FloatUtils.get2Float(map.get("Pq_FundUAngB")));
|
||||||
|
baseRealDataSet.setV1AngC(FloatUtils.get2Float(map.get("Pq_FundUAngC")));
|
||||||
|
} else {
|
||||||
|
baseRealDataSet.setV1AngA(FloatUtils.get2Float(map.get("Pq_FundLUAngAB")));
|
||||||
|
baseRealDataSet.setV1AngB(FloatUtils.get2Float(map.get("Pq_FundLUAngBC")));
|
||||||
|
baseRealDataSet.setV1AngC(FloatUtils.get2Float(map.get("Pq_FundLUAngCA")));
|
||||||
|
}
|
||||||
//基波电流相位
|
//基波电流相位
|
||||||
baseRealDataSet.setI1AngA(FloatUtils.get2Float(map.get("Pq_FundIAngA")));
|
baseRealDataSet.setI1AngA(FloatUtils.get2Float(map.get("Pq_FundIAngA")));
|
||||||
baseRealDataSet.setI1AngB(FloatUtils.get2Float(map.get("Pq_FundIAngB")));
|
baseRealDataSet.setI1AngB(FloatUtils.get2Float(map.get("Pq_FundIAngB")));
|
||||||
baseRealDataSet.setI1AngC(FloatUtils.get2Float(map.get("Pq_FundIAngC")));
|
baseRealDataSet.setI1AngC(FloatUtils.get2Float(map.get("Pq_FundIAngC")));
|
||||||
//电压总谐波畸变率
|
//电压总谐波畸变率
|
||||||
baseRealDataSet.setVThdA(FloatUtils.get2Float(map.get("Pq_ThdUA")));
|
if (conType == 0) {
|
||||||
baseRealDataSet.setVThdB(FloatUtils.get2Float(map.get("Pq_ThdUB")));
|
baseRealDataSet.setVThdA(FloatUtils.get2Float(map.get("Pq_ThdUA")));
|
||||||
baseRealDataSet.setVThdC(FloatUtils.get2Float(map.get("Pq_ThdUC")));
|
baseRealDataSet.setVThdB(FloatUtils.get2Float(map.get("Pq_ThdUB")));
|
||||||
|
baseRealDataSet.setVThdC(FloatUtils.get2Float(map.get("Pq_ThdUC")));
|
||||||
|
} else {
|
||||||
|
baseRealDataSet.setVThdA(FloatUtils.get2Float(map.get("Pq_ThdLUAB")));
|
||||||
|
baseRealDataSet.setVThdB(FloatUtils.get2Float(map.get("Pq_ThdLUBC")));
|
||||||
|
baseRealDataSet.setVThdC(FloatUtils.get2Float(map.get("Pq_ThdLUCA")));
|
||||||
|
}
|
||||||
//电流总谐波畸变率
|
//电流总谐波畸变率
|
||||||
baseRealDataSet.setIThdA(FloatUtils.get2Float(map.get("Pq_ThdIA")));
|
baseRealDataSet.setIThdA(FloatUtils.get2Float(map.get("Pq_ThdIA")));
|
||||||
baseRealDataSet.setIThdB(FloatUtils.get2Float(map.get("Pq_ThdIB")));
|
baseRealDataSet.setIThdB(FloatUtils.get2Float(map.get("Pq_ThdIB")));
|
||||||
@@ -281,10 +305,10 @@ public class RtServiceImpl implements IRtService {
|
|||||||
baseRealDataSet.setPfC(FloatUtils.get2Float(map.get("Pq_PFC")));
|
baseRealDataSet.setPfC(FloatUtils.get2Float(map.get("Pq_PFC")));
|
||||||
baseRealDataSet.setPfTot(FloatUtils.get2Float(map.get("Pq_TotPFM")));
|
baseRealDataSet.setPfTot(FloatUtils.get2Float(map.get("Pq_TotPFM")));
|
||||||
//基波功率因数
|
//基波功率因数
|
||||||
baseRealDataSet.setDpfA(FloatUtils.get2Float(map.get("Pq_DPFA")));
|
baseRealDataSet.setDpfA(FloatUtils.get2Float(map.get("Pq_DFA")));
|
||||||
baseRealDataSet.setDpfB(FloatUtils.get2Float(map.get("Pq_DPFB")));
|
baseRealDataSet.setDpfB(FloatUtils.get2Float(map.get("Pq_DFB")));
|
||||||
baseRealDataSet.setDpfC(FloatUtils.get2Float(map.get("Pq_DPFC")));
|
baseRealDataSet.setDpfC(FloatUtils.get2Float(map.get("Pq_DFC")));
|
||||||
baseRealDataSet.setDpfTot(FloatUtils.get2Float(map.get("Pq_TotDPFM")));
|
baseRealDataSet.setDpfTot(FloatUtils.get2Float(map.get("Pq_TotDFM")));
|
||||||
return baseRealDataSet;
|
return baseRealDataSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ public class StatServiceImpl implements IStatService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
redisUtil.saveByKey(AppRedisKey.LINE_POSITION+id,map);
|
redisUtil.saveByKeyWithExpire(AppRedisKey.LINE_POSITION+id,map,30L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,7 +220,9 @@ public class StatServiceImpl implements IStatService {
|
|||||||
String tableName = map.get(dataArrayList.get(i).getName());
|
String tableName = map.get(dataArrayList.get(i).getName());
|
||||||
Map<String, String> tags = new HashMap<>();
|
Map<String, String> tags = new HashMap<>();
|
||||||
tags.put(InfluxDBTableConstant.LINE_ID,lineId);
|
tags.put(InfluxDBTableConstant.LINE_ID,lineId);
|
||||||
tags.put(InfluxDBTableConstant.PHASIC_TYPE,Objects.isNull(PHASE_MAPPING.get(dataArrayList.get(i).getPhase()))?dataArrayList.get(i).getPhase():PHASE_MAPPING.get(dataArrayList.get(i).getPhase()));
|
tags.put(InfluxDBTableConstant.PHASIC_TYPE,dataArrayList.get(i).getPhase());
|
||||||
|
//todo 不清楚之前为啥要修改相别,这边按字典配置相别无法查询到数据,先改回来
|
||||||
|
//tags.put(InfluxDBTableConstant.PHASIC_TYPE,Objects.isNull(PHASE_MAPPING.get(dataArrayList.get(i).getPhase()))?dataArrayList.get(i).getPhase():PHASE_MAPPING.get(dataArrayList.get(i).getPhase()));
|
||||||
tags.put(InfluxDBTableConstant.VALUE_TYPE,statMethod);
|
tags.put(InfluxDBTableConstant.VALUE_TYPE,statMethod);
|
||||||
tags.put(InfluxDBTableConstant.CL_DID,clDid.toString());
|
tags.put(InfluxDBTableConstant.CL_DID,clDid.toString());
|
||||||
tags.put(InfluxDBTableConstant.PROCESS,process.toString());
|
tags.put(InfluxDBTableConstant.PROCESS,process.toString());
|
||||||
@@ -249,8 +251,4 @@ public class StatServiceImpl implements IStatService {
|
|||||||
}
|
}
|
||||||
return urlList;
|
return urlList;
|
||||||
}
|
}
|
||||||
|
|
||||||
//相别处理
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,6 +184,6 @@ public class CsWaveAnalysisServiceImpl implements ICsWaveAnalysisService {
|
|||||||
map.put(2,item.getLineId());
|
map.put(2,item.getLineId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
redisUtil.saveByKeyWithExpire(AppRedisKey.LINE_POSITION+id,map,600L);
|
redisUtil.saveByKeyWithExpire(AppRedisKey.LINE_POSITION+id,map,30L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class EventServiceImpl implements IEventService {
|
|||||||
po.setStartTime(LocalDateTime.parse(cldLogMessage.getTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
po.setStartTime(LocalDateTime.parse(cldLogMessage.getTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||||
po.setTag(cldLogMessage.getLog());
|
po.setTag(cldLogMessage.getLog());
|
||||||
po.setClDid(1);
|
po.setClDid(1);
|
||||||
po.setLevel(3);
|
po.setLevel(channelLevel(cldLogMessage.getGrade()));
|
||||||
po.setProcess(4);
|
po.setProcess(4);
|
||||||
po.setCode(cldLogMessage.getCode());
|
po.setCode(cldLogMessage.getCode());
|
||||||
//前置告警
|
//前置告警
|
||||||
@@ -289,6 +289,29 @@ public class EventServiceImpl implements IEventService {
|
|||||||
csEventService.save(po);
|
csEventService.save(po);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理告警等级
|
||||||
|
*/
|
||||||
|
public int channelLevel(String grade) {
|
||||||
|
int result;
|
||||||
|
switch (grade) {
|
||||||
|
case "DEBUG":
|
||||||
|
result = 4;
|
||||||
|
break;
|
||||||
|
case "WARN":
|
||||||
|
result = 6;
|
||||||
|
break;
|
||||||
|
case "ERROR":
|
||||||
|
result = 7;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
result = 5;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理电压
|
* 处理电压
|
||||||
* @param vol
|
* @param vol
|
||||||
@@ -347,7 +370,7 @@ public class EventServiceImpl implements IEventService {
|
|||||||
map.put(2,item.getLineId());
|
map.put(2,item.getLineId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
redisUtil.saveByKeyWithExpire(AppRedisKey.LINE_POSITION+id,map,600L);
|
redisUtil.saveByKeyWithExpire(AppRedisKey.LINE_POSITION+id,map,30L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class CldDevRunFlagConsumer extends EnhanceConsumerMessageHandler<CldDevi
|
|||||||
protected void handleMessage(CldDeviceRunFlagMessage cldDeviceRunFlagMessage) {
|
protected void handleMessage(CldDeviceRunFlagMessage cldDeviceRunFlagMessage) {
|
||||||
log.info("分发至翻转设备状态");
|
log.info("分发至翻转设备状态");
|
||||||
int status = Objects.equals(cldDeviceRunFlagMessage.getStatus(),"0") ? 1 : 2;
|
int status = Objects.equals(cldDeviceRunFlagMessage.getStatus(),"0") ? 1 : 2;
|
||||||
equipmentFeignClient.flipCldDevStatus(cldDeviceRunFlagMessage.getId(), status);
|
equipmentFeignClient.flipCldDevStatus(cldDeviceRunFlagMessage.getDate(),cldDeviceRunFlagMessage.getId(), status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user