Commit 2dd367d652a1979d141c35e4a38a146884776207

Authored by boyang
1 parent 416a951c

fix: 商品规格顺序按id降序

shop/src/main/java/com/canrd/shop/service/impl/ProductServiceImpl.java
... ... @@ -144,6 +144,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, ProductDO> im
144 144 // 金额处理
145 145 Boolean productPriceShow = switchControlService.getEnabledByName(SwitchControlConstants.PRODUCT_PRICE_SHOW);
146 146 List<TicketTypeDO> ticketTypeDOS = ticketTypeService.selectByProductId(productDO.getId());
  147 + // 按 id 降序排序(直接修改原列表)
  148 + ticketTypeDOS.sort(Comparator.comparing(TicketTypeDO::getId).reversed());
147 149 if(CollectionUtils.isNotEmpty(ticketTypeDOS)){
148 150 List<TickeyTypeVO> typeVOS = ticketTypeDOS.stream().map(productConverter::convertToTickeyTypeVO).collect(Collectors.toList());
149 151 for (TickeyTypeVO typeVO : typeVOS) {
... ...