diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java index ef7833dee..b2aa40a8f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java @@ -132,22 +132,27 @@ public class CvsGoodsServiceImpl extends ServiceImpl im queryWrapper.eq("store_id",storeId); List cvsGoods = baseMapper.selectList(queryWrapper); List list = new ArrayList<>(); + List goodsVos = new ArrayList<>(); for (CvsGoods cvsGood : cvsGoods) { if (cvsGood.getPid()==0){ CvsGoodsTree cvsGoodsTree = new CvsGoodsTree(); - cvsGoodsTree.setPid(cvsGood.getPid()); + CvsGoodsVo cvsGoodsVo = new CvsGoodsVo(); + + cvsGoodsVo.setPid(cvsGood.getPid()); + cvsGoodsTree.setValue(cvsGood.getId()); cvsGoodsTree.setLabel(cvsGood.getName()); cvsGoodsTree.setChildren(new ArrayList<>()); + list.add(cvsGoodsTree); + goodsVos.add(cvsGoodsVo); } } for (int i = 0; i < cvsGoods.size(); i++){ List children = new ArrayList<>(); for (CvsGoods cvsGood : cvsGoods) { - if (list.get(i).getPid()==cvsGood.getPid()){ + if (goodsVos.get(i).getPid()==cvsGood.getPid()){ CvsGoodsTree cvsGoodsTree = new CvsGoodsTree(); - cvsGoodsTree.setPid(cvsGood.getPid()); cvsGoodsTree.setValue(cvsGood.getId()); cvsGoodsTree.setLabel(cvsGood.getName()); children.add(cvsGoodsTree); diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/CvsGoodsTree.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/CvsGoodsTree.java index 8bd7eff64..26ace583d 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/CvsGoodsTree.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/vo/CvsGoodsTree.java @@ -7,7 +7,6 @@ import java.util.List; @Data public class CvsGoodsTree { private Integer value; - private Integer pid; private String label; private List children; }