|
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.pms.controller.admin.iotbom;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import cn.hutool.core.util.ObjUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
@@ -133,7 +134,11 @@ public class IotBomController {
|
|
|
return success(BeanUtils.toBean(list, IotBomRespVO.class, bom -> {
|
|
|
Integer materialCount = bomMaterialCount.getOrDefault(bom.getId(), 0);
|
|
|
bom.setMaterials(materialCount);
|
|
|
- bom.setDeviceCategoryName(deviceCategoryMap.get(bom.getDeviceCategoryId()).getName());
|
|
|
+ if (ObjUtil.isNotEmpty(bom.getDeviceCategoryId())) {
|
|
|
+ if (ObjUtil.isNotEmpty(deviceCategoryMap.get(bom.getDeviceCategoryId()))) {
|
|
|
+ bom.setDeviceCategoryName(deviceCategoryMap.get(bom.getDeviceCategoryId()).getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
}));
|
|
|
}
|
|
|
|