|
|
|
|
@ -5,6 +5,7 @@ package org.springblade.lims.service.impl; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
@ -35,10 +36,14 @@ public class InspectionRecordServiceImpl extends BaseServiceImpl<InspectionRecor |
|
|
|
|
wrapper.eq(BaseEntity::getIsDeleted, 0); |
|
|
|
|
wrapper.orderByDesc(InspectionRecord::getCreateTime); |
|
|
|
|
IPage<InspectionRecord> page = this.page(Condition.getPage(query), wrapper); |
|
|
|
|
page.getRecords().forEach(record ->{ |
|
|
|
|
Instrument instrument = instrumentService.getById(record.getAssetId()); |
|
|
|
|
record.setAssetName(instrument.getName()); |
|
|
|
|
}); |
|
|
|
|
if(CollectionUtils.isNotEmpty(page.getRecords())){ |
|
|
|
|
page.getRecords().forEach(record ->{ |
|
|
|
|
Instrument instrument = instrumentService.getById(record.getAssetId()); |
|
|
|
|
if(instrument != null){ |
|
|
|
|
record.setAssetName(instrument.getName()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
return page; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|