便携式暂态事件代码兼容

This commit is contained in:
xy
2024-10-31 13:44:12 +08:00
parent e6715a8d96
commit 81c78278d8
3 changed files with 8 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@@ -37,8 +38,10 @@ public class CsEventServiceImpl extends ServiceImpl<CsEventMapper, CsEventPO> im
lambdaUpdateWrapper.set(CsEventPO::getWavePath,csEventParam.getPath()).eq(CsEventPO::getLineId,csEventParam.getLineId()) lambdaUpdateWrapper.set(CsEventPO::getWavePath,csEventParam.getPath()).eq(CsEventPO::getLineId,csEventParam.getLineId())
.eq(CsEventPO::getDeviceId,csEventParam.getDeviceId()) .eq(CsEventPO::getDeviceId,csEventParam.getDeviceId())
.in(CsEventPO::getType, Arrays.asList(0,1)) .in(CsEventPO::getType, Arrays.asList(0,1))
.eq(CsEventPO::getLocation,csEventParam.getLocation())
.between(CsEventPO::getStartTime,csEventParam.getStartTime(),csEventParam.getEndTime()); .between(CsEventPO::getStartTime,csEventParam.getStartTime(),csEventParam.getEndTime());
if (Objects.nonNull(csEventParam.getLocation())) {
lambdaUpdateWrapper.eq(CsEventPO::getLocation, csEventParam.getLocation());
}
this.update(lambdaUpdateWrapper); this.update(lambdaUpdateWrapper);
List<CsEventPO> list = this.baseMapper.selectList(lambdaUpdateWrapper); List<CsEventPO> list = this.baseMapper.selectList(lambdaUpdateWrapper);
if (CollectionUtil.isNotEmpty(list)){ if (CollectionUtil.isNotEmpty(list)){

View File

@@ -71,16 +71,16 @@ public class CsWaveAnalysisServiceImpl implements ICsWaveAnalysisService {
if (CollectionUtil.isNotEmpty(dataArrayList)){ if (CollectionUtil.isNotEmpty(dataArrayList)){
for (AppEventMessage.DataArray item : dataArrayList) { for (AppEventMessage.DataArray item : dataArrayList) {
List<AppEventMessage.Param> paramList = item.getParam(); List<AppEventMessage.Param> paramList = item.getParam();
Object object = paramList.stream().filter(item2 -> ZlConstant.WAVE_NAME.equals(item2.getName())).findFirst().get().getData(); Object object = paramList.stream().filter(item2 -> ZlConstant.WAVE_NAME.equals(item2.getName())).findFirst().map(AppEventMessage.Param::getData).orElse(null);
Object object2 = paramList.stream().filter(item2 -> ZlConstant.WAVE_PARAM_RCDKEEPTIME.equals(item2.getName())).findFirst().get().getData(); Object object2 = paramList.stream().filter(item2 -> ZlConstant.WAVE_PARAM_RCDKEEPTIME.equals(item2.getName())).findFirst().map(AppEventMessage.Param::getData).orElse(null);
Object object3 = paramList.stream().filter(item2 -> ZlConstant.WAVE_POSITION.equals(item2.getName())).findFirst().get().getData(); Object object3 = paramList.stream().filter(item2->ZlConstant.WAVE_POSITION.equals(item2.getName())).findFirst().map(AppEventMessage.Param::getData).orElse(null);
String lineId = appEventMessage.getId() + appEventMessage.getMsg().getClDid(); String lineId = appEventMessage.getId() + appEventMessage.getMsg().getClDid();
String fileName = object.toString().replaceAll("\\[","").replaceAll("]",""); String fileName = object.toString().replaceAll("\\[","").replaceAll("]","");
List<String> fileList = Arrays.stream(fileName.split(",")).collect(Collectors.toList()); List<String> fileList = Arrays.stream(fileName.split(",")).collect(Collectors.toList());
//获取到录波文件,将文件信息存储起来 //获取到录波文件,将文件信息存储起来
for (String file : fileList) { for (String file : fileList) {
file = file.trim(); file = file.trim();
WaveTimeDto dto = channelTimeRange(file,appEventMessage.getId(),item.getDataTimeSec(),item.getDataTimeUSec(),(Double)object2,deviceId,lineId,object3.toString()); WaveTimeDto dto = channelTimeRange(file,appEventMessage.getId(),item.getDataTimeSec(),item.getDataTimeUSec(),(Double)object2,deviceId,lineId,Objects.isNull(object3)?null:object3.toString());
list.add(dto); list.add(dto);
} }
Object obj = redisUtil.getObjectByKey("eventFile:" + appEventMessage.getId()); Object obj = redisUtil.getObjectByKey("eventFile:" + appEventMessage.getId());

View File

@@ -158,7 +158,6 @@ public class FileServiceImpl implements IFileService {
csEventLogs.setAllStep(1); csEventLogs.setAllStep(1);
csEventLogs.setIsAll(1); csEventLogs.setIsAll(1);
redisUtil.delete(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName())); redisUtil.delete(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName()));
// redisUtil.delete(AppRedisKey.FILE_PART.concat(appFileMessage.getMsg().getName()));
redisUtil.delete(AppRedisKey.RMQ_FILE_CONSUME_KEY.concat(fileName)); redisUtil.delete(AppRedisKey.RMQ_FILE_CONSUME_KEY.concat(fileName));
//存储文件信息 //存储文件信息
fileStreamDto.setTotal(appFileMessage.getMsg().getFrameTotal()); fileStreamDto.setTotal(appFileMessage.getMsg().getFrameTotal());
@@ -208,7 +207,6 @@ public class FileServiceImpl implements IFileService {
file.delete(); file.delete();
} }
redisUtil.delete(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName())); redisUtil.delete(AppRedisKey.FILE_PART_TIME.concat(appFileMessage.getMsg().getName()));
// redisUtil.delete(AppRedisKey.FILE_PART.concat(appFileMessage.getMsg().getName()));
redisUtil.delete(AppRedisKey.RMQ_FILE_CONSUME_KEY.concat(fileName)); redisUtil.delete(AppRedisKey.RMQ_FILE_CONSUME_KEY.concat(fileName));
redisUtil.delete(AppRedisKey.FILE_DOWN_TIME.concat(appFileMessage.getMsg().getName())); redisUtil.delete(AppRedisKey.FILE_DOWN_TIME.concat(appFileMessage.getMsg().getName()));
} else { } else {