暂降原因
This commit is contained in:
@@ -89,6 +89,11 @@
|
||||
<artifactId>supervision-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>advance-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
import com.njcn.advance.api.EventCauseFeignClient;
|
||||
import com.njcn.advance.api.EventWaveAnalysisFeignClient;
|
||||
import com.njcn.advance.pojo.dto.EventAnalysisDTO;
|
||||
import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.dto.LogInfoDTO;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
@@ -19,6 +22,7 @@ import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.event.pojo.vo.SendEventVO;
|
||||
import com.njcn.event.utils.EventUtil;
|
||||
import com.njcn.event.mapper.majornetwork.EventDetailMapper;
|
||||
@@ -66,7 +70,7 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
private final EventCauseFeignClient eventCauseFeignClient;
|
||||
@Override
|
||||
public List<EventDetail> getEventDetailData(String id, String startTime, String endTime) {
|
||||
//数据暂降查询
|
||||
@@ -168,12 +172,26 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
}
|
||||
|
||||
rmpEventDetailPO.setEventDescribe(" ");
|
||||
//默认都是其他
|
||||
DictData reason = dicDataFeignClient.getDicDataByCode(DicDataEnum.RESON_REST.getCode()).getData();
|
||||
DictData advanceType = dicDataFeignClient.getDicDataByCode(DicDataEnum.TYPE_REST.getCode()).getData();
|
||||
//如果不为空,说明是二次上传波形文件了;
|
||||
String reason,type;
|
||||
if(!StringUtils.isEmpty(rmpEventDetailPO.getWavePath())){
|
||||
LineDetailDataVO lineDetailData = lineFeignClient.getLineDetailData(rmpEventDetailPO.getLineId()).getData();
|
||||
String ip = lineDetailData.getIp();
|
||||
EventAnalysisDTO eventAnalysisDTO = new EventAnalysisDTO();
|
||||
eventAnalysisDTO.setIp(ip);
|
||||
eventAnalysisDTO.setWaveName(rmpEventDetailPO.getWavePath());
|
||||
EventAnalysisDTO result = eventCauseFeignClient.analysisCauseAndType(eventAnalysisDTO).getData();
|
||||
reason =reasonReflection(result.getCause());
|
||||
type =advanceTypeReflection(result.getType());
|
||||
DictData advancereason = dicDataFeignClient.getDicDataByCode(reason).getData();
|
||||
DictData advanceType = dicDataFeignClient.getDicDataByCode(type).getData();
|
||||
rmpEventDetailPO.setAdvanceReason(advancereason.getId());
|
||||
rmpEventDetailPO.setAdvanceType(advanceType.getId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
rmpEventDetailPO.setAdvanceReason(reason.getId());
|
||||
rmpEventDetailPO.setAdvanceType(advanceType.getId());
|
||||
String severity = EventUtil.getYzd(deatilDTO.getDuration().floatValue(),(deatilDTO.getAmplitude().floatValue()/100));
|
||||
rmpEventDetailPO.setSeverity(Double.valueOf(severity));
|
||||
rmpEventDetailPO.setCreateTime(LocalDateTime.now());
|
||||
@@ -181,6 +199,7 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
RmpEventDetailPO one = this.lambdaQuery().eq(RmpEventDetailPO::getLineId, rmpEventDetailPO.getLineId()).eq(RmpEventDetailPO::getStartTime, rmpEventDetailPO.getStartTime()).one();
|
||||
if(Objects.nonNull(one)){
|
||||
rmpEventDetailPO.setEventId(one.getEventId());
|
||||
|
||||
this.updateById(rmpEventDetailPO);
|
||||
} else {
|
||||
this.save(rmpEventDetailPO);
|
||||
@@ -191,9 +210,72 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
pushEvent(rmpEventDetailPO);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private String advanceTypeReflection(Integer type) {
|
||||
String result = DicDataEnum.TYPE_REST.getCode();
|
||||
switch (type) {
|
||||
case 0:
|
||||
result = DicDataEnum.INTERPHASE_BC.getCode();
|
||||
break;
|
||||
case 1:
|
||||
result = DicDataEnum.PHASE_C.getCode();
|
||||
break;
|
||||
case 2:
|
||||
result = DicDataEnum.INTERPHASE_AC.getCode();
|
||||
break;
|
||||
case 3:
|
||||
result = DicDataEnum.PHASE_A.getCode();
|
||||
break;
|
||||
case 4:
|
||||
result = DicDataEnum.INTERPHASE_AB.getCode();
|
||||
break;
|
||||
case 5:
|
||||
result = DicDataEnum.PHASE_B.getCode();
|
||||
break;
|
||||
case 6:
|
||||
result = DicDataEnum.GROUND_BC.getCode();
|
||||
break;
|
||||
case 7:
|
||||
result = DicDataEnum.GROUND_AC.getCode();
|
||||
break;
|
||||
case 8:
|
||||
result = DicDataEnum.GROUND_AB.getCode();
|
||||
break;
|
||||
case 9:
|
||||
result = DicDataEnum.GROUND_ABC.getCode();
|
||||
break;
|
||||
case 10:
|
||||
result = DicDataEnum.TYPE_REST.getCode();
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String reasonReflection(Integer cause) {
|
||||
String result =DicDataEnum.RESON_REST.getCode();
|
||||
switch (cause) {
|
||||
case 0:
|
||||
result = DicDataEnum.RESON_REST.getCode();
|
||||
break;
|
||||
case 1:
|
||||
result = DicDataEnum.SHORT_TROUBLE.getCode();
|
||||
break;
|
||||
case 2:
|
||||
result = DicDataEnum.TRANSFORMER_EXCITATION.getCode();
|
||||
break;
|
||||
case 3:
|
||||
result = DicDataEnum.LARGE_INDUCTION.getCode();
|
||||
break;
|
||||
case 4:
|
||||
result = DicDataEnum.VOLTAGE_DISTURBANCE.getCode();
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void pushEvent(RmpEventDetailPO po) {
|
||||
String id = po.getLineId();
|
||||
//根据监测点获取部门
|
||||
@@ -234,6 +316,7 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
break;
|
||||
case 1210003:
|
||||
result = DicDataEnum.OTHER.getCode();
|
||||
break;
|
||||
case 1210004:
|
||||
result = DicDataEnum.SHORT_INTERRUPTIONS.getCode();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user