Procházet zdrojové kódy

景聚庭-物资分类根据名称查询调整

huangguoce před 1 dnem
rodič
revize
d914c3d2d9

+ 6 - 0
jeeplus-modules/jeeplus-psi-management/src/main/java/com/jeeplus/psimanage/materialType/service/PsiMaterialTypeService.java

@@ -39,6 +39,9 @@ public class PsiMaterialTypeService extends ServiceImpl<PsiMaterialTypeMapper, P
             List<PsiMaterialTypeInfo> materialTypeInfoList = this.list(new QueryWrapper<PsiMaterialTypeInfo>().lambda()
                     .like(StringUtils.isNotBlank(info.getName()), PsiMaterialTypeInfo::getName, info.getName())
             );
+            if (CollectionUtil.isEmpty(materialTypeInfoList)) {
+                return new ArrayList<>();
+            }
             List<String> collect = materialTypeInfoList.stream().map(PsiMaterialTypeInfo::getId).collect(Collectors.toList());
             //materialTypeInfoList的父级id全部获取
             List<String> cupIdList = materialTypeInfoList.stream().map(PsiMaterialTypeInfo::getParentId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
@@ -127,6 +130,9 @@ public class PsiMaterialTypeService extends ServiceImpl<PsiMaterialTypeMapper, P
             List<PsiMaterialTypeInfo> materialTypeInfoList = this.list(new QueryWrapper<PsiMaterialTypeInfo>().lambda()
                     .like(StringUtils.isNotBlank(info.getName()), PsiMaterialTypeInfo::getName, info.getName())
             );
+            if (CollectionUtil.isEmpty(materialTypeInfoList)) {
+                return new ArrayList<>();
+            }
             List<String> collect = materialTypeInfoList.stream().map(PsiMaterialTypeInfo::getId).collect(Collectors.toList());
             //materialTypeInfoList的父级id全部获取
             List<String> cupIdList = materialTypeInfoList.stream().map(PsiMaterialTypeInfo::getParentId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());