hyingbo
3 天以前 7e0152c5c1d1c0cd38b59ffaea3222dcde13012e
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java
@@ -1,6 +1,7 @@
package org.jeecg.modules.mdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.system.vo.DictModel;
@@ -103,9 +104,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());
                        Set<TmpEquipmentAlarm> tmpEquipmentAlarmSet = entity.getTmpEquipmentAlarmSet();
                        if (CollectionUtils.isNotEmpty(tmpEquipmentAlarmSet)) {
                            dto.setAlarmContent(tmpEquipmentAlarmSet.stream().findFirst().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 +230,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();