From 6340357229cc53789423f7337d1fcaa8bb05fe47 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 21 Sep 2024 16:23:23 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E6=B5=8B=E8=AF=95=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TrunklineCarsLoadServiceImpl.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 800086c35..535a28f31 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -2690,16 +2690,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl { Long scanId = item.getCarsLoadScanId(); List list = scanZeroDetailVOMap.get(scanId); - //把list中所有元素的goodsName用逗号拼起来 - String loadingGoods = list.stream() - .map(t-> t.getGoodsName()+"("+t.getLoadingNum()+")") - .collect(Collectors.joining(",")); - - String unloadGoods = list.stream() - .map(t-> t.getGoodsName()+"("+t.getUnloadNum()+")") - .collect(Collectors.joining(",")); - item.setLoadingGoods(loadingGoods); - item.setUnloadGoods(unloadGoods); + if(CollUtil.isNotEmpty(list)){ + //把list中所有元素的goodsName用逗号拼起来 + String loadingGoods = list.stream() + .map(t-> t.getGoodsName()+"("+t.getLoadingNum()+")") + .collect(Collectors.joining(",")); + + String unloadGoods = list.stream() + .map(t-> t.getGoodsName()+"("+t.getUnloadNum()+")") + .collect(Collectors.joining(",")); + item.setLoadingGoods(loadingGoods); + item.setUnloadGoods(unloadGoods); + } }); } pageList.setRecords(records);