|
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@@ -130,6 +131,10 @@ public class GyDataServiceImpl implements GyDataService {
|
|
|
.map(GyDataImportDTO::getId)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(dataIds)){
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
// 一次性获取所有关联的单位信息并转换为Map以提高查询效率
|
|
|
Map<Long, GyDataUnitDO> unitMap = gyDataUnitService.getByDataIds(dataIds).stream()
|
|
|
.collect(Collectors.toMap(GyDataUnitDO::getDataId, Function.identity()));
|