From 54f239669575cedfdbdf28e38d0e9619a610bf95 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期六, 19 七月 2025 16:57:33 +0800 Subject: [PATCH] 去除多于引用 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java index e35d444..eae4353 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java @@ -103,9 +103,14 @@ BeanUtils.copyProperties(entity, dto); if (entity.getStatus() == 22) { if (equip != null) { - List<MdcAlarmInfo> mdcAlarmInfo = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getDriveType, equip.getDrivetype()).eq(MdcAlarmInfo::getAlarmCode, entity.getAlarm()).eq(MdcAlarmInfo::getIsUse, 0)); - if (mdcAlarmInfo != null && !mdcAlarmInfo.isEmpty()) { - dto.setAlarmContent(mdcAlarmInfo.get(0).getAlarmContent()); + Optional<TmpEquipmentAlarm> tmpEquipmentAlarm = entity.getTmpEquipmentAlarmSet().stream().findFirst(); + if (tmpEquipmentAlarm.isPresent() && StringUtils.isNotBlank(tmpEquipmentAlarm.get().getAlarmContent())) { + dto.setAlarmContent(tmpEquipmentAlarm.get().getAlarmContent()); + }else { + List<MdcAlarmInfo> mdcAlarmInfo = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getDriveType, equip.getDrivetype()).eq(MdcAlarmInfo::getAlarmCode, entity.getAlarm()).eq(MdcAlarmInfo::getIsUse, 0)); + if (mdcAlarmInfo != null && !mdcAlarmInfo.isEmpty()) { + dto.setAlarmContent(mdcAlarmInfo.get(0).getAlarmContent()); + } } } } @@ -224,6 +229,9 @@ queryWrapper.le(MdcEquipmentRunningSection::getStartTime, endTime); queryWrapper.orderByAsc(MdcEquipmentRunningSection::getStartTime); list = this.baseMapper.selectList(queryWrapper); + + list = mergeErrorRunningTrace(list); + } if (list == null || list.isEmpty()) { return Collections.emptyList(); -- Gitblit v1.9.3