Browse Source

处理空值判断

ljx 4 years ago
parent
commit
a9fa4ab9b7

+ 8 - 3
src/main/java/com/imed/costaccount/service/impl/CostShareParamServiceImpl.java

@@ -180,9 +180,14 @@ public class CostShareParamServiceImpl extends ServiceImpl<CostShareParamMapper,
             throw new CostException(500, "当前分摊参数已被移除或不存在");
         }
         String accountingId = byId.getAccountingId();
-        String[] split = accountingId.split(StrUtil.COMMA);
-        List<Integer> collect = Arrays.stream(split).map(Integer::valueOf).collect(Collectors.toList());
-        return collect;
+        if (!StringUtils.isEmpty(accountingId)){
+            String[] split = accountingId.split(StrUtil.COMMA);
+            List<Integer> collect = Arrays.stream(split).map(Integer::valueOf).collect(Collectors.toList());
+            return collect;
+        }else {
+            return null;
+        }
+
 
     }