Commit 4b1fc2ed64d5a90d55f2e0e2ad9bbd94dbe2c0d2

Authored by boyang
2 parents 416a951c 2dd367d6

Merge branch 'bugfix0422' into 'master'

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



See merge request !1
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) {
... ...