Переглянути джерело

b端设备详情,商品管理过滤特殊商品

tanbin 9 місяців тому
батько
коміт
b467133ad2

+ 1 - 1
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -1833,7 +1833,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
         Integer afterFillStock = 0;
         if (CollUtil.isNotEmpty(goodsDeviceList)) {
             //goodsDeviceList 过滤商品id=1和商品id=2的商品
-            goodsDeviceList = goodsDeviceList.stream().filter(g -> !g.getGoodsId().equals(1) && !g.getGoodsId().equals(2)).collect(Collectors.toList());
+            goodsDeviceList = goodsDeviceList.stream().filter(g -> g.getGoodsId() != 1 && g.getGoodsId() != 2).collect(Collectors.toList());
             stock = goodsDeviceList.stream().mapToInt(GoodsDeviceDto.Vo::getStock).sum();
             afterFillStock = goodsDeviceList.stream().mapToInt(GoodsDeviceDto.Vo::getFillCount).sum();
         }