1.无线设备bug修改

This commit is contained in:
2024-09-24 16:40:32 +08:00
parent 35e521365d
commit d3f32fd396
11 changed files with 164 additions and 24 deletions

View File

@@ -19,6 +19,7 @@ import com.njcn.csdevice.enums.LineBaseEnum;
import com.njcn.csdevice.mapper.CsDataArrayMapper;
import com.njcn.csdevice.mapper.CsGroArrMapper;
import com.njcn.csdevice.mapper.CsGroupMapper;
import com.njcn.csdevice.mapper.OverlimitMapper;
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
import com.njcn.csdevice.pojo.param.EnergyBaseParam;
import com.njcn.csdevice.pojo.po.CsDataArray;
@@ -33,15 +34,14 @@ import com.njcn.csdevice.service.ICsDataArrayService;
import com.njcn.csdevice.service.ICsGroupService;
import com.njcn.csdevice.util.InfluxDbParamUtil;
import com.njcn.csdevice.utils.DataChangeUtil;
import com.njcn.csharmonic.api.EventFeignClient;
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
import com.njcn.csharmonic.param.CsEventUserQueryPage;
import com.njcn.csharmonic.pojo.vo.CsEventVO;
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
import com.njcn.device.biz.pojo.po.Overlimit;
import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.pq.api.OverLimitClient;
import com.njcn.device.pq.pojo.vo.LineDetailVO;
import com.njcn.event.api.EventDetailFeignClient;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.influx.pojo.bo.CommonQueryParam;
import com.njcn.influx.pojo.dto.EventDataSetDTO;
import com.njcn.influx.pojo.dto.StatisticalDataDTO;
@@ -104,15 +104,13 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
private final EvtDataService evtDataService;
private final EventDetailFeignClient eventDetailFeignClient;
private final DecimalFormat df = new DecimalFormat("#0.00");
private final EleEvtFeignClient eleEvtFeignClient;
private final OverLimitClient overLimitClient;
private final OverlimitMapper overlimitMapper;
private final LineFeignClient lineFeignClient;
private final EventFeignClient eventFeignClient;
private final InfluxDbParamUtil influxDbParamUtil;
@@ -390,9 +388,13 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
return result;
}else if("3".equals(type)){
//传3 则是暂态事件tab页面
Page<DataGroupEventVO> returnpage = new Page<> (commonStatisticalQueryParam.getPageNum(),commonStatisticalQueryParam.getPageSize());
returnpage = this.getBaseMapper().getGroupEventList(returnpage,commonStatisticalQueryParam.getDevId(),commonStatisticalQueryParam.getLineId());
returnpage.getRecords().forEach(temp->{
CsEventUserQueryPage csEventUserQueryPage = new CsEventUserQueryPage();
csEventUserQueryPage.setPageNum(commonStatisticalQueryParam.getPageNum());
csEventUserQueryPage.setPageSize(commonStatisticalQueryParam.getPageSize());
csEventUserQueryPage.setLineId(commonStatisticalQueryParam.getLineId());
Page<DataGroupEventVO> csEventVOPage = eventFeignClient.pageQueryByLineId(csEventUserQueryPage).getData();
csEventVOPage.getRecords().forEach(temp->{
//事件描述、相别、暂降幅值,需要特殊处理赋值
//事件描述
EleEpdPqd ele = epdFeignClient.findByName(temp.getTag()).getData();
@@ -420,11 +422,18 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
}else {
temp.setPhaseType(evtParamPhase.get(0).getValue()+(Objects.isNull(evtParamPhase.get(0).getUnit())?"":evtParamPhase.get(0).getUnit()));
}
List<EventDataSetDTO> evtParamDepth = eventDataSetDTOS.stream().
filter(dataSetDTO -> Objects.equals(dataSetDTO.getName(), DataParam.EvtParamDepth)).
collect(Collectors.toList());
if(CollectionUtil.isEmpty(evtParamDepth)){
temp.setFeatureAmplitude(null);
}else {
temp.setFeatureAmplitude(evtParamDepth.get(0).getValue().equals("-")?null:Float.parseFloat(evtParamDepth.get(0).getValue()));
}
}
});
return returnpage;
return csEventVOPage;
}
return null;
}
@@ -453,7 +462,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
@Override
public List<ThdDataTdVO> getDeviceTrendData(String devId, String lineId,String groupId) {
List<ThdDataTdVO> data = new ArrayList();
List<Overlimit> overlimits = overLimitClient.getOverLimitByLineIds(Arrays.asList(lineId)).getData();
List<Overlimit> overlimits = overlimitMapper.selectBatchIds(Arrays.asList(lineId));
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(lineId)).getData();
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(devId).collect(Collectors.toList())).getData();
//便携式设备-稳态指标-实时数据-指标

View File

@@ -6,15 +6,21 @@ import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.csdevice.api.CsLineFeignClient;
import com.njcn.csdevice.api.EquipmentFeignClient;
import com.njcn.csdevice.constant.DataParam;
import com.njcn.csdevice.enums.LineBaseEnum;
import com.njcn.csdevice.mapper.CsDeviceUserPOMapper;
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
import com.njcn.csdevice.mapper.CsLinePOMapper;
import com.njcn.csdevice.mapper.WlRecordMapper;
import com.njcn.csdevice.param.WlRecordPageParam;
import com.njcn.csdevice.pojo.dto.CsEquipmentDeliveryDTO;
import com.njcn.csdevice.pojo.dto.CsEquipmentProcessDTO;
import com.njcn.csdevice.pojo.param.WlRecordParam;
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.csdevice.pojo.po.CsLinePO;
import com.njcn.csdevice.pojo.po.WlRecord;
import com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo;
@@ -39,6 +45,7 @@ import java.text.DecimalFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -65,6 +72,10 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
private final InfluxDbParamUtil influxDbParamUtil;
private final CsLinePOMapper csLinePOMapper;
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
private final DecimalFormat df = new DecimalFormat(DataParam.DecimalFormatStr);
@Override
@@ -176,6 +187,55 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
@Override
public Object queryPage(WlRecordPageParam wlRecordPageParam) {
//组装tree用于测试项绑定数据页面左侧的搜索树
/* List<RecordAllDevTreeVo> devList = new ArrayList<>();
if(wlRecordPageParam.getIsTrueFlag() == 0){
LambdaQueryWrapper<WlRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(WlRecord::getType,1).eq(WlRecord::getState, DataStateEnum.ENABLE.getCode());
List<WlRecord> wlRecordList = this.list(lambdaQueryWrapper);
if(CollUtil.isNotEmpty(wlRecordList)){
List<String> devIds = wlRecordList.stream().map(WlRecord::getDevId).distinct().collect(Collectors.toList());
List<String> lineIds = wlRecordList.stream().map(WlRecord::getLineId).distinct().collect(Collectors.toList());
List<CsLinePO> csLinePOList = csLinePOMapper.selectBatchIds(lineIds);
Map<String,CsLinePO> csLinePOMap = csLinePOList.stream().collect(Collectors.toMap(CsLinePO::getLineId, Function.identity()));
List<CsEquipmentDeliveryPO> csDevPOList = csEquipmentDeliveryMapper.selectList(new LambdaQueryWrapper<CsEquipmentDeliveryPO>().in(CsEquipmentDeliveryPO::getId,devIds));
Map<String,CsEquipmentDeliveryPO> csDevPOMap = csDevPOList.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, Function.identity()));
Map<String,List<WlRecord>> devMap = wlRecordList.stream().collect(Collectors.groupingBy(WlRecord::getDevId));
devMap.forEach((devId,list)->{
RecordAllDevTreeVo devTree = new RecordAllDevTreeVo();
devTree.setId(devId);
devTree.setName(csDevPOMap.get(list.get(0).getDevId()).getName());
devTree.setPid("0");
Map<String,List<WlRecord>> lineMap = list.stream().collect(Collectors.groupingBy(WlRecord::getLineId));
List<RecordAllDevTreeVo> csLineList = new ArrayList<>();
lineMap.forEach((lineId,lineList)->{
RecordAllDevTreeVo recordAllDevTreeVo = new RecordAllDevTreeVo();
recordAllDevTreeVo.setId(lineId);
recordAllDevTreeVo.setName(csLinePOMap.get(lineList.get(0).getLineId()).getName());
recordAllDevTreeVo.setPid(devId);
List<RecordAllDevTreeVo> iiList = new ArrayList<>();
lineList.forEach(it->{
RecordAllDevTreeVo ii = new RecordAllDevTreeVo();
ii.setId(it.getId());
ii.setName(it.getStartTime()+"-"+it.getEndTime());
ii.setPid(lineId);
iiList.add(ii);
});
recordAllDevTreeVo.setChildren(iiList);
csLineList.add(recordAllDevTreeVo);
});
devTree.setChildren(csLineList);
devList.add(devTree);
});
}
}*/
List<RecordAllDevTreeVo> recordAllDevTreeVos = this.baseMapper.getRecordAll(wlRecordPageParam);
for (RecordAllDevTreeVo recordAllDevTreeVo : recordAllDevTreeVos){
wlRecordPageParam.setDevId(recordAllDevTreeVo.getId());