便利店
This commit is contained in:
parent
92eafa75ec
commit
7da876c51e
@ -132,22 +132,27 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
List<CvsGoods> cvsGoods = baseMapper.selectList(queryWrapper);
|
||||
List<CvsGoodsTree> list = new ArrayList<>();
|
||||
List<CvsGoodsVo> 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<CvsGoodsTree> 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);
|
||||
|
@ -7,7 +7,6 @@ import java.util.List;
|
||||
@Data
|
||||
public class CvsGoodsTree {
|
||||
private Integer value;
|
||||
private Integer pid;
|
||||
private String label;
|
||||
private List<CvsGoodsTree> children;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user