fix: 修复店铺商品标签排序不正确问题

This commit is contained in:
paulGao 2022-10-13 11:55:25 +08:00
parent bd0f1f0b23
commit 0ba493d71d

View File

@ -58,6 +58,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
list.stream()
.filter(label -> label.getParentId() != null && label.getParentId().equals(storeGoodsLabel.getId()))
.forEach(storeGoodsLabelChild -> storeGoodsLabelVOChildList.add(new StoreGoodsLabelVO(storeGoodsLabelChild.getId(), storeGoodsLabelChild.getLabelName(), storeGoodsLabelChild.getLevel(), storeGoodsLabelChild.getSortOrder())));
storeGoodsLabelVOChildList.sort(Comparator.comparing(StoreGoodsLabelVO::getSortOrder));
storeGoodsLabelVO.setChildren(storeGoodsLabelVOChildList);
storeGoodsLabelVOList.add(storeGoodsLabelVO);
});